(\s+)<\/span>/g,(e,t)=>1==t.length?" ":t).replace(//g,"")}(o.getData("text/html")):o.getData("text/plain")&&(s=function(e){return((e=e.replace(//g,">").replace(/\r?\n\r?\n/g,"").replace(/\r?\n/g," ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).includes("
")||e.includes(" "))&&(e=`
${e}
`),e}(o.getData("text/plain"))),s=this.editor.data.htmlProcessor.toView(s));const r=new i(this,"inputTransformation");this.fire(r,{content:s,dataTransfer:o,targetRanges:t.targetRanges,method:t.method}),r.stop.called&&e.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(e,n)=>{if(n.content.isEmpty)return;const i=this.editor.data.toModel(n.content,"$clipboardHolder");0!=i.childCount&&(e.stop(),t.change(()=>{this.fire("contentInsertion",{content:i,method:n.method,dataTransfer:n.dataTransfer,targetRanges:n.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(e,n)=>{n.resultRange=t.insertContent(n.content)},{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,n=e.editing.view.document;function i(i,o){const s=o.dataTransfer;o.preventDefault();const r=e.data.toView(e.model.getSelectedContent(t.selection));n.fire("clipboardOutput",{dataTransfer:s,content:r,method:i.name})}this.listenTo(n,"copy",i,{priority:"low"}),this.listenTo(n,"cut",(t,n)=>{e.isReadOnly?n.preventDefault():i(t,n)},{priority:"low"}),this.listenTo(n,"clipboardOutput",(n,i)=>{i.content.isEmpty||(i.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(i.content)),i.dataTransfer.setData("text/plain",vm(i.content))),"cut"==i.method&&e.model.deleteContent(t.selection)},{priority:"low"})}}class jm{constructor(){this._stack=[]}add(e,t){const n=this._stack,i=n[0];this._insertDescriptor(e);const o=n[0];i===o||Cm(i,o)||this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:t})}remove(e,t){const n=this._stack,i=n[0];this._removeDescriptor(e);const o=n[0];i===o||Cm(i,o)||this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:t})}_insertDescriptor(e){const t=this._stack,n=t.findIndex(t=>t.id===e.id);if(Cm(e,t[n]))return;n>-1&&t.splice(n,1);let i=0;for(;t[i]&&ym(t[i],e);)i++;t.splice(i,0,e)}_removeDescriptor(e){const t=this._stack,n=t.findIndex(t=>t.id===e);n>-1&&t.splice(n,1)}}function Cm(e,t){return e&&t&&e.priority==t.priority&&km(e.classes)==km(t.classes)}function ym(e,t){return e.priority>t.priority||!(e.prioritykm(t.classes)}function km(e){return Array.isArray(e)?e.sort().join(","):e}st(jm,_);const Am="ck-widget_selected";function wm(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function Sm(e,t,n={}){if(!e.is("containerElement"))throw new u("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass("ck-widget",e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=$m,n.label&&function(e,t,n){n.setCustomProperty("widgetLabel",t,e)}(e,n.label,t),n.hasSelectionHandle&&function(e,t){const n=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(e){const t=this.toDomElement(e),n=new hc;return n.set("content",' '),n.render(),t.appendChild(n.element),t});t.insert(t.createPositionAt(e,0),n),t.addClass(["ck-widget_with-selection-handle"],e)}(e,t),function(e,t,n=Em,i=Tm){const o=new jm;o.on("change:top",(t,o)=>{o.oldDescriptor&&i(e,o.oldDescriptor,o.writer),o.newDescriptor&&n(e,o.newDescriptor,o.writer)}),t.setCustomProperty("addHighlight",(e,t,n)=>o.add(t,n),e),t.setCustomProperty("removeHighlight",(e,t,n)=>o.remove(t,n),e)}(e,t),e}function Em(e,t,n){if(t.classes&&n.addClass(Gn(t.classes),e),t.attributes)for(const i in t.attributes)n.setAttribute(i,t.attributes[i],e)}function Tm(e,t,n){if(t.classes&&n.removeClass(Gn(t.classes),e),t.attributes)for(const i in t.attributes)n.removeAttribute(i,e)}function zm(e){const t=e.getCustomProperty("widgetLabel");return t?"function"==typeof t?t():t:""}function $m(){return null}const Om="widget-type-around";function Rm(e,t,n){return e&&wm(e)&&!n.isInline(t)}function Pm(e){return e.getAttribute(Om)}var Dm=s(137);rs()(Dm.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Dm.Z.locals;const Fm=["before","after"],Mm=(new DOMParser).parseFromString(' ',"image/svg+xml").firstChild,Nm="ck-widget__type-around_disabled";class Lm extends rt{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[Eh,qh]}constructor(e){super(e),this._currentFakeCaretModelElement=null}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",(n,i,o)=>{t.change(e=>{for(const n of t.document.roots)o?e.removeClass(Nm,n):e.addClass(Nm,n)}),o||e.model.change(e=>{e.removeSelectionAttribute(Om)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const n=this.editor,i=n.editing.view,o=n.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);n.execute("insertParagraph",{position:n.model.createPositionAt(e,t),attributes:o}),i.focus(),i.scrollToTheSelection()}_listenToIfEnabled(e,t,n,i){this.listenTo(e,t,(...e)=>{this.isEnabled&&n(...e)},i)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=Pm(e);if(!t)return!1;const n=e.getSelectedElement();return this._insertParagraph(n,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,n=e.locale.t,i={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(e,n,o)=>{const s=o.mapper.toViewElement(n.item);Rm(s,n.item,t)&&function(e,t,n){const i=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(e){const n=this.toDomElement(e);return function(e,t){for(const n of Fm){const i=new Vd({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${n}`],title:t[n]},children:[e.ownerDocument.importNode(Mm,!0)]});e.appendChild(i.render())}}(n,t),function(e){const t=new Vd({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}(n),n});e.insert(e.createPositionAt(n,"end"),i)}(o.writer,i,s)},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,n=t.document.selection,i=t.schema,o=e.editing.view;function s(e){return`ck-widget_type-around_show-fake-caret_${e}`}this._listenToIfEnabled(o.document,"arrowKey",(e,t)=>{this._handleArrowKeyPress(e,t)},{context:[wm,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",(t,n)=>{n.directChange&&e.model.change(e=>{e.removeSelectionAttribute(Om)})}),this._listenToIfEnabled(t.document,"change:data",()=>{const t=n.getSelectedElement();t&&Rm(e.editing.mapper.toViewElement(t),t,i)||e.model.change(e=>{e.removeSelectionAttribute(Om)})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(e,t,n)=>{const o=n.writer;if(this._currentFakeCaretModelElement){const e=n.mapper.toViewElement(this._currentFakeCaretModelElement);e&&(o.removeClass(Fm.map(s),e),this._currentFakeCaretModelElement=null)}const r=t.selection.getSelectedElement();if(!r)return;const a=n.mapper.toViewElement(r);if(!Rm(a,r,i))return;const l=Pm(t.selection);l&&(o.addClass(s(l),a),this._currentFakeCaretModelElement=r)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(t,n,i)=>{i||e.model.change(e=>{e.removeSelectionAttribute(Om)})})}_handleArrowKeyPress(e,t){const n=this.editor,i=n.model,o=i.document.selection,s=i.schema,r=n.editing.view,a=function(e,t){const n=ko(e,t);return"down"===n||"right"===n}(t.keyCode,n.locale.contentLanguageDirection),l=r.document.selection.getSelectedElement();let d;Rm(l,n.editing.mapper.toModelElement(l),s)?d=this._handleArrowKeyPressOnSelectedWidget(a):o.isCollapsed?d=this._handleArrowKeyPressWhenSelectionNextToAWidget(a):t.shiftKey||(d=this._handleArrowKeyPressWhenNonCollapsedSelection(a)),d&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,n=Pm(t.document.selection);return t.change(t=>n?n!==(e?"after":"before")&&(t.removeSelectionAttribute(Om),!0):(t.setSelectionAttribute(Om,e?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,n=t.model,i=n.schema,o=t.plugins.get("Widget"),s=o._getObjectElementNextToSelection(e);return!!Rm(t.editing.mapper.toViewElement(s),s,i)&&(n.change(t=>{o._setSelectionOverElement(s),t.setSelectionAttribute(Om,e?"before":"after")}),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,n=t.model,i=n.schema,o=t.editing.mapper,s=n.document.selection,r=e?s.getLastPosition().nodeBefore:s.getFirstPosition().nodeAfter;return!!Rm(o.toViewElement(r),r,i)&&(n.change(t=>{t.setSelection(r,"on"),t.setSelectionAttribute(Om,e?"after":"before")}),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(n,i)=>{const o=function(e){return e.closest(".ck-widget__type-around__button")}(i.domTarget);if(!o)return;const s=function(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(o),r=function(e,t){const n=e.closest(".ck-widget");return t.mapDomToView(n)}(o,t.domConverter),a=e.editing.mapper.toModelElement(r);this._insertParagraph(a,s),i.preventDefault(),n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,n=e.editing.view;this._listenToIfEnabled(n.document,"enter",(n,i)=>{if("atTarget"!=n.eventPhase)return;const o=t.getSelectedElement(),s=e.editing.mapper.toViewElement(o),r=e.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:Rm(s,o,r)&&(this._insertParagraph(o,i.isSoft?"before":"after"),a=!0),a&&(i.preventDefault(),n.stop())},{context:wm})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view,t=[vo.enter,vo.delete,vo.backspace];this._listenToIfEnabled(e.document,"keydown",(e,n)=>{t.includes(n.keyCode)||Lh(n)||this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,n=e.model,i=n.schema;this._listenToIfEnabled(t.document,"delete",(t,o)=>{if("atTarget"!=t.eventPhase)return;const s=Pm(n.document.selection);if(!s)return;const r=o.direction,a=n.document.selection.getSelectedElement(),l="forward"==r;if("before"===s===l)e.execute("delete",{selection:n.createSelection(a,"on")});else{const t=i.getNearestSelectionRange(n.createPositionAt(a,s),r);if(t)if(t.isCollapsed){const o=n.createSelection(t.start);if(n.modifySelection(o,{direction:r}),o.focus.isEqual(t.start)){const e=function(e,t){let n=t;for(const i of t.getAncestors({parentFirst:!0})){if(i.childCount>1||e.isLimit(i))break;n=i}return n}(i,t.start.parent);n.deleteContent(n.createSelection(e,"on"),{doNotAutoparagraph:!0})}else n.change(n=>{n.setSelection(t),e.execute(l?"deleteForward":"delete")})}else n.change(n=>{n.setSelection(t),e.execute(l?"deleteForward":"delete")})}o.preventDefault(),t.stop()},{context:wm})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,n=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(e,[i,o])=>{if(o&&!o.is("documentSelection"))return;const s=Pm(n);return s?(e.stop(),t.change(e=>{const o=n.getSelectedElement(),r=t.createPositionAt(o,s),a=e.createSelection(r),l=t.insertContent(i,a);return e.setSelection(a),l})):void 0},{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",(e,n)=>{const[,i,,o={}]=n;if(i&&!i.is("documentSelection"))return;const s=Pm(t);s&&(o.findOptimalPosition=s,n[3]=o)},{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(e,[n])=>{n&&!n.is("documentSelection")||Pm(t)&&e.stop()},{priority:"high"})}}function Bm(e,t,n){const i=e.schema,o=e.createRangeIn(t.root),s="forward"==n?"elementStart":"elementEnd";for(const{previousPosition:e,item:r,type:a}of o.getWalker({startPosition:t,direction:n})){if(i.isLimit(r)&&!i.isInline(r))return e;if(a==s&&i.isBlock(r))return null}return null}function Vm(e,t,n){const i="backward"==n?t.end:t.start;if(e.checkChild(i,"$text"))return i;for(const{nextPosition:i}of t.getWalker({direction:n}))if(e.checkChild(i,"$text"))return i;return null}var Um=s(507);rs()(Um.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Um.Z.locals;class Wm extends rt{static get pluginName(){return"Widget"}static get requires(){return[Lm,qh]}init(){const e=this.editor,t=e.editing.view,n=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(t,n,i)=>{const o=i.writer,s=n.selection;if(s.isCollapsed)return;const r=s.getSelectedElement();if(!r)return;const a=e.editing.mapper.toViewElement(r);wm(a)&&i.consumable.consume(s,"selection")&&o.setSelection(o.createRangeOn(a),{fake:!0,label:zm(a)})}),this.editor.editing.downcastDispatcher.on("selection",(e,t,n)=>{this._clearPreviouslySelectedWidgets(n.writer);const i=n.writer,o=i.document.selection;let s=null;for(const e of o.getRanges())for(const t of e){const e=t.item;wm(e)&&!Gm(e,s)&&(i.addClass(Am,e),this._previouslySelected.add(e),s=e)}},{priority:"low"}),t.addObserver(qu),this.listenTo(n,"mousedown",(...e)=>this._onMousedown(...e)),this.listenTo(n,"arrowKey",(...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)},{context:[wm,"$text"]}),this.listenTo(n,"arrowKey",(...e)=>{this._preventDefaultOnArrowKeyPress(...e)},{context:"$root"}),this.listenTo(n,"arrowKey",function(e){const t=e.model;return(n,i)=>{const o=i.keyCode==vo.arrowup,s=i.keyCode==vo.arrowdown,r=i.shiftKey,a=t.document.selection;if(!o&&!s)return;const l=s;if(r&&function(e,t){return!e.isCollapsed&&e.isBackward==t}(a,l))return;const d=function(e,t,n){const i=e.model;if(n){const e=t.isCollapsed?t.focus:t.getLastPosition(),n=Bm(i,e,"forward");if(!n)return null;const o=i.createRange(e,n),s=Vm(i.schema,o,"backward");return s?i.createRange(e,s):null}{const e=t.isCollapsed?t.focus:t.getFirstPosition(),n=Bm(i,e,"backward");if(!n)return null;const o=i.createRange(n,e),s=Vm(i.schema,o,"forward");return s?i.createRange(s,e):null}}(e,a,l);if(d){if(d.isCollapsed){if(a.isCollapsed)return;if(r)return}(d.isCollapsed||function(e,t,n){const i=e.model,o=e.view.domConverter;if(n){const e=i.createSelection(t.start);i.modifySelection(e),e.focus.isAtEnd||t.start.isEqual(e.focus)||(t=i.createRange(e.focus,t.end))}const s=e.mapper.toViewRange(t),r=o.viewRangeToDom(s),a=Ir.getDomRangeRects(r);let l;for(const e of a)if(void 0!==l){if(Math.round(e.top)>=l)return!1;l=Math.max(l,Math.round(e.bottom))}else l=Math.round(e.bottom);return!0}(e,d,l))&&(t.change(e=>{const n=l?d.end:d.start;if(r){const i=t.createSelection(a.anchor);i.setFocus(n),e.setSelection(i)}else e.setSelection(n)}),n.stop(),i.preventDefault(),i.stopPropagation())}}}(this.editor.editing),{context:"$text"}),this.listenTo(n,"delete",(e,t)=>{this._handleDelete("forward"==t.direction)&&(t.preventDefault(),e.stop())},{context:"$root"})}_onMousedown(e,t){const n=this.editor,i=n.editing.view,o=i.document;let s=t.target;if(function(e){for(;e;){if(e.is("editableElement")&&!e.is("rootElement"))return!0;if(wm(e))return!1;e=e.parent}return!1}(s)){if((fo.isSafari||fo.isGecko)&&t.domEvent.detail>=3){const e=n.editing.mapper,i=s.is("attributeElement")?s.findAncestor(e=>!e.is("attributeElement")):s,o=e.toModelElement(i);t.preventDefault(),this.editor.model.change(e=>{e.setSelection(o,"in")})}return}if(!wm(s)&&(s=s.findAncestor(wm),!s))return;fo.isAndroid&&t.preventDefault(),o.isFocused||i.focus();const r=n.editing.mapper.toModelElement(s);this._setSelectionOverElement(r)}_handleSelectionChangeOnArrowKeyPress(e,t){const n=t.keyCode,i=this.editor.model,o=i.schema,s=i.document.selection,r=s.getSelectedElement(),a=ko(n,this.editor.locale.contentLanguageDirection),l="down"==a||"right"==a,d="up"==a||"down"==a;if(r&&o.isObject(r)){const n=l?s.getLastPosition():s.getFirstPosition(),r=o.getNearestSelectionRange(n,l?"forward":"backward");return void(r&&(i.change(e=>{e.setSelection(r)}),t.preventDefault(),e.stop()))}if(!s.isCollapsed&&!t.shiftKey){const n=s.getFirstPosition(),r=s.getLastPosition(),a=n.nodeAfter,d=r.nodeBefore;return void((a&&o.isObject(a)||d&&o.isObject(d))&&(i.change(e=>{e.setSelection(l?r:n)}),t.preventDefault(),e.stop()))}if(!s.isCollapsed)return;const c=this._getObjectElementNextToSelection(l);if(c&&o.isObject(c)){if(o.isInline(c)&&d)return;this._setSelectionOverElement(c),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const n=this.editor.model,i=n.schema,o=n.document.selection.getSelectedElement();o&&i.isObject(o)&&(t.preventDefault(),e.stop())}_handleDelete(e){if(this.editor.isReadOnly)return;const t=this.editor.model.document.selection;if(!t.isCollapsed)return;const n=this._getObjectElementNextToSelection(e);return n?(this.editor.model.change(e=>{let i=t.anchor.parent;for(;i.isEmpty;){const t=i;i=t.parent,e.remove(t)}this._setSelectionOverElement(n)}),!0):void 0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,n=t.schema,i=t.document.selection,o=t.createSelection(i);if(t.modifySelection(o,{direction:e?"forward":"backward"}),o.isEqual(i))return null;const s=e?o.focus.nodeBefore:o.focus.nodeAfter;return s&&n.isObject(s)?s:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(Am,t);this._previouslySelected.clear()}}function Gm(e,t){return!!t&&Array.from(e.getAncestors()).includes(t)}const Hm=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return w(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),dr(e,t,{leading:i,maxWait:t,trailing:o})};var qm=s(390);rs()(qm.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),qm.Z.locals;class Ym extends rt{static get pluginName(){return"DragDrop"}static get requires(){return[bm,Wm]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=Hm(e=>this._updateDropMarker(e),40),this._removeDropMarkerDelayed=Xm(()=>this._removeDropMarker(),40),this._clearDraggableAttributesDelayed=Xm(()=>this._clearDraggableAttributes(),40),t.addObserver(_m),t.addObserver(qu),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(e,t,n)=>{n||this._finalizeDragging(!1)}),fo.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._updateDropMarkerThrottled.cancel(),this._removeDropMarkerDelayed.cancel(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,t=e.model,n=t.document,i=e.editing.view,o=i.document;this.listenTo(o,"dragstart",(i,s)=>{const r=n.selection;if(s.target&&s.target.is("editableElement"))return void s.preventDefault();const l=s.target?Jm(s.target):null;if(l){const n=e.editing.mapper.toModelElement(l);this._draggedRange=da.fromRange(t.createRangeOn(n)),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}else if(!o.selection.isCollapsed){const e=o.selection.getSelectedElement();e&&wm(e)||(this._draggedRange=da.fromRange(r.getFirstRange()))}if(!this._draggedRange)return void s.preventDefault();this._draggingUid=a(),s.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",s.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const d=t.createSelection(this._draggedRange.toRange()),c=e.data.toView(t.getSelectedContent(d));o.fire("clipboardOutput",{dataTransfer:s.dataTransfer,content:c,method:i.name}),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(o,"dragend",(e,t)=>{this._finalizeDragging(!t.dataTransfer.isCanceled&&"move"==t.dataTransfer.dropEffect)},{priority:"low"}),this.listenTo(o,"dragenter",()=>{this.isEnabled&&i.focus()}),this.listenTo(o,"dragleave",()=>{this._removeDropMarkerDelayed()}),this.listenTo(o,"dragging",(t,n)=>{if(!this.isEnabled)return void(n.dataTransfer.dropEffect="none");this._removeDropMarkerDelayed.cancel();const i=Km(e,n.targetRanges,n.target);this._draggedRange||(n.dataTransfer.dropEffect="copy"),fo.isGecko||("copy"==n.dataTransfer.effectAllowed?n.dataTransfer.dropEffect="copy":["all","copyMove"].includes(n.dataTransfer.effectAllowed)&&(n.dataTransfer.dropEffect="move")),i&&this._updateDropMarkerThrottled(i)},{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"clipboardInput",(t,n)=>{if("drop"!=n.method)return;const i=Km(e,n.targetRanges,n.target);return this._removeDropMarker(),i?(this._draggedRange&&this._draggingUid!=n.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),"move"==Zm(n.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(i,!0)?(this._finalizeDragging(!1),void t.stop()):void(n.targetRanges=[e.editing.mapper.toViewRange(i)])):(this._finalizeDragging(!1),void t.stop())},{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(bm);e.on("contentInsertion",(e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const n=t.targetRanges.map(e=>this.editor.editing.mapper.toModelRange(e));this.editor.model.change(e=>e.setSelection(n))},{priority:"high"}),e.on("contentInsertion",(e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const n="move"==Zm(t.dataTransfer),i=!t.resultRange||!t.resultRange.isCollapsed;this._finalizeDragging(i&&n)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,n=t.document;this.listenTo(n,"mousedown",(i,o)=>{if(fo.isAndroid||!o)return;this._clearDraggableAttributesDelayed.cancel();let s=Jm(o.target);if(fo.isBlink&&!e.isReadOnly&&!s&&!n.selection.isCollapsed){const e=n.selection.getSelectedElement();e&&wm(e)||(s=n.selection.editableElement)}s&&(t.change(e=>{e.setAttribute("draggable","true",s)}),this._draggableElement=e.editing.mapper.toModelElement(s))}),this.listenTo(n,"mouseup",()=>{fo.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change(t=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_setupDropMarker(){const e=this.editor;e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:n})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return n.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(e){const t=this.toDomElement(e);return t.innerHTML="⁠ ⁠",t})}})}_updateDropMarker(e){const t=this.editor,n=t.model.markers;t.model.change(t=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(e)||t.updateMarker("drop-target",{range:e}):t.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})})}_removeDropMarker(){const e=this.editor.model;this._removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),e.markers.has("drop-target")&&e.change(e=>{e.removeMarker("drop-target")})}_finalizeDragging(e){const t=this.editor,n=t.model;this._removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._draggedRange&&(e&&this.isEnabled&&n.deleteContent(n.createSelection(this._draggedRange),{doNotAutoparagraph:!0}),this._draggedRange.detach(),this._draggedRange=null)}}function Km(e,t,n){const i=e.model,o=e.editing.mapper;let s=null;const r=t?t[0].start:null;if(n.is("uiElement")&&(n=n.parent),s=function(e,t){const n=e.model,i=e.editing.mapper;if(wm(t))return n.createRangeOn(i.toModelElement(t));if(!t.is("editableElement")){const e=t.findAncestor(e=>wm(e)||e.is("editableElement"));if(wm(e))return n.createRangeOn(i.toModelElement(e))}return null}(e,n),s)return s;const a=function(e,t){const n=e.editing.mapper,i=e.editing.view,o=n.toModelElement(t);if(o)return o;const s=i.createPositionBefore(t),r=n.findMappedViewAncestor(s);return n.toModelElement(r)}(e,n),l=r?o.toModelPosition(r):null;return l?(s=function(e,t,n){const i=e.model;if(!i.schema.checkChild(n,"$block"))return null;const o=i.createPositionAt(n,0),s=t.path.slice(0,o.path.length),r=i.createPositionFromPath(t.root,s).nodeAfter;return r&&i.schema.isObject(r)?i.createRangeOn(r):null}(e,l,a),s||(s=i.schema.getNearestSelectionRange(l,fo.isGecko?"forward":"backward"),s||function(e,t){const n=e.model;for(;t;){if(n.schema.isObject(t))return n.createRangeOn(t);t=t.parent}}(e,l.parent))):function(e,t){const n=e.model,i=n.schema,o=n.createPositionAt(t,0);return i.getNearestSelectionRange(o,"forward")}(e,a)}function Zm(e){return fo.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function Xm(e,t){let n;function i(...o){i.cancel(),n=setTimeout(()=>e(...o),t)}return i.cancel=()=>{clearTimeout(n)},i}function Jm(e){if(e.is("editableElement"))return null;if(e.hasClass("ck-widget__selection-handle"))return e.findAncestor(wm);if(wm(e))return e;const t=e.findAncestor(e=>wm(e)||e.is("editableElement"));return wm(t)?t:null}class Qm extends rt{static get pluginName(){return"PastePlainText"}static get requires(){return[bm]}init(){const e=this.editor,t=e.model,n=e.editing.view,i=n.document,o=t.document.selection;let s=!1;n.addObserver(_m),this.listenTo(i,"keydown",(e,t)=>{s=t.shiftKey}),e.plugins.get(bm).on("contentInsertion",(e,n)=>{(s||function(e,t){if(e.childCount>1)return!1;const n=e.getChild(0);return!t.isObject(n)&&0==[...n.getAttributeKeys()].length}(n.content,t.schema))&&t.change(e=>{const i=Array.from(o.getAttributes()).filter(([e])=>t.schema.getAttributeProperties(e).isFormatting);o.isCollapsed||t.deleteContent(o,{doNotAutoparagraph:!0}),i.push(...o.getAttributes());const s=e.createRangeIn(n.content);for(const t of s.getItems())t.is("$textProxy")&&e.setAttributes(i,t)})})}}class eg extends rt{static get pluginName(){return"Clipboard"}static get requires(){return[bm,Ym,Qm]}}class tg extends lt{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let n=e.schema.getLimitElement(t);if(t.containsEntireContent(n)||!ng(e.schema,n))do{if(n=n.parent,!n)return}while(!ng(e.schema,n));e.change(e=>{e.setSelection(n,"in")})}}function ng(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const ig=Co("Ctrl+A");class og extends rt{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor,t=e.editing.view.document;e.commands.add("selectAll",new tg(e)),this.listenTo(t,"keydown",(t,n)=>{jo(n)===ig&&(e.execute("selectAll"),n.preventDefault())})}}class sg extends rt{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",t=>{const n=e.commands.get("selectAll"),i=new fc(t),o=t.t;return i.set({label:o("Select all"),icon:' ',keystroke:"Ctrl+A",tooltip:!0}),i.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(i,"execute",()=>{e.execute("selectAll"),e.editing.view.focus()}),i})}}class rg extends rt{static get requires(){return[og,sg]}static get pluginName(){return"SelectAll"}}class ag extends lt{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this.listenTo(e.data,"set",(e,t)=>{t[1]={...t[1]};const n=t[1];n.batchType||(n.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(e.data,"set",(e,t)=>{t[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}addBatch(e){const t=this.editor.model.document.selection,n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,n){const i=this.editor.model,o=i.document,s=[],r=e.map(e=>e.getTransformedByOperations(n)),a=r.flat();for(const e of r){const t=e.filter(e=>e.root!=o.graveyard).filter(e=>!dg(e,a));t.length&&(lg(t),s.push(t[0]))}s.length&&i.change(e=>{e.setSelection(s,{backward:t})})}_undo(e,t){const n=this.editor.model,i=n.document;this._createdBatches.add(t);const o=e.operations.slice().filter(e=>e.isDocumentOperation);o.reverse();for(const e of o){const o=e.baseVersion+1,s=Array.from(i.history.getOperations(o)),r=Nu([e.getReversed()],s,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const o of r)t.addOperation(o),n.applyOperation(o),i.history.setOperationAsUndone(e,o)}}}function lg(e){e.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let t=1;tt!==e&&t.containsRange(e,!0))}class cg extends ag{execute(e=null){const t=e?this._stack.findIndex(t=>t.batch==e):this._stack.length-1,n=this._stack.splice(t,1)[0],i=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(i,()=>{this._undo(n.batch,i);const e=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,e),this.fire("revert",n.batch,i)}),this.refresh()}}class ug extends ag{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,()=>{const n=e.batch.operations[e.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,i),this._undo(e.batch,t)}),this.refresh()}}class hg extends rt{static get pluginName(){return"UndoEditing"}constructor(e){super(e),this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new cg(e),this._redoCommand=new ug(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(e,t)=>{const n=t[0];if(!n.isDocumentOperation)return;const i=n.batch,o=this._redoCommand._createdBatches.has(i),s=this._undoCommand._createdBatches.has(i);this._batchRegistry.has(i)||(this._batchRegistry.add(i),i.isUndoable&&(o?this._undoCommand.addBatch(i):s||(this._undoCommand.addBatch(i),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(e,t,n)=>{this._redoCommand.addBatch(n)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo")}}const mg=' ',gg=' ';class pg extends rt{static get pluginName(){return"UndoUI"}init(){const e=this.editor,t=e.locale,n=e.t,i="ltr"==t.uiLanguageDirection?mg:gg,o="ltr"==t.uiLanguageDirection?gg:mg;this._addButton("undo",n("Undo"),"CTRL+Z",i),this._addButton("redo",n("Redo"),"CTRL+Y",o)}_addButton(e,t,n,i){const o=this.editor;o.ui.componentFactory.add(e,s=>{const r=o.commands.get(e),a=new fc(s);return a.set({label:t,icon:i,keystroke:n,tooltip:!0}),a.bind("isEnabled").to(r,"isEnabled"),this.listenTo(a,"execute",()=>{o.execute(e),o.editing.view.focus()}),a})}}class fg extends rt{static get requires(){return[hg,pg]}static get pluginName(){return"Undo"}}class xg extends lt{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,i=e.value;t.change(e=>{if(n.isCollapsed)i?e.setSelectionAttribute(this.attributeKey,i):e.removeSelectionAttribute(this.attributeKey);else{const o=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const t of o)i?e.setAttribute(this.attributeKey,i,t):e.removeAttribute(this.attributeKey,t)}})}}class _g extends Un{constructor(e){super(e),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",0===this.length)})}add(e,t){this.find(t=>t.color===e.color)||super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}}st(_g,Qe);var Ig=s(585);rs()(Ig.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Ig.Z.locals;class vg extends Bd{constructor(e,{colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:s}){super(e),this.items=this.createCollection(),this.colorDefinitions=t,this.focusTracker=new Pr,this.keystrokes=new Dr,this.set("selectedColor"),this.removeButtonLabel=i,this.columns=n,this.documentColors=new _g,this.documentColorsCount=s,this._focusCycler=new jc({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this._documentColorsLabel=o,this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-table"]},children:this.items}),this.items.add(this._removeColorButton())}updateDocumentColors(e,t){const n=e.document,i=this.documentColorsCount;this.documentColors.clear();for(const o of n.getRootNames()){const s=n.getRoot(o),r=e.createRangeIn(s);for(const e of r.getItems())if(e.is("$textProxy")&&e.hasAttribute(t)&&(this._addColorToDocumentColors(e.getAttribute(t)),this.documentColors.length>=i))return}}updateSelectedColors(){const e=this.documentColorsGrid,t=this.staticColorsGrid,n=this.selectedColor;t.selectedColor=n,e&&(e.selectedColor=n)}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}appendGrids(){if(!this.staticColorsGrid&&(this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount)){const e=Vd.bind(this.documentColors,this.documentColors),t=new tu(this.locale);t.text=this._documentColorsLabel,t.extendTemplate({attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]}}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_removeColorButton(){const e=new fc;return e.set({withText:!0,icon:' ',tooltip:!0,label:this.removeButtonLabel}),e.class="ck-color-table__remove-color",e.on("execute",()=>{this.fire("execute",{value:null})}),e}_createStaticColorsGrid(){const e=new kc(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.delegate("execute").to(this),e}_createDocumentColorsGrid(){const e=Vd.bind(this.documentColors,this.documentColors),t=new kc(this.locale,{columns:this.columns});return t.delegate("execute").to(this),t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using(e=>{const t=new vc;return t.set({color:e.color,hasBorder:e.options&&e.options.hasBorder}),e.label&&t.set({label:e.label,tooltip:!0}),t.on("execute",()=>{this.fire("execute",{value:e.color})}),t}),this.documentColors.on("change:isEmpty",(e,n,i)=>{i&&(t.selectedColor=null)}),t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find(t=>t.color===e);t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}}const bg="fontColor",jg="fontBackgroundColor";function Cg(e){return t=>function(e){return e.replace(/\s/g,"")}(t.getStyle(e))}function yg(e){return(t,{writer:n})=>n.createAttributeElement("span",{style:`${e}:${t}`},{priority:7})}class kg extends xg{constructor(e){super(e,jg)}}class Ag extends rt{static get pluginName(){return"FontBackgroundColorEditing"}constructor(e){super(e),e.config.define(jg,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(ch),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:jg,value:Cg("background-color")}}),e.conversion.for("downcast").attributeToElement({model:jg,view:yg("background-color")}),e.commands.add(jg,new kg(e)),e.model.schema.extend("$text",{allowAttributes:jg}),e.model.schema.setAttributeProperties(jg,{isFormatting:!0,copyOnEnter:!0})}}class wg extends rt{constructor(e,{commandName:t,icon:n,componentName:i,dropdownLabel:o}){super(e),this.commandName=t,this.componentName=i,this.icon=n,this.dropdownLabel=o,this.columns=e.config.get(`${this.componentName}.columns`),this.colorTableView=void 0}init(){const e=this.editor,t=e.locale,n=t.t,i=e.commands.get(this.commandName),o=function(e,t){const n=e.t,i={Black:n("Black"),"Dim grey":n("Dim grey"),Grey:n("Grey"),"Light grey":n("Light grey"),White:n("White"),Red:n("Red"),Orange:n("Orange"),Yellow:n("Yellow"),"Light green":n("Light green"),Green:n("Green"),Aquamarine:n("Aquamarine"),Turquoise:n("Turquoise"),"Light blue":n("Light blue"),Blue:n("Blue"),Purple:n("Purple")};return t.map(e=>{const t=i[e.label];return t&&t!=e.label&&(e.label=t),e})}(t,function(e){return e.map(Ic).filter(e=>!!e)}(e.config.get(this.componentName).colors)),s=e.config.get(`${this.componentName}.documentColors`);e.ui.componentFactory.add(this.componentName,t=>{const r=Kc(t);return this.colorTableView=function({dropdownView:e,colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:s}){const r=e.locale,a=new vg(r,{colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:s});return e.colorTableView=a,e.panelView.children.add(a),a.delegate("execute").to(e,"execute"),a}({dropdownView:r,colors:o.map(e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}})),columns:this.columns,removeButtonLabel:n("Remove color"),documentColorsLabel:0!==s?n("Document colors"):void 0,documentColorsCount:void 0===s?this.columns:s}),this.colorTableView.bind("selectedColor").to(i,"value"),r.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),r.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),r.bind("isEnabled").to(i),r.on("execute",(t,n)=>{e.execute(this.commandName,n),e.editing.view.focus()}),r.on("change:isOpen",(t,n,i)=>{r.colorTableView.appendGrids(),i&&(0!==s&&this.colorTableView.updateDocumentColors(e.model,this.componentName),this.colorTableView.updateSelectedColors())}),r})}}class Sg extends wg{constructor(e){const t=e.locale.t;super(e,{commandName:jg,componentName:jg,icon:' ',dropdownLabel:t("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class Eg extends xg{constructor(e){super(e,bg)}}class Tg extends rt{static get pluginName(){return"FontColorEditing"}constructor(e){super(e),e.config.define(bg,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:bg,value:Cg("color")}}),e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:bg,value:e=>e.getAttribute("color")}}),e.conversion.for("downcast").attributeToElement({model:bg,view:yg("color")}),e.commands.add(bg,new Eg(e)),e.model.schema.extend("$text",{allowAttributes:bg}),e.model.schema.setAttributeProperties(bg,{isFormatting:!0,copyOnEnter:!0})}}class zg extends wg{constructor(e){const t=e.locale.t;super(e,{commandName:bg,componentName:bg,icon:' ',dropdownLabel:t("Font Color")})}static get pluginName(){return"FontColorUI"}}class $g extends lt{refresh(){const e=this.editor.model,t=Rr(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&Og(t,e.schema)}execute(e={}){const t=this.editor.model,n=t.document;t.change(i=>{const o=(e.selection||n.selection).getSelectedBlocks();for(const e of o)!e.is("element","paragraph")&&Og(e,t.schema)&&i.rename(e,"paragraph")})}}function Og(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class Rg extends lt{execute(e){const t=this.editor.model,n=e.attributes;let i=e.position;t.change(e=>{const o=e.createElement("paragraph");if(n&&t.schema.setAllowedAttributes(o,n,e),!t.schema.checkChild(i.parent,o)){const n=t.schema.findAllowedParent(i,o);if(!n)return;i=e.split(i,n).position}t.insertContent(o,i),e.setSelection(o,"in")})}}class Pg extends rt{static get pluginName(){return"Paragraph"}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new $g(e)),e.commands.add("insertParagraph",new Rg(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(e,{writer:t})=>Pg.paragraphLikeElements.has(e.name)?e.isEmpty?null:t.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}Pg.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class Dg extends lt{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=Rr(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>Fg(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,n=t.document,i=e.value;t.change(e=>{const o=Array.from(n.selection.getSelectedBlocks()).filter(e=>Fg(e,i,t.schema));for(const t of o)t.is("element",i)||e.rename(t,i)})}}function Fg(e,t,n){return n.checkChild(e.parent,t)&&!n.isObject(e)}const Mg="paragraph";class Ng extends rt{static get pluginName(){return"HeadingEditing"}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[Pg]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const i of t)i.model!==Mg&&(e.model.schema.register(i.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new Dg(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(t,i)=>{const o=e.model.document.selection.getFirstPosition().parent,s=n.some(e=>o.is("element",e.model));s&&!o.is("element",Mg)&&0===o.childCount&&i.writer.rename(o,Mg)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:d.get("low")+1})}}var Lg=s(230);rs()(Lg.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Lg.Z.locals;class Bg extends rt{static get pluginName(){return"HeadingUI"}init(){const e=this.editor,t=e.t,n=function(e){const t=e.t,n={Paragraph:t("Paragraph"),"Heading 1":t("Heading 1"),"Heading 2":t("Heading 2"),"Heading 3":t("Heading 3"),"Heading 4":t("Heading 4"),"Heading 5":t("Heading 5"),"Heading 6":t("Heading 6")};return e.config.get("heading.options").map(e=>{const t=n[e.title];return t&&t!=e.title&&(e.title=t),e})}(e),i=t("Choose heading"),o=t("Heading");e.ui.componentFactory.add("heading",t=>{const s={},r=new Un,a=e.commands.get("heading"),l=e.commands.get("paragraph"),d=[a];for(const e of n){const t={type:"button",model:new mu({label:e.title,class:e.class,withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(l,"value"),t.model.set("commandName","paragraph"),d.push(l)):(t.model.bind("isOn").to(a,"value",t=>t===e.model),t.model.set({commandName:"heading",commandValue:e.model})),r.add(t),s[e.model]=e.title}const c=Kc(t);return Xc(c,r),c.buttonView.set({isOn:!1,withText:!0,tooltip:o}),c.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),c.bind("isEnabled").toMany(d,"isEnabled",(...e)=>e.some(e=>e)),c.buttonView.bind("label").to(a,"value",l,"value",(e,t)=>{const n=e||t&&"paragraph";return s[n]?s[n]:i}),this.listenTo(c,"execute",t=>{e.execute(t.source.commandName,t.source.commandValue?{value:t.source.commandValue}:void 0),e.editing.view.focus()}),c})}}class Vg{constructor(e){this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=e,this._referenceCoordinates=null}begin(e,t,n){const i=new Ir(t);this.activeHandlePosition=function(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const n of t)if(e.classList.contains(Ug(n)))return n}(e),this._referenceCoordinates=function(e,t){const n=new Ir(e),i=t.split("-"),o={x:"right"==i[1]?n.right:n.left,y:"bottom"==i[0]?n.bottom:n.top};return o.x+=e.ownerDocument.defaultView.scrollX,o.y+=e.ownerDocument.defaultView.scrollY,o}(t,function(e){const t=e.split("-"),n={top:"bottom",bottom:"top",left:"right",right:"left"};return`${n[t[0]]}-${n[t[1]]}`}(this.activeHandlePosition)),this.originalWidth=i.width,this.originalHeight=i.height,this.aspectRatio=i.width/i.height;const o=n.style.width;o&&o.match(/^\d+(\.\d*)?%$/)?this.originalWidthPercents=parseFloat(o):this.originalWidthPercents=function(e,t){const n=e.parentElement,i=parseFloat(n.ownerDocument.defaultView.getComputedStyle(n).width);return t.width/i*100}(n,i)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}function Ug(e){return`ck-widget__resizer__handle-${e}`}st(Vg,Qe);class Wg extends Bd{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",e=>e?`ck-orientation-${e}`:"")],style:{display:e.if("_isVisible","none",e=>!e)}},children:[{text:e.to("_label")}]})}_bindToState(e,t){this.bind("_isVisible").to(t,"proposedWidth",t,"proposedHeight",(e,t)=>null!==e&&null!==t),this.bind("_label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",(t,n,i)=>"px"===e.unit?`${t}×${n}`:`${i}%`),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",(e,t,n)=>t<50||n<50?"above-center":e)}_dismiss(){this.unbind(),this._isVisible=!1}}class Gg{constructor(e){this._options=e,this._viewResizerWrapper=null,this.set("isEnabled",!0),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",e=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),e.stop())},{priority:"high"}),this.on("change:isEnabled",()=>{this.isEnabled&&this.redraw()})}attach(){const e=this,t=this._options.viewElement;this._options.editor.editing.view.change(n=>{const i=n.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},function(t){const n=this.toDomElement(t);return e._appendHandles(n),e._appendSizeUI(n),e.on("change:isEnabled",(e,t,i)=>{n.style.display=i?"":"none"}),n.style.display=e.isEnabled?"":"none",n});n.insert(n.createPositionAt(t,"end"),i),n.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=i})}begin(e){this.state=new Vg(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){const t=this._proposeNewSize(e);this._options.editor.editing.view.change(e=>{const n=this._options.unit||"%",i=("%"===n?t.widthPercents:t.width)+n;e.setStyle("width",i,this._options.viewElement)});const n=this._getHandleHost(),i=new Ir(n);t.handleHostWidth=Math.round(i.width),t.handleHostHeight=Math.round(i.height);const o=new Ir(n);t.width=Math.round(o.width),t.height=Math.round(o.height),this.redraw(i),this.state.update(t)}commit(){const e=this._options.unit||"%",t=("%"===e?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(t)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const t=this._domResizerWrapper;if(!function(e){return e&&e.ownerDocument&&e.ownerDocument.contains(e)}(t))return;const n=t.parentElement,i=this._getHandleHost(),o=this._viewResizerWrapper,s=[o.getStyle("width"),o.getStyle("height"),o.getStyle("left"),o.getStyle("top")];let r;if(n.isSameNode(i)){const t=e||new Ir(i);r=[t.width+"px",t.height+"px",void 0,void 0]}else r=[i.offsetWidth+"px",i.offsetHeight+"px",i.offsetLeft+"px",i.offsetTop+"px"];"same"!==Xn(s,r)&&this._options.editor.editing.view.change(e=>{e.setStyle({width:r[0],height:r[1],left:r[2],top:r[3]},o)})}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss(),this._options.editor.editing.view.change(e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){const t=this.state,n=function(e){return{x:e.pageX,y:e.pageY}}(e),i=!this._options.isCentered||this._options.isCentered(this),o={x:t._referenceCoordinates.x-(n.x+t.originalWidth),y:n.y-t.originalHeight-t._referenceCoordinates.y};i&&t.activeHandlePosition.endsWith("-right")&&(o.x=n.x-(t._referenceCoordinates.x+t.originalWidth)),i&&(o.x*=2);const s={width:Math.abs(t.originalWidth+o.x),height:Math.abs(t.originalHeight+o.y)};s.dominant=s.width/t.aspectRatio>s.height?"width":"height",s.max=s[s.dominant];const r={width:s.width,height:s.height};return"width"==s.dominant?r.height=r.width/t.aspectRatio:r.width=r.height*t.aspectRatio,{width:Math.round(r.width),height:Math.round(r.height),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*r.width*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const n of t)e.appendChild(new Vd({tag:"div",attributes:{class:`ck-widget__resizer__handle ${Hg(n)}`}}).render())}_appendSizeUI(e){this._sizeView=new Wg,this._sizeView.render(),e.appendChild(this._sizeView.element)}}function Hg(e){return`ck-widget__resizer__handle-${e}`}st(Gg,Qe);var qg=s(263);rs()(qg.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),qg.Z.locals;class Yg extends rt{static get pluginName(){return"WidgetResize"}init(){const e=this.editor.editing,t=hs.window.document;this.set("visibleResizer",null),this.set("_activeResizer",null),this._resizers=new Map,e.view.addObserver(qu),this._observer=Object.create(ws),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this));const n=()=>{this.visibleResizer&&this.visibleResizer.redraw()};this._redrawFocusedResizerThrottled=Hm(n,200),this.on("change:visibleResizer",n),this.editor.ui.on("update",this._redrawFocusedResizerThrottled),this.editor.model.document.on("change",()=>{for(const[e,t]of this._resizers)e.isAttached()||(this._resizers.delete(e),t.destroy())},{priority:"lowest"}),this._observer.listenTo(hs.window,"resize",this._redrawFocusedResizerThrottled);const i=this.editor.editing.view.document.selection;i.on("change",()=>{const e=i.getSelectedElement();this.visibleResizer=this.getResizerByViewElement(e)||null})}destroy(){this._observer.stopListening();for(const e of this._resizers.values())e.destroy();this._redrawFocusedResizerThrottled.cancel()}attachTo(e){const t=new Gg(e),n=this.editor.plugins;if(t.attach(),n.has("WidgetToolbarRepository")){const e=n.get("WidgetToolbarRepository");t.on("begin",()=>{e.forceDisabled("resize")},{priority:"lowest"}),t.on("cancel",()=>{e.clearForceDisabled("resize")},{priority:"highest"}),t.on("commit",()=>{e.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(e.viewElement,t);const i=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(i)==t&&(this.visibleResizer=t),t}getResizerByViewElement(e){return this._resizers.get(e)}_getResizerByHandle(e){for(const t of this._resizers.values())if(t.containsHandle(e))return t}_mouseDownListener(e,t){const n=t.domTarget;Gg.isResizeHandle(n)&&(this._activeResizer=this._getResizerByHandle(n),this._activeResizer&&(this._activeResizer.begin(n),e.stop(),t.preventDefault()))}_mouseMoveListener(e,t){this._activeResizer&&this._activeResizer.updateSize(t)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}st(Yg,Qe);class Kg extends lt{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,n=t.plugins.get("ImageUtils"),i=t.model,o=n.getClosestSelectedImageElement(i.document.selection);i.change(t=>{t.setAttribute("alt",e.newValue,o)})}}function Zg(e){return e.createContainerElement("figure",{class:"image"},[e.createEmptyElement("img"),e.createSlot()])}function Xg(e,t){const n=e.plugins.get("ImageUtils"),i=e.plugins.has("ImageInlineEditing")&&e.plugins.has("ImageBlockEditing");return e=>n.isInlineImageView(e)?i&&(e.findAncestor(n.isBlockImageView)?"imageBlock":"imageInline")!==t?null:function(e){const t={name:!0};return e.hasAttribute("src")&&(t.attributes=["src"]),t}(e):null}function Jg(e,t){const n=Rr(t.getSelectedBlocks());return!n||e.isObject(n)||n.isEmpty&&"listItem"!=n.name?"imageBlock":"imageInline"}class Qg extends rt{static get pluginName(){return"ImageUtils"}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,n=null){const i=this.editor,o=i.model,s=o.document.selection;n=ep(i,t||s,n),e={...Object.fromEntries(s.getAttributes()),...e};for(const t in e)o.schema.checkAttribute(n,t)||delete e[t];return o.change(i=>{const s=i.createElement(n,e);return o.insertObject(s,t,null,{setSelection:"on",findOptimalPosition:!t&&"imageInline"!=n}),s.parent?s:null})}getClosestSelectedImageWidget(e){const t=e.getSelectedElement();if(t&&this.isImageWidget(t))return t;let n=e.getFirstPosition().parent;for(;n;){if(n.is("element")&&this.isImageWidget(n))return n;n=n.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}isImageAllowed(){const e=this.editor.model.document.selection;return function(e,t){if("imageBlock"==ep(e,t)){const n=function(e,t){const n=function(e,t){const n=e.getSelectedElement();if(n){const i=Pm(e);if(i)return t.createRange(t.createPositionAt(n,i))}return ad(e,t)}(e,t),i=n.start.parent;return i.isEmpty&&!i.is("element","$root")?i.parent:i}(t,e.model);if(e.model.schema.checkChild(n,"imageBlock"))return!0}else if(e.model.schema.checkChild(t.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(e){return[...e.focus.getAncestors()].every(e=>!e.is("element","imageBlock"))}(e)}toImageWidget(e,t,n){return t.setCustomProperty("image",!0,e),Sm(e,t,{label:()=>{const t=this.findViewImgElement(e).getAttribute("alt");return t?`${t} ${n}`:n}})}isImageWidget(e){return!!e.getCustomProperty("image")&&wm(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:n}of t.createRangeIn(e))if(this.isInlineImageView(n))return n}}function ep(e,t,n){const i=e.model.schema,o=e.config.get("image.insert.type");return e.plugins.has("ImageBlockEditing")?e.plugins.has("ImageInlineEditing")?n||("inline"===o?"imageInline":"block"===o?"imageBlock":t.is("selection")?Jg(i,t):i.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class tp extends rt{static get requires(){return[Qg]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new Kg(this.editor))}}var np=s(831);rs()(np.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),np.Z.locals;var ip=s(590);rs()(ip.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),ip.Z.locals;class op extends Bd{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new Pr,this.keystrokes=new Dr,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),Pd,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),Rd,"ck-button-cancel","cancel"),this._focusables=new Nd,this._focusCycler=new jc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]}),Fd(this)}render(){super.render(),this.keystrokes.listenTo(this.element),Md({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(e,t,n,i){const o=new fc(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),i&&o.delegate("execute").to(this,i),o}_createLabeledInputView(){const e=this.locale.t,t=new cu(this.locale,uu);return t.label=e("Text alternative"),t}}function sp(e){const t=e.editing.view,n=_u.defaultPositions,i=e.plugins.get("ImageUtils");return{target:t.domConverter.viewToDom(i.getClosestSelectedImageWidget(t.document.selection)),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}class rp extends rt{static get requires(){return[Cu]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",n=>{const i=e.commands.get("imageTextAlternative"),o=new fc(n);return o.set({label:t("Change image text alternative"),icon:' ',tooltip:!0}),o.bind("isEnabled").to(i,"isEnabled"),this.listenTo(o,"execute",()=>{this._showForm()}),o})}_createForm(){const e=this.editor,t=e.editing.view.document,n=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new op(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(e,t)=>{this._hideForm(!0),t()}),this.listenTo(e.ui,"update",()=>{n.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(e){const t=e.plugins.get("ContextualBalloon");if(e.plugins.get("ImageUtils").getClosestSelectedImageWidget(e.editing.view.document.selection)){const n=sp(e);t.updatePosition(n)}}(e):this._hideForm(!0)}),Dd({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const e=this.editor,t=e.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:sp(e)}),n.fieldView.value=n.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class ap extends rt{static get requires(){return[tp,rp]}static get pluginName(){return"ImageTextAlternative"}}function lp(e,t){return e=>{e.on(`attribute:srcset:${t}`,n)};function n(t,n,i){if(!i.consumable.consume(n.item,t.name))return;const o=i.writer,s=i.mapper.toViewElement(n.item),r=e.findViewImgElement(s);if(null===n.attributeNewValue){const e=n.attributeOldValue;e.data&&(o.removeAttribute("srcset",r),o.removeAttribute("sizes",r),e.width&&o.removeAttribute("width",r))}else{const e=n.attributeNewValue;e.data&&(o.setAttribute("srcset",e.data,r),o.setAttribute("sizes","100vw",r),e.width&&o.setAttribute("width",e.width,r))}}}function dp(e,t,n){return e=>{e.on(`attribute:${n}:${t}`,i)};function i(t,n,i){if(!i.consumable.consume(n.item,t.name))return;const o=i.writer,s=i.mapper.toViewElement(n.item),r=e.findViewImgElement(s);o.setAttribute(n.attributeKey,n.attributeNewValue||"",r)}}class cp extends Ts{observe(e){this.listenTo(e,"load",(e,t)=>{const n=t.target;this.checkShouldIgnoreEventFromTarget(n)||"IMG"==n.tagName&&this._fireEvents(t)},{useCapture:!0})}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class up extends lt{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||"block"===t&&h("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||"inline"===t&&h("image-inline-plugin-required")}refresh(){this.isEnabled=this.editor.plugins.get("ImageUtils").isImageAllowed()}execute(e){const t=Gn(e.source),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),o=Object.fromEntries(n.getAttributes());t.forEach((e,t)=>{const s=n.getSelectedElement();if("string"==typeof e&&(e={src:e}),t&&s&&i.isImage(s)){const t=this.editor.model.createPositionAfter(s);i.insertImage({...e,...o},t)}else i.insertImage({...e,...o})})}}class hp extends rt{static get requires(){return[Qg]}static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(cp),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:e=>{const t={data:e.getAttribute("srcset")};return e.hasAttribute("width")&&(t.width=e.getAttribute("width")),t}}});const n=new up(e);e.commands.add("insertImage",n),e.commands.add("imageInsert",n)}}class mp extends lt{constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);"imageBlock"===this._modelElementName?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(){const e=this.editor,t=this.editor.model,n=e.plugins.get("ImageUtils"),i=n.getClosestSelectedImageElement(t.document.selection),o=Object.fromEntries(i.getAttributes());return o.src||o.uploadId?t.change(e=>{const s=Array.from(t.markers).filter(e=>e.getRange().containsItem(i)),r=n.insertImage(o,t.createSelection(i,"on"),this._modelElementName);if(!r)return null;const a=e.createRangeOn(r);for(const t of s){const n=t.getRange(),i="$graveyard"!=n.root.rootName?n.getJoined(a,!0):a;e.updateMarker(t,{range:i})}return{oldElement:i,newElement:r}}):null}}class gp extends rt{static get requires(){return[hp,Qg,bm]}static get pluginName(){return"ImageBlockEditing"}init(){const e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new mp(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:t})=>Zg(t)}),n.for("editingDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:n})=>i.toImageWidget(Zg(n),n,t("image widget"))}),n.for("downcast").add(dp(i,"imageBlock","src")).add(dp(i,"imageBlock","alt")).add(lp(i,"imageBlock")),n.for("upcast").elementToElement({view:Xg(e,"imageBlock"),model:(e,{writer:t})=>t.createElement("imageBlock",e.hasAttribute("src")?{src:e.getAttribute("src")}:null)}).add(function(e){return e=>{e.on("element:figure",t)};function t(t,n,i){if(!i.consumable.test(n.viewItem,{name:!0,classes:"image"}))return;const o=e.findViewImgElement(n.viewItem);if(!o||!i.consumable.test(o,{name:!0}))return;i.consumable.consume(n.viewItem,{name:!0,classes:"image"});const s=Rr(i.convertItem(o,n.modelCursor).modelRange.getItems());s?(i.convertChildren(n.viewItem,s),i.updateConversionResult(s,n)):i.consumable.revert(n.viewItem,{name:!0,classes:"image"})}}(i))}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,i=e.plugins.get("ImageUtils");this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(o,s)=>{const r=Array.from(s.content.getChildren());let a;if(!r.every(i.isInlineImageView))return;a=s.targetRanges?e.editing.mapper.toModelRange(s.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageBlock"===Jg(t.schema,l)){const e=new Yu(n.document),t=r.map(t=>e.createElement("figure",{class:"image"},t));s.content=e.createDocumentFragment(t)}})}}var pp=s(48);rs()(pp.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),pp.Z.locals;class fp extends rt{static get requires(){return[gp,Wm,ap]}static get pluginName(){return"ImageBlock"}}class xp extends rt{static get requires(){return[hp,Qg,bm]}static get pluginName(){return"ImageInlineEditing"}init(){const e=this.editor,t=e.model.schema;t.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"]}),t.addChildCheck((e,t)=>{if(e.endsWith("caption")&&"imageInline"===t.name)return!1}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new mp(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageInline",view:(e,{writer:t})=>t.createEmptyElement("img")}),n.for("editingDowncast").elementToStructure({model:"imageInline",view:(e,{writer:n})=>i.toImageWidget(function(e){return e.createContainerElement("span",{class:"image-inline"},e.createEmptyElement("img"))}(n),n,t("image widget"))}),n.for("downcast").add(dp(i,"imageInline","src")).add(dp(i,"imageInline","alt")).add(lp(i,"imageInline")),n.for("upcast").elementToElement({view:Xg(e,"imageInline"),model:(e,{writer:t})=>t.createElement("imageInline",e.hasAttribute("src")?{src:e.getAttribute("src")}:null)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,i=e.plugins.get("ImageUtils");this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(o,s)=>{const r=Array.from(s.content.getChildren());let a;if(!r.every(i.isBlockImageView))return;a=s.targetRanges?e.editing.mapper.toModelRange(s.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageInline"===Jg(t.schema,l)){const e=new Yu(n.document),t=r.map(t=>1===t.childCount?(Array.from(t.getAttributes()).forEach(n=>e.setAttribute(...n,i.findViewImgElement(t))),t.getChild(0)):t);s.content=e.createDocumentFragment(t)}})}}class _p extends rt{static get requires(){return[xp,Wm,ap]}static get pluginName(){return"ImageInline"}}class Ip extends lt{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!t,t&&t.hasAttribute("width")?this.value={width:t.getAttribute("width"),height:null}:this.value=null}execute(e){const t=this.editor,n=t.model,i=t.plugins.get("ImageUtils").getClosestSelectedImageElement(n.document.selection);this.value={width:e.width,height:null},i&&n.change(t=>{t.setAttribute("width",e.width,i)})}}class vp extends rt{static get requires(){return[Qg]}static get pluginName(){return"ImageResizeEditing"}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const e=this.editor,t=new Ip(e);this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:"width"}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:"width"})}_registerConverters(e){const t=this.editor;t.conversion.for("downcast").add(t=>t.on(`attribute:width:${e}`,(e,t,n)=>{if(!n.consumable.consume(t.item,e.name))return;const i=n.writer,o=n.mapper.toViewElement(t.item);null!==t.attributeNewValue?(i.setStyle("width",t.attributeNewValue,o),i.addClass("image_resized",o)):(i.removeStyle("width",o),i.removeClass("image_resized",o))})),t.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===e?"figure":"img",styles:{width:/.+/}},model:{key:"width",value:e=>e.getStyle("width")}})}}const bp={small:' ',medium:' ',large:' ',original:' '};class jp extends rt{static get requires(){return[vp]}static get pluginName(){return"ImageResizeButtons"}constructor(e){super(e),this._resizeUnit=e.config.get("image.resizeUnit")}init(){const e=this.editor,t=e.config.get("image.resizeOptions"),n=e.commands.get("resizeImage");this.bind("isEnabled").to(n);for(const e of t)this._registerImageResizeButton(e);this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){const t=this.editor,{name:n,value:i,icon:o}=e,s=i?i+this._resizeUnit:null;t.ui.componentFactory.add(n,n=>{const i=new fc(n),r=t.commands.get("resizeImage"),a=this._getOptionLabelValue(e,!0);if(!bp[o])throw new u("imageresizebuttons-missing-icon",t,e);return i.set({label:a,icon:bp[o],tooltip:a,isToggleable:!0}),i.bind("isEnabled").to(this),i.bind("isOn").to(r,"value",Cp(s)),this.listenTo(i,"execute",()=>{t.execute("resizeImage",{width:s})}),i})}_registerImageResizeDropdown(e){const t=this.editor,n=t.t,i=e.find(e=>!e.value),o=o=>{const s=t.commands.get("resizeImage"),r=Kc(o,Ac),a=r.buttonView;return a.set({tooltip:n("Resize image"),commandValue:i.value,icon:bp.medium,isToggleable:!0,label:this._getOptionLabelValue(i),withText:!0,class:"ck-resize-image-button"}),a.bind("label").to(s,"value",e=>e&&e.width?e.width:this._getOptionLabelValue(i)),r.bind("isOn").to(s),r.bind("isEnabled").to(this),Xc(r,this._getResizeDropdownListItemDefinitions(e,s)),r.listView.ariaLabel=n("Image resize list"),this.listenTo(r,"execute",e=>{t.execute(e.source.commandName,{width:e.source.commandValue}),t.editing.view.focus()}),r};t.ui.componentFactory.add("resizeImage",o),t.ui.componentFactory.add("imageResize",o)}_getOptionLabelValue(e,t){const n=this.editor.t;return e.label?e.label:t?e.value?n("Resize image to %0",e.value+this._resizeUnit):n("Resize image to the original size"):e.value?e.value+this._resizeUnit:n("Original")}_getResizeDropdownListItemDefinitions(e,t){const n=new Un;return e.map(e=>{const i=e.value?e.value+this._resizeUnit:null,o={type:"button",model:new mu({commandName:"resizeImage",commandValue:i,label:this._getOptionLabelValue(e),withText:!0,icon:null})};o.model.bind("isOn").to(t,"value",Cp(i)),n.add(o)}),n}}function Cp(e){return t=>null===e&&t===e||t&&t.width===e}const yp=/(image|image-inline)/,kp="image_resized";class Ap extends rt{static get requires(){return[Yg]}static get pluginName(){return"ImageResizeHandles"}init(){const e=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(e),this._setupResizerCreator()}_setupResizerCreator(){const e=this.editor,t=e.editing.view;t.addObserver(cp),this.listenTo(t.document,"imageLoaded",(n,i)=>{if(!i.target.matches("figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img"))return;const o=e.editing.view.domConverter,s=o.domToView(i.target).findAncestor({classes:yp});let r=this.editor.plugins.get(Yg).getResizerByViewElement(s);if(r)return void r.redraw();const a=e.editing.mapper,l=a.toModelElement(s);r=e.plugins.get(Yg).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:l,viewElement:s,editor:e,getHandleHost:e=>e.querySelector("img"),getResizeHost:()=>o.viewToDom(a.toViewElement(l.parent)),isCentered(){const e=l.getAttribute("imageStyle");return!e||"block"==e||"alignCenter"==e},onCommit(n){t.change(e=>{e.removeClass(kp,s)}),e.execute("resizeImage",{width:n})}}),r.on("updateSize",()=>{s.hasClass(kp)||t.change(e=>{e.addClass(kp,s)})}),r.bind("isEnabled").to(this)})}}var wp=s(43);rs()(wp.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),wp.Z.locals;class Sp{constructor(){const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((n,i)=>{t.onload=()=>{const e=t.result;this._data=e,n(e)},t.onerror=()=>{i("error")},t.onabort=()=>{i("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}st(Sp,Qe);class Ep extends rt{static get pluginName(){return"FileRepository"}static get requires(){return[Od]}init(){this.loaders=new Un,this.loaders.on("add",()=>this._updatePendingAction()),this.loaders.on("remove",()=>this._updatePendingAction()),this._loadersMap=new Map,this._pendingAction=null,this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return h("filerepository-no-upload-adapter"),null;const t=new Tp(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(e=>{this._loadersMap.set(e,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let e=0;for(const t of this.loaders)e+=t.uploaded;this.uploaded=e}),t.on("change:uploadTotal",()=>{let e=0;for(const t of this.loaders)t.uploadTotal&&(e+=t.uploadTotal);this.uploadTotal=e}),t}destroyLoader(e){const t=e instanceof Tp?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((e,n)=>{e===t&&this._loadersMap.delete(n)})}_updatePendingAction(){const e=this.editor.plugins.get(Od);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,n=e=>`${t("Upload in progress")} ${parseInt(e)}%.`;this._pendingAction=e.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else e.remove(this._pendingAction),this._pendingAction=null}}st(Ep,Qe);class Tp{constructor(e,t){this.id=a(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new Sp,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new u("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if("reading"!==this.status)throw this.status;return this.status="idle",e}).catch(e=>{if("aborted"===e)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:e})}upload(){if("idle"!=this.status)throw new u("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{if("aborted"===this.status)throw"aborted";throw this.status="error",e})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==e?this._reader.abort():"uploading"==e&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise((n,i)=>{t.rejecter=i,t.isFulfilled=!1,e.then(e=>{t.isFulfilled=!0,n(e)}).catch(e=>{t.isFulfilled=!0,i(e)})}),t}}st(Tp,Qe);class zp extends Bd{constructor(e){super(e),this.buttonView=new fc(e),this._fileInputView=new $p(e),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[this.buttonView,this._fileInputView]}),this.buttonView.on("execute",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class $p extends Bd{constructor(e){super(e),this.set("acceptedType"),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}class Op{constructor(e,t){this.loader=e,this.options=t}upload(){return this.loader.file.then(e=>new Promise((t,n)=>{this._initRequest(),this._initListeners(t,n,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.options.uploadUrl,!0),e.responseType="json"}_initListeners(e,t,n){const i=this.xhr,o=this.loader,s=`Couldn't upload file: ${n.name}.`;i.addEventListener("error",()=>t(s)),i.addEventListener("abort",()=>t()),i.addEventListener("load",()=>{const n=i.response;if(!n||n.error)return t(n&&n.error&&n.error.message?n.error.message:s);const o=n.url?{default:n.url}:n.urls;e({...n,urls:o})}),i.upload&&i.upload.addEventListener("progress",e=>{e.lengthComputable&&(o.uploadTotal=e.total,o.uploaded=e.loaded)})}_sendRequest(e){const t=this.options.headers||{},n=this.options.withCredentials||!1;for(const e of Object.keys(t))this.xhr.setRequestHeader(e,t[e]);this.xhr.withCredentials=n;const i=new FormData;i.append("upload",e),this.xhr.send(i)}}function Rp(e){const t=e.map(e=>e.replace("+","\\+"));return new RegExp(`^image\\/(${t.join("|")})$`)}function Pp(e){return new Promise((t,n)=>{const i=e.getAttribute("src");fetch(i).then(e=>e.blob()).then(e=>{const n=Dp(e,i),o=n.replace("image/",""),s=new File([e],`image.${o}`,{type:n});t(s)}).catch(e=>e&&"TypeError"===e.name?function(e){return function(e){return new Promise((t,n)=>{const i=hs.document.createElement("img");i.addEventListener("load",()=>{const e=hs.document.createElement("canvas");e.width=i.width,e.height=i.height,e.getContext("2d").drawImage(i,0,0),e.toBlob(e=>e?t(e):n())}),i.addEventListener("error",()=>n()),i.src=e})}(e).then(t=>{const n=Dp(t,e),i=n.replace("image/","");return new File([t],`image.${i}`,{type:n})})}(i).then(t).catch(n):n(e))})}function Dp(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class Fp extends rt{static get pluginName(){return"ImageUploadUI"}init(){const e=this.editor,t=e.t,n=n=>{const i=new zp(n),o=e.commands.get("uploadImage"),s=e.config.get("image.upload.types"),r=Rp(s);return i.set({acceptedType:s.map(e=>`image/${e}`).join(","),allowMultipleFiles:!0}),i.buttonView.set({label:t("Insert image"),icon:' ',tooltip:!0}),i.buttonView.bind("isEnabled").to(o),i.on("done",(t,n)=>{const i=Array.from(n).filter(e=>r.test(e.type));i.length&&e.execute("uploadImage",{file:i})}),i};e.ui.componentFactory.add("uploadImage",n),e.ui.componentFactory.add("imageUpload",n)}}var Mp=s(870);rs()(Mp.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Mp.Z.locals;var Np=s(899);rs()(Np.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Np.Z.locals;var Lp=s(825);rs()(Lp.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Lp.Z.locals;class Bp extends rt{static get pluginName(){return"ImageUploadProgress"}constructor(e){super(e),this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",(...e)=>this.uploadStatusChange(...e)),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",(...e)=>this.uploadStatusChange(...e))}uploadStatusChange(e,t,n){const i=this.editor,o=t.item,s=o.getAttribute("uploadId");if(!n.consumable.consume(t.item,e.name))return;const r=i.plugins.get("ImageUtils"),a=i.plugins.get(Ep),l=s?t.attributeNewValue:null,d=this.placeholder,c=i.editing.mapper.toViewElement(o),u=n.writer;if("reading"==l)return Vp(c,u),void Up(r,d,c,u);if("uploading"==l){const e=a.loaders.get(s);return Vp(c,u),void(e?(Wp(c,u),function(e,t,n,i){const o=function(e){const t=e.createUIElement("div",{class:"ck-progress-bar"});return e.setCustomProperty("progressBar",!0,t),t}(t);t.insert(t.createPositionAt(e,"end"),o),n.on("change:uploadedPercent",(e,t,n)=>{i.change(e=>{e.setStyle("width",n+"%",o)})})}(c,u,e,i.editing.view),function(e,t,n,i){if(i.data){const o=e.findViewImgElement(t);n.setAttribute("src",i.data,o)}}(r,c,u,e)):Up(r,d,c,u))}"complete"==l&&a.loaders.get(s)&&function(e,t,n){const i=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),i),setTimeout(()=>{n.change(e=>e.remove(e.createRangeOn(i)))},3e3)}(c,u,i.editing.view),function(e,t){Hp(e,t,"progressBar")}(c,u),Wp(c,u),function(e,t){t.removeClass("ck-appear",e)}(c,u)}}function Vp(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function Up(e,t,n,i){n.hasClass("ck-image-upload-placeholder")||i.addClass("ck-image-upload-placeholder",n);const o=e.findViewImgElement(n);o.getAttribute("src")!==t&&i.setAttribute("src",t,o),Gp(n,"placeholder")||i.insert(i.createPositionAfter(o),function(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}(i))}function Wp(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),Hp(e,t,"placeholder")}function Gp(e,t){for(const n of e.getChildren())if(n.getCustomProperty(t))return n}function Hp(e,t,n){const i=Gp(e,n);i&&t.remove(t.createRangeOn(i))}class qp extends lt{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(n)}execute(e){const t=Gn(e.file),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),o=Object.fromEntries(n.getAttributes());t.forEach((e,t)=>{const s=n.getSelectedElement();if(t&&s&&i.isImage(s)){const t=this.editor.model.createPositionAfter(s);this._uploadImage(e,o,t)}else this._uploadImage(e,o)})}_uploadImage(e,t,n){const i=this.editor,o=i.plugins.get(Ep).createLoader(e),s=i.plugins.get("ImageUtils");o&&s.insertImage({...t,uploadId:o.id},n)}}class Yp extends rt{static get requires(){return[Ep,hu,bm,Qg]}static get pluginName(){return"ImageUploadEditing"}constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){const e=this.editor,t=e.model.document,n=e.conversion,i=e.plugins.get(Ep),o=e.plugins.get("ImageUtils"),s=Rp(e.config.get("image.upload.types")),r=new qp(e);e.commands.add("uploadImage",r),e.commands.add("imageUpload",r),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",(t,n)=>{if(function(e){return Array.from(e.types).includes("text/html")&&""!==e.getData("text/html")}(n.dataTransfer))return;const i=Array.from(n.dataTransfer.files).filter(e=>!!e&&s.test(e.type));i.length&&(t.stop(),e.model.change(t=>{n.targetRanges&&t.setSelection(n.targetRanges.map(t=>e.editing.mapper.toModelRange(t))),e.model.enqueueChange(()=>{e.execute("uploadImage",{file:i})})}))}),this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(t,n)=>{const s=Array.from(e.editing.view.createRangeIn(n.content)).filter(e=>function(e,t){return!(!e.isInlineImageView(t)||!t.getAttribute("src"))&&(t.getAttribute("src").match(/^data:image\/\w+;base64,/g)||t.getAttribute("src").match(/^blob:/g))}(o,e.item)&&!e.item.getAttribute("uploadProcessed")).map(e=>({promise:Pp(e.item),imageElement:e.item}));if(!s.length)return;const r=new Yu(e.editing.view.document);for(const e of s){r.setAttribute("uploadProcessed",!0,e.imageElement);const t=i.createLoader(e.promise);t&&(r.setAttribute("src","",e.imageElement),r.setAttribute("uploadId",t.id,e.imageElement))}}),e.editing.view.document.on("dragover",(e,t)=>{t.preventDefault()}),t.on("change",()=>{const n=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),o=new Set;for(const t of n)if("insert"==t.type&&"$text"!=t.name){const n=t.position.nodeAfter,s="$graveyard"==t.position.root.rootName;for(const t of Kp(e,n)){const e=t.getAttribute("uploadId");if(!e)continue;const n=i.loaders.get(e);n&&(s?o.has(e)||n.abort():(o.add(e),this._uploadImageElements.set(e,t),"idle"==n.status&&this._readAndUpload(n)))}}}),this.on("uploadComplete",(e,{imageElement:t,data:n})=>{const i=n.urls?n.urls:n;this.editor.model.change(e=>{e.setAttribute("src",i.default,t),this._parseAndSetSrcsetAttributeOnImage(i,t,e)})},{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(e){const t=this.editor,n=t.model,i=t.locale.t,o=t.plugins.get(Ep),s=t.plugins.get(hu),r=t.plugins.get("ImageUtils"),a=this._uploadImageElements;return n.enqueueChange({isUndoable:!1},t=>{t.setAttribute("uploadStatus","reading",a.get(e.id))}),e.read().then(()=>{const i=e.upload(),o=a.get(e.id);if(fo.isSafari){const e=t.editing.mapper.toViewElement(o),n=r.findViewImgElement(e);t.editing.view.once("render",()=>{if(!n.parent)return;const e=t.editing.view.domConverter.mapViewToDom(n.parent);if(!e)return;const i=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=i})}return n.enqueueChange({isUndoable:!1},e=>{e.setAttribute("uploadStatus","uploading",o)}),i}).then(t=>{n.enqueueChange({isUndoable:!1},n=>{const i=a.get(e.id);n.setAttribute("uploadStatus","complete",i),this.fire("uploadComplete",{data:t,imageElement:i})}),l()}).catch(t=>{if("error"!==e.status&&"aborted"!==e.status)throw t;"error"==e.status&&t&&s.showWarning(t,{title:i("Upload failed"),namespace:"upload"}),n.enqueueChange({isUndoable:!1},t=>{t.remove(a.get(e.id))}),l()});function l(){n.enqueueChange({isUndoable:!1},t=>{const n=a.get(e.id);t.removeAttribute("uploadId",n),t.removeAttribute("uploadStatus",n),a.delete(e.id)}),o.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let i=0;const o=Object.keys(e).filter(e=>{const t=parseInt(e,10);if(!isNaN(t))return i=Math.max(i,t),!0}).map(t=>`${e[t]} ${t}w`).join(", ");""!=o&&n.setAttribute("srcset",{data:o,width:i},t)}}function Kp(e,t){const n=e.plugins.get("ImageUtils");return Array.from(e.model.createRangeOn(t)).filter(e=>n.isImage(e.item)).map(e=>e.item)}const Zp="italic";class Xp extends rt{static get pluginName(){return"ItalicEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Zp}),e.model.schema.setAttributeProperties(Zp,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Zp,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(Zp,new hm(e,Zp)),e.keystrokes.set("CTRL+I",Zp)}}const Jp="italic";class Qp extends rt{static get pluginName(){return"ItalicUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(Jp,n=>{const i=e.commands.get(Jp),o=new fc(n);return o.set({label:t("Italic"),icon:' ',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{e.execute(Jp),e.editing.view.focus()}),o})}}class ef{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach(e=>this._definitions.add(e)):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",(e,t,n)=>{if(!n.consumable.test(t.item,"attribute:linkHref"))return;if(!t.item.is("selection")&&!n.schema.isInline(t.item))return;const i=n.writer,o=i.document.selection;for(const e of this._definitions){const s=i.createAttributeElement("a",e.attributes,{priority:5});e.classes&&i.addClass(e.classes,s);for(const t in e.styles)i.setStyle(t,e.styles[t],s);i.setCustomProperty("link",!0,s),e.callback(t.attributeNewValue)?t.item.is("selection")?i.wrap(o.getFirstRange(),s):i.wrap(n.mapper.toViewRange(t.range),s):i.unwrap(n.mapper.toViewRange(t.range),s)}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",(e,t,{writer:n,mapper:i})=>{const o=i.toViewElement(t.item),s=Array.from(o.getChildren()).find(e=>"a"===e.name);for(const e of this._definitions){const i=ni(e.attributes);if(e.callback(t.attributeNewValue)){for(const[e,t]of i)"class"===e?n.addClass(t,s):n.setAttribute(e,t,s);e.classes&&n.addClass(e.classes,s);for(const t in e.styles)n.setStyle(t,e.styles[t],s)}else{for(const[e,t]of i)"class"===e?n.removeClass(t,s):n.removeAttribute(e,s);e.classes&&n.removeClass(e.classes,s);for(const t in e.styles)n.removeStyle(t,s)}}})}}}var tf=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const nf=function(e){return tf.test(e)};var of="\\ud800-\\udfff",sf="["+of+"]",rf="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",af="\\ud83c[\\udffb-\\udfff]",lf="[^"+of+"]",df="(?:\\ud83c[\\udde6-\\uddff]){2}",cf="[\\ud800-\\udbff][\\udc00-\\udfff]",uf="(?:"+rf+"|"+af+")?",hf="[\\ufe0e\\ufe0f]?",mf=hf+uf+"(?:\\u200d(?:"+[lf,df,cf].join("|")+")"+hf+uf+")*",gf="(?:"+[lf+rf+"?",rf,df,cf,sf].join("|")+")",pf=RegExp(af+"(?="+af+")|"+gf+mf,"g");const ff=function(e){return nf(e)?function(e){return e.match(pf)||[]}(e):function(e){return e.split("")}(e)},xf=function(e){return function(t){t=Ii(t);var n=nf(t)?ff(t):void 0,i=n?n[0]:t.charAt(0),o=n?function(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:yi(e,t,n)}(n,1).join(""):t.slice(1);return i[e]()+o}}("toUpperCase"),_f=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,If=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,vf=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,bf=/^((\w+:(\/{2,})?)|(\W))/i,jf="Ctrl+K";function Cf(e,{writer:t}){const n=t.createAttributeElement("a",{href:e},{priority:5});return t.setCustomProperty("link",!0,n),n}function yf(e){return function(e){return e.replace(_f,"").match(If)}(e=String(e))?e:"#"}function kf(e,t){return!!e&&t.checkAttribute(e.name,"linkHref")}function Af(e,t){const n=function(e){return vf.test(e)}(e)?"mailto:":t,i=!!n&&!bf.test(e);return e&&i?n+e:e}function wf(e){window.open(e,"_blank","noopener")}class Sf extends lt{constructor(e){super(e),this.manualDecorators=new Un,this.automaticDecorators=new ef}restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement()||Rr(t.getSelectedBlocks());kf(n,e.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(n,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}execute(e,t={}){const n=this.editor.model,i=n.document.selection,o=[],s=[];for(const e in t)t[e]?o.push(e):s.push(e);n.change(t=>{if(i.isCollapsed){const r=i.getFirstPosition();if(i.hasAttribute("linkHref")){const a=im(r,"linkHref",i.getAttribute("linkHref"),n);t.setAttribute("linkHref",e,a),o.forEach(e=>{t.setAttribute(e,!0,a)}),s.forEach(e=>{t.removeAttribute(e,a)}),t.setSelection(t.createPositionAfter(a.end.nodeBefore))}else if(""!==e){const s=ni(i.getAttributes());s.set("linkHref",e),o.forEach(e=>{s.set(e,!0)});const{end:a}=n.insertContent(t.createText(e,s),r);t.setSelection(a)}["linkHref",...o,...s].forEach(e=>{t.removeSelectionAttribute(e)})}else{const r=n.schema.getValidRanges(i.getRanges(),"linkHref"),a=[];for(const e of i.getSelectedBlocks())n.schema.checkAttribute(e,"linkHref")&&a.push(t.createRangeOn(e));const l=a.slice();for(const e of r)this._isRangeToUpdate(e,a)&&l.push(e);for(const n of l)t.setAttribute("linkHref",e,n),o.forEach(e=>{t.setAttribute(e,!0,n)}),s.forEach(e=>{t.removeAttribute(e,n)})}})}_getDecoratorStateFromModel(e){const t=this.editor.model,n=t.document.selection,i=n.getSelectedElement();return kf(i,t.schema)?i.getAttribute(e):n.getAttribute(e)}_isRangeToUpdate(e,t){for(const n of t)if(n.containsRange(e))return!1;return!0}}class Ef extends lt{refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement();kf(n,e.schema)?this.isEnabled=e.schema.checkAttribute(n,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,n=t.document.selection,i=e.commands.get("link");t.change(e=>{const o=n.isCollapsed?[im(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),t)]:t.schema.getValidRanges(n.getRanges(),"linkHref");for(const t of o)if(e.removeAttribute("linkHref",t),i)for(const n of i.manualDecorators)e.removeAttribute(n.id,t)})}}class Tf{constructor({id:e,label:t,attributes:n,classes:i,styles:o,defaultValue:s}){this.id=e,this.set("value"),this.defaultValue=s,this.label=t,this.attributes=n,this.classes=i,this.styles=o}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}st(Tf,Qe);var zf=s(399);rs()(zf.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),zf.Z.locals;const $f="automatic",Of=/^(https?:)?\/\//;class Rf extends rt{static get pluginName(){return"LinkEditing"}static get requires(){return[Xh,Wh,bm]}constructor(e){super(e),e.config.define("link",{addTargetToExternalLinks:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:Cf}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,t)=>Cf(yf(e),t)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:e=>e.getAttribute("href")}}),e.commands.add("link",new Sf(e)),e.commands.add("unlink",new Ef(e));const t=function(e,t){const n={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach(e=>(e.label&&n[e.label]&&(e.label=n[e.label]),e)),t}(e.t,function(e){const t=[];if(e)for(const[n,i]of Object.entries(e)){const e=Object.assign({},i,{id:`link${xf(n)}`});t.push(e)}return t}(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter(e=>e.mode===$f)),this._enableManualDecorators(t.filter(e=>"manual"===e.mode)),e.plugins.get(Xh).registerAttribute("linkHref"),function(e,t,n,i){const o=e.editing.view,s=new Set;o.document.registerPostFixer(n=>{const o=e.model.document.selection;let r=!1;if(o.hasAttribute(t)){const a=im(o.getFirstPosition(),t,o.getAttribute(t),e.model),l=e.editing.mapper.toViewRange(a);for(const e of l.getItems())e.is("element","a")&&!e.hasClass(i)&&(n.addClass(i,e),s.add(e),r=!0)}return r}),e.conversion.for("editingDowncast").add(e=>{function t(){o.change(e=>{for(const t of s.values())e.removeClass(i,t),s.delete(t)})}e.on("insert",t,{priority:"highest"}),e.on("remove",t,{priority:"highest"}),e.on("attribute",t,{priority:"highest"}),e.on("selection",t,{priority:"highest"})})}(e,"linkHref",0,"ck-link_selected"),this._enableLinkOpen(),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(e){const t=this.editor,n=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:$f,callback:e=>Of.test(e),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(e),n.length&&t.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,n=t.commands.get("link").manualDecorators;e.forEach(e=>{t.model.schema.extend("$text",{allowAttributes:e.id}),e=new Tf(e),n.add(e),t.conversion.for("downcast").attributeToElement({model:e.id,view:(t,{writer:n,schema:i},{item:o})=>{if(i.isInline(o)&&t){const t=n.createAttributeElement("a",e.attributes,{priority:5});e.classes&&n.addClass(e.classes,t);for(const i in e.styles)n.setStyle(i,e.styles[i],t);return n.setCustomProperty("link",!0,t),t}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...e._createPattern()},model:{key:e.id}})})}_enableLinkOpen(){const e=this.editor,t=e.editing.view.document,n=e.model.document;this.listenTo(t,"click",(e,t)=>{if(!(fo.isMac?t.domEvent.metaKey:t.domEvent.ctrlKey))return;let n=t.domTarget;if("a"!=n.tagName.toLowerCase()&&(n=n.closest("a")),!n)return;const i=n.getAttribute("href");i&&(e.stop(),t.preventDefault(),wf(i))},{context:"$capture"}),this.listenTo(t,"enter",(e,t)=>{const i=n.selection,o=i.getSelectedElement(),s=o?o.getAttribute("linkHref"):i.getAttribute("linkHref");s&&t.domEvent.altKey&&(e.stop(),wf(s))},{context:"a"})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(e,"insertContent",()=>{const n=t.anchor.nodeBefore,i=t.anchor.nodeAfter;t.hasAttribute("linkHref")&&n&&n.hasAttribute("linkHref")&&(i&&i.hasAttribute("linkHref")||e.change(t=>{Pf(t,Ff(e.schema))}))},{priority:"low"})}_enableClickingAfterLink(){const e=this.editor,t=e.model;e.editing.view.addObserver(qu);let n=!1;this.listenTo(e.editing.view.document,"mousedown",()=>{n=!0}),this.listenTo(e.editing.view.document,"selectionChange",()=>{if(!n)return;n=!1;const e=t.document.selection;if(!e.isCollapsed)return;if(!e.hasAttribute("linkHref"))return;const i=e.getFirstPosition(),o=im(i,"linkHref",e.getAttribute("linkHref"),t);(i.isTouching(o.start)||i.isTouching(o.end))&&t.change(e=>{Pf(e,Ff(t.schema))})})}_enableTypingOverLink(){const e=this.editor,t=e.editing.view;let n,i;this.listenTo(t.document,"delete",()=>{i=!0},{priority:"high"}),this.listenTo(e.model,"deleteContent",()=>{const t=e.model.document.selection;t.isCollapsed||(i?i=!1:Df(e)&&function(e){const t=e.document.selection,n=t.getFirstPosition(),i=t.getLastPosition(),o=n.nodeAfter;if(!o)return!1;if(!o.is("$text"))return!1;if(!o.hasAttribute("linkHref"))return!1;if(o===(i.textNode||i.nodeBefore))return!0;return im(n,"linkHref",o.getAttribute("linkHref"),e).containsRange(e.createRange(n,i),!0)}(e.model)&&(n=t.getAttributes()))},{priority:"high"}),this.listenTo(e.model,"insertContent",(t,[o])=>{i=!1,Df(e)&&n&&(e.model.change(e=>{for(const[t,i]of n)e.setAttribute(t,i,o)}),n=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const e=this.editor,t=e.model,n=t.document.selection,i=e.editing.view;let o=!1,s=!1;this.listenTo(i.document,"delete",(e,t)=>{s=t.domEvent.keyCode===vo.backspace},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{o=!1;const e=n.getFirstPosition(),i=n.getAttribute("linkHref");if(!i)return;const s=im(e,"linkHref",i,t);o=s.containsPosition(e)||s.end.isEqual(e)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{s&&(s=!1,o||e.model.enqueueChange(e=>{Pf(e,Ff(t.schema))}))},{priority:"low"})}}function Pf(e,t){e.removeSelectionAttribute("linkHref");for(const n of t)e.removeSelectionAttribute(n)}function Df(e){return e.model.change(e=>e.batch).isTyping}function Ff(e){return e.getDefinition("$text").allowAttributes.filter(e=>e.startsWith("link"))}var Mf=s(827);rs()(Mf.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Mf.Z.locals;class Nf extends Bd{constructor(e,t){super(e);const n=e.t;this.focusTracker=new Pr,this.keystrokes=new Dr,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),Pd,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),Rd,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusables=new Nd,this._focusCycler=new jc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&i.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children}),Fd(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>(e[t.name]=t.isOn,e),{})}render(){super.render(),Md({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const e=this.locale.t,t=new cu(this.locale,uu);return t.label=e("Link URL"),t}_createButton(e,t,n,i){const o=new fc(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),i&&o.delegate("execute").to(this,i),o}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const n of e.manualDecorators){const i=new _c(this.locale);i.set({name:n.id,label:n.label,withText:!0}),i.bind("isOn").toMany([n,e],"value",(e,t)=>void 0===t&&void 0===e?n.defaultValue:e),i.on("execute",()=>{n.set("value",!i.isOn)}),t.add(i)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const e=new Bd;e.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(e=>({tag:"li",children:[e],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(e)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}}var Lf=s(465);rs()(Lf.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Lf.Z.locals;class Bf extends Bd{constructor(e){super(e);const t=e.t;this.focusTracker=new Pr,this.keystrokes=new Dr,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(t("Unlink"),' ',"unlink"),this.editButtonView=this._createButton(t("Edit link"),' ',"edit"),this.set("href"),this._focusables=new Nd,this._focusCycler=new jc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(e,t,n){const i=new fc(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.delegate("execute").to(this,n),i}_createPreviewButton(){const e=new fc(this.locale),t=this.bindTemplate,n=this.t;return e.set({withText:!0,tooltip:n("Open link in new tab")}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",e=>e&&yf(e)),target:"_blank",rel:"noopener noreferrer"}}),e.bind("label").to(this,"href",e=>e||n("This link has no URL")),e.bind("isEnabled").to(this,"href",e=>!!e),e.template.tag="a",e.template.eventListeners={},e}}const Vf="link-ui";class Uf extends rt{static get requires(){return[Cu]}static get pluginName(){return"LinkUI"}init(){const e=this.editor;e.editing.view.addObserver(Hu),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=e.plugins.get(Cu),this._createToolbarLinkButton(),this._enableUserBalloonInteractions(),e.conversion.for("editingDowncast").markerToHighlight({model:Vf,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:Vf,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const e=this.editor,t=new Bf(e.locale),n=e.commands.get("link"),i=e.commands.get("unlink");return t.bind("href").to(n,"value"),t.editButtonView.bind("isEnabled").to(n),t.unlinkButtonView.bind("isEnabled").to(i),this.listenTo(t,"edit",()=>{this._addFormView()}),this.listenTo(t,"unlink",()=>{e.execute("unlink"),this._hideUI()}),t.keystrokes.set("Esc",(e,t)=>{this._hideUI(),t()}),t.keystrokes.set(jf,(e,t)=>{this._addFormView(),t()}),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),n=e.config.get("link.defaultProtocol"),i=new Nf(e.locale,t);return i.urlInputView.fieldView.bind("value").to(t,"value"),i.urlInputView.bind("isReadOnly").to(t,"isEnabled",e=>!e),i.saveButtonView.bind("isEnabled").to(t),this.listenTo(i,"submit",()=>{const{value:t}=i.urlInputView.fieldView.element,o=Af(t,n);e.execute("link",o,i.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(i,"cancel",()=>{this._closeFormView()}),i.keystrokes.set("Esc",(e,t)=>{this._closeFormView(),t()}),i}_createToolbarLinkButton(){const e=this.editor,t=e.commands.get("link"),n=e.t;e.keystrokes.set(jf,(e,n)=>{n(),t.isEnabled&&this._showUI(!0)}),e.ui.componentFactory.add("link",e=>{const i=new fc(e);return i.isEnabled=!0,i.label=n("Link"),i.icon=' ',i.keystroke=jf,i.tooltip=!0,i.isToggleable=!0,i.bind("isEnabled").to(t,"isEnabled"),i.bind("isOn").to(t,"value",e=>!!e),this.listenTo(i,"execute",()=>this._showUI(!0)),i})}_enableUserBalloonInteractions(){const e=this.editor.editing.view.document;this.listenTo(e,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),this.editor.keystrokes.set("Tab",(e,t)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),t())},{priority:"high"}),this.editor.keystrokes.set("Esc",(e,t)=>{this._isUIVisible&&(this._hideUI(),t())}),Dd({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=e.value||""}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),void 0!==e.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const e=this.editor;this.stopListening(e.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let n=this._getSelectedLinkElement(),i=s();const o=()=>{const e=this._getSelectedLinkElement(),t=s();n&&!e||!n&&t!==i?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=e,i=t};function s(){return t.selection.focus.getAncestors().reverse().find(e=>e.is("element"))}this.listenTo(e.ui,"update",o),this.listenTo(this._balloon,"change:visibleView",o)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,n=e.document;let i=null;if(t.markers.has(Vf)){const t=Array.from(this.editor.editing.mapper.markerNameToElements(Vf)),n=e.createRange(e.createPositionBefore(t[0]),e.createPositionAfter(t[t.length-1]));i=e.domConverter.viewRangeToDom(n)}else i=()=>{const t=this._getSelectedLinkElement();return t?e.domConverter.mapViewToDom(t):e.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:i}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,n=t.getSelectedElement();if(t.isCollapsed||n&&wm(n))return Wf(t.getFirstPosition());{const n=t.getFirstRange().getTrimmed(),i=Wf(n.start),o=Wf(n.end);return i&&i==o&&e.createRangeIn(i).getTrimmed().isEqual(n)?i:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{const n=e.document.selection.getFirstRange();if(e.markers.has(Vf))t.updateMarker(Vf,{range:n});else if(n.start.isAtEnd){const i=n.start.getLastMatchingPosition(({item:t})=>!e.schema.isContent(t),{boundaries:n});t.addMarker(Vf,{usingOperation:!1,affectsData:!1,range:t.createRange(i,n.end)})}else t.addMarker(Vf,{usingOperation:!1,affectsData:!1,range:n})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(Vf)&&e.change(e=>{e.removeMarker(Vf)})}}function Wf(e){return e.getAncestors().find(e=>function(e){return e.is("attributeElement")&&!!e.getCustomProperty("link")}(e))}const Gf=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class Hf extends rt{static get requires(){return[qh]}static get pluginName(){return"AutoLink"}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const e=this.editor,t=new Zh(e.model,e=>{if(!function(e){return e.length>4&&" "===e[e.length-1]&&" "!==e[e.length-2]}(e))return;const t=qf(e.substr(0,e.length-1));return t?{url:t}:void 0});t.on("matched:data",(t,n)=>{const{batch:i,range:o,url:s}=n;if(!i.isTyping)return;const r=o.end.getShiftedBy(-1),a=r.getShiftedBy(-s.length),l=e.model.createRange(a,r);this._applyAutoLink(s,l)}),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("enter");n&&n.on("execute",()=>{const e=t.document.selection.getFirstPosition();if(!e.parent.previousSibling)return;const n=t.createRangeIn(e.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(n)})}_enableShiftEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("shiftEnter");n&&n.on("execute",()=>{const e=t.document.selection.getFirstPosition(),n=t.createRange(t.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(n)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:n,range:i}=Kh(e,t),o=qf(n);if(o){const e=t.createRange(i.end.getShiftedBy(-o.length),i.end);this._applyAutoLink(o,e)}}_applyAutoLink(e,t){const n=this.editor.model,i=this.editor.plugins.get("Delete");this.isEnabled&&function(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),"linkHref")}(t,n)&&n.enqueueChange(o=>{const s=this.editor.config.get("link.defaultProtocol"),r=Af(e,s);o.setAttribute("linkHref",r,t),n.enqueueChange(()=>{i.requestUndoOnBackspace()})})}}function qf(e){const t=Gf.exec(e);return t?t[2]:null}class Yf extends lt{constructor(e,t){super(e),this.type=t}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.document,i=Array.from(n.selection.getSelectedBlocks()).filter(e=>Zf(e,t.schema)),o=void 0!==e.forceValue?!e.forceValue:this.value;t.change(e=>{if(o){let t=i[i.length-1].nextSibling,n=Number.POSITIVE_INFINITY,o=[];for(;t&&"listItem"==t.name&&0!==t.getAttribute("listIndent");){const e=t.getAttribute("listIndent");e=n;)s>o.getAttribute("listIndent")&&(s=o.getAttribute("listIndent")),o.getAttribute("listIndent")==s&&e[t?"unshift":"push"](o),o=o[t?"previousSibling":"nextSibling"]}}function Zf(e,t){return t.checkChild(e.parent,"listItem")&&!t.isObject(e)}class Xf extends lt{constructor(e,t){super(e),this._indentBy="forward"==t?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=e.document;let n=Array.from(t.selection.getSelectedBlocks());e.change(e=>{const t=n[n.length-1];let i=t.nextSibling;for(;i&&"listItem"==i.name&&i.getAttribute("listIndent")>t.getAttribute("listIndent");)n.push(i),i=i.nextSibling;this._indentBy<0&&(n=n.reverse());for(const t of n){const n=t.getAttribute("listIndent")+this._indentBy;n<0?e.rename(t,"paragraph"):e.setAttribute("listIndent",n,t)}this.fire("_executeCleanup",n)})}_checkEnabled(){const e=Rr(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is("element","listItem"))return!1;if(this._indentBy>0){const t=e.getAttribute("listIndent"),n=e.getAttribute("listType");let i=e.previousSibling;for(;i&&i.is("element","listItem")&&i.getAttribute("listIndent")>=t;){if(i.getAttribute("listIndent")==t)return i.getAttribute("listType")==n;i=i.previousSibling}return!1}return!0}}function Jf(e,t,n,i){const o=t.parent,s=n.mapper,r=n.writer;let a=s.toViewPosition(i.createPositionBefore(e));const l=tx(e.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:e.getAttribute("listIndent")}),d=e.previousSibling;if(l&&l.getAttribute("listIndent")==e.getAttribute("listIndent")){const e=s.toViewElement(l);a=r.breakContainer(r.createPositionAfter(e))}else if(d&&"listItem"==d.name){a=s.toViewPosition(i.createPositionAt(d,"end"));const e=s.findMappedViewAncestor(a),t=function(e){for(const t of e.getChildren())if("ul"==t.name||"ol"==t.name)return t;return null}(e);a=t?r.createPositionBefore(t):r.createPositionAt(e,"end")}else a=s.toViewPosition(i.createPositionBefore(e));if(a=ex(a),r.insert(a,o),d&&"listItem"==d.name){const e=s.toViewElement(d),n=r.createRange(r.createPositionAt(e,0),a).getWalker({ignoreElementEnd:!0});for(const e of n)if(e.item.is("element","li")){const i=r.breakContainer(r.createPositionBefore(e.item)),o=e.item.parent,s=r.createPositionAt(t,"end");Qf(r,s.nodeBefore,s.nodeAfter),r.move(r.createRangeOn(o),s),n.position=i}}else{const n=o.nextSibling;if(n&&(n.is("element","ul")||n.is("element","ol"))){let i=null;for(const t of n.getChildren()){const n=s.toModelElement(t);if(!(n&&n.getAttribute("listIndent")>e.getAttribute("listIndent")))break;i=t}i&&(r.breakContainer(r.createPositionAfter(i)),r.move(r.createRangeOn(i.parent),r.createPositionAt(t,"end")))}}Qf(r,o,o.nextSibling),Qf(r,o.previousSibling,o)}function Qf(e,t,n){return!t||!n||"ul"!=t.name&&"ol"!=t.name||t.name!=n.name||t.getAttribute("class")!==n.getAttribute("class")?null:e.mergeContainers(e.createPositionAfter(t))}function ex(e){return e.getLastMatchingPosition(e=>e.item.is("uiElement"))}function tx(e,t){const n=!!t.sameIndent,i=!!t.smallerIndent,o=t.listIndent;let s=e;for(;s&&"listItem"==s.name;){const e=s.getAttribute("listIndent");if(n&&o==e||i&&o>e)return s;s="forward"===t.direction?s.nextSibling:s.previousSibling}return null}function nx(e,t,n,i){e.ui.componentFactory.add(t,o=>{const s=e.commands.get(t),r=new fc(o);return r.set({label:n,icon:i,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(s,"value","isEnabled"),r.on("execute",()=>{e.execute(t),e.editing.view.focus()}),r})}function ix(){const e=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||e?0:Vi.call(this)}function ox(e){return(t,n,i)=>{const o=i.consumable;if(!o.test(n.item,"insert")||!o.test(n.item,"attribute:listType")||!o.test(n.item,"attribute:listIndent"))return;o.consume(n.item,"insert"),o.consume(n.item,"attribute:listType"),o.consume(n.item,"attribute:listIndent");const s=n.item;Jf(s,function(e,t){const n=t.mapper,i=t.writer,o="numbered"==e.getAttribute("listType")?"ol":"ul",s=function(e){const t=e.createContainerElement("li");return t.getFillerOffset=ix,t}(i),r=i.createContainerElement(o,null);return i.insert(i.createPositionAt(r,0),s),n.bindElements(e,s),s}(s,i),i,e)}}function sx(e,t,n){if(!n.consumable.test(t.item,e.name))return;const i=n.mapper.toViewElement(t.item),o=n.writer;o.breakContainer(o.createPositionBefore(i)),o.breakContainer(o.createPositionAfter(i));const s=i.parent,r="numbered"==t.attributeNewValue?"ol":"ul";o.rename(r,s)}function rx(e,t,n){n.consumable.consume(t.item,e.name);const i=n.mapper.toViewElement(t.item).parent,o=n.writer;Qf(o,i,i.nextSibling),Qf(o,i.previousSibling,i)}function ax(e,t,n){if(n.consumable.test(t.item,e.name)&&"listItem"!=t.item.name){let e=n.mapper.toViewPosition(t.range.start);const i=n.writer,o=[];for(;("ul"==e.parent.name||"ol"==e.parent.name)&&(e=i.breakContainer(e),"li"==e.parent.name);){const t=e,n=i.createPositionAt(e.parent,"end");if(!t.isEqual(n)){const e=i.remove(i.createRange(t,n));o.push(e)}e=i.createPositionAfter(e.parent)}if(o.length>0){for(let t=0;t0){const t=Qf(i,n,n.nextSibling);t&&t.parent==n&&e.offset--}}Qf(i,e.nodeBefore,e.nodeAfter)}}}function lx(e,t,n){const i=n.mapper.toViewPosition(t.position),o=i.nodeBefore,s=i.nodeAfter;Qf(n.writer,o,s)}function dx(e,t,n){if(n.consumable.consume(t.viewItem,{name:!0})){const e=n.writer,i=e.createElement("listItem"),o=function(e){let t=0,n=e.parent;for(;n;){if(n.is("element","li"))t++;else{const e=n.previousSibling;e&&e.is("element","li")&&t++}n=n.parent}return t}(t.viewItem);e.setAttribute("listIndent",o,i);const s=t.viewItem.parent&&"ol"==t.viewItem.parent.name?"numbered":"bulleted";if(e.setAttribute("listType",s,i),!n.safeInsert(i,t.modelCursor))return;const r=function(e,t,n){const{writer:i,schema:o}=n;let s=i.createPositionAfter(e);for(const r of t)if("ul"==r.name||"ol"==r.name)s=n.convertItem(r,s).modelCursor;else{const t=n.convertItem(r,i.createPositionAt(e,"end")),a=t.modelRange.start.nodeAfter;a&&a.is("element")&&!o.checkChild(e,a.name)&&(e=t.modelCursor.parent.is("element","listItem")?t.modelCursor.parent:gx(t.modelCursor),s=i.createPositionAfter(e))}return s}(i,t.viewItem.getChildren(),n);t.modelRange=e.createRange(t.modelCursor,r),n.updateConversionResult(i,t)}}function cx(e,t,n){if(n.consumable.test(t.viewItem,{name:!0})){const e=Array.from(t.viewItem.getChildren());for(const t of e)!t.is("element","li")&&!fx(t)&&t._remove()}}function ux(e,t,n){if(n.consumable.test(t.viewItem,{name:!0})){if(0===t.viewItem.childCount)return;const e=[...t.viewItem.getChildren()];let n=!1;for(const t of e)n&&!fx(t)&&t._remove(),fx(t)&&(n=!0)}}function hx(e){return(t,n)=>{if(n.isPhantom)return;const i=n.modelPosition.nodeBefore;if(i&&i.is("element","listItem")){const t=n.mapper.toViewElement(i),o=t.getAncestors().find(fx),s=e.createPositionAt(t,0).getWalker();for(const e of s){if("elementStart"==e.type&&e.item.is("element","li")){n.viewPosition=e.previousPosition;break}if("elementEnd"==e.type&&e.item==o){n.viewPosition=e.nextPosition;break}}}}}function mx(e,[t,n]){let i,o=t.is("documentFragment")?t.getChild(0):t;if(i=n?this.createSelection(n):this.document.selection,o&&o.is("element","listItem")){const e=i.getFirstPosition();let t=null;if(e.parent.is("element","listItem")?t=e.parent:e.nodeBefore&&e.nodeBefore.is("element","listItem")&&(t=e.nodeBefore),t){const e=t.getAttribute("listIndent");if(e>0)for(;o&&o.is("element","listItem");)o._setAttribute("listIndent",o.getAttribute("listIndent")+e),o=o.nextSibling}}}function gx(e){const t=new Gr({startPosition:e});let n;do{n=t.next()}while(!n.value.item.is("element","listItem"));return n.value.item}function px(e,t,n,i,o,s){const r=tx(t.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:e,foo:"b"}),a=o.mapper,l=o.writer,d=r?r.getAttribute("listIndent"):null;let c;if(r)if(d==e){const e=a.toViewElement(r).parent;c=l.createPositionAfter(e)}else{const e=s.createPositionAt(r,"end");c=a.toViewPosition(e)}else c=n;c=ex(c);for(const e of[...i.getChildren()])fx(e)&&(c=l.move(l.createRangeOn(e),c).end,Qf(l,e,e.nextSibling),Qf(l,e.previousSibling,e))}function fx(e){return e.is("element","ol")||e.is("element","ul")}class xx extends rt{static get pluginName(){return"ListEditing"}static get requires(){return[Eh,qh]}init(){const e=this.editor;e.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const t=e.data,n=e.editing;e.model.document.registerPostFixer(t=>function(e,t){const n=e.document.differ.getChanges(),i=new Map;let o=!1;for(const i of n)if("insert"==i.type&&"listItem"==i.name)s(i.position);else if("insert"==i.type&&"listItem"!=i.name){if("$text"!=i.name){const n=i.position.nodeAfter;n.hasAttribute("listIndent")&&(t.removeAttribute("listIndent",n),o=!0),n.hasAttribute("listType")&&(t.removeAttribute("listType",n),o=!0),n.hasAttribute("listStyle")&&(t.removeAttribute("listStyle",n),o=!0),n.hasAttribute("listReversed")&&(t.removeAttribute("listReversed",n),o=!0),n.hasAttribute("listStart")&&(t.removeAttribute("listStart",n),o=!0);for(const t of Array.from(e.createRangeIn(n)).filter(e=>e.item.is("element","listItem")))s(t.previousPosition)}s(i.position.getShiftedBy(i.length))}else"remove"==i.type&&"listItem"==i.name?s(i.position):("attribute"==i.type&&"listIndent"==i.attributeKey||"attribute"==i.type&&"listType"==i.attributeKey)&&s(i.range.start);for(const e of i.values())r(e),a(e);return o;function s(e){const t=e.nodeBefore;if(t&&t.is("element","listItem")){let e=t;if(i.has(e))return;for(let t=e.previousSibling;t&&t.is("element","listItem");t=e.previousSibling)if(e=t,i.has(e))return;i.set(t,e)}else{const t=e.nodeAfter;t&&t.is("element","listItem")&&i.set(t,t)}}function r(e){let n=0,i=null;for(;e&&e.is("element","listItem");){const s=e.getAttribute("listIndent");if(s>n){let r;null===i?(i=s-n,r=n):(i>s&&(i=s),r=s-i),t.setAttribute("listIndent",r,e),o=!0}else i=null,n=e.getAttribute("listIndent")+1;e=e.nextSibling}}function a(e){let n=[],i=null;for(;e&&e.is("element","listItem");){const s=e.getAttribute("listIndent");if(i&&i.getAttribute("listIndent")>s&&(n=n.slice(0,s+1)),0!=s)if(n[s]){const i=n[s];e.getAttribute("listType")!=i&&(t.setAttribute("listType",i,e),o=!0)}else n[s]=e.getAttribute("listType");i=e,e=e.nextSibling}}}(e.model,t)),n.mapper.registerViewToModelLength("li",_x),t.mapper.registerViewToModelLength("li",_x),n.mapper.on("modelToViewPosition",hx(n.view)),n.mapper.on("viewToModelPosition",function(e){return(t,n)=>{const i=n.viewPosition,o=i.parent,s=n.mapper;if("ul"==o.name||"ol"==o.name){if(i.isAtEnd){const t=s.toModelElement(i.nodeBefore),o=s.getModelLength(i.nodeBefore);n.modelPosition=e.createPositionBefore(t).getShiftedBy(o)}else{const t=s.toModelElement(i.nodeAfter);n.modelPosition=e.createPositionBefore(t)}t.stop()}else if("li"==o.name&&i.nodeBefore&&("ul"==i.nodeBefore.name||"ol"==i.nodeBefore.name)){const r=s.toModelElement(o);let a=1,l=i.nodeBefore;for(;l&&fx(l);)a+=s.getModelLength(l),l=l.previousSibling;n.modelPosition=e.createPositionBefore(r).getShiftedBy(a),t.stop()}}}(e.model)),t.mapper.on("modelToViewPosition",hx(n.view)),e.conversion.for("editingDowncast").add(t=>{t.on("insert",ax,{priority:"high"}),t.on("insert:listItem",ox(e.model)),t.on("attribute:listType:listItem",sx,{priority:"high"}),t.on("attribute:listType:listItem",rx,{priority:"low"}),t.on("attribute:listIndent:listItem",function(e){return(t,n,i)=>{if(!i.consumable.consume(n.item,"attribute:listIndent"))return;const o=i.mapper.toViewElement(n.item),s=i.writer;s.breakContainer(s.createPositionBefore(o)),s.breakContainer(s.createPositionAfter(o));const r=o.parent,a=r.previousSibling,l=s.createRangeOn(r);s.remove(l),a&&a.nextSibling&&Qf(s,a,a.nextSibling),px(n.attributeOldValue+1,n.range.start,l.start,o,i,e),Jf(n.item,o,i,e);for(const e of n.item.getChildren())i.consumable.consume(e,"insert")}}(e.model)),t.on("remove:listItem",function(e){return(t,n,i)=>{const o=i.mapper.toViewPosition(n.position).getLastMatchingPosition(e=>!e.item.is("element","li")),s=o.nodeAfter,r=i.writer;r.breakContainer(r.createPositionBefore(s)),r.breakContainer(r.createPositionAfter(s));const a=s.parent,l=a.previousSibling,d=r.createRangeOn(a),c=r.remove(d);l&&l.nextSibling&&Qf(r,l,l.nextSibling),px(i.mapper.toModelElement(s).getAttribute("listIndent")+1,n.position,d.start,s,i,e);for(const e of r.createRangeIn(c).getItems())i.mapper.unbindViewElement(e);t.stop()}}(e.model)),t.on("remove",lx,{priority:"low"})}),e.conversion.for("dataDowncast").add(t=>{t.on("insert",ax,{priority:"high"}),t.on("insert:listItem",ox(e.model))}),e.conversion.for("upcast").add(e=>{e.on("element:ul",cx,{priority:"high"}),e.on("element:ol",cx,{priority:"high"}),e.on("element:li",ux,{priority:"high"}),e.on("element:li",dx)}),e.model.on("insertContent",mx,{priority:"high"}),e.commands.add("numberedList",new Yf(e,"numbered")),e.commands.add("bulletedList",new Yf(e,"bulleted")),e.commands.add("indentList",new Xf(e,"forward")),e.commands.add("outdentList",new Xf(e,"backward"));const i=n.view.document;this.listenTo(i,"enter",(e,t)=>{const n=this.editor.model.document,i=n.selection.getLastPosition().parent;n.selection.isCollapsed&&"listItem"==i.name&&i.isEmpty&&(this.editor.execute("outdentList"),t.preventDefault(),e.stop())},{context:"li"}),this.listenTo(i,"delete",(e,t)=>{if("backward"!==t.direction)return;const n=this.editor.model.document.selection;if(!n.isCollapsed)return;const i=n.getFirstPosition();if(!i.isAtStart)return;const o=i.parent;"listItem"===o.name&&(o.previousSibling&&"listItem"===o.previousSibling.name||(this.editor.execute("outdentList"),t.preventDefault(),e.stop()))},{context:"li"}),this.listenTo(e.editing.view.document,"tab",(t,n)=>{const i=n.shiftKey?"outdentList":"indentList";this.editor.commands.get(i).isEnabled&&(e.execute(i),n.stopPropagation(),n.preventDefault(),t.stop())},{context:"li"})}afterInit(){const e=this.editor.commands,t=e.get("indent"),n=e.get("outdent");t&&t.registerChildCommand(e.get("indentList")),n&&n.registerChildCommand(e.get("outdentList"))}}function _x(e){let t=1;for(const n of e.getChildren())if("ul"==n.name||"ol"==n.name)for(const e of n.getChildren())t+=_x(e);return t}class Ix extends rt{static get pluginName(){return"ListUI"}init(){const e=this.editor.t;nx(this.editor,"numberedList",e("Numbered List"),' '),nx(this.editor,"bulletedList",e("Bulleted List"),' ')}}const vx="underline";class bx extends rt{static get pluginName(){return"UnderlineEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:vx}),e.model.schema.setAttributeProperties(vx,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:vx,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),e.commands.add(vx,new hm(e,vx)),e.keystrokes.set("CTRL+U","underline")}}const jx="underline";class Cx extends rt{static get pluginName(){return"UnderlineUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(jx,n=>{const i=e.commands.get(jx),o=new fc(n);return o.set({label:t("Underline"),icon:' ',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{e.execute(jx),e.editing.view.focus()}),o})}}class yx extends ph{}yx.builtinPlugins=[class extends rt{static get requires(){return[jh,yh]}static get pluginName(){return"Alignment"}},class extends rt{static get requires(){return[dm,um]}static get pluginName(){return"BlockQuote"}},class extends rt{static get requires(){return[gm,fm]}static get pluginName(){return"Bold"}},class extends rt{static get requires(){return[eg,Eh,rg,Oh,Yh,fg]}static get pluginName(){return"Essentials"}},class extends rt{static get requires(){return[Ag,Sg]}static get pluginName(){return"FontBackgroundColor"}},class extends rt{static get requires(){return[Tg,zg]}static get pluginName(){return"FontColor"}},class extends rt{static get requires(){return[Ng,Bg]}static get pluginName(){return"Heading"}},class extends rt{static get requires(){return[fp,_p]}static get pluginName(){return"Image"}},class extends rt{static get requires(){return[vp,Ap,jp]}static get pluginName(){return"ImageResize"}},class extends rt{static get pluginName(){return"ImageUpload"}static get requires(){return[Yp,Fp,Bp]}},class extends rt{static get requires(){return[Xp,Qp]}static get pluginName(){return"Italic"}},class extends rt{static get requires(){return[Rf,Uf,Hf]}static get pluginName(){return"Link"}},class extends rt{static get requires(){return[xx,Ix]}static get pluginName(){return"List"}},Pg,class extends rt{static get requires(){return[Ep]}static get pluginName(){return"SimpleUploadAdapter"}init(){const e=this.editor.config.get("simpleUpload");e&&(e.uploadUrl?this.editor.plugins.get(Ep).createUploadAdapter=t=>new Op(t,e):h("simple-upload-adapter-missing-uploadurl"))}},class extends rt{static get requires(){return[bx,Cx]}static get pluginName(){return"Underline"}}],yx.defaultConfig={toolbar:{items:["bold","italic","underline","|","heading","fontColor","fontBackgroundColor","alignment","|","blockQuote","bulletedList","numberedList","|","link","imageUpload","|","undo","redo"]},language:"fr"};const kx=yx})(),r.default})(),e.exports=i()},5594:(e,t,n)=>{"use strict";e.exports=n.p+"img/member-7b0dc9a7cc229b5ba65b.png"},5682:()=>{},5833:()=>{!function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 of %1","Align center":"Align center","Align left":"Align left","Align right":"Align right",Aquamarine:"Aquamarine",Black:"Black","Block quote":"Block quote",Blue:"Blue",Bold:"Bold","Break text":"Break text","Bulleted List":"Bulleted List",Cancel:"Cancel","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading","Dim grey":"Dim grey","Document colors":"Document colors",Downloadable:"Downloadable","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Edit link":"Edit link","Editor toolbar":"Editor toolbar","Font Background Color":"Font Background Color","Font Color":"Font Color","Full size image":"Full size image",Green:"Green",Grey:"Grey",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6","Image resize list":"Image resize list","Image toolbar":"Image toolbar","image widget":"image widget","In line":"In line","Insert image":"Insert image","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block",Italic:"Italic",Justify:"Justify","Left aligned image":"Left aligned image","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link URL":"Link URL",Next:"Next","Numbered List":"Numbered List","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Orange:"Orange",Original:"Original",Paragraph:"Paragraph",Previous:"Previous",Purple:"Purple",Red:"Red",Redo:"Redo","Remove color":"Remove color","Resize image":"Resize image","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0","Right aligned image":"Right aligned image",Save:"Save","Select all":"Select all","Show more items":"Show more items","Side image":"Side image","Text alignment":"Text alignment","Text alignment toolbar":"Text alignment toolbar","Text alternative":"Text alternative","This link has no URL":"This link has no URL",Turquoise:"Turquoise",Underline:"Underline",Undo:"Undo",Unlink:"Unlink","Upload failed":"Upload failed","Upload in progress":"Upload in progress",White:"White","Widget toolbar":"Widget toolbar","Wrap text":"Wrap text",Yellow:"Yellow"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}))},6041:(e,t,n)=>{"use strict";e.exports=n.p+"img/logoWeezeventSquare-9184b02c60dbc8695435.png"},6687:(e,t,n)=>{"use strict";e.exports=n.p+"svg/weezeventBlankMessages-76d6e6c79babc98388e9.svg"},6871:()=>{!function(e){const t=e.it=e.it||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 di %1","Align center":"Allinea al centro","Align left":"Allinea a sinistra","Align right":"Allinea a destra",Aquamarine:"Aquamarina",Black:"Nero","Block quote":"Blocco citazione",Blue:"Blu",Bold:"Grassetto","Break text":"Interrompi testo","Bulleted List":"Elenco puntato",Cancel:"Annulla","Centered image":"Immagine centrata","Change image text alternative":"Cambia testo alternativo dell'immagine","Choose heading":"Seleziona intestazione","Dim grey":"Grigio tenue","Document colors":"Colori del docmento",Downloadable:"Scaricabile","Dropdown toolbar":"Barra degli strumenti del menu a discesa","Edit block":"Modifica blocco","Edit link":"Modifica collegamento","Editor toolbar":"Barra degli strumenti dell'editor","Font Background Color":"Colore di sfondo caratteri","Font Color":"Colore caratteri","Full size image":"Immagine a dimensione intera",Green:"Verde",Grey:"Grigio",Heading:"Intestazione","Heading 1":"Intestazione 1","Heading 2":"Intestazione 2","Heading 3":"Intestazione 3","Heading 4":"Intestazione 4","Heading 5":"Intestazione 5","Heading 6":"Intestazione 6","Image resize list":"Elenco ridimensionamenti immagine","Image toolbar":"Barra degli strumenti dell'immagine","image widget":"Widget immagine","In line":"In linea","Insert image":"Inserisci immagine","Insert paragraph after block":"Inserisci paragrafo dopo blocco","Insert paragraph before block":"Inserisci paragrafo prima di blocco",Italic:"Corsivo",Justify:"Giustifica","Left aligned image":"Immagine allineata a sinistra","Light blue":"Azzurro","Light green":"Verde chiaro","Light grey":"Grigio chiaro",Link:"Collegamento","Link URL":"URL del collegamento",Next:"Avanti","Numbered List":"Elenco numerato","Open in a new tab":"Apri in una nuova scheda","Open link in new tab":"Apri collegamento in nuova scheda",Orange:"Arancio",Original:"Originale",Paragraph:"Paragrafo",Previous:"Indietro",Purple:"Porpora",Red:"Rosso",Redo:"Ripristina","Remove color":"Rimuovi colore","Resize image":"Ridimensiona immagine","Resize image to %0":"Ridimensiona immagine a %0","Resize image to the original size":"Ridimensiona immagine alle dimensioni originali","Rich Text Editor":"Editor di testo formattato","Rich Text Editor, %0":"Editor di testo formattato, %0","Right aligned image":"Immagine allineata a destra",Save:"Salva","Select all":"Seleziona tutto","Show more items":"Mostra più elementi","Side image":"Immagine laterale","Text alignment":"Allineamento del testo","Text alignment toolbar":"Barra degli strumenti dell'allineamento","Text alternative":"Testo alternativo","This link has no URL":"Questo collegamento non ha un URL",Turquoise:"Turchese",Underline:"Sottolineato",Undo:"Annulla",Unlink:"Elimina collegamento","Upload failed":"Caricamento fallito","Upload in progress":"Caricamento in corso",White:"Bianco","Widget toolbar":"Barra degli strumenti del widget","Wrap text":"Testo a capo",Yellow:"Giallo"}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}))},6954:(e,t,n)=>{"use strict";e.exports=n.p+"img/googleSatellite-0706bcb1678d6e9f219c.png"},7008:(e,t,n)=>{"use strict";e.exports=n.p+"img/accreditation-7f66e46aebab965fa566.png"},7648:(e,t,n)=>{"use strict";e.exports=n.p+"svg/weezeventBlankPerson-e5c7b9cf3fcac68f3df8.svg"},8144:(e,t,n)=>{"use strict";e.exports=n.p+"img/asoHomeBackground-7b756e9652a2a7882137.jpg"},8184:(e,t,n)=>{"use strict";e.exports=n.p+"svg/dnsWrongDomain-3954cd8d9805c779a7bc.svg"},8264:(e,t,n)=>{"use strict";e.exports=n.p+"img/userProfile-37c0493d81fa861def54.png"},8301:(e,t,n)=>{"use strict";e.exports=n.p+"img/aso-897aab2a976d58ba485d.png"},8631:(e,t,n)=>{"use strict";var i=n(4848),o=(n(8630),n(9191));function s(e){try{return Buffer.from(e).toString("base64")}catch{try{return btoa(e)}catch{return""}}}function r(e){try{return Buffer.from(e,"base64").toString()}catch{try{return atob(e)}catch{return""}}}var a,l=n(2664);function d(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function c(e){return(e||"").trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function u(e,t={}){const n=t.replacer??a.Dash,i=d(e).trim().toLowerCase().replace(/['"]+/gi,"");let o;return o=n===a.Dash?i.replace(/[^a-z0-9\\-]+/gu,"-").replace(/-+$/,"").replace(/^-+/,""):n===a.Underscore?i.replace(/[^a-z0-9_]+/gu,"_").replace(/_+$/,"").replace(/^_+/,""):i.replace(/[^a-z0-9]+/gu,"").trim(),t?.replaceStartingNumber?o.replace(/^(\d)/,"_$1"):o}function h(e){return"string"==typeof e&&e.trim().length>0}function m(e){return!h(e)}!function(e){e[e.Dash=0]="Dash",e[e.Empty=1]="Empty",e[e.Underscore=2]="Underscore"}(a||(a={}));const g=e=>h(e)?e[0].toUpperCase()+e.slice(1):"";function p(e){return(e??"").trim().toLowerCase().replace(/\s+/g," ").split(" ").map(e=>g(e)).join(" ").split("-").map(e=>g(e.trim())).join("-")}function f(e,t){const n=(e,t,n,i,o)=>en?n+1:e+1:i===o?t:t+1;if(e===t)return 0;if(e.length>t.length){const n=e;e=t,t=n}let i=e.length,o=t.length;for(;i>0&&e.charCodeAt(i-1)===t.charCodeAt(o-1);)i--,o--;let s=0;for(;s{if("object"==typeof window&&void 0!==window[e])return window[e];if(void 0!==I?.[e])return I[e];throw new Error(`Missing env. var. ${e}`)},b=e=>"object"==typeof window&&void 0!==window[e]?window[e]:void 0!==I?.[e]?I[e]:void 0,j=e=>{const t=v(e);return"boolean"==typeof t?t:"true"===t},C=v("HEAVENT_APPLICATION_DOMAIN"),y=b("HEAVENT_RESOURCES_DOMAIN")??C,k=b("HEAVENT_ASSETS_DOMAIN")??y,A=b("HEAVENT_APP_SUBDOMAIN")??"app",w=b("HEAVENT_API_SUBDOMAIN")??"api",S=b("HEAVENT_PUBLIC_SUBDOMAIN")??"event",E=b("HEAVENT_INVOICES_SUBDOMAIN")??"invoices",T=b("HEAVENT_ASSETS_SUBDOMAIN")??"assets",z=b("HEAVENT_UPLOADS_SUBDOMAIN")??"uploads",$=b("HEAVENT_APPLICATION_BASENAME")??"",O=b("HEAVENT_RESOURCES_BASENAME")??"",R={ADMINS:v("HEAVENT_ADMINS"),EMAIL_FROM:v("HEAVENT_EMAIL_FROM"),EMAIL_FROM_NAME:v("HEAVENT_EMAIL_FROM_NAME"),HEAVENT_APPLICATION_DOMAIN:C,HEAVENT_RESOURCES_DOMAIN:y,HEAVENT_ASSETS_DOMAIN:k,HEAVENT_APPLICATION_BASENAME:$,HEAVENT_APP_URL:new x(b("HEAVENT_APP_DOMAIN")??C,void 0,A,b("HEAVENT_APP_BASENAME")??$),HEAVENT_API_URL:new x(b("HEAVENT_API_DOMAIN")??C,void 0,w,b("HEAVENT_API_BASENAME")??$),HEAVENT_PUBLIC_URL:new x(b("HEAVENT_PUBLIC_DOMAIN")??C,void 0,S,b("HEAVENT_PUBLIC_BASENAME")??$),HEAVENT_ASSETS_URL:new x(k,void 0,T,b("HEAVENT_ASSETS_BASENAME")??O),HEAVENT_INVOICES_URL:new x(b("HEAVENT_INVOICES_DOMAIN")??y,void 0,E,b("HEAVENT_INVOICES_BASENAME")??O),HEAVENT_UPLOADS_URL:new x(b("HEAVENT_UPLOADS_DOMAIN")??y,void 0,z,b("HEAVENT_UPLOADS_BASENAME")??O),USE_HUBSPOT:v("HEAVENT_USE_HUBSPOT"),COGNITO_USER_POOL_ID:v("HEAVENT_COGNITO_USER_POOL_ID"),COGNITO_USER_POOL_CLIENT_ID:v("HEAVENT_COGNITO_USER_POOL_CLIENT_ID"),COGNITO_DOMAIN_URL:v("HEAVENT_COGNITO_DOMAIN_URL"),COGNITO_CLIENT_CALLBACK_URL:v("HEAVENT_COGNITO_CLIENT_CALLBACK_URL")[0],USE_MIXPANEL:j("HEAVENT_USE_MIXPANEL"),MIXPANEL_TOKEN:j("HEAVENT_MIXPANEL_TOKEN"),HEAVENT_AWS_UPLOADS_BUCKET:v("HEAVENT_AWS_UPLOADS_BUCKET"),LOG_TOKEN:v("HEAVENT_LOG_TOKEN"),WEEZEVENT_DOMAIN:v("HEAVENT_WEEZEVENT_DOMAIN")},P="x-heavent-commit-sha",D="x-user-token";var F=n(6540),M=n(5002);function N(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}const L="heavent-user-session-key",B="heavent-user-email",V="UserNotFoundException";let U=null;const W=()=>(null===U&&(U=new M.NE({UserPoolId:R.COGNITO_USER_POOL_ID,ClientId:R.COGNITO_USER_POOL_CLIENT_ID})),U);function G(){return new Promise((e,t)=>{const n=W().getCurrentUser();null!==n?n.getSession((i,o)=>{i||!1===o?.isValid()?t(new Error("Could not get current user")):e({user:n,token:o.getIdToken().getJwtToken()})}):t(new Error("Could not get current user"))})}async function H(){try{const e=localStorage.getItem("heavent-test-token");return h(e)?e:(await G()).token}catch{return}}function q(e,t){const n=e.trim().toLowerCase();return new Promise((e,i)=>{const o=[new M.HB({Name:"email",Value:n})];W().signUp(n,t,o,[],(t,n)=>{t?i(t):e(n.user)})})}function Y(){G().then(({user:e})=>{e.signOut(),location.reload()}).catch(()=>{alert("Something wrong happened ")})}function K(e,t,n){return new Promise((i,o)=>{const s=new M.TU({Username:e,Pool:W()}),r=new M.By({Username:e}),a={onSuccess(e){t(e.getIdToken().getJwtToken())},onFailure(e){e.code===V?o(V):n(e)},customChallenge(){localStorage.setItem(B,e),localStorage.setItem(L,s.Session),i({user:s,callbacks:a})}};s.setAuthenticationFlowType("CUSTOM_AUTH"),s.initiateAuth(r,a)})}function Z(e,t){return new Promise((n,i)=>{new M.TU({Username:e,Pool:W()}).authenticateUser(new M.By({Username:e,Password:t}),{onSuccess(e){n(e.getIdToken().getJwtToken())},onFailure(e){i(e)}})})}function X(e){return new Promise((t,n)=>{new M.TU({Username:e,Pool:W()}).forgotPassword({onSuccess(){t(!0)},async onFailure(i){if(i.code===V)try{await q(e,N()),await X(e),t(!0)}catch(e){n(e)}else n(i)}})})}function J(e,t,n){return new Promise((i,o)=>{new M.TU({Username:e,Pool:W()}).confirmPassword(t,n,{async onSuccess(){i(await Z(e,n))},onFailure(e){o(e)}})})}var Q,ee=n(961);!function(e){e.Development="development",e.Production="production",e.Test="test"}(Q||(Q={}));var te,ne,ie,oe,se,re,ae,le,de,ce,ue,he,me,ge,pe,fe,xe,_e,Ie,ve,be,je,Ce,ye,ke,Ae,we,Se,Ee,Te,ze,$e,Oe,Re,Pe,De,Fe,Me,Ne,Le,Be,Ve,Ue,We,Ge,He,qe,Ye,Ke,Ze,Xe,Je,Qe,et,tt,nt,it,ot,st,rt,at,lt,dt,ct,ut,ht,mt,gt,pt,ft,xt,_t,It,vt,bt,jt,Ct,yt,kt,At,wt,St,Et,Tt,zt,$t,Ot,Rt,Pt,Dt,Ft,Mt,Nt,Lt,Bt=n(1519);!function(e){e.Delegation="Delegation",e.DelegationCategory="DelegationCategory",e.Event="Event",e.Organization="Organization",e.Position="Position",e.PositionCategory="PositionCategory"}(te||(te={})),function(e){e.Calendar="Calendar",e.List="List",e.Radio="Radio"}(ne||(ne={})),function(e){e.Acronym="Acronym",e.Address="Address",e.AutoAccredit="AutoAccredit",e.Category="Category",e.Color="Color",e.Description="Description",e.Icon="Icon",e.Index="Index",e.Latitude="Latitude",e.Longitude="Longitude",e.Name="Name",e.Tag="Tag",e.WeezeventIsSynchronized="WeezeventIsSynchronized"}(ie||(ie={})),function(e){e.Accredited="Accredited",e.Everyone="Everyone",e.Members="Members",e.Refused="Refused",e.Segments="Segments"}(oe||(oe={})),function(e){e.Accreditation="Accreditation",e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Date="Date",e.Id="Id",e.Name="Name"}(se||(se={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Index="Index",e.Name="Name"}(re||(re={})),function(e){e.Accredited="Accredited",e.AutoAccredited="AutoAccredited",e.NotApplicable="NotApplicable",e.Refused="Refused",e.WaitingAccreditation="WaitingAccreditation"}(ae||(ae={})),function(e){e.Assigned="Assigned",e.Everyone="Everyone",e.Members="Members",e.Refused="Refused",e.Segments="Segments"}(le||(le={})),function(e){e.InsertedAt="InsertedAt",e.Name="Name",e.State="State",e.Type="Type"}(de||(de={})),function(e){e.Done="Done",e.Draft="Draft",e.InProgress="InProgress",e.Scheduled="Scheduled",e.Template="Template"}(ce||(ce={})),function(e){e.Email="Email",e.Sms="Sms"}(ue||(ue={})),function(e){e.Waiting="Waiting",e.CheckedIn="CheckedIn",e.CheckedOut="CheckedOut"}(he||(he={})),function(e){e.CheckIn="CheckIn",e.CheckInOut="CheckInOut",e.CheckOut="CheckOut",e.Reset="Reset"}(me||(me={})),function(e){e.And="And",e.Or="Or"}(ge||(ge={})),function(e){e.Animajeconvention="Animajeconvention",e.Asoassignment="Asoassignment",e.Cerclelivraison="Cerclelivraison",e.Cercleopcom="Cercleopcom",e.Cerclepressandpartenaire="Cerclepressandpartenaire",e.Cerclestaff="Cerclestaff",e.Delta="Delta",e.Dfcoa4="Dfcoa4",e.Dfcosmall="Dfcosmall",e.Eurockeennes="Eurockeennes",e.Fcg="Fcg",e.Garorockplanning="Garorockplanning",e.Goldencoast="Goldencoast",e.Hbcldc="Hbcldc",e.Hbclnh="Hbclnh",e.Lnh="Lnh",e.Moorea="Moorea",e.Nuitssecretes="Nuitssecretes",e.Openbrest="Openbrest",e.P2nassignment="P2nassignment",e.P2nassignmentmontagedemontage="P2nassignmentmontagedemontage",e.P2nbadge="P2nbadge",e.Paris20km="Paris20km",e.Paris20kmassignment="Paris20kmassignment",e.Paris20kmcontremarque="Paris20kmcontremarque",e.Pastourelle="Pastourelle",e.Pastourelleexposant="Pastourelleexposant",e.Pec="Pec",e.Playground="Playground",e.Roiarthur="Roiarthur",e.Rose="Rose",e.Roseparking="Roseparking",e.Salamandre="Salamandre",e.T24assignment="T24assignment",e.Triathlonlarochellebadge="Triathlonlarochellebadge",e.Utopialesa4="Utopialesa4",e.Utopialesimprimeur="Utopialesimprimeur",e.Vandbcontremarque="Vandbcontremarque",e.Vannes="Vannes",e.Vannesassignment="Vannesassignment",e.Vendanges="Vendanges",e.Vendeeglobebadge="Vendeeglobebadge",e.Vendeeglobecontremarque="Vendeeglobecontremarque"}(pe||(pe={})),function(e){e.All="All",e.Public="Public",e.Private="Private"}(fe||(fe={})),function(e){e.Category="Category",e.Label="Label",e.Name="Name",e.Privacy="Privacy"}(xe||(xe={})),function(e){e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Label="Label",e.Name="Name",e.Status="Status",e.Type="Type"}(_e||(_e={})),function(e){e.Accreditation="Accreditation",e.Delegation="Delegation",e.Event="Event",e.Position="Position",e.UserInfo="UserInfo"}(Ie||(Ie={})),function(e){e.Campaigns="Campaigns",e.CanLeadersAddMembers="CanLeadersAddMembers",e.CanLeadersDeleteMembers="CanLeadersDeleteMembers",e.CanLeadersEditColumns="CanLeadersEditColumns",e.CanLeadersEditCustomFields="CanLeadersEditCustomFields",e.CanLeadersEditMembers="CanLeadersEditMembers",e.CanLeadersImportMembers="CanLeadersImportMembers",e.CanLeadersSeeHiddenAccreditationsSlots="CanLeadersSeeHiddenAccreditationsSlots",e.Category="Category",e.Columns="Columns",e.DeadlineDate="DeadlineDate",e.Description="Description",e.Documents="Documents",e.Form="Form",e.IsLocked="IsLocked",e.MaxResources="MaxResources",e.Name="Name",e.ShowFormLinkInDelegationSpace="ShowFormLinkInDelegationSpace",e.ShowInDelegationSpace="ShowInDelegationSpace",e.Tag="Tag"}(ve||(ve={})),function(e){e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(be||(be={})),function(e){e.Done="Done",e.Waiting="Waiting"}(je||(je={})),function(e){e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(Ce||(Ce={})),function(e){e.Expired="Expired",e.Full="Full",e.Locked="Locked",e.Ongoing="Ongoing"}(ye||(ye={})),function(e){e.Failed="FAILED",e.Pending="PENDING",e.Success="SUCCESS"}(ke||(ke={})),function(e){e.OnePerPage="OnePerPage",e.GroupedA4="GroupedA4"}(Ae||(Ae={})),function(e){e.Name="Name"}(we||(we={})),function(e){e.Assignments="Assignments",e.Badge="Badge",e.Certificate="Certificate",e.CustomBadge="CustomBadge",e.Planning="Planning",e.Position="Position",e.PositionPlanning="PositionPlanning",e.PositionsVolunteersPlanning="PositionsVolunteersPlanning",e.UserCustomDocument="UserCustomDocument",e.UserHours="UserHours",e.UserPlanning="UserPlanning",e.UserPlanningDays="UserPlanningDays",e.UserPlanningList="UserPlanningList",e.UsersPictures="UsersPictures",e.VolunteersListing="VolunteersListing"}(Se||(Se={})),function(e){e.Bounced="Bounced",e.Delivered="Delivered",e.Opened="Opened",e.Queued="Queued",e.Sent="Sent",e.Waiting="Waiting"}(Ee||(Ee={})),function(e){e.DoesNotExist="DoesNotExist",e.NotVerified="NotVerified",e.Verified="Verified"}(Te||(Te={})),function(e){e.Accreditations="Accreditations",e.AccreditationsRefused="AccreditationsRefused",e.Assignments="Assignments",e.Campaign="Campaign",e.Code="Code",e.DelegationCategoryLeaderAssign="DelegationCategoryLeaderAssign",e.DelegationFormInvite="DelegationFormInvite",e.DelegationLeaderAssign="DelegationLeaderAssign",e.DelegationsImport="DelegationsImport",e.Documents="Documents",e.EventInvite="EventInvite",e.Export="Export",e.FilesImport="FilesImport",e.FormInvite="FormInvite",e.FormSubmit="FormSubmit",e.MembersImport="MembersImport",e.NewMember="NewMember",e.NewVolunteer="NewVolunteer",e.NotifyLeaders="NotifyLeaders",e.OrganizationInvite="OrganizationInvite",e.PositionCategoryLeaderAssign="PositionCategoryLeaderAssign",e.PositionLeaderAssign="PositionLeaderAssign",e.PositionsImport="PositionsImport",e.Refused="Refused",e.VolunteerRegistration="VolunteerRegistration"}(ze||(ze={})),function(e){e.EndAt="EndAt",e.Name="Name",e.StartAt="StartAt",e.Tag="Tag"}($e||($e={})),function(e){e.EndAt="EndAt",e.Id="Id",e.Name="Name",e.StartAt="StartAt"}(Oe||(Oe={})),(Lt=Re||(Re={})).Archived="Archived",Lt.Done="Done",Lt.Ongoing="Ongoing",Lt.Upcoming="Upcoming",function(e){e.Excel="Excel",e.Csv="CSV"}(Pe||(Pe={})),function(e){e.Done="Done",e.Waiting="Waiting"}(De||(De={})),function(e){e.Accreditation="Accreditation",e.Api="Api",e.Community="Community",e.CustomDocument="CustomDocument",e.Delegation="Delegation",e.Documents="Documents",e.Eid="Eid",e.KmlImport="KmlImport",e.Languages="Languages",e.Multiform="Multiform",e.Skidata="Skidata",e.Sms="Sms",e.Weezevent="Weezevent",e.Zapier="Zapier"}(Fe||(Fe={})),function(e){e.City="city",e.Country="country",e.Custom="custom",e.DateOfBirth="dateOfBirth",e.Eid="eid",e.FirstName="firstName",e.Language="language",e.LastName="lastName",e.Nationality="nationality",e.Phone="phone",e.Picture="picture",e.Population="population",e.PostalCode="postalCode",e.Sex="sex",e.Street="street"}(Me||(Me={})),(Nt=Ne||(Ne={})).Address="Address",Nt.Checkbox="Checkbox",Nt.Country="Country",Nt.Date="Date",Nt.Datetime="Datetime",Nt.File="File",Nt.Language="Language",Nt.Nationality="Nationality",Nt.Number="Number",Nt.Phone="Phone",Nt.Select="Select",Nt.Sex="Sex",Nt.Text="Text",Nt.Textarea="Textarea",Nt.Time="Time",Nt.Validation="Validation",function(e){e.Done="Done",e.Waiting="Waiting"}(Le||(Le={})),function(e){e.Address="Address",e.Campaign="Campaign",e.Checkbox="Checkbox",e.Country="Country",e.Date="Date",e.DateTimeRange="DateTimeRange",e.Datetime="Datetime",e.File="File",e.Language="Language",e.Nationality="Nationality",e.Number="Number",e.Phone="Phone",e.Select="Select",e.Sex="Sex",e.Text="Text",e.Textarea="Textarea",e.Time="Time",e.Validation="Validation"}(Be||(Be={})),function(e){e.Field="Field",e.Section="Section",e.Text="Text"}(Ve||(Ve={})),function(e){e.Ranked="Ranked",e.Unranked="Unranked"}(Ue||(Ue={})),function(e){e.Admin="Admin",e.DelegationsSpace="DelegationsSpace",e.Form="Form"}(We||(We={})),function(e){e.CloseWhenEventDone="CloseWhenEventDone",e.Closed="Closed",e.ClosedAt="ClosedAt",e.Open="Open"}(Ge||(Ge={})),function(e){e.Backpack="Backpack",e.BadgeCheck="BadgeCheck",e.BagShopping="BagShopping",e.Bed="Bed",e.BriefcaseMedical="BriefcaseMedical",e.BurgerSoda="BurgerSoda",e.CakeCandles="CakeCandles",e.Camera="Camera",e.Car="Car",e.CircleParking="CircleParking",e.CircleQuestion="CircleQuestion",e.Droplet="Droplet",e.ForkKnife="ForkKnife",e.HatCowboy="HatCowboy",e.House="House",e.LocationDot="LocationDot",e.MartiniGlass="MartiniGlass",e.Megaphone="Megaphone",e.PersonBiking="PersonBiking",e.PersonHiking="PersonHiking",e.ScrewdriverWrench="ScrewdriverWrench",e.Shirt="Shirt",e.SignsPost="SignsPost",e.Star="Star",e.Ticket="Ticket",e.UserPolice="UserPolice"}(He||(He={})),function(e){e.Create="Create",e.CreateUpdate="CreateUpdate",e.Update="Update"}(qe||(qe={})),function(e){e.Overdue="Overdue",e.Paid="Paid",e.Refunded="Refunded",e.Waiting="Waiting"}(Ye||(Ye={})),function(e){e.Mandarin="Mandarin",e.Spanish="Spanish",e.English="English",e.Hindi="Hindi",e.Bengali="Bengali",e.Portuguese="Portuguese",e.Russian="Russian",e.Japanese="Japanese",e.Punjabi="Punjabi",e.Turkish="Turkish",e.Korean="Korean",e.French="French",e.German="German",e.Vietnamese="Vietnamese",e.Tamil="Tamil",e.Urdu="Urdu",e.Javanese="Javanese",e.Italian="Italian",e.Persian="Persian",e.Polish="Polish",e.Ukrainian="Ukrainian",e.Romanian="Romanian",e.Dutch="Dutch"}(Ke||(Ke={})),function(e){e.App="App",e.DelegationsSpace="DelegationsSpace",e.MembersSpace="MembersSpace",e.VolunteerAssignments="VolunteerAssignments",e.VolunteerRegister="VolunteerRegister"}(Ze||(Ze={})),function(e){e.Google="Google",e.GoogleSatellite="GoogleSatellite",e.IgnPlan="IgnPlan"}(Xe||(Xe={})),function(e){e.Add="Add",e.Delete="Delete",e.Replace="Replace"}(Je||(Je={})),function(e){e.Categories="Categories",e.Positions="Positions"}(Qe||(Qe={})),function(e){e.Both="Both",e.Event="Event",e.Organization="Organization"}(et||(et={})),function(e){e.Id="Id",e.InsertedAt="InsertedAt",e.PeriodEndAt="PeriodEndAt"}(tt||(tt={})),function(e){e.A4Portrait="A4Portrait",e.A4Landscape="A4Landscape",e.A5Portrait="A5Portrait",e.A6Portrait="A6Portrait"}(nt||(nt={})),function(e){e.Acronym="Acronym",e.Address="Address",e.Category="Category",e.Color="Color",e.Description="Description",e.Icon="Icon",e.Latitude="Latitude",e.Longitude="Longitude",e.Name="Name",e.Tag="Tag",e.Traces="Traces"}(it||(it={})),function(e){e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(ot||(ot={})),function(e){e.Done="Done",e.Waiting="Waiting"}(st||(st={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name",e.Position="Position",e.Range="Range"}(rt||(rt={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name",e.Slot="Slot"}(at||(at={})),function(e){e.Empty="Empty",e.Partial="Partial",e.Full="Full"}(lt||(lt={})),function(e){e.Between="between",e.Contains="contains",e.EndsWith="endsWith",e.EngulfedBy="engulfedBy",e.Engulfs="engulfs",e.GreaterThan="greaterThan",e.GreaterThanEqual="greaterThanEqual",e.Is="is",e.IsAfter="isAfter",e.IsBefore="isBefore",e.IsEmpty="isEmpty",e.IsNot="isNot",e.IsNotEmpty="isNotEmpty",e.IsNotValid="isNotValid",e.IsValid="isValid",e.LessThan="lessThan",e.LessThanEqual="lessThanEqual",e.NotContains="notContains",e.NotEngulfedBy="notEngulfedBy",e.NotEngulfs="notEngulfs",e.NotOverlaps="notOverlaps",e.Overlaps="overlaps",e.StartsWith="startsWith",e.Today="today"}(dt||(dt={})),function(e){e.Accreditation="Accreditation",e.None="None"}(ct||(ct={})),function(e){e.AllDays="AllDays",e.DaysWithSlots="DaysWithSlots"}(ut||(ut={})),function(e){e.Category="Category",e.Position="Position",e.Slot="Slot",e.None="None"}(ht||(ht={})),function(e){e.FilterWithSlots="FilterWithSlots",e.None="None"}(mt||(mt={})),(Mt=gt||(gt={})).Calendar="Calendar",Mt.Custom="Custom",Mt.Display="Display",Mt.DisplayDays="DisplayDays",Mt.Hide="Hide",function(e){e.Custom="Custom",e.DelegationCategoryLeader="DelegationCategoryLeader",e.EventAdmin="EventAdmin",e.EventReader="EventReader",e.OrganizationAdmin="OrganizationAdmin",e.OrganizationReader="OrganizationReader",e.PositionEditor="PositionEditor",e.PositionReader="PositionReader"}(pt||(pt={})),function(e){e.Accreditations="Accreditations",e.Campaigns="Campaigns",e.CustomFields="CustomFields",e.Delegations="Delegations",e.Events="Events",e.Positions="Positions",e.Volunteers="Volunteers"}(ft||(ft={})),function(e){e.Female="Female",e.Male="Male",e.Nonbinary="Nonbinary",e.Notsay="Notsay",e.Other="Other"}(xt||(xt={})),function(e){e.Asc="Asc",e.Desc="Desc"}(_t||(_t={})),function(e){e.De="De",e.En="En",e.Es="Es",e.Fr="Fr",e.Keys="Keys",e.Nl="Nl"}(It||(It={})),function(e){e.Accreditations="Accreditations",e.Delegations="Delegations",e.Events="Events",e.Positions="Positions",e.UsersInfos="UsersInfos"}(vt||(vt={})),function(e){e.WithReplies="WithReplies",e.WithUnreadReplies="WithUnreadReplies",e.WithoutReplies="WithoutReplies"}(bt||(bt={})),function(e){e.Delivered="Delivered",e.InvalidNumber="InvalidNumber",e.Other="Other",e.Refused="Refused",e.Sent="Sent",e.Undelivered="Undelivered",e.Waiting="Waiting"}(jt||(jt={})),function(e){e.None="None",e.Backward="Backward",e.Forward="Forward"}(Ct||(Ct={})),function(e){e.Accreditation="Accreditation",e.CustomField="CustomField",e.CustomSlot="CustomSlot",e.Delegation="Delegation",e.Document="Document",e.Email="Email",e.Event="Event",e.Form="Form",e.Other="Other",e.Position="Position"}(yt||(yt={})),function(e){e.NotTranslated="NotTranslated",e.Translated="Translated",e.TranslatedAndNotTranslated="TranslatedAndNotTranslated"}(kt||(kt={})),function(e){e.String="String",e.StringArray="StringArray",e.RichText="RichText"}(At||(At={})),function(e){e.Admin="Admin",e.Leader="Leader"}(wt||(wt={})),function(e){e.FirstName="FirstName",e.Id="Id",e.InsertedAt="InsertedAt",e.LastName="LastName",e.Name="Name",e.UpdatedAt="UpdatedAt"}(St||(St={})),function(e){e.Assigned="Assigned",e.NotApplicable="NotApplicable",e.PreAssigned="PreAssigned",e.Refused="Refused",e.WaitingAssignment="WaitingAssignment"}(Et||(Et={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Tt||(Tt={})),function(e){e.AccreditationState="AccreditationState",e.Delegation="Delegation",e.FirstName="FirstName",e.Id="Id",e.InsertedAt="InsertedAt",e.LastName="LastName",e.LocalId="LocalId",e.Name="Name",e.State="State",e.TeamCode="TeamCode",e.UpdatedAt="UpdatedAt"}(zt||(zt={})),function(e){e.AddAccreditations="AddAccreditations",e.AddEvent="AddEvent",e.CreateDelegation="CreateDelegation",e.DeleteAccreditations="DeleteAccreditations",e.SendCampaign="SendCampaign",e.SetCustomField="SetCustomField"}($t||($t={})),function(e){e.EveryMinute="EveryMinute",e.Every2Minutes="Every2Minutes",e.Every5Minutes="Every5Minutes",e.Every10Minutes="Every10Minutes"}(Ot||(Ot={})),function(e){e.DelegationsLeaders="DelegationsLeaders",e.PositionsLeaders="PositionsLeaders",e.UsersInfosIds="UsersInfosIds",e.View="View"}(Rt||(Rt={})),function(e){e.CreatedAt="CreatedAt",e.ExecutedAt="ExecutedAt",e.Id="Id",e.Name="Name",e.VolunteersSegment="VolunteersSegment"}(Pt||(Pt={})),function(e){e.Active="Active",e.Error="Error",e.Paused="Paused"}(Dt||(Dt={})),function(e){e.Assigned="Assigned",e.FormSubmit="FormSubmit",e.VolunteersSegment="VolunteersSegment"}(Ft||(Ft={})),Object.keys(te);const Vt=Object.keys(ne),Ut=Object.keys(ie),Wt=(Object.keys(oe),Object.keys(se),Object.keys(re),Object.keys(ae)),Gt=(Object.keys(le),Object.keys(de),Object.keys(ce)),Ht=Object.keys(ue),qt=Object.keys(he),Yt=(Object.keys(me),Object.keys(ge),Object.keys(pe)),Kt=(Object.keys(fe),Object.keys(xe)),Zt=(Object.keys(_e),Object.keys(Ie)),Xt=Object.keys(ve),Jt=(Object.keys(be),Object.keys(je),Object.keys(Ce),Object.keys(ye)),Qt=(Object.keys(ke),Object.keys(Ae)),en=(Object.keys(we),Object.keys(Se),Object.keys(Ee)),tn=(Object.keys(Te),Object.keys(ze)),nn=(Object.keys($e),Object.keys(Oe),Object.keys(Re)),on=(Object.keys(Pe),Object.keys(De),Object.keys(Fe)),sn=(Object.keys(Me),Object.keys(Ne)),rn=(Object.keys(Le),Object.keys(Be),Object.keys(Ve),Object.keys(Ue)),an=(Object.keys(We),Object.keys(Ge)),ln=Object.keys(He),dn=Object.keys(qe),cn=Object.keys(Ye),un=Object.keys(Ke),hn=(Object.keys(Ze),Object.keys(Xe)),mn=Object.keys(Je),gn=Object.keys(Qe),pn=(Object.keys(et),Object.keys(tt),Object.keys(nt),Object.keys(it)),fn=(Object.keys(ot),Object.keys(st),Object.keys(rt),Object.keys(at),Object.keys(lt)),xn=(Object.keys(dt),Object.keys(ct)),_n=Object.keys(ut),In=Object.keys(ht),vn=Object.keys(mt),bn=Object.keys(gt),jn=(Object.keys(pt),Object.keys(ft),Object.keys(xt)),Cn=(Object.keys(_t),Object.keys(It),Object.keys(vt),Object.keys(bt)),yn=Object.keys(jt),kn=(Object.keys(Ct),Object.keys(yt)),An=Object.keys(kt),wn=(Object.keys(At),Object.keys(wt),Object.keys(St),Object.keys(Et)),Sn=(Object.keys(Tt),Object.keys(zt),Object.keys($t)),En=(Object.keys(Ot),Object.keys(Rt)),Tn=(Object.keys(Pt),Object.keys(Dt)),zn=Object.keys(Ft),$n=["insertedAt","updatedAt","checkInAt","date","sentAt","scheduledAt","deletedAt","lockedAt","bouncedAt","complaintAt","deliveredAt","rejectedAt","openedAt","clickedAt","queuedAt","closedAt","periodEndAt","checkOutAt","validatedAt","receptionDate","termsAcceptedAt","lastSeenAt","registrationDate","weezeventPairedAt","executedAt"],On=["date","calendarInviteStartDate","calendarInviteEndDate","startDate","endDate","deadlineDate","minAccreditationSlotDate","startAt","endAt","paidAt"],Rn=["range","ranges"],Pn=["assignedDuration","duration"];let Dn=class{language;translations;constructor(e,t){this.language=e,this.translations=t}translate(e,...t){if("production"!==Q.Test||process.env.JEST_WORKER_ID){let n=this.translations[e]||e;const i=this.translations[`${e}_plural`];return i&&"number"==typeof t[0]&&t[0]>1&&(n=i),Array.isArray(t)&&t.length>0&&(n=t.reduce((e,t,n)=>e.replaceAll(`{${n+1}}`,t),n)),n}return`${e} - ${JSON.stringify(t)}`}*interpolateWithComponents(e,...t){let n=0;for(const[o,s]of e.split(/{\d+}/).entries())n>0&&(yield(0,i.jsx)(F.Fragment,{children:t[o-1]},n)),n++,yield s}formatListValues(e,t="disjunction"){return new Intl.ListFormat(this.language.toLowerCase(),{style:"long",type:t}).format(e)}};Dn=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[String,Object])],Dn);const Fn=(0,F.createContext)({}),Mn=Fn.Consumer;function Nn(e){return(0,F.useContext)(Fn).container.get(e)}function Ln(){const e=(0,F.useContext)(Fn).container.get(Dn);return e.translate.bind(e)}function Bn(){const e=(0,F.useContext)(Fn).container.get(Dn);return e.interpolateWithComponents.bind(e)}function Vn(e,t,n=[]){const i="production"!==Q.Test?e:e.loc.source.body;return(0,F.useContext)(Fn).useQuery(i,t,n)}function Un(e,t={}){return(0,F.useContext)(Fn).useMutation(e,t)}function Wn(){return(0,F.useContext)(Fn).useParams()}function Gn(){return(0,F.useContext)(Fn).useHistory()}function Hn(){return(0,F.useContext)(Fn).useLocation()}function qn(){return(0,F.useContext)(Fn).useLocalStorage()}const Yn=e=>{const t=Wn(),n=Gn();return(0,F.useEffect)(()=>{h(e.path)&&(e.replace?n.replace(e.path,e.state):n.push(e.path,e.state)),e.push&&n.push(e.push(t),e.state),e.onLoad&&e.onLoad()},[]),(0,i.jsx)("div",{})},Kn=(0,F.createContext)({user:null});function Zn(){return(0,F.useContext)(Kn)}const Xn=e=>{const t=Wn(),{user:n}=Zn();return n&&e.shouldHaveUser||!n&&!e.shouldHaveUser?(0,i.jsx)(i.Fragment,{children:e.children}):(0,i.jsx)(Yn,{path:e.getRedirectPath(t),replace:!0})};function Jn(...e){console.log(...e)}const Qn=e=>e.join("/"),ei=R.HEAVENT_APPLICATION_BASENAME,ti={FIELDS:{PLURAL:"fields",SINGLE:"field"}},ni={AUTH:"auth",EDIT:"edit",CREATE:"create",EXPORT:"export",EXPORT_BASIC:"export/basic",EXPORT_API:"export/api",IMPORT:"import",INVITE:"invite"},ii={INFORMATION:"information",DASHBOARD:"dashboard",REGISTRATION:"registration",DOCUMENTS:"documents",PROFILE:"profile",REPORTING:"reporting",FORMS:"forms",FORM:"form",MEMBER:"member",MEMBERS:"members",PREVIEW:"preview"},oi=e=>Qn([e,ni.AUTH]),si=e=>Qn([e,ni.CREATE]),ri=e=>Qn([e,ni.EDIT]),ai={PLURAL:"/organizations",SINGLE:"/organization"},li="delegations",di={_BASE:"parameters",MEMBERS_SPACE:{_BASE:"members-space",DESIGN:"design",INTEGRATION:"integration",EMAIL_TEMPLATES:"emails",SETTINGS:"settings"},DELEGATION_SPACE:{_BASE:"delegation-space",DESIGN:"design",INTEGRATION:"integration",EMAIL_TEMPLATES:"emails",SETTINGS:"settings"}},ci="blocked",ui="expired",hi={ORGANIZATIONS:ai.PLURAL,ORGANIZATION:e=>Qn([ai.SINGLE,e])},mi={ORGANIZATIONS:hi.ORGANIZATIONS,ORGANIZATION:({organizationId:e})=>hi.ORGANIZATION(e),ORGANIZATION_SETTINGS:e=>Qn([mi.ORGANIZATION(e),di._BASE]),ORGANIZATION_SETTINGS_MEMBERS_SPACE:e=>Qn([mi.ORGANIZATION_SETTINGS(e),di.MEMBERS_SPACE._BASE]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN:e=>Qn([mi.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),di.MEMBERS_SPACE.DESIGN]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION:e=>Qn([mi.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),di.MEMBERS_SPACE.INTEGRATION]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES:e=>Qn([mi.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),di.MEMBERS_SPACE.EMAIL_TEMPLATES]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS:e=>Qn([mi.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),di.MEMBERS_SPACE.SETTINGS]),ORGANIZATION_SETTINGS_DELEGATION_SPACE:e=>Qn([mi.ORGANIZATION_SETTINGS(e),di.DELEGATION_SPACE._BASE]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN:e=>Qn([mi.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),di.DELEGATION_SPACE.DESIGN]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION:e=>Qn([mi.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),di.DELEGATION_SPACE.INTEGRATION]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES:e=>Qn([mi.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),di.DELEGATION_SPACE.EMAIL_TEMPLATES]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS:e=>Qn([mi.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),di.DELEGATION_SPACE.SETTINGS]),ORGANIZATION_DELEGATIONS:e=>Qn([mi.ORGANIZATION(e),li]),IS_BLOCKED:e=>Qn([e,ci]),IS_EXPIRED:e=>Qn([e,ui]),ORGANIZATION_FORM:e=>zi.FORM(e)},gi="dashboard",pi="users",fi={COMMUNITY:e=>Qn([mi.ORGANIZATION(e),"community"]),COMMUNITY_DASHBOARD:e=>Qn([fi.COMMUNITY(e),gi]),COMMUNITY_USERS:e=>Qn([fi.COMMUNITY(e),pi])},xi={PLURAL:"forms",SINGLE:"form"},_i="elements",Ii="emails",vi="integration",bi="parameters",ji="preview",Ci="general",yi="design",ki="availabilities",Ai="missions",wi="accreditations",Si="broadcast",Ei="state",Ti={FORMS:xi.PLURAL,FORM:e=>Qn([xi.SINGLE,e])},zi={FORMS:({eventId:e,...t})=>Qn([e?Pi.EVENT({...t,eventId:e}):fi.COMMUNITY(t),Ti.FORMS]),FORM:({formId:e,...t})=>Qn(["eventId"in t&&t.eventId?Pi.EVENT(t):fi.COMMUNITY(t),Ti.FORM(e)]),FORM_ELEMENTS:e=>Qn([zi.FORM(e),_i]),FORM_INTEGRATION:e=>Qn([zi.FORM(e),vi]),FORM_EMAILS:e=>Qn([zi.FORM(e),Ii]),FORM_PREVIEW:e=>Qn([zi.FORM(e),ji]),FORM_PARAMETERS:e=>Qn([zi.FORM(e),bi]),FORM_PARAMETERS_GENERAL:e=>Qn([zi.FORM_PARAMETERS(e),Ci]),FORM_PARAMETERS_DESIGN:e=>Qn([zi.FORM_PARAMETERS(e),yi]),FORM_PARAMETERS_AVAILABILITIES:e=>Qn([zi.FORM_PARAMETERS(e),ki]),FORM_PARAMETERS_MISSIONS:e=>Qn([zi.FORM_PARAMETERS(e),Ai]),FORM_PARAMETERS_ACCREDITATIONS:e=>Qn([zi.FORM_PARAMETERS(e),wi]),FORM_PARAMETERS_BROADCAST:e=>Qn([zi.FORM_PARAMETERS(e),Si]),FORM_PARAMETERS_STATE:e=>Qn([zi.FORM_PARAMETERS(e),Ei])},$i={PLURAL:"events",SINGLE:"event"},Oi={PLURAL:"teams",SINGLE:"team"},Ri={EVENTS:$i.PLURAL,EVENT:e=>Qn([$i.SINGLE,e]),TEAM:e=>Qn([Oi.SINGLE,e])},Pi={EVENTS:e=>Qn([mi.ORGANIZATION(e),Ri.EVENTS]),EVENT:({eventId:e,...t})=>Qn([mi.ORGANIZATION(t),Ri.EVENT(e)]),EVENT_FORM:e=>Qn([zi.FORM(e)]),EVENT_TEAM_FORM:({teamCode:e,...t})=>Qn([Pi.EVENT_FORM(t),Ri.TEAM(e)])},Di={PLURAL:"accreditation-categories",SINGLE:"accreditation-category"},Fi={PLURAL:"accreditations",SINGLE:"accreditation"},Mi={PLURAL:"slots",SINGLE:"slot"},Ni="dashboard",Li="member",Bi="members",Vi={ACCREDITATION_CATEGORIES:Di.PLURAL,ACCREDITATION_CATEGORY:e=>Qn([Di.SINGLE,e]),ACCREDITATIONS:Fi.PLURAL,ACCREDITATION:e=>Qn([Fi.SINGLE,e]),ACCREDITATION_SLOTS:Mi.PLURAL,ACCREDITATION_SLOT:e=>Qn([Mi.SINGLE,e])},Ui={ACCREDITATION_CATEGORY:({accreditationCategoryId:e,...t})=>Qn([Pi.EVENT(t),Vi.ACCREDITATION_CATEGORY(e)]),ACCREDITATION_CATEGORY_DASHBOARD:e=>Qn([Ui.ACCREDITATION_CATEGORY(e),Ni]),ACCREDITATION_CATEGORY_MEMBERS:e=>Qn([Ui.ACCREDITATION_CATEGORY(e),Bi])},Wi={ACCREDITATIONS:e=>Qn([Pi.EVENT(e),Vi.ACCREDITATIONS]),ACCREDITATION:({accreditationId:e,...t})=>Qn([Pi.EVENT(t),Vi.ACCREDITATION(e)]),ACCREDITATION_DASHBOARD:e=>Qn([Wi.ACCREDITATION(e),Ni]),ACCREDITATION_MEMBERS:e=>Qn([Wi.ACCREDITATION(e),Bi]),ACCREDITATION_MEMBER:({userInfoId:e,...t})=>Qn([Wi.ACCREDITATION_MEMBERS(t),Li,e]),ACCREDITATION_MEMBER_INFORMATION:e=>Qn([Wi.ACCREDITATION_MEMBER(e),ii.INFORMATION])},Gi={ACCREDITATION_SLOT:({accreditationSlotId:e,...t})=>Qn([Hi.ACCREDITATION(t),Vi.ACCREDITATION_SLOT(e)]),ACCREDITATION_SLOT_DASHBOARD:e=>Qn([Gi.ACCREDITATION_SLOT(e),Ni]),ACCREDITATION_SLOT_MEMBERS:e=>Qn([Gi.ACCREDITATION_SLOT(e),Bi])},Hi={...Ui,...Wi,...Gi},qi={PLURAL:"delegations-categories",SINGLE:"delegation-category"},Yi={PLURAL:"delegations",SINGLE:"delegation"},Ki="accreditations",Zi="availabilities",Xi="positions",Ji={DELEGATIONS_CATEGORIES:qi.PLURAL,DELEGATION_CATEGORY:e=>Qn([qi.SINGLE,e]),DELEGATIONS:Yi.PLURAL,DELEGATION:e=>Qn([Yi.SINGLE,e])},Qi={DELEGATION_CATEGORY:({delegationCategoryId:e,...t})=>Qn(["eventId"in t&&t.eventId?Pi.EVENT(t):fi.COMMUNITY(t),Ji.DELEGATION_CATEGORY(e)]),DELEGATION_CATEGORY_DASHBOARD:e=>Qn([Qi.DELEGATION_CATEGORY(e),ii.DASHBOARD]),DELEGATION_CATEGORY_MEMBERS:e=>Qn([Qi.DELEGATION_CATEGORY(e),ii.MEMBERS])},eo={DELEGATIONS:e=>Qn(["eventId"in e&&e.eventId?Pi.EVENT(e):fi.COMMUNITY(e),Ji.DELEGATIONS]),DELEGATION:({delegationId:e,...t})=>Qn(["eventId"in t&&t.eventId?Pi.EVENT(t):fi.COMMUNITY(t),Ji.DELEGATION(e)]),DELEGATION_DASHBOARD:e=>Qn([eo.DELEGATION(e),ii.DASHBOARD]),DELEGATION_MEMBERS:e=>Qn([eo.DELEGATION(e),ii.MEMBERS]),DELEGATION_ACCREDITATIONS:e=>Qn([eo.DELEGATION(e),Ki]),DELEGATION_REPORTING:e=>Qn([eo.DELEGATION(e),ii.REPORTING]),DELEGATION_DOCUMENTS:e=>Qn([eo.DELEGATION(e),ii.DOCUMENTS]),DELEGATION_MEMBERS_IMPORT:e=>Qn([eo.DELEGATION(e),ni.IMPORT]),DELEGATION_MEMBER:({userInfoId:e,...t})=>Qn([eo.DELEGATION_MEMBERS(t),ii.MEMBER,e]),DELEGATION_MEMBER_INFORMATION:e=>Qn([eo.DELEGATION_MEMBER(e),ii.INFORMATION]),DELEGATION_MEMBER_ACCREDITATIONS:e=>Qn([eo.DELEGATION_MEMBER(e),Ki]),DELEGATION_MEMBER_AVAILABILITIES:e=>Qn([eo.DELEGATION_MEMBER(e),Zi]),DELEGATION_MEMBER_POSITIONS:e=>Qn([eo.DELEGATION_MEMBER(e),Xi]),MEMBERS_INVITE:e=>Qn([eo.DELEGATION(e),ii.MEMBERS,ni.INVITE]),MEMBER_CREATE:({formId:e,...t})=>si(Qn([eo.DELEGATION(t),ii.MEMBER,ii.FORM,e])),MEMBER_EDIT:({formId:e,...t})=>ri(Qn([eo.DELEGATION_MEMBER(t),ii.FORM,e])),DELEGATION_PROFILE:e=>Qn([eo.DELEGATION(e),ii.PROFILE]),FIELDS_EDIT:e=>ri(Qn([eo.DELEGATION(e),ti.FIELDS.PLURAL])),DELEGATION_FORM:({delegationId:e,...t})=>Qn([zi.FORM(t),Ji.DELEGATION(e)])},to={...Qi,...eo},no={ITEMS:{POSITIONS_CATEGORIES:{PLURAL:"position-categories",SINGLE:"position-category"},POSITIONS:{PLURAL:"positions",SINGLE:"position"},POSITION_SLOTS:{PLURAL:"slots",SINGLE:"slot"}},ACTIONS:{IMPORT:{CSV:`${ni.IMPORT}/csv`}},SECTIONS:{PREASSIGNED_MEMBERS:"preassigned-members"}},io={POSITION_CATEGORIES:no.ITEMS.POSITIONS_CATEGORIES.PLURAL,POSITION_CATEGORY:e=>Qn([no.ITEMS.POSITIONS_CATEGORIES.SINGLE,e]),POSITIONS:no.ITEMS.POSITIONS.PLURAL,POSITION:e=>Qn([no.ITEMS.POSITIONS.SINGLE,e]),POSITION_SLOTS:no.ITEMS.POSITION_SLOTS.PLURAL,POSITION_SLOT:e=>Qn([no.ITEMS.POSITION_SLOTS.SINGLE,e])},oo={POSITION_CATEGORY:({positionCategoryId:e,...t})=>Qn([Pi.EVENT(t),io.POSITION_CATEGORY(e)]),POSITION_CATEGORY_DASHBOARD:e=>Qn([oo.POSITION_CATEGORY(e),ii.DASHBOARD]),POSITION_CATEGORY_MEMBERS:e=>Qn([oo.POSITION_CATEGORY(e),ii.MEMBERS]),POSITION_CATEGORY_PREASSIGNED_MEMBERS:e=>Qn([oo.POSITION_CATEGORY(e),no.SECTIONS.PREASSIGNED_MEMBERS])},so={POSITIONS:e=>Qn([Pi.EVENT(e),io.POSITIONS]),POSITION:({positionId:e,positionCategoryId:t,...n})=>Qn(t?[oo.POSITION_CATEGORY({positionCategoryId:t,...n}),io.POSITION(e)]:[Pi.EVENT(n),io.POSITION(e)]),POSITION_DASHBOARD:e=>Qn([so.POSITION(e),ii.DASHBOARD]),POSITION_MEMBERS:e=>Qn([so.POSITION(e),ii.MEMBERS]),POSITION_PREASSIGNED_MEMBERS:e=>Qn([so.POSITION(e),no.SECTIONS.PREASSIGNED_MEMBERS]),POSITION_MEMBER:({userInfoId:e,...t})=>Qn([so.POSITION_MEMBERS(t),ii.MEMBER,e]),POSITION_MEMBER_INFORMATION:e=>Qn([so.POSITION_MEMBER(e),ii.INFORMATION]),POSITION_IMPORT_CSV:e=>Qn([Pi.EVENT(e),no.ACTIONS.IMPORT.CSV])},ro={POSITION_SLOTS:e=>Qn([so.POSITION(e),io.POSITION_SLOTS]),POSITION_SLOT:({positionSlotId:e,...t})=>Qn([so.POSITION(t),io.POSITION_SLOT(e)])},ao={...oo,...so,...ro},lo="/auth",co=`${lo}/sign-in`,uo=`${lo}/sign-up`,ho="/backoffice",mo=e=>`${mi.ORGANIZATION({organizationId:e})}/parameters`,go=(e,t,n,i)=>`${ao.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/check-members`,po=(e,t,n,i)=>`${ao.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/members`,fo=(e,t,n,i,o)=>`${ao.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/assign-volunteers/${o}`,xo=(e,t)=>`${Pi.EVENT({organizationId:e,eventId:t})}/volunteers`,_o=(e,t)=>`${xo(e,t)}/search`,Io=(e,t,n)=>`${_o(e,t)}/volunteer/${n}`,vo=(e,t,n)=>`${xo(e,t)}/${n}`,bo=(e,t,n,i)=>`${vo(e,t,n)}/volunteer/${i}`,jo=(e,t,n,i)=>`${vo(e,t,n)}/volunteer-panel/${i}`,Co=(e,t)=>`${Pi.EVENT({organizationId:e,eventId:t})}/emails`,yo=(e,t)=>`${Pi.EVENT({organizationId:e,eventId:t})}/integration`,ko=(e,t)=>`${Pi.EVENT({organizationId:e,eventId:t})}/documents`,Ao=(e,t)=>`${Pi.EVENT({organizationId:e,eventId:t})}/options`,wo=(e,t)=>`${Pi.EVENT({organizationId:e,eventId:t})}/dashboard`,So={HOME:`/${ei}`,UNSUBSCRIBE_EMAIL:"/unsubscribe-email",USER_UPDATE_BY_TICKET_ID:(e,t)=>`/organization/${e}/update-by-ticket-id/field/${t}`,USER_FIELD_UPDATE:(e,t,n,i)=>`/organization/${e}/user/${t}/field/${n}/update/${i}`,AUTH:lo,AUTH_FORGOT_PASSWORD:`${lo}/forgot-password`,AUTH_SIGN_IN:co,AUTH_SIGN_UP:uo,AUTH_SIGN_IN_EMAIL:`${co}/email`,AUTH_SIGN_IN_CODE:`${co}/code`,AUTH_SIGN_UP_CREDENTIALS:`${uo}/credentials`,AUTH_SIGN_UP_CODE:`${uo}/code`,COGNITO_CALLBACK:"/cognito-callback",MAGIC_LINK:(e,t)=>`/magic-link/${e}/${t}`,ACCEPT_TERMS_AND_CONDITIONS:e=>`${mi.ORGANIZATION({organizationId:e})}/accept-terms-and-conditions`,BACKOFFICE:ho,BACKOFFICE_ORGANIZATIONS:`${ho}/organizations`,EDIT_BACKOFFICE_ORGANIZATION:e=>`${ho}/organization/${e}/edit`,BACKOFFICE_INVOICES:`${ho}/invoices`,ORGANIZATION_PARAMETERS:mo,ORGANIZATION_PARAMETERS_PROFILE:e=>`${mo(e)}/profile`,ORGANIZATION_PARAMETERS_INFOS:e=>`${mo(e)}/general`,ORGANIZATION_PARAMETERS_TEAM:e=>`${mo(e)}/team`,ORGANIZATION_PARAMETERS_ROLES:e=>`${mo(e)}/roles`,CREATE_ORGANIZATION_PARAMETERS_ROLE:e=>`${mo(e)}/roles/create`,EDIT_ORGANIZATION_PARAMETERS_ROLE:(e,t)=>`${mo(e)}/roles/role/${t}/edit`,DUPLICATE_ORGANIZATION_PARAMETERS_ROLE:(e,t)=>`${mo(e)}/roles/role/${t}/duplicate`,ORGANIZATION_PARAMETERS_EMAILS:e=>`${mo(e)}/emails`,CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS:e=>`${mo(e)}/emails/senders/create`,EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS:(e,t)=>`${mo(e)}/emails/senders/${t}/edit`,ORGANIZATION_PARAMETERS_EMAILS_SENDERS:e=>`${mo(e)}/emails/senders`,ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW:(e,t)=>`${mo(e)}/emails/senders/${t}/preview`,ORGANIZATION_PARAMETERS_EMAILS_DNS:e=>`${mo(e)}/emails/dns`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE:e=>`${mo(e)}/delegations-space`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_DESIGN:e=>`${mo(e)}/delegations-space/design`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_INTEGRATION:e=>`${mo(e)}/delegations-space/integration`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_EMAILS:e=>`${mo(e)}/delegations-space/emails`,ORGANIZATION_PARAMETERS_CATEGORIES:e=>`${mo(e)}/categories`,ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS:e=>`${mo(e)}/categories/custom-fields`,ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS:e=>`${mo(e)}/categories/positions`,ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS:e=>`${mo(e)}/categories/accreditations`,ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS:e=>`${mo(e)}/categories/delegations`,ORGANIZATION_PARAMETERS_TAGS:e=>`${mo(e)}/tags`,ORGANIZATION_PARAMETERS_TRANSLATIONS:e=>`${mo(e)}/translations`,ORGANIZATION_PARAMETERS_INVOICES:e=>`${mo(e)}/invoices`,ORGANIZATION_PARAMETERS_ACTIVITY:e=>`${mo(e)}/activity`,ORGANIZATION_PARAMETERS_SKIDATA:e=>`${mo(e)}/skidata`,ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH:e=>`${mo(e)}/organization-switch`,ORGANIZATION_PARAMETERS_DELETE_ACCOUNT:e=>`${mo(e)}/delete-account`,CUSTOM_FIELDS:e=>`${mi.ORGANIZATION({organizationId:e})}/custom-fields`,CUSTOM_FIELDS_SEGMENT:(e,t)=>`${mi.ORGANIZATION({organizationId:e})}/custom-fields/${t}`,CUSTOM_FIELD_USAGE:(e,t,n)=>`${mi.ORGANIZATION({organizationId:e})}/custom-fields/${t}/usage/${n}`,CREATE_CUSTOM_FIELD:(e,t)=>`${mi.ORGANIZATION({organizationId:e})}/custom-fields/${t}/create`,EDIT_CUSTOM_FIELD:(e,t,n)=>`${mi.ORGANIZATION({organizationId:e})}/custom-fields/${t}/edit/${n}`,COMMUNITY_USERS_SEGMENT:(e,t)=>`${mi.ORGANIZATION({organizationId:e})}/community/users/${t}`,COMMUNITY_USERS_USER:(e,t,n)=>`${mi.ORGANIZATION({organizationId:e})}/community/users/${t}/user/${n}`,COMMUNITY_USERS_USER_INFORMATIONS:(e,t,n)=>`${mi.ORGANIZATION({organizationId:e})}/community/users/${t}/user/${n}/${ii.INFORMATION}`,COMMUNITY_USERS_DUPLICATES:e=>`${mi.ORGANIZATION({organizationId:e})}/community/users-duplicates`,COMMUNITY_EDIT_USER:(e,t)=>`${mi.ORGANIZATION({organizationId:e})}/community/user/${t}/edit`,COMMUNITY_EDIT_USER_FORM:(e,t,n)=>`${mi.ORGANIZATION({organizationId:e})}/community/user/${t}/edit/form/${n}`,COMMUNITY_VOLUNTEERS_IMPORT:e=>`${mi.ORGANIZATION({organizationId:e})}/community/import`,COMMUNITY_FILES_IMPORT:e=>`${mi.ORGANIZATION({organizationId:e})}/community/documents-import`,COMMUNITY_DELEGATIONS:e=>`${mi.ORGANIZATION({organizationId:e})}/community/delegations`,COMMUNITY_DELEGATIONS_SEGMENT:(e,t)=>`${mi.ORGANIZATION({organizationId:e})}/community/delegations/${t}`,COMMUNITY_DELEGATION:(e,t)=>`${mi.ORGANIZATION({organizationId:e})}/community/delegation/${t}`,COMMUNITY_CREATE_DELEGATION(e,t){let n=`${mi.ORGANIZATION({organizationId:e})}/community/create-delegation`;return t&&(n=`${n}/${t}`),n},COMMUNITY_EDIT_DELEGATION:(e,t)=>`${mi.ORGANIZATION({organizationId:e})}/community/delegation/${t}/edit`,COMMUNITY_EDIT_USER_DELEGATION:(e,t,n)=>`${mi.ORGANIZATION({organizationId:e})}/community/delegation/${t}user/${n}/edit`,COMMUNITY_EDIT_USER_DELEGATION_FORM:(e,t,n,i)=>`${mi.ORGANIZATION({organizationId:e})}/community/delegation/${t}/user/${n}/edit/form/${i}`,CREATE_EVENT_WITH_ORGANIZATION:"/create-event",CREATE_EVENT:e=>`${mi.ORGANIZATION({organizationId:e})}/create-event`,EVENTS_SEGMENT:(e,t)=>`${mi.ORGANIZATION({organizationId:e})}/events/${t}`,EVENT_DELEGATIONS_IMPORT:(e,t)=>`${Pi.EVENT({organizationId:e,eventId:t})}/delegations-import`,EVENT_VOLUNTEERS_IMPORT:(e,t)=>`${Pi.EVENT({organizationId:e,eventId:t})}/members-import`,EVENT_FILES_IMPORT:(e,t)=>`${Pi.EVENT({organizationId:e,eventId:t})}/documents-import`,EDIT_EVENT:(e,t)=>`${Pi.EVENT({organizationId:e,eventId:t})}/edit`,DASHBOARD:wo,DASHBOARD_EVENT_SWITCH:(e,t)=>`${wo(e,t)}/event-switch`,POSITION_MEMBERS_USER:(e,t,n,i,o)=>`${ao.POSITION_MEMBERS({organizationId:e,eventId:t,positionCategoryId:n,positionId:i})}/${o}`,POSITION_MEMBERS_USER_INFORMATIONS:(e,t,n,i,o)=>`${ao.POSITION_MEMBERS({organizationId:e,eventId:t,positionCategoryId:n,positionId:i})}/${o}/${ii.INFORMATION}`,EXPORT_POSITIONS_MAP:(e,t)=>`/export/event/${e}/positions/${t}/map`,POSITIONS_SEARCH:(e,t)=>`${ao.POSITIONS({organizationId:e,eventId:t})}/search`,POSITIONS_SEGMENT:(e,t,n)=>`${ao.POSITIONS({organizationId:e,eventId:t})}/${n}`,CREATE_POSITION(e,t,n){let i=`${Pi.EVENT({organizationId:e,eventId:t})}/create-position`;return n&&(i=`${i}/${n}`),i},POSITION_MAP:(e,t)=>`/position/${e}-${t}/map`,POSITION_SETTINGS:(e,t,n)=>`${ao.POSITION({organizationId:e,eventId:t,positionId:n})}/settings`,EDIT_POSITION:(e,t,n)=>`${ao.POSITION({organizationId:e,eventId:t,positionId:n})}/edit`,POSITION_SLOT_ASSIGN_VOLUNTEERS:(e,t,n,i)=>`${ao.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/assign-volunteers`,POSITION_SLOT_ASSIGN_VOLUNTEERS_USER:fo,POSITION_SLOT_ASSIGN_VOLUNTEERS_USER_INFORMATIONS:(e,t,n,i,o)=>`${fo(e,t,n,i,o)}/${ii.INFORMATION}`,POSITION_SLOT_MEMBERS:po,POSITION_SLOT_MEMBERS_USER:(e,t,n,i,o)=>`${po(e,t,n,i)}/${o}`,POSITION_SLOT_MEMBERS_USER_INFORMATIONS:(e,t,n,i,o)=>`${po(e,t,n,i)}/${o}/${ii.INFORMATION}`,POSITION_SLOT_MEMBERS_CHECK_OPTIONS:(e,t,n,i)=>`${po(e,t,n,i)}/check-options`,POSITION_SLOT_CHECK_MEMBERS_CHECK_IN:(e,t,n,i)=>`${go(e,t,n,i)}/check-in`,POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT:(e,t,n,i)=>`${go(e,t,n,i)}/check-out`,POSITION_SLOT_CHECK_MEMBERS_RESET:(e,t,n,i)=>`${go(e,t,n,i)}/reset`,VOLUNTEERS:xo,VOLUNTEERS_SEARCH:_o,VOLUNTEERS_SEARCH_USER:Io,VOLUNTEERS_SEARCH_USER_INFORMATIONS:(e,t,n)=>`${Io(e,t,n)}/${ii.INFORMATION}`,VOLUNTEERS_SEGMENT:(e,t,n)=>`${xo(e,t)}/${n}`,VOLUNTEERS_LIST_USER:bo,VOLUNTEERS_LIST_USER_INFORMATIONS:(e,t,n,i)=>`${bo(e,t,n,i)}/${ii.INFORMATION}`,VOLUNTEERS_LIST_USER_PANEL:jo,VOLUNTEERS_LIST_USER_PANEL_ACCREDITATIONS:(e,t,n,i)=>`${jo(e,t,n,i)}/accreditations`,VOLUNTEERS_LIST_USER_PANEL_AVAILABILITIES:(e,t,n,i)=>`${jo(e,t,n,i)}/availabilities`,VOLUNTEERS_LIST_USER_PANEL_POSITIONS:(e,t,n,i)=>`${jo(e,t,n,i)}/positions`,VOLUNTEERS_LIST_USER_PANEL_TEAM:(e,t,n,i,o)=>`${jo(e,t,n,i)}/team/${o}`,EDIT_USER:(e,t,n)=>`${Pi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit`,EDIT_USER_FORM:(e,t,n,i)=>`${Pi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit/form/${i}`,EDIT_USER_MISSIONS:(e,t,n)=>`${Pi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-missions`,EDIT_USER_MISSIONS_FORM:(e,t,n,i)=>`${Pi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-missions/form/${i}`,EDIT_USER_SLOTS:(e,t,n)=>`${Pi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-slots`,EDIT_USER_SLOTS_FORM:(e,t,n,i)=>`${Pi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-slots/form/${i}`,EDIT_USER_ACCREDITATIONS:(e,t,n)=>`${Pi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-accreditations`,EDIT_USER_ACCREDITATIONS_FORM:(e,t,n,i)=>`${Pi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-accreditations/form/${i}`,ASSIGNMENTS:(e,t)=>`${Pi.EVENT({organizationId:e,eventId:t})}/assignments`,ASSIGNMENT:(e,t,n)=>`${Pi.EVENT({organizationId:e,eventId:t})}/assignment/${n}`,EDIT_ASSIGNMENT:(e,t,n)=>`${Pi.EVENT({organizationId:e,eventId:t})}/edit-assignment/${n}`,TEAM_ASSIGNMENT:(e,t,n)=>`${Pi.EVENT({organizationId:e,eventId:t})}/team-assignment/${n}`,PRE_ASSIGNMENT:(e,t,n)=>`${Pi.EVENT({organizationId:e,eventId:t})}/pre-assignment/${n}`,ACCREDITATIONS_ASSIGNMENTS:(e,t)=>`${Pi.EVENT({organizationId:e,eventId:t})}/accreditations-assignments`,ACCREDIT:(e,t,n)=>`${Pi.EVENT({organizationId:e,eventId:t})}/accredit/${n}`,EDIT_ACCREDIT:(e,t,n)=>`${Pi.EVENT({organizationId:e,eventId:t})}/edit-accredit/${n}`,EVENT_EMAILS:Co,EVENT_EMAILS_PARAMETERS:(e,t)=>`${Co(e,t)}/parameters`,EDIT_CUSTOM_DOCUMENT:(e,t,n)=>`${Pi.EVENT({organizationId:e,eventId:t})}/custom-document/${n}/edit`,INTEGRATION:yo,INTEGRATION_LINKS:(e,t)=>`${yo(e,t)}/links`,INTEGRATION_FIELDS:(e,t)=>`${yo(e,t)}/fields`,INTEGRATION_PARAMETERS:(e,t)=>`${yo(e,t)}/parameters`,INTEGRATION_DESIGN:(e,t)=>`${yo(e,t)}/design`,DOCUMENTS:ko,DOCUMENTS_USER_PLANNING:(e,t,n)=>`${ko(e,t)}/user-planning/${n}`,DOCUMENTS_USER_PLANNING_LIST:(e,t,n)=>`${ko(e,t)}/user-planning-list/${n}`,DOCUMENTS_USER_PLANNING_DAYS:(e,t,n)=>`${ko(e,t)}/user-planning-days/${n}`,DOCUMENTS_ASSIGNMENTS:(e,t,n)=>`${ko(e,t)}/assignments/${n}`,DOCUMENTS_VOLUNTEERS_LISTING:(e,t,n)=>`${ko(e,t)}/volunteers-listing/${n}`,DOCUMENTS_BADGE:(e,t,n,i)=>`${ko(e,t)}/user/${n}/badge/${i}`,DOCUMENTS_CERTIFICATE:(e,t,n)=>`${ko(e,t)}/user/${n}/certificate`,DOCUMENTS_HOURS:(e,t,n)=>`${ko(e,t)}/user/${n}/hours`,DOCUMENTS_POSITION_PLANNING:(e,t,n)=>`${ko(e,t)}/position-planning/${n}`,DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING:(e,t,n)=>`${ko(e,t)}/positions-volunteers-planning/${n}`,DOCUMENTS_POSITION:(e,t,n)=>`${ko(e,t)}/position/${n}`,DOCUMENTS_PLANNING:(e,t,n)=>`${ko(e,t)}/planning/${n}`,DOCUMENTS_USER_CUSTOM_DOCUMENT:(e,t,n,i)=>`${ko(e,t)}/user/${n}/custom-document/${i}`,DOCUMENTS_USERS_PICTURES:(e,t,n)=>`${ko(e,t)}/users-pictures/${n}`,OPTIONS:Ao,OPTIONS_API:(e,t)=>`${Ao(e,t)}/api`,OPTIONS_WEEZEVENT_V2:(e,t)=>`${Ao(e,t)}/weezevent-v2`,ACCREDITATIONS_SEGMENT:(e,t,n)=>`${Hi.ACCREDITATIONS({organizationId:e,eventId:t})}/${n}`,CREATE_ACCREDITATION(e,t,n){let i=`${Pi.EVENT({organizationId:e,eventId:t})}/create-accreditation`;return n&&(i=`${i}/${n}`),i},EDIT_ACCREDITATION:(e,t,n)=>`${Hi.ACCREDITATION({organizationId:e,eventId:t,accreditationId:n})}/edit`,ACCREDITATION_MAP:(e,t)=>`/accreditation/${e}-${t}/map`,DELEGATIONS_SEGMENT:(e,t,n)=>`${to.DELEGATIONS({organizationId:e,eventId:t})}/${n}`,CREATE_DELEGATION(e,t,n){let i=`${Pi.EVENT({organizationId:e,eventId:t})}/create-delegation`;return n&&(i=`${i}/${n}`),i},EDIT_DELEGATION:(e,t,n)=>`${to.DELEGATION({organizationId:e,eventId:t,delegationId:n})}/edit`,EDIT_USER_DELEGATION:(e,t,n,i)=>`${to.DELEGATION({organizationId:e,eventId:t,delegationId:n})}/user/${i}/edit`,EDIT_USER_DELEGATION_FORM:(e,t,n,i,o)=>`${to.DELEGATION({organizationId:e,eventId:t,delegationId:n})}/user/${i}/edit/form/${o}`},Eo=(e,t)=>`/volunteers/${e}-${t}`,To=(e,t)=>`${Eo(e,t)}/assignments`,zo=(e,t)=>`${Eo(e,t)}/register`,$o=To;var Oo=n(1343);const Ro={AccreditationChartFragment:{code:"fragment AccreditationChart on Accreditation {\n    id\n    name\n    hasSlots\n    willAutoAccredit\n\n    slots(includeHidden: true) {\n        date\n        name\n        assignedResources\n        delegationsTotalResources\n        maxResources\n        scannedResources\n        wishedResources\n    }\n}\n",fragments:[]},AccreditationEmailFragment:{code:"fragment AccreditationEmail on AccreditationsUsersInfo {\n    accreditationCategory {\n        name\n    }\n\n    accreditation {\n        id\n        eventId\n        name\n        description\n        address\n        latitude\n        longitude\n    }\n\n    accreditationSlot {\n        name\n        date\n    }\n}\n",fragments:[]},AccreditationImportFragment:{code:"fragment AccreditationImport on Accreditation {\n    id\n    name\n\n    slots(includeHidden: true) {\n        id\n        name\n        date\n    }\n}\n",fragments:[]},AccreditationSlotMatrixFragment:{code:"fragment AccreditationSlotMatrix on AccreditationsSlot {\n    id\n    name\n    date\n\n    accreditation {\n        id\n        acronym\n        color\n        name\n        index\n    }\n\n    accreditationCategory {\n        name\n    }\n}\n",fragments:[]},AccreditationSlotVolunteerRegistrationFragment:{code:"fragment AccreditationSlotVolunteerRegistration on AccreditationsSlot {\n    id\n    accreditationId\n    name\n    date\n    isBlocked\n\n    accreditation {\n        id\n        accreditationCategoryId\n        acronym\n        name\n        color\n        icon\n        hiddenSlotId\n        hasSlots\n        index\n    }\n\n    accreditationCategory {\n        id\n        name\n    }\n}\n",fragments:[]},AccreditationsAccreditationFragment:{code:"fragment AccreditationsAccreditation on Accreditation {\n    id\n    name\n    address\n    latitude\n    longitude\n    acronym\n    icon\n    color\n    fillingRate\n    maxResources\n    assignedResources\n    willAutoAccredit\n    weezeventIsSynchronized\n    fields\n    index\n    insertedAt\n\n    accreditationCategory {\n        id\n        name\n    }\n\n    accreditationsCustomFields @include(if: $includeConditions) {\n        ...AccreditationsAccreditationCustomField\n    }\n\n    createdBy @include(if: $includeCreatedBy) {\n        email\n        name\n    }\n\n    tags @include(if: $includeTags) {\n        id\n        name\n    }\n}\n",fragments:["AccreditationsAccreditationCustomFieldFragment"]},AccreditationsAccreditationCustomFieldFragment:{code:"fragment AccreditationsAccreditationCustomField on AccreditationsCustomField {\n    conditionValue\n\n    customField {\n        name\n        fieldType\n\n        values {\n            id\n            value\n        }\n    }\n}\n",fragments:[]},AccreditationsAccreditationSlotFragment:{code:"fragment AccreditationsAccreditationSlot on AccreditationsSlot {\n    id\n    name\n    date\n    maxResources\n    assignedResources\n    fillingRate\n    isHidden\n    insertedAt\n    weezeventChecklistId\n\n    accreditation {\n        id\n        name\n        address\n        latitude\n        longitude\n        acronym\n        icon\n        color\n        fields\n\n        accreditationsCustomFields @include(if: $includeConditions) {\n            ...AccreditationsAccreditationCustomField\n        }\n\n        createdBy @include(if: $includeCreatedBy) {\n            email\n            name\n        }\n\n        tags @include(if: $includeTags) {\n            id\n            name\n        }\n    }\n\n    accreditationCategory {\n        id\n        name\n    }\n}\n",fragments:["AccreditationsAccreditationCustomFieldFragment"]},AccreditationsSlotFragment:{code:"fragment AccreditationsSlot on AccreditationsSlot {\n    id\n    accreditationCategoryId\n    accreditationId\n    eventId\n    name\n    date\n    assignedResources\n    wishedResources\n    maxResources\n    isBlocked\n\n    accreditation {\n        id\n        accreditationCategoryId\n        eventId\n        acronym\n        name\n        color\n        icon\n        hasSlots\n        accreditationDisplay\n        hiddenSlotId\n        index\n    }\n\n    accreditationCategory {\n        id\n        name\n    }\n}\n",fragments:[]},AssigmentEmailFragment:{code:"fragment AssigmentEmail on PositionsSlotsUsersInfo {\n    id\n\n    position {\n        id\n        eventId\n        name\n        description\n        acronym\n        color\n        address\n        latitude\n        longitude\n        zoom\n        range\n        layer\n        fields\n\n        leaders {\n            ...LeaderAssignment\n        }\n\n        category {\n            id\n            name\n\n            leaders {\n                ...LeaderAssignment\n            }\n        }\n\n        tags {\n            name\n        }\n    }\n\n    positionSlot {\n        id\n        name\n        range\n    }\n}\n",fragments:["LeaderAssignmentFragment"]},AttachCustomFieldFragment:{code:"fragment AttachCustomField on CustomField {\n    ...CustomFieldWithCondition\n\n    category {\n        id\n        name\n    }\n}\n",fragments:["CustomFieldWithConditionFragment"]},CampaignEditFragment:{code:"fragment CampaignEdit on Campaign {\n    name\n    state\n    campaignType\n    sender\n    text\n    subject\n    html\n    replyTo\n    sendToEveryone\n    states\n    positionsCategoriesIds\n    positionsIds\n    positionsSlotsIds\n    tagsIds\n    accreditationsCategoriesIds\n    accreditationsIds\n    accreditationsSlotsIds\n    usersInfosIds\n    segmentsIds\n    scheduledAt\n    emailSenderId\n    attachments\n    hasCalendarInvite\n    calendarInviteName\n    calendarInviteStartDate\n    calendarInviteStartTime\n    calendarInviteEndDate\n    calendarInviteEndTime\n\n    documents {\n        acl\n        key\n        name\n        size\n    }\n}\n",fragments:[]},CampaignEmailRendererFragment:{code:"fragment CampaignEmailRenderer on Campaign {\n    subject\n    text\n    html\n    replyTo\n    attachments\n    hasCalendarInvite\n    calendarInviteName\n    calendarInviteStartDate\n    calendarInviteStartTime\n    calendarInviteEndDate\n    calendarInviteEndTime\n\n    documents {\n        name\n        key\n    }\n}\n",fragments:[]},CampaignListFragment:{code:"fragment CampaignList on Campaign {\n    id\n    name\n    campaignType\n    state\n    numberOfRecipients\n    cost\n    sentAt\n    scheduledAt\n\n    createdBy {\n        nameOrEmail\n    }\n}\n",fragments:[]},CampaignUserInfoFragment:{code:'fragment CampaignUserInfo on UsersInfo {\n    id\n    name\n    email\n    picture {\n        url\n    }\n    phone: fieldValue(slug: "phone")\n}\n',fragments:[]},CommentFragment:{code:"fragment Comment on Comment {\n    id\n    content\n    insertedAt\n\n    event {\n        name\n    }\n\n    writtenBy {\n        email\n\n        userInfo(organizationId: $organizationId) {\n            name\n            nameOrEmail\n            picture {\n                url\n            }\n        }\n    }\n}\n",fragments:[]},ConditionCustomFieldFragment:{code:"fragment ConditionCustomField on CustomField {\n    id\n    name\n    slug\n    fieldType\n\n    values {\n        id\n        value\n    }\n}\n",fragments:[]},ConditionsCustomFieldsFragment:{code:"fragment ConditionsCustomFields on Organization {\n    conditionsCustomFields: customFields(\n        variety: UserInfo\n        privacy: All\n        fieldTypes: [Checkbox, Select]\n        sort: { attribute: Name, direction: Asc }\n    ) {\n        nodes {\n            ...ConditionCustomField\n        }\n    }\n}\n",fragments:["ConditionCustomFieldFragment"]},CreateAccreditationEventFragment:{code:"fragment CreateAccreditationEvent on Event {\n    startAt\n    endAt\n    layer\n    isWeezeventConnected\n\n    accreditationsCategories {\n        id\n        name\n    }\n}\n",fragments:[]},CreateCampaignEmailSenderFragment:{code:"fragment CreateCampaignEmailSender on EmailsSender {\n    id\n    name\n    isValidToSendEmail\n}\n",fragments:[]},CreateCustomFieldInfosFragment:{code:"fragment CreateCustomFieldInfos on Organization {\n    customFields(\n        variety: UserInfo\n        privacy: All\n        fieldTypes: [Checkbox, Country, Language, Nationality, Select]\n    ) {\n        nodes {\n            id\n            name\n            label\n            fieldProperty\n            fieldType\n\n            values {\n                id\n                value\n            }\n        }\n    }\n\n    customFieldsCategories {\n        nodes {\n            id\n            name\n        }\n    }\n}\n",fragments:[]},CreateDelegationEventFragment:{code:"fragment CreateDelegationEvent on Event {\n    startAt\n    endAt\n\n    campaigns(states: [Template]) {\n        nodes {\n            id\n            name\n        }\n    }\n\n    customDocuments {\n        slug\n        name\n    }\n\n    forms {\n        nodes {\n            ...CreateDelegationForm\n        }\n    }\n\n    ...EventAccreditations\n}\n",fragments:["CreateDelegationFormFragment","EventAccreditationsFragment"]},CreateDelegationFormFragment:{code:"fragment CreateDelegationForm on Form {\n    id\n    name\n}\n",fragments:[]},CreatePositionEventFragment:{code:"fragment CreatePositionEvent on Event {\n    startAt\n    endAt\n    layer\n    latitude\n    longitude\n\n    positionsCategories(scoped: true) {\n        id\n        name\n    }\n\n    traces {\n        ...Trace\n    }\n}\n",fragments:["TraceFragment"]},CreatePositionTagsFragment:{code:"fragment CreatePositionTags on Organization {\n    tags {\n        nodes {\n            id\n            name\n        }\n    }\n}\n",fragments:[]},CreateUpdateEventInfosFragment:{code:"fragment CreateUpdateEventInfos on Organization {\n    name\n    weezeventOrganizationId\n\n    eventCustomFields: customFields(variety: Event) {\n        nodes {\n            ...AttachCustomField\n        }\n    }\n\n    emailsSenders {\n        id\n        name\n    }\n\n    tags {\n        nodes {\n            id\n            name\n        }\n    }\n}\n",fragments:["AttachCustomFieldFragment"]},CreateUpdateMemberFormFragment:{code:"fragment CreateUpdateMemberForm on Form {\n    id\n    name\n    description\n    daysDisplay\n    positionTitle\n    positionSubtitle\n    slotTitle\n    slotSubtitle\n    accreditationTitle\n    accreditationSubtitle\n    informationTitle\n    registerButtonText\n\n    ...FormMissionsOptions\n    ...FormAccreditationsOptions\n\n    elements {\n        ...FormElementDisplay\n    }\n\n    customSlotsPeriods {\n        ...FormRegisterCustomSlotPeriod\n    }\n}\n",fragments:["FormMissionsOptionsFragment","FormAccreditationsOptionsFragment","FormElementDisplayFragment","FormRegisterCustomSlotPeriodFragment"]},CreatedByFragment:{code:"fragment CreatedBy on UsersInfo {\n    name\n    email\n    picture {\n        url\n    }\n}\n",fragments:[]},CustomBadgeVolunteerRegistrationFragment:{code:'fragment CustomBadgeVolunteerRegistration on VolunteersRegistration {\n    localId\n    state\n    isLeader\n    utid\n    ticketId\n    weezevent\n\n    userInfo {\n        id\n        email\n        name\n        fields(expand: true)\n        registrationDate(eventId: $eventId)\n\n        links(eventId: $eventId) {\n            ...UserInfoLinks\n        }\n\n        formsUsersInfos(eventId: $eventId, level: Event) {\n            formId\n\n            slots {\n                range\n            }\n        }\n    }\n\n    delegation {\n        name\n\n        leaders {\n            name\n            firstName: fieldValue(slug: "firstName")\n            lastName: fieldValue(slug: "lastName")\n            phone: fieldValue(slug: "phone")\n        }\n    }\n\n    accreditationsUsersInfos {\n        accreditation {\n            id\n            name\n            acronym\n            color\n            icon\n        }\n\n        accreditationSlot {\n            id\n            name\n            date\n        }\n\n        accreditationCategory {\n            id\n            name\n        }\n    }\n\n    positionsSlotsUsersInfos {\n        ...AssigmentEmail\n    }\n}\n',fragments:["UserInfoLinksFragment","AssigmentEmailFragment"]},CustomDocumentPopulationFragment:{code:"fragment CustomDocumentPopulation on CustomDocument {\n    slug\n    name\n    populationsIds\n}\n",fragments:[]},CustomFieldFragment:{code:"fragment CustomField on CustomField {\n    id\n    slug\n    name\n    label\n    variety\n    fieldProperty\n    fieldType\n    isPrivate\n    hasCondition\n    conditionCustomFieldId\n    dependencies\n    numberOfTimesUsed\n    canDelete\n    isSelectV2\n    insertedAt\n\n    category {\n        id\n        name\n    }\n\n    conditionCustomField {\n        name\n    }\n\n    createdBy {\n        id\n        name\n        email\n\n        picture {\n            url\n        }\n    }\n\n    values {\n        value\n    }\n}\n",fragments:[]},CustomFieldImportFragment:{code:"fragment CustomFieldImport on CustomField {\n    id\n    name\n    slug\n    customFieldCategoryId\n    customFieldCategoryName\n    fieldType\n    fieldProperty\n    canSelectMultiple\n\n    values {\n        id\n        value\n    }\n}\n",fragments:[]},CustomFieldWithConditionFragment:{code:"fragment CustomFieldWithCondition on CustomField {\n    id\n    name\n    label\n    description\n    fieldType\n    fieldProperty\n    isPrivate\n    hasCondition\n    conditionValue\n    canSelectMultiple\n    slug\n    isSelectV2\n\n    conditionCustomField {\n        id\n        name\n        fieldType\n        fieldProperty\n        canSelectMultiple\n        slug\n    }\n\n    document {\n        url\n        name\n    }\n\n    values {\n        id\n        value\n    }\n}\n",fragments:[]},DelegationAccreditationSlotFragment:{code:"fragment DelegationAccreditationSlot on DelegationAccreditationSlot {\n    accreditationCategoryId\n    accreditationId\n    accreditationSlotId\n    isDefault\n    isFull\n    isVisible\n\n    accreditationSlot {\n        date\n        isBlocked\n        isFull\n    }\n}\n",fragments:[]},DelegationAccreditationSlotStatsFragment:{code:"fragment DelegationAccreditationSlotStats on DelegationAccreditationSlot {\n    accreditationSlotId\n    accreditationId\n    assignedResources\n    maxResources\n    scannedResources\n    wishedResources\n}\n",fragments:[]},DelegationAccreditationsSlotsFragment:{code:"fragment DelegationAccreditationsSlots on Delegation {\n    accreditationsSlots {\n        accreditationId\n        accreditationSlotId\n        maxResources\n        assignedResources\n        isDefault\n        isVisible\n\n        accreditationSlot {\n            id\n            name\n            date\n            isHidden\n            accreditation {\n                id\n                name\n            }\n            accreditationCategoryId\n        }\n    }\n}\n",fragments:[]},DelegationUserProfileFragment:{code:"fragment DelegationUserProfile on Delegation {\n    id\n    name\n    event {\n        id\n        name\n    }\n}\n",fragments:[]},DelegationsDelegationFragment:{code:"fragment DelegationsDelegation on Delegation {\n    id\n    organizationId\n    eventId\n    name\n    state\n    deadlineDate\n    numberOfResources @include(if: $includeResources)\n    maxResources\n    fillingRate @include(if: $includeResources)\n    showInDelegationSpace\n    fields\n    canLeadersAddMembers\n    canLeadersEditMembers\n    canLeadersDeleteMembers\n    canLeadersEditColumns\n    canLeadersEditCustomFields\n    canLeadersImportMembers\n    canLeadersSeeHiddenAccreditationsSlots\n    showFormLinkInDelegationSpace\n    lockedAt\n    usedCustomFieldsFilled @include(if: $includeUsedCustomFieldsFilled)\n    insertedAt\n\n    campaigns @include(if: $includeCampaigns) {\n        id\n        name\n    }\n\n    children @include(if: $includeChildren) {\n        event {\n            id\n            name\n        }\n    }\n\n    customDocuments @include(if: $includeDocuments) {\n        slug\n        name\n    }\n\n    delegationCategory {\n        id\n        name\n    }\n\n    createdBy @include(if: $includeCreatedBy) {\n        email\n        name\n    }\n\n    form {\n        id\n        name\n    }\n\n    tags @include(if: $includeTags) {\n        id\n        name\n    }\n\n    leaders @include(if: $includeLeaders) {\n        id\n        email\n        name\n        nameOrEmail\n    }\n\n    accreditationsSlots @include(if: $includeAccreditationsSlots) {\n        ...DelegationAccreditationSlotStats\n    }\n}\n",fragments:["DelegationAccreditationSlotStatsFragment"]},DocumentEmailPreviewFragment:{code:"fragment DocumentEmailPreview on Document {\n    id\n    acl\n    key\n    name\n    size\n    url\n}\n",fragments:[]},DocumentPositionPlanningFragment:{code:'fragment DocumentPositionPlanning on Event {\n    position(id: $positionId) {\n        name\n        range\n\n        slots {\n            id\n            range\n        }\n    }\n\n    volunteersRegistrations(positionId: $positionId, sort: { attribute: "Name", direction: Asc }) {\n        nodes {\n            id\n\n            userInfo {\n                email\n                name\n                picture {\n                    url\n                }\n            }\n\n            slots {\n                range\n            }\n\n            positionsSlotsUsersInfos {\n                positionSlotId\n                positionSlot {\n                    range\n                }\n            }\n        }\n    }\n}\n',fragments:[]},DocumentPositionSheetFragment:{code:"fragment DocumentPositionSheet on Query {\n    organization(id: $organizationId) {\n        customFields(variety: UserInfo) {\n            nodes {\n                ...CustomFieldWithCondition\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        document(documentType: Position) {\n            id\n            options\n        }\n\n        position(id: $positionId) {\n            ...PositionPdfInfos\n\n            slots {\n                id\n                name\n                range\n            }\n        }\n\n        volunteersRegistrations(states: [Assigned], positionId: $positionId) {\n            nodes {\n                ...VolunteerPdf\n\n                positionsSlotsUsersInfos {\n                    positionSlotId\n                }\n            }\n        }\n    }\n}\n",fragments:["CustomFieldWithConditionFragment","PositionPdfInfosFragment","VolunteerPdfFragment"]},DocumentPositionsPlanningFragment:{code:"fragment DocumentPositionsPlanning on Event {\n    name\n\n    positionsSlots(segmentId: $segmentId, date: $date) {\n        nodes {\n            id\n            positionId\n            name\n            range\n\n            position {\n                id\n                name\n                color\n            }\n        }\n    }\n\n    segment(id: $segmentId) {\n        name\n    }\n}\n",fragments:[]},DocumentPositionsVolunteersPlanningFragment:{code:"fragment DocumentPositionsVolunteersPlanning on Event {\n    name\n\n    positionsSlots(segmentId: $segmentId) {\n        nodes {\n            id\n            range\n\n            position {\n                id\n                name\n                acronym\n            }\n        }\n    }\n\n    segment(id: $segmentId) {\n        name\n    }\n\n    volunteersRegistrations(states: [Assigned]) {\n        nodes {\n            id\n\n            userInfo {\n                email\n                name\n                picture {\n                    url\n                }\n            }\n\n            positionsSlotsUsersInfos {\n                positionSlotId\n            }\n        }\n    }\n}\n",fragments:[]},DocumentUserAssignmentsFragment:{code:"fragment DocumentUserAssignments on Query {\n    organization(id: $organizationId) {\n        id\n\n        customFields(variety: Position, privacy: Public) {\n            nodes {\n                ...CustomFieldWithCondition\n            }\n        }\n\n        userInfo(id: $userInfoId) {\n            ...UserInfoDocument\n        }\n    }\n\n    event(id: $eventId) {\n        id\n        name\n\n        document(documentType: Assignments) {\n            id\n            options\n            title\n            informationsTitle\n            informationsContent\n            informations2Title\n            informations2Content\n            signature\n        }\n\n        volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n            id\n            localId\n            ticketId\n            weezevent\n\n            preassignPositions {\n                name\n            }\n\n            preassignPositionsCategories {\n                name\n            }\n\n            positionsSlotsUsersInfos {\n                ...AssigmentEmail\n            }\n        }\n    }\n}\n",fragments:["CustomFieldWithConditionFragment","UserInfoDocumentFragment","AssigmentEmailFragment"]},DocumentUserBadgeFragment:{code:'fragment DocumentUserBadge on Event {\n    document(documentType: Badge) {\n        id\n        options\n    }\n\n    volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n        userInfo {\n            name\n            email\n            nameOrEmail\n            language: fieldValue(slug: "language")\n\n            links(eventId: $eventId) {\n                userBadgeLink\n            }\n\n            picture {\n                url\n            }\n        }\n\n        positionsSlotsUsersInfos {\n            position {\n                name\n            }\n\n            positionSlot {\n                range\n            }\n        }\n    }\n}\n',fragments:[]},DocumentUserCertificateFragment:{code:'fragment DocumentUserCertificate on Event {\n    document(documentType: Certificate) {\n        id\n        options\n    }\n\n    volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n        userInfo {\n            nameOrEmail\n            name\n            dateOfBirth: fieldValue(slug: "dateOfBirth")\n            street: fieldValue(slug: "street")\n            city: fieldValue(slug: "city")\n            postalCode: fieldValue(slug: "postalCode")\n            language: fieldValue(slug: "language")\n\n            links(eventId: $eventId) {\n                userCertificateLink\n            }\n        }\n\n        positionsSlotsUsersInfos {\n            position {\n                name\n            }\n\n            positionSlot {\n                range\n            }\n        }\n    }\n}\n',fragments:[]},DocumentUserCustomBadgeFragment:{code:"fragment DocumentUserCustomBadge on Event {\n    id\n    name\n    startAt\n    weezevent\n\n    tags {\n        name\n    }\n\n    document(documentType: CustomBadge, customBadge: $customBadge) {\n        id\n        options\n    }\n\n    volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n        ...CustomBadgeVolunteerRegistration\n    }\n}\n",fragments:["CustomBadgeVolunteerRegistrationFragment"]},DocumentUserCustomBadgesFragment:{code:"fragment DocumentUserCustomBadges on Event {\n    id\n    name\n    startAt\n    weezevent\n\n    tags {\n        name\n    }\n\n    document(documentType: CustomBadge, customBadge: $customBadge) {\n        id\n        options\n    }\n\n    volunteersRegistrations(segmentId: $segmentId) {\n        nodes {\n            ...CustomBadgeVolunteerRegistration\n        }\n    }\n}\n",fragments:["CustomBadgeVolunteerRegistrationFragment"]},DocumentUserPlanningFragment:{code:"fragment DocumentUserPlanning on Event {\n    startAt\n    endAt\n    dayStartTime\n\n    document(documentType: UserPlanning) {\n        id\n        options\n        title\n        informationsTitle\n        informationsContent\n        informations2Title\n        informations2Content\n        signature\n    }\n\n    volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n        id\n        localId\n        ticketId\n        weezevent\n\n        userInfo {\n            ...UserInfoDocument\n        }\n\n        positionsSlotsUsersInfos {\n            ...PsuiUserPlanning\n        }\n    }\n}\n",fragments:["UserInfoDocumentFragment","PsuiUserPlanningFragment"]},DocumentUserPlanningDaysFragment:{code:'fragment DocumentUserPlanningDays on Event {\n    document(documentType: UserPlanningDays) {\n        id\n        options\n    }\n\n    volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n        userInfo {\n            nameOrEmail\n            language: fieldValue(slug: "language")\n\n            links(eventId: $eventId) {\n                userPlanningDaysLink\n            }\n        }\n\n        positionsSlotsUsersInfos {\n            positionSlot {\n                range\n            }\n\n            position {\n                id\n                organizationId\n                name\n                address\n            }\n        }\n    }\n}\n',fragments:[]},DocumentUserPlanningListFragment:{code:'fragment DocumentUserPlanningList on Event {\n    document(documentType: UserPlanningList) {\n        id\n        options\n    }\n\n    volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n        userInfo {\n            nameOrEmail\n            language: fieldValue(slug: "language")\n\n            links(eventId: $eventId) {\n                userPlanningListLink\n            }\n        }\n\n        positionsSlotsUsersInfos {\n            positionSlot {\n                name\n                range\n            }\n\n            position {\n                name\n            }\n        }\n    }\n}\n',fragments:[]},DocumentUsersHoursFragment:{code:"fragment DocumentUsersHours on Event {\n    timeZone\n\n    document(documentType: UserHours) {\n        id\n        options\n        title\n        informationsTitle\n        informationsContent\n        informations2Title\n        informations2Content\n        signature\n    }\n\n    volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n        positionsSlotsUsersInfos {\n            ...PsuiUserHours\n        }\n\n        userInfo {\n            ...UserInfoDocument\n        }\n    }\n}\n",fragments:["PsuiUserHoursFragment","UserInfoDocumentFragment"]},DocumentUsersListingFragment:{code:"fragment DocumentUsersListing on Query {\n    organization(id: $organizationId) {\n        customFields(variety: UserInfo) {\n            nodes {\n                ...CustomFieldWithCondition\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        document(documentType: VolunteersListing) {\n            id\n            options\n            title\n            informationsTitle\n            informationsContent\n            informations2Title\n            informations2Content\n            signature\n        }\n\n        segment(id: $segmentId) {\n            name\n\n            links {\n                usersListingLink\n            }\n        }\n\n        volunteersRegistrations(segmentId: $segmentId) {\n            nodes {\n                ...VolunteerPdf\n            }\n        }\n    }\n}\n",fragments:["CustomFieldWithConditionFragment","VolunteerPdfFragment"]},DocumentUsersPicturesFragment:{code:'fragment DocumentUsersPictures on Query {\n    event(id: $eventId) {\n        document(documentType: UsersPictures) {\n            id\n            options\n            title\n            informationsTitle\n            informationsContent\n            informations2Title\n            informations2Content\n            signature\n        }\n\n        segment(id: $segmentId) {\n            name\n\n            links {\n                usersPicturesLink\n            }\n        }\n\n        volunteersRegistrations(\n            segmentId: $segmentId\n            sort: { attribute: "Name", direction: Asc }\n        ) {\n            nodes {\n                userInfo {\n                    id\n                    name\n                    email\n                    firstName: fieldValue(slug: "firstName")\n                    lastName: fieldValue(slug: "lastName")\n\n                    phone {\n                        internationalFormat\n                    }\n\n                    picture {\n                        url\n                    }\n                }\n            }\n        }\n    }\n}\n',fragments:[]},DocumentUsersPlanningFragment:{code:"fragment DocumentUsersPlanning on VolunteersRegistration {\n    id\n    state\n\n    userInfo {\n        id\n        email\n        name\n        picture {\n            url\n        }\n    }\n\n    positionsSlotsUsersInfos {\n        positionCategory {\n            name\n        }\n\n        positionSlot {\n            id\n            name\n            range\n        }\n\n        position {\n            id\n            name\n            color\n            icon\n        }\n    }\n\n    slots {\n        range\n    }\n}\n",fragments:[]},EditVolunteerRegistrationSlotFragment:{code:"fragment EditVolunteerRegistrationSlot on ISlot {\n    startDate\n    startTime\n    endDate\n    endTime\n}\n",fragments:[]},EmailRecipientFragment:{code:"fragment EmailRecipient on Email {\n    id\n    state\n    sentAt\n    infos\n\n    userInfo {\n        ...CampaignUserInfo\n    }\n}\n",fragments:["CampaignUserInfoFragment"]},EmailSenderEmailRendererFragment:{code:"fragment EmailSenderEmailRenderer on EmailsSender {\n    fromName\n    fromEmail\n    replyTo\n    signature\n\n    header {\n        key\n    }\n\n    picture {\n        key\n    }\n\n    footer {\n        key\n    }\n}\n",fragments:[]},EmailTemplateEmailRendererFragment:{code:"fragment EmailTemplateEmailRenderer on EmailsTemplate {\n    useDefault\n    subject\n    content\n    attachments\n}\n",fragments:[]},EventAccreditationsFragment:{code:"fragment EventAccreditations on Event {\n    accreditationsCategories {\n        id\n        name\n\n        accreditations {\n            id\n            accreditationCategoryId\n            name\n            color\n            icon\n            accreditationCategoryName\n            accreditationDisplay\n            hasSlots\n            hiddenSlotId\n            index\n\n            slots(includeHidden: true) {\n                id\n                accreditationId\n                name\n                date\n            }\n        }\n    }\n}\n",fragments:[]},EventEmailRendererFragment:{code:"fragment EventEmailRenderer on Event {\n    id\n    organizationId\n    name\n    languages\n    timeZone\n    startAt\n    endAt\n\n    customDocuments {\n        slug\n    }\n}\n",fragments:[]},EventPositionsExportFragment:{code:"fragment EventPositionsExport on Event {\n    languages\n\n    segmentsFolders(segmentType: Positions) {\n        id\n        name\n\n        segments {\n            id\n            name\n        }\n    }\n}\n",fragments:[]},EventVolunteersExportFragment:{code:"fragment EventVolunteersExport on Event {\n    languages\n\n    segmentsFolders(segmentType: Volunteers) {\n        id\n        name\n\n        segments {\n            id\n            name\n        }\n    }\n}\n",fragments:[]},EventsEventFragment:{code:"fragment EventsEvent on Event {\n    id\n    name\n    state\n    startAt\n    endAt\n    fields\n    numberOfMembers @include(if: $includeNumberOfMembers)\n    numberOfMembersAccredited @include(if: $includeNumberOfMembers)\n    numberOfMembersAssigned @include(if: $includeNumberOfMembers)\n\n    tags {\n        id\n        name\n    }\n}\n",fragments:[]},ExistingVolunteerFragment:{code:"fragment ExistingVolunteer on UsersInfo {\n    id\n    nameOrEmail\n    name\n    email\n    picture {\n        url\n    }\n}\n",fragments:[]},FormAccreditationsOptionsFragment:{code:"fragment FormAccreditationsOptions on Form {\n    accreditationDisplay\n    accreditationFilter\n    showFullAccreditation\n    hiddenAccreditationsCategoriesIds\n    hiddenAccreditationsIds\n    hiddenAccreditationsSlotsIds\n    displayedAccreditationsCategoriesIds\n    displayedAccreditationsIds\n    displayedAccreditationsSlotsIds\n    showAccreditationDescription\n    slotDisplay\n\n    accreditationsFormCustomFields {\n        accreditationsSlotsIds\n        isMandatory\n\n        customField {\n            ...CustomFieldWithCondition\n        }\n    }\n}\n",fragments:["CustomFieldWithConditionFragment"]},FormCustomFieldFragment:{code:"fragment FormCustomField on CustomField {\n    id\n    name\n    label\n    fieldType\n    fieldProperty\n\n    category {\n        id\n        name\n    }\n\n    conditionCustomField {\n        id\n        name\n    }\n\n    values {\n        id\n        value\n    }\n}\n",fragments:[]},FormCustomFieldsFragment:{code:"fragment FormCustomFields on Organization {\n    formCustomFields: customFields(\n        variety: UserInfo\n        privacy: Public\n        sort: { attribute: Name, direction: Asc }\n    ) {\n        nodes {\n            ...FormCustomField\n        }\n    }\n}\n",fragments:["FormCustomFieldFragment"]},FormElementDisplayFragment:{code:"fragment FormElementDisplay on FormsElement {\n    id\n    elementType\n    isMandatory\n    section\n    text\n    hasCondition\n    conditionValue\n\n    conditionCustomField {\n        ...CustomFieldWithCondition\n    }\n\n    customField {\n        ...CustomFieldWithCondition\n    }\n}\n",fragments:["CustomFieldWithConditionFragment"]},FormElementsElementFragment:{code:"fragment FormElementsElement on FormsElement {\n    id\n    elementType\n    customFieldId\n    section\n    text\n    isMandatory\n    hasCondition\n    conditionCustomFieldId\n    conditionValue\n}\n",fragments:[]},FormEmailFragment:{code:"fragment FormEmail on FormsUsersInfo {\n    teamCode\n\n    form {\n        id\n        areTeamsAllowed\n    }\n\n    ...WishesEmail\n}\n",fragments:["WishesEmailFragment"]},FormListFragment:{code:"fragment FormList on Form {\n    id\n    name\n    numberOfCustomFields\n}\n",fragments:[]},FormMemberRegistrationFragment:{code:"fragment FormMemberRegistration on Form {\n    id\n    name\n    isEditableInMemberSpace\n\n    elements {\n        id\n        ...FormElementDisplay\n    }\n\n    ...FormSlotsOptions\n    ...FormMissionsOptions\n    ...FormAccreditationsOptions\n\n    customSlotsPeriods {\n        ...FormRegisterCustomSlotPeriod\n    }\n}\n",fragments:["FormElementDisplayFragment","FormSlotsOptionsFragment","FormMissionsOptionsFragment","FormAccreditationsOptionsFragment","FormRegisterCustomSlotPeriodFragment"]},FormMissionsOptionsFragment:{code:"fragment FormMissionsOptions on Form {\n    positionDisplay\n    positionFilter\n    positionRanking\n    positionLimit\n    showFullPosition\n    hiddenPositionsCategoriesIds\n    hiddenPositionsIds\n    hiddenPositionsSlotsIds\n    displayedPositionsCategoriesIds\n    displayedPositionsIds\n    displayedPositionsSlotsIds\n    showPositionCategoryDescription\n    showPositionDescription\n    slotDisplay\n    willAutoAssign\n}\n",fragments:[]},FormRegisterAccreditationFragment:{code:"fragment FormRegisterAccreditation on IAccreditation {\n    id\n    name\n    description\n    color\n    icon\n    hiddenSlotId\n    hasSlots\n    accreditationDisplay\n    conditionsOperator\n    index\n\n    slots {\n        ...FormRegisterAccreditationSlot\n    }\n\n    conditionsCustomFields: accreditationsCustomFields {\n        conditionValue\n\n        customField {\n            slug\n            fieldType\n            canSelectMultiple\n        }\n    }\n\n    formCustomFields {\n        isMandatory\n\n        customField {\n            ...CustomFieldWithCondition\n        }\n    }\n}\n",fragments:["FormRegisterAccreditationSlotFragment","CustomFieldWithConditionFragment"]},FormRegisterAccreditationCategoryFragment:{code:"fragment FormRegisterAccreditationCategory on IAccreditationsCategory {\n    id\n    name\n\n    accreditations {\n        ...FormRegisterAccreditation\n    }\n}\n",fragments:["FormRegisterAccreditationFragment"]},FormRegisterAccreditationSlotFragment:{code:"fragment FormRegisterAccreditationSlot on IAccreditationsSlot {\n    id\n    name\n    date\n    isBlocked\n    isFull\n}\n",fragments:[]},FormRegisterCategoryFragment:{code:"fragment FormRegisterCategory on IPositionsCategory {\n    id\n    name\n    description\n\n    positions {\n        ...FormRegisterPosition\n    }\n}\n",fragments:["FormRegisterPositionFragment"]},FormRegisterCustomSlotFragment:{code:"fragment FormRegisterCustomSlot on CustomSlot {\n    name\n    startTime\n    endTime\n}\n",fragments:[]},FormRegisterCustomSlotPeriodFragment:{code:"fragment FormRegisterCustomSlotPeriod on CustomSlotsPeriod {\n    name\n    startDate\n    endDate\n    hideNameDates\n    displayAsCalendar\n\n    customSlots {\n        ...FormRegisterCustomSlot\n    }\n}\n",fragments:["FormRegisterCustomSlotFragment"]},FormRegisterPositionFragment:{code:"fragment FormRegisterPosition on IPosition {\n    id\n    name\n    description\n    isVisible\n    conditionsOperator\n\n    slots {\n        ...FormRegisterSlot\n    }\n\n    conditionsCustomFields: positionsCustomFields {\n        conditionValue\n\n        customField {\n            slug\n            fieldType\n            canSelectMultiple\n        }\n    }\n}\n",fragments:["FormRegisterSlotFragment"]},FormRegisterSlotFragment:{code:"fragment FormRegisterSlot on IPositionsSlot {\n    id\n    name\n    range\n    nameOrRange\n    isFull\n}\n",fragments:[]},FormSlotsOptionsFragment:{code:"fragment FormSlotsOptions on Form {\n    slotDisplay\n    daysDisplay\n    slotTitle\n    slotSubtitle\n}\n",fragments:[]},FormUserInfoUserProfileFragment:{code:"fragment FormUserInfoUserProfile on FormsUsersInfo {\n    organizationId\n    eventId\n    formId\n    insertedAt\n    teamCode\n\n    teamMembers {\n        ...UserInfoTeamMember\n    }\n}\n",fragments:["UserInfoTeamMemberFragment"]},FormUserInfoWishedFragment:{code:"fragment FormUserInfoWished on UsersInfo {\n    formUserInfo(formId: $formId) {\n        insertedAt\n        formId\n        positionsCategoriesIds\n        positionsIds\n        positionsSlotsIds\n        accreditationsSlotsIds\n\n        form {\n            ...FormMemberRegistration\n        }\n\n        accreditationsSlots {\n            name\n            date\n\n            accreditation {\n                id\n                name\n            }\n        }\n\n        positionsSlots {\n            nameOrRange\n\n            position {\n                id\n                name\n            }\n        }\n\n        positions {\n            id\n            name\n            range\n        }\n\n        positionsCategories {\n            id\n            name\n            range\n        }\n\n        slots {\n            startDate\n            startTime\n            endDate\n            endTime\n        }\n    }\n}\n",fragments:["FormMemberRegistrationFragment"]},FormUserOverlayFragment:{code:"fragment FormUserOverlay on Form {\n    id\n    name\n\n    elements {\n        ...FormElementDisplay\n    }\n}\n",fragments:["FormElementDisplayFragment"]},FormsUsersInfosWishedFragment:{code:"fragment FormsUsersInfosWished on UsersInfo {\n    formsUsersInfos(eventId: $eventId, level: Both) {\n        insertedAt\n        formId\n        eventId\n        positionsCategoriesIds\n        positionsIds\n        positionsSlotsIds\n        accreditationsSlotsIds\n\n        form {\n            ...FormMemberRegistration\n        }\n\n        accreditationsSlots {\n            name\n            date\n\n            accreditation {\n                id\n                name\n                index\n            }\n\n            accreditationCategory {\n                name\n            }\n        }\n\n        positionsSlots {\n            nameOrRange\n\n            position {\n                id\n                name\n            }\n        }\n\n        positions {\n            id\n            name\n            range\n        }\n\n        positionsCategories {\n            id\n            name\n            range\n        }\n\n        slots {\n            startDate\n            startTime\n            endDate\n            endTime\n            range\n        }\n    }\n}\n",fragments:["FormMemberRegistrationFragment"]},FullPageInfoFragment:{code:"fragment FullPageInfo on PageInfo {\n    hasNextPage\n    hasPreviousPage\n}\n",fragments:[]},LeaderAssignmentFragment:{code:'fragment LeaderAssignment on Leader {\n    userInfo {\n        id\n        name\n        email\n        firstName: fieldValue(slug: "firstName")\n        lastName: fieldValue(slug: "lastName")\n        phone: fieldValue(slug: "phone")\n    }\n}\n',fragments:[]},LeaderInfosFragment:{code:"fragment LeaderInfos on Leader {\n    role {\n        id\n        name\n    }\n\n    userInfo {\n        ...LeaderUserInfo\n    }\n}\n",fragments:["LeaderUserInfoFragment"]},LeaderUserInfoFragment:{code:"fragment LeaderUserInfo on UsersInfo {\n    id\n    userId\n    email\n    name\n    nameOrEmail\n    picture {\n        url\n    }\n    phone {\n        internationalFormat\n    }\n}\n",fragments:[]},MassEditCustomFieldFragment:{code:"fragment MassEditCustomField on CustomField {\n    id\n    name\n    label\n    slug\n    fieldType\n    fieldProperty\n    canSelectMultiple\n\n    values {\n        id\n        value\n    }\n}\n",fragments:[]},MemberAccreditationFragment:{code:"fragment MemberAccreditation on AccreditationsUsersInfo {\n    accreditationSlot {\n        name\n        date\n    }\n\n    accreditation {\n        name\n        description\n        acronym\n        hasSlots\n    }\n\n    accreditationCategory {\n        name\n    }\n}\n",fragments:[]},MemberAssignmentFragment:{code:"fragment MemberAssignment on PositionsSlotsUsersInfo {\n    position {\n        name\n        description\n        address\n        latitude\n        longitude\n        zoom\n        layer\n\n        leaders {\n            ...LeaderAssignment\n        }\n\n        category {\n            name\n\n            leaders {\n                ...LeaderAssignment\n            }\n        }\n\n        traces {\n            ...Trace\n        }\n    }\n\n    positionSlot {\n        range\n    }\n}\n",fragments:["LeaderAssignmentFragment","TraceFragment"]},MemberRegistrationUserInfoFragment:{code:"fragment MemberRegistrationUserInfo on UsersInfo {\n    id\n    userId\n    name\n    email\n    nameOrEmail\n    fields\n    picture {\n        url\n    }\n}\n",fragments:[]},OrganizationAdminInfosFragment:{code:"fragment OrganizationAdminInfos on Organization {\n    name\n    adminName\n    adminEmail\n    street\n    postalCode\n    city\n    country\n    timeZone\n    emailSenderId\n    dateFormat\n    datetimeFormat\n    timeFormat\n\n    emailsSenders {\n        id\n        name\n    }\n}\n",fragments:[]},OrganizationBackofficeFragment:{code:"fragment OrganizationBackoffice on Organization {\n    customBadges\n    features\n    id\n    insertedAt\n    isBlocked\n    name\n    numberOfEvents\n    periodEndAt\n    weezeventOrganizationId\n    useOldBilling\n    membersLimit\n    pricePerMember\n    billingComment\n\n    membersStats {\n        numberOfMembers\n    }\n\n    membersStats2024: membersStats(year: 2024) {\n        numberOfMembers\n    }\n\n    users {\n        id\n        email\n    }\n}\n",fragments:[]},OrganizationCertificateDefaultFragment:{code:"fragment OrganizationCertificateDefault on Organization {\n    name\n    adminName\n    street\n    city\n    postalCode\n    country\n}\n",fragments:[]},OrganizationCustomFieldsFragment:{code:"fragment OrganizationCustomFields on Organization {\n    customFields(variety: UserInfo, privacy: All) {\n        nodes {\n            ...SegmentCustomField\n        }\n    }\n}\n",fragments:["SegmentCustomFieldFragment"]},OrganizationDelegationsSpaceFragment:{code:"fragment OrganizationDelegationsSpace on IOrganization {\n    name\n    allowDelegationSpaceDownload\n    delegationsSpaceCustomBadges\n\n    delegationsSpaceDesign {\n        colors\n        logo {\n            url\n        }\n\n        banner {\n            url\n        }\n    }\n}\n",fragments:[]},OrganizationEmailRendererFragment:{code:"fragment OrganizationEmailRenderer on Organization {\n    id\n    name\n    datetimeFormat\n    timeZone\n}\n",fragments:[]},OrganizationMembersSpaceFragment:{code:"fragment OrganizationMembersSpace on Organization {\n    hideAssignmentsUntilConfirmationEmailSent\n    hideAccreditationsUntilConfirmationEmailSent\n    name\n\n    membersSpaceDesign {\n        colors\n        logo {\n            url\n        }\n\n        banner {\n            url\n        }\n    }\n}\n",fragments:[]},PositionCategoryPositionFragment:{code:"fragment PositionCategoryPosition on Position {\n    id\n    assignedResources\n    name\n    range\n    resources\n    numberOfSlots\n}\n",fragments:[]},PositionPdfInfosFragment:{code:"fragment PositionPdfInfos on Position {\n    id\n    eventId\n    name\n    description\n    range\n    address\n    latitude\n    longitude\n    zoom\n    layer\n    numberOfSlots\n    assignedResources\n    acronym\n\n    leaders {\n        ...LeaderAssignment\n    }\n\n    category {\n        name\n\n        leaders {\n            ...LeaderAssignment\n        }\n    }\n}\n",fragments:["LeaderAssignmentFragment"]},PositionPlanningFragment:{code:"fragment PositionPlanning on Position {\n    id\n    name\n    color\n    icon\n\n    category {\n        name\n    }\n\n    slots {\n        id\n        name\n        range\n        fillingRate\n        assignedResources\n        resources\n    }\n}\n",fragments:[]},PositionPositionSlotFragment:{code:"fragment PositionPositionSlot on PositionsSlot {\n    id\n    positionCategoryId\n    positionId\n    assignedResources\n    name\n    range\n    nameOrRange\n    resources\n    startDate\n    startTime\n    endDate\n    endTime\n}\n",fragments:[]},PositionPositionsCustomFieldsFragment:{code:"fragment PositionPositionsCustomFields on Position {\n    conditionsOperator\n\n    conditionsCustomFields: positionsCustomFields {\n        conditionValue\n\n        customField {\n            slug\n            fieldType\n            canSelectMultiple\n        }\n    }\n}\n",fragments:[]},PositionPositionsMapFragment:{code:"fragment PositionPositionsMap on Position {\n    acronym\n    color\n    icon\n    latitude\n    longitude\n}\n",fragments:[]},PositionsPositionFragment:{code:"fragment PositionsPosition on Position {\n    id\n    name\n    range\n    resources\n    assignedResources\n    address\n    latitude\n    longitude\n    acronym\n    color\n    icon\n    isVisible\n    state\n    fillingRate\n    numberOfSlots\n    fields\n    insertedAt\n\n    checkedInRate @include(if: $includeCheckedInRate)\n\n    category {\n        id\n        name\n\n        leaders @include(if: $includeLeaders) {\n            userInfo {\n                id\n                nameOrEmail\n            }\n        }\n    }\n\n    createdBy @include(if: $includeCreatedBy) {\n        email\n        name\n    }\n\n    leaders @include(if: $includeLeaders) {\n        userInfo {\n            id\n            nameOrEmail\n        }\n    }\n\n    positionsCustomFields @include(if: $includeConditions) {\n        ...PositionsPositionCustomField\n    }\n\n    tags @include(if: $includeTags) {\n        id\n        name\n    }\n}\n",fragments:["PositionsPositionCustomFieldFragment"]},PositionsPositionCustomFieldFragment:{code:"fragment PositionsPositionCustomField on PositionsCustomField {\n    conditionValue\n\n    customField {\n        name\n        fieldType\n\n        values {\n            id\n            value\n        }\n    }\n}\n",fragments:[]},PositionsPositionSlotFragment:{code:"fragment PositionsPositionSlot on PositionsSlot {\n    id\n    name\n    startDate\n    startTime\n    endDate\n    endTime\n    range\n    assignedResources\n    resources\n    fillingRate\n    state\n    insertedAt\n\n    checkedInRate @include(if: $includeCheckedInRate)\n\n    position {\n        id\n        name\n        fields\n        acronym\n        color\n        icon\n        address\n        latitude\n        longitude\n\n        createdBy @include(if: $includeCreatedBy) {\n            email\n            name\n        }\n\n        positionsCustomFields @include(if: $includeConditions) {\n            ...PositionsPositionCustomField\n        }\n\n        tags @include(if: $includeTags) {\n            id\n            name\n        }\n    }\n\n    positionCategory {\n        id\n        name\n    }\n}\n",fragments:["PositionsPositionCustomFieldFragment"]},PsuiUserHoursFragment:{code:"fragment PsuiUserHours on PositionsSlotsUsersInfo {\n    breakTime\n    checkInAt\n    checkOutAt\n    timeDifferenceMinutes\n\n    positionSlot {\n        range\n    }\n\n    position {\n        name\n    }\n}\n",fragments:[]},PsuiUserPlanningFragment:{code:"fragment PsuiUserPlanning on PositionsSlotsUsersInfo {\n    id\n\n    positionSlot {\n        name\n        range\n    }\n\n    position {\n        name\n        color\n    }\n}\n",fragments:[]},SegmentCampaignFragment:{code:"fragment SegmentCampaign on Campaign {\n    id\n    name\n    campaignType\n}\n",fragments:[]},SegmentCustomFieldFragment:{code:"fragment SegmentCustomField on CustomField {\n    id\n    slug\n    name\n    label\n    fieldType\n    fieldProperty\n    canSelectMultiple\n    customFieldCategoryId\n    customFieldCategoryName\n    isSelectV2\n    isEncrypted\n\n    values {\n        id\n        value\n    }\n}\n",fragments:[]},SegmentEventFragment:{code:"fragment SegmentEvent on Event {\n    id\n    name\n}\n",fragments:[]},SegmentFormFragment:{code:"fragment SegmentForm on Form {\n    id\n    name\n}\n",fragments:[]},SegmentsFoldersSegmentsFragment:{code:"fragment SegmentsFoldersSegments on SegmentsFolder {\n    id\n    name\n\n    segments {\n        id\n        segmentFolderId\n        name\n        predicates\n        columns\n        columnsExport\n        columnsSearch\n        sort\n        count\n        rendering\n        description\n        isUsedInWorkflow\n        infos\n    }\n}\n",fragments:[]},TraceFragment:{code:"fragment Trace on Trace {\n    id\n    name\n    color\n    points\n    direction\n}\n",fragments:[]},TracePositionsMapFragment:{code:"fragment TracePositionsMap on Trace {\n    id\n    color\n    points\n    direction\n}\n",fragments:[]},TranslationFragment:{code:"fragment Translation on Translation {\n    id\n    translationType\n    module\n    fr\n    en\n    es\n    de\n    nl\n    isFrTranslated\n    isEnTranslated\n    isEsTranslated\n    isDeTranslated\n    isNlTranslated\n    frString\n    enString\n    esString\n    deString\n    nlString\n}\n",fragments:[]},UpdateUserFormFragment:{code:"fragment UpdateUserForm on Form {\n    id\n    name\n    areTeamsAllowed\n    delegationsIds\n\n    elements {\n        ...FormElementDisplay\n    }\n}\n",fragments:["FormElementDisplayFragment"]},UserAllPermissionsFragment:{code:"fragment UserAllPermissions on UsersInfo {\n    usersOrganizations {\n        id\n        sendNotifications\n\n        role {\n            id\n            name\n            type\n        }\n    }\n\n    usersEvents(eventId: $eventId) {\n        id\n\n        event {\n            id\n            name\n        }\n\n        role {\n            id\n            name\n            type\n        }\n    }\n\n    usersDelegations(eventId: $eventId) {\n        id\n        eventId\n        userInfoId\n\n        delegation {\n            name\n        }\n    }\n\n    usersDelegationsCategories(eventId: $eventId) {\n        id\n        eventId\n\n        delegationCategory {\n            name\n        }\n\n        role {\n            id\n            name\n        }\n    }\n\n    usersPositionsCategories(eventId: $eventId) {\n        id\n        eventId\n\n        positionCategory {\n            name\n        }\n\n        role {\n            id\n            name\n        }\n    }\n\n    usersPositions(eventId: $eventId) {\n        id\n        eventId\n\n        position {\n            name\n        }\n\n        role {\n            id\n            name\n        }\n    }\n}\n",fragments:[]},UserInfoCommunityFragment:{code:'fragment UserInfoCommunity on UsersInfo {\n    id\n    name\n    email\n    nameOrEmail\n    fields\n    insertedAt\n    phone: fieldValue(slug: "phone")\n\n    ...UserAllPermissions @include(if: $includeRoles)\n\n    picture {\n        url\n    }\n\n    events @include(if: $includeEvents) {\n        id\n        name\n    }\n\n    delegations(level: Organization) @include(if: $includeDelegations) {\n        id\n        name\n\n        delegationCategory {\n            id\n            name\n        }\n    }\n\n    formsUsersInfos(level: Organization) @include(if: $includeForms) {\n        id\n        insertedAt\n\n        form {\n            id\n            name\n        }\n    }\n\n    tags @include(if: $includeTags) {\n        id\n        name\n    }\n}\n',fragments:["UserAllPermissionsFragment"]},UserInfoDocumentFragment:{code:'fragment UserInfoDocument on UsersInfo {\n    id\n    name\n    nameOrEmail\n    email\n    language: fieldValue(slug: "language")\n    fields(expand: true)\n    registrationDate(eventId: $eventId)\n\n    links(eventId: $eventId) {\n        ...UserInfoLinks\n    }\n\n    picture {\n        url\n    }\n}\n',fragments:["UserInfoLinksFragment"]},UserInfoEmailRendererFragment:{code:"fragment UserInfoEmailRenderer on UsersInfo {\n    id\n    email\n    fields\n    registrationDate(eventId: $eventId)\n\n    links(eventId: $eventId) {\n        ...UserInfoLinks\n    }\n\n    user {\n        id\n        language\n    }\n}\n",fragments:["UserInfoLinksFragment"]},UserInfoFormFragment:{code:"fragment UserInfoForm on UsersInfo {\n    id\n    email\n    nameOrEmail\n    fields\n    registrationDate(eventId: $eventId)\n    canAccess(formId: $formId)\n\n    links(eventId: $eventId) {\n        ...UserInfoLinks\n    }\n}\n",fragments:["UserInfoLinksFragment"]},UserInfoLinksFragment:{code:"fragment UserInfoLinks on UserInfoDocumentLink {\n    userAssignmentsLink\n    userBadgeLink\n    userCertificateLink\n    userCustomBadgeLinks\n    userCustomDocumentLinks\n    userHoursLink\n    userPlanningLink\n    userPlanningDaysLink\n    userPlanningListLink\n}\n",fragments:[]},UserInfoOrganizationFragment:{code:"fragment UserInfoOrganization on UsersInfo {\n    id\n    userId\n    name\n    email\n    nameOrEmail\n\n    ...UserAllPermissions\n\n    picture {\n        url\n    }\n}\n",fragments:["UserAllPermissionsFragment"]},UserInfoOverlayFragment:{code:'fragment UserInfoOverlay on UsersInfo {\n    id\n    name\n    email\n    nameOrEmail\n    fields\n    phone: fieldValue(slug: "phone")\n    population: fieldValue(slug: "population")\n    language: fieldValue(slug: "language")\n\n    picture {\n        url\n    }\n}\n',fragments:[]},UserInfoTeamMemberFragment:{code:"fragment UserInfoTeamMember on UsersInfo {\n    id\n    email\n    name\n\n    picture {\n        url\n    }\n}\n",fragments:[]},UserInfoTeamRightPanelFragment:{code:"fragment UserInfoTeamRightPanel on VolunteersRegistration {\n    positionsCategories {\n        positions {\n            id\n            name\n            icon\n            color\n\n            slots {\n                id\n                name\n                range\n            }\n        }\n    }\n\n    positions {\n        id\n        name\n        icon\n        color\n\n        slots {\n            id\n            name\n            range\n        }\n    }\n\n    positionsSlots {\n        id\n        name\n        range\n\n        position {\n            id\n            name\n            icon\n            color\n        }\n    }\n\n    positionsSlotsUsersInfos {\n        positionSlot {\n            id\n            name\n            range\n        }\n\n        position {\n            id\n            name\n            icon\n            color\n        }\n    }\n\n    userInfo {\n        id\n        email\n        name\n\n        picture {\n            url\n        }\n    }\n}\n",fragments:[]},UserPanelAccreditationSlotUserInfoFragment:{code:"fragment UserPanelAccreditationSlotUserInfo on AccreditationsUsersInfo {\n    id\n    eventId\n    isAutoAccredit\n    isWorkflow\n    checkInAt\n    insertedAt\n    checkInAt\n    state\n\n    accreditationCategory {\n        name\n    }\n\n    accreditation {\n        id\n        name\n        color\n        icon\n        index\n    }\n\n    accreditationSlot {\n        id\n        name\n        date\n    }\n\n    createdBy {\n        email\n        name\n    }\n}\n",fragments:[]},UserPermissionsFragment:{code:"fragment UserPermissions on User {\n    roles(organizationId: $organizationId, eventId: $eventId) {\n        id\n        delegationCategoryPermissions\n        positionPermissions\n        type\n    }\n\n    usersPositionsCategories(eventId: $eventId) {\n        positionCategoryId\n\n        role {\n            id\n            editPosition\n            type\n        }\n    }\n\n    usersPositions(eventId: $eventId) {\n        positionId\n\n        role {\n            id\n            editPosition\n            type\n        }\n    }\n}\n",fragments:[]},UserPositionSlotUserInfoFragment:{code:"fragment UserPositionSlotUserInfo on PositionsSlotsUsersInfo {\n    breakTime\n    checkInAt\n    checkOutAt\n    eventId\n    id\n    insertedAt\n    isAutoAssign\n    organizationId\n    positionCategoryId\n    state\n    timeDifferenceMinutes\n    userInfoId\n\n    createdBy {\n        email\n        name\n    }\n\n    position {\n        id\n        acronym\n        color\n        icon\n        name\n    }\n\n    positionSlot {\n        id\n        name\n        range\n    }\n\n    positionCategory {\n        id\n        name\n    }\n}\n",fragments:[]},VolunteerInfosFragment:{code:'fragment VolunteerInfos on VolunteersRegistration {\n    delegation {\n        id\n        name\n    }\n\n    userInfo {\n        id\n        name\n        email\n        phone: fieldValue(slug: "phone")\n        picture {\n            url\n        }\n    }\n}\n',fragments:[]},VolunteerPdfFragment:{code:"fragment VolunteerPdf on VolunteersRegistration {\n    teams {\n        teamCode\n    }\n\n    userInfo {\n        id\n        name\n        email\n        fields\n\n        picture {\n            url\n        }\n    }\n}\n",fragments:[]},VolunteerRegistrationFragment:{code:"fragment VolunteerRegistration on VolunteersRegistration {\n    id\n    localId\n    ticketId\n    state\n    accreditationState\n    insertedAt\n    canDelete\n    canRegistrationStateUpdate @include(if: $includeCanRegistrationStateUpdate)\n    numberOfAccreditations @include(if: $includeNumberOfAccreditations)\n    numberOfAssignments @include(if: $includeNumberOfAssignments)\n    numberOfAssignmentsDays @include(if: $includeNumberOfAssignmentsDays)\n    numberOfAvailableDays @include(if: $includeNumberOfAvailableDays)\n    shortTag\n    volunteerMinutes @include(if: $includeVolunteerMinutes)\n    weezeventPairedAt @include(if: $includeWeezevent)\n    weezeventPayUrl @include(if: $includeWeezeventUrls)\n    weezeventTicketUrl @include(if: $includeWeezeventUrls)\n\n    delegation @include(if: $includeDelegation) {\n        id\n        name\n\n        delegationCategory {\n            id\n            name\n        }\n    }\n\n    userInfo {\n        id\n        userId\n        organizationId\n        name\n        email\n        nameOrEmail\n        fields\n        isEditable @include(if: $includeIsEditable)\n        insertedAt\n\n        ...UserAllPermissions @include(if: $includeRoles)\n\n        links(eventId: $eventId) {\n            ...UserInfoLinks\n        }\n\n        picture {\n            url\n        }\n\n        comments @include(if: $includeComments) {\n            content\n        }\n\n        emails(emailTypes: [Campaign], delegationId: $delegationId) @include(if: $includeEmails) {\n            id\n            state\n\n            campaign {\n                name\n            }\n        }\n\n        formsUsersInfos(level: Event, eventId: $eventId) @include(if: $includeFormsUsersInfos) {\n            id\n            insertedAt\n\n            form @include(if: $includeForms) {\n                id\n                name\n                slotDisplay\n            }\n\n            slots @include(if: $includeAvailability) {\n                id\n                range\n            }\n\n            teamMembers @include(if: $includeTeam) {\n                ...UserInfoTeamMember\n            }\n        }\n\n        tags @include(if: $includeTags) {\n            id\n            name\n        }\n    }\n\n    accreditationsUsersInfos(\n        delegationId: $delegationId\n        onlyVisible: $onlyVisibleAccreditationsSlots\n    ) @include(if: $includeAccreditations) {\n        checkInAt\n\n        accreditationSlot {\n            ...AccreditationSlotVolunteerRegistration\n        }\n    }\n\n    matrixAuis: accreditationsUsersInfos(\n        delegationId: $delegationId\n        onlyVisible: $onlyVisibleAccreditationsSlots\n    ) @include(if: $includeAccreditationsMatrix) {\n        accreditationSlotId\n        isAutoAccredit\n    }\n\n    accreditationsSlots(delegationId: $delegationId, onlyVisible: $onlyVisibleAccreditationsSlots)\n        @include(if: $includeAccreditations) {\n        ...AccreditationSlotVolunteerRegistration\n    }\n\n    matrixWishedSlots: accreditationsSlots @include(if: $includeAccreditationsMatrix) {\n        id\n    }\n\n    positionsSlotsUsersInfos @include(if: $includePositions) {\n        ...UserPositionSlotUserInfo\n    }\n\n    positionsCategories @include(if: $includeWishedPositions) {\n        id\n        name\n    }\n\n    positions @include(if: $includeWishedPositions) {\n        id\n        acronym\n        color\n        icon\n        name\n    }\n\n    positionsSlots @include(if: $includeWishedPositions) {\n        id\n        name\n        range\n\n        position {\n            acronym\n            color\n            icon\n            name\n        }\n    }\n\n    preassignPositionsCategories @include(if: $includePreassignedPositions) {\n        id\n        name\n    }\n\n    preassignPositions @include(if: $includePreassignedPositions) {\n        id\n        name\n    }\n\n    teams @include(if: $includeTeam) {\n        teamCode\n    }\n\n    weezaccessChecklists @include(if: $includeWeezeventChecklists) {\n        id\n        name\n    }\n}\n",fragments:["UserAllPermissionsFragment","UserInfoLinksFragment","UserInfoTeamMemberFragment","AccreditationSlotVolunteerRegistrationFragment","UserPositionSlotUserInfoFragment"]},VolunteerRegistrationDelegationAccreditationSlotFragment:{code:"fragment VolunteerRegistrationDelegationAccreditationSlot on VolunteersRegistration {\n    id\n\n    accreditationsSlots {\n        id\n    }\n\n    accreditationsUsersInfos {\n        accreditationSlotId\n    }\n\n    userInfo {\n        id\n        email\n        name\n\n        picture {\n            url\n        }\n    }\n}\n",fragments:[]},VolunteerRegistrationEmailRendererFragment:{code:'fragment VolunteerRegistrationEmailRenderer on VolunteersRegistration {\n    localId\n    ticketId\n    weezevent\n\n    delegation {\n        name\n\n        leaders {\n            firstName: fieldValue(slug: "firstName")\n            lastName: fieldValue(slug: "lastName")\n            phone: fieldValue(slug: "phone")\n        }\n    }\n}\n',fragments:[]},VolunteerRegistrationWaitingAssignmentFragment:{code:"fragment VolunteerRegistrationWaitingAssignment on VolunteersRegistration {\n    insertedAt\n\n    userInfo {\n        id\n        name\n        email\n        picture {\n            url\n        }\n    }\n}\n",fragments:[]},VolunteerRegistrationWeezeventFragment:{code:"fragment VolunteerRegistrationWeezevent on VolunteersRegistration {\n    id\n    state\n    accreditationState\n    ticketId\n    weezevent\n\n    accreditationsUsersInfos {\n        accreditationSlotId\n        accreditationCategoryId\n\n        accreditation {\n            id\n            name\n            fields\n        }\n    }\n\n    positionsSlotsUsersInfos {\n        positionCategory {\n            id\n            name\n        }\n\n        position {\n            id\n            name\n        }\n    }\n\n    delegation {\n        name\n\n        delegationCategory {\n            name\n        }\n    }\n\n    userInfo {\n        id\n        email\n        fieldsExpanded: fields(expand: true)\n\n        picture {\n            url\n        }\n    }\n}\n",fragments:[]},WishesEmailFragment:{code:"fragment WishesEmail on FormsUsersInfo {\n    positionsCategories {\n        name\n    }\n\n    positions {\n        name\n    }\n\n    slots {\n        range\n    }\n\n    accreditationsSlots {\n        name\n        date\n\n        accreditation {\n            name\n        }\n    }\n}\n",fragments:[]},WorkflowsWorkflowFragment:{code:"fragment WorkflowsWorkflow on Workflow {\n    id\n    name\n    state\n    trigger\n    action\n    executedAt\n    insertedAt\n\n    createdBy {\n        email\n        name\n    }\n\n    data {\n        errorMessage\n    }\n\n    accreditationsSlots @include(if: $includeAccreditations) {\n        ...AccreditationSlotVolunteerRegistration\n    }\n\n    campaign @include(if: $includeCampaign) {\n        id\n        name\n    }\n\n    customField @include(if: $includeCustomField) {\n        id\n        name\n    }\n\n    volunteersSegment {\n        id\n        name\n    }\n}\n",fragments:["AccreditationSlotVolunteerRegistrationFragment"]},ZapierMemberFragment:{code:"fragment ZapierMember on UsersInfo {\n    id\n    fields(expand: true)\n    email\n    insertedAt\n    updatedAt\n    deletedAt\n}\n",fragments:[]}};function Po(e){return e.flatMap(e=>[e.code].concat(Po(e.fragments.map(e=>Ro[e]))))}function Do(e){return(0,Oo.A)(Po(e)).join(" ")}var Fo=n(8097);const Mo="yyyy-MM-dd",No="yyyy-MM-dd'T'HH:mm",Lo="yyyy-MM-dd'T'HH:mm:ss";function Bo(e){const[t,n]=JSON.parse(e);return Fo.IX.fromDateTimes(Fo.c9.fromISO(t,{zone:"UTC"}),Fo.c9.fromISO(n,{zone:"UTC"}))}function Vo({startDate:e,startTime:t,endDate:n,endTime:i}){try{const[o,s]=t.split(":"),[r,a]=i.split(":");return Fo.IX.fromDateTimes(e.set({hour:parseInt(o,10),minute:parseInt(s,10)}),n.set({hour:parseInt(r,10),minute:parseInt(a,10)}))}catch{return Fo.IX.invalid("Invalid")}}function Uo(e){return Fo.IX.isInterval(e)?e:Vo(e)}function Wo(e){return{startDate:e.start.set({hour:0,minute:0,second:0}),startTime:e.start.toFormat("HH:mm:ss"),endDate:e.end.set({hour:0,minute:0,second:0}),endTime:e.end.toFormat("HH:mm:ss")}}const Go=(e,t)=>e.contains(t)||e.start.startOf("day").toMillis()===t.startOf("day").toMillis()||e.end.minus({minute:1}).startOf("day").toMillis()===t.startOf("day").toMillis(),Ho={DateOnly:{Numeric:{year:"numeric",month:"2-digit",day:"2-digit"},MonthLong:{year:"numeric",month:"long",day:"numeric"},MonthShort:{year:"numeric",month:"short",day:"numeric"},WeekdayLongMonthLong:{year:"numeric",month:"long",day:"numeric",weekday:"long"},WeekdayShortMonthLong:{year:"numeric",month:"long",day:"numeric",weekday:"short"},WeekdayShortMonthShort:{year:"numeric",month:"short",day:"numeric",weekday:"short"},MonthLongYear:{year:"numeric",month:"long"}},TimeOnly:{hour:"2-digit",minute:"2-digit"},DateTime:{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"},FullDateTime:{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"},ShortDateTime:{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}};function qo(){return Fo.c9.utc().toLocal().zoneName}function Yo(e){if(!0===Array.isArray(e))return e.map(e=>null!=e&&"object"==typeof e?Yo(e):e);if("boolean"==typeof e||"number"==typeof e||"string"==typeof e||null===e)return e;{const t={};return Object.keys(e).forEach(n=>{const i=e[n];On.includes(n)||$n.includes(n)?t[n]=i&&Fo.c9.fromISO(i,{zone:"UTC"}):Rn.includes(n)?Array.isArray(i)?t[n]=i.map(Bo):t[n]=i&&Bo(i):Pn.includes(n)?t[n]=i&&Fo.dw.fromISO(i):t[n]=null!=i&&"object"==typeof i?Yo(i):i}),t}}function Ko(e){return null==e?[]:Array.isArray(e)?e:[e]}function Zo(e){return Array.isArray(e)&&e.length>0}function Xo(e){return!Zo(e)}function Jo(e,t,n){const i=new Set(e);return n?i.add(t):i.delete(t),Array.from(i)}function Qo(e,t){const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),Array.from(n)}function es(e,t,n){const i=[...e],[o]=i.splice(t,1);return i.splice(n,0,o),i}function ts(e,t){return e.filter((e,n)=>n!==t)}const ns="00aab77ba79f6f9e0cb7a7ac64427def73b41871\n".trim();var is=n(7405);const os="h-new-version";async function ss(e,t={}){let n=R.HEAVENT_API_URL.href;const i=new URL(location.href).searchParams,o=`${e} ${Zo(t.fragments)?Do(t.fragments):""}`,s={"Content-Type":"application/json",[P]:ns};i.has("lang")&&(n=`${n}?lang=${i.get("lang")}`),t.token&&(s[D]=t.token);const r=await fetch(n,{method:"post",headers:s,body:JSON.stringify({query:o,variables:t.variables||{},uuid:N()})});if(r.ok){t.reloadOnNewVersion&&"true"===r.headers.get("x-heavent-new-version")&&document.body.dispatchEvent(new CustomEvent(os,{bubbles:!0}));const e=await r.json();if(e.errors){const t=e.errors[0]?.message??"";if("You need to be logged-in"===t)return localStorage.clear(),location.href="/crew",{};if(t.startsWith("You do not have access to this"))return location.href="/crew",{};throw e.errors}{const t=(0,is.A)(e.data),n={};return t.forEach(t=>{n[t]=Yo(e.data[t])}),n}}throw new Error(r.statusText)}function rs(e,t,n){const i=Object.keys(t).sort().map(e=>{const n=t[e];return`"${e}":${JSON.stringify(n)}`}).join(",");return(0,F.useMemo)(()=>H().then(i=>ss(e,{variables:t,token:i||void 0,fragments:n})),[e,i])}const as="query CustomFieldsMassEditInfos($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        customFieldsCategories {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n}\n",ls="query DelegationsMassEditInfos(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $level: OrganizationEventLevel!\n) {\n    organization(id: $organizationId) {\n        campaigns(level: $level, eventId: $eventId, states: [Template]) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        customFields(variety: Delegation, sort: { attribute: Name, direction: Asc }) {\n            nodes {\n                ...MassEditCustomField\n            }\n        }\n\n        delegationsCategories(level: $level, eventId: $eventId) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        forms(level: $level, eventId: $eventId) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        tags {\n            nodes {\n                id\n                name\n            }\n        }\n\n        event: eventMaybe(id: $eventId) {\n            customDocuments {\n                slug\n                name\n            }\n        }\n    }\n}\n",ds='query PositionsSearch(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $hasSelected: Boolean!\n    $ids: [PositionId!]!\n    $name: String\n) {\n    organization(id: $organizationId) {\n        list: positions(\n            eventId: $eventId\n            name: $name\n            limit: 50\n            sort: { attribute: "Name", direction: Asc }\n        ) {\n            nodes {\n                id\n                name\n\n                event {\n                    id\n                    name\n                }\n            }\n        }\n\n        selected: positions(ids: $ids) @include(if: $hasSelected) {\n            nodes {\n                id\n                name\n\n                event {\n                    id\n                    name\n                }\n            }\n        }\n    }\n}\n',cs="query Tags($organizationId: OrganizationId!, $eventId: EventId, $context: TagContext) {\n    organization(id: $organizationId) {\n        tags(eventId: $eventId, context: $context) {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n}\n",us="query Users(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $predicates: [Predicate!]!\n    $name: String\n    $columnsSearch: [String!]\n    $limit: Int\n    $offset: Int\n    $sort: UsersInfosSort\n    $delegationCategoryId: DelegationsCategoryId\n    $delegationId: DelegationId\n    $includeDelegations: Boolean!\n    $includeEvents: Boolean!\n    $includeForms: Boolean!\n    $includeTags: Boolean!\n    $includeRoles: Boolean!\n) {\n    data: organization(id: $organizationId) {\n        rows: usersInfos(\n            predicates: $predicates\n            name: $name\n            columnsSearch: $columnsSearch\n            delegationCategoryId: $delegationCategoryId\n            delegationId: $delegationId\n            limit: $limit\n            offset: $offset\n            sort: $sort\n        ) {\n            nodes {\n                ...UserInfoCommunity\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",hs="query Volunteers(\n    $eventId: EventId!\n    $predicates: [Predicate!]!\n    $limit: Int\n    $offset: Int\n    $sort: VolunteersRegistrationsSort\n    $name: String\n    $columnsSearch: [String!]\n    $positionCategoryId: PositionsCategoryId\n    $positionId: PositionId\n    $preassignedPositionCategoryId: PositionsCategoryId\n    $preassignedPositionId: PositionId\n    $accreditationCategoryId: AccreditationsCategoryId\n    $accreditationId: AccreditationId\n    $accreditationSlotId: AccreditationsSlotId\n    $delegationCategoryId: DelegationsCategoryId\n    $delegationId: DelegationId\n    $onlyVisibleAccreditationsSlots: Boolean\n    $includeAccreditations: Boolean!\n    $includeAccreditationsMatrix: Boolean!\n    $includeAvailability: Boolean!\n    $includeCanRegistrationStateUpdate: Boolean!\n    $includeComments: Boolean!\n    $includeDelegation: Boolean!\n    $includeEmails: Boolean!\n    $includeFormsUsersInfos: Boolean!\n    $includeForms: Boolean!\n    $includeIsEditable: Boolean!\n    $includeNumberOfAccreditations: Boolean!\n    $includeNumberOfAssignments: Boolean!\n    $includeNumberOfAssignmentsDays: Boolean!\n    $includeNumberOfAvailableDays: Boolean!\n    $includePositions: Boolean!\n    $includeRoles: Boolean!\n    $includeTags: Boolean!\n    $includeTeam: Boolean!\n    $includeVolunteerMinutes: Boolean!\n    $includeWishedPositions: Boolean!\n    $includePreassignedPositions: Boolean!\n    $includeWeezeventChecklists: Boolean!\n    $includeWeezevent: Boolean!\n    $includeWeezeventUrls: Boolean!\n) {\n    data: event(id: $eventId) {\n        rows: volunteersRegistrations(\n            predicates: $predicates\n            name: $name\n            columnsSearch: $columnsSearch\n            positionCategoryId: $positionCategoryId\n            positionId: $positionId\n            preassignedPositionCategoryId: $preassignedPositionCategoryId\n            preassignedPositionId: $preassignedPositionId\n            accreditationCategoryId: $accreditationCategoryId\n            accreditationId: $accreditationId\n            accreditationSlotId: $accreditationSlotId\n            delegationCategoryId: $delegationCategoryId\n            delegationId: $delegationId\n            limit: $limit\n            offset: $offset\n            sort: $sort\n        ) {\n            nodes {\n                ...VolunteerRegistration\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",ms="mutation UserCreate {\n    userCreate {\n        id\n        email\n    }\n}\n";function gs(e){return Vn('query AccreditAssignWaitingMembers(\n    $eventId: EventId!\n    $states: [VolunteerRegistrationState!]\n    $accreditationStates: [AccreditationState!]\n    $name: String\n    $segmentId: SegmentId\n    $delegationId: DelegationId\n    $direction: SortDirection!\n    $loadDelegations: Boolean!\n) {\n    event(id: $eventId) {\n        delegations @include(if: $loadDelegations) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        segmentsFolders(segmentType: Volunteers) {\n            id\n            name\n\n            segments {\n                id\n                name\n            }\n        }\n\n        volunteersRegistrations(\n            states: $states\n            accreditationStates: $accreditationStates\n            name: $name\n            segmentId: $segmentId\n            delegationId: $delegationId\n            sort: { attribute: "InsertedAt", direction: $direction }\n        ) {\n            nodes {\n                ...VolunteerRegistrationWaitingAssignment\n            }\n\n            totalCount\n        }\n    }\n}\n',e,[Ro.VolunteerRegistrationWaitingAssignmentFragment])}function ps(e={}){return Un("mutation VolunteersRegistrationsMassAccredit(\n    $eventId: EventId!\n    $massAccredit: MassAccreditInput!\n) {\n    numberOfMembers: volunteersRegistrationsMassAccredit(\n        eventId: $eventId\n        massAccredit: $massAccredit\n    )\n}\n",e)}function fs(e={}){return Un("mutation CampaignCreate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $campaign: CampaignInput!\n) {\n    campaignCreate(organizationId: $organizationId, eventId: $eventId, campaign: $campaign) {\n        id\n    }\n}\n",e)}function xs(e={}){return Un("mutation CampaignUpdate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $campaignId: CampaignId!\n    $campaign: CampaignInput!\n) {\n    campaignUpdate(\n        organizationId: $organizationId\n        eventId: $eventId\n        campaignId: $campaignId\n        campaign: $campaign\n    ) {\n        id\n    }\n}\n",e)}function _s(e){return Vn("query CreateCampaignInfos(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $userInfoId: UsersInfoId\n) {\n    organization(id: $organizationId) {\n        adminEmail\n        emailSenderId\n        timeZone\n\n        emailsSenders {\n            ...CreateCampaignEmailSender\n        }\n\n        event: eventMaybe(id: $eventId) {\n            timeZone\n\n            customDocuments {\n                slug\n                name\n            }\n\n            emailSender {\n                ... on EmailsSender {\n                    id\n                }\n            }\n        }\n\n        userInfo: userInfoMaybe(id: $userInfoId) {\n            name\n        }\n    }\n}\n",e,[Ro.CreateCampaignEmailSenderFragment])}function Is(e={}){return Un("mutation AccreditationsMassEdit($eventId: EventId!, $massEdit: MassEditInput!) {\n    numberOfEdited: accreditationsMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}function vs(e={}){return Un("mutation CustomFieldsMassEdit($organizationId: OrganizationId!, $massEdit: MassEditInput!) {\n    numberOfEdited: customFieldsMassEdit(organizationId: $organizationId, massEdit: $massEdit)\n}\n",e)}function bs(e,t){return ss(as,{variables:e,token:t||void 0,fragments:[]})}function js(e={}){return Un("mutation DelegationsMassEdit(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $massEdit: MassEditInput!\n) {\n    numberOfEdited: delegationsMassEdit(\n        organizationId: $organizationId\n        eventId: $eventId\n        massEdit: $massEdit\n    )\n}\n",e)}function Cs(e,t){return ss(ls,{variables:e,token:t||void 0,fragments:[Ro.MassEditCustomFieldFragment]})}function ys(e={}){return Un("mutation EventsMassEdit($organizationId: OrganizationId!, $massEdit: MassEditInput!) {\n    eventsMassEdit(organizationId: $organizationId, massEdit: $massEdit)\n}\n",e)}function ks(e={}){return Un("mutation PositionsMassEdit($eventId: EventId!, $massEdit: MassEditInput!) {\n    numberOfEdited: positionsMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}function As(e={}){return Un("mutation UsersInfosMassEdit(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $delegationId: DelegationId\n    $massEdit: MassEditInput!\n) {\n    numberOfEdited: usersInfosMassEdit(\n        organizationId: $organizationId\n        eventId: $eventId\n        delegationId: $delegationId\n        massEdit: $massEdit\n    )\n}\n",e)}function ws(e,t){return ss("query DelegationAccreditationSlotStats(\n    $eventId: EventId!\n    $delegationId: DelegationId!\n    $accreditationSlotId: AccreditationsSlotId!\n) {\n    event(id: $eventId) {\n        delegation(id: $delegationId) {\n            accreditationSlot(id: $accreditationSlotId) {\n                ...DelegationAccreditationSlotStats\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.DelegationAccreditationSlotStatsFragment]})}function Ss(e={}){return Un("mutation EventDocumentsExport(\n    $eventId: EventId!\n    $delegationId: DelegationId\n    $documentsExport: DocumentsExportInput!\n) {\n    eventDocumentsExport(\n        eventId: $eventId\n        delegationId: $delegationId\n        documentsExport: $documentsExport\n    )\n}\n",e)}function Es(e={}){return Un("mutation UsersInfosMassDelegationDelete(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $delegationId: DelegationId!\n    $selecteds: MassActionSelectedsInput!\n    $deleteFromEvent: Boolean\n) {\n    usersInfosMassDelegationDelete(\n        organizationId: $organizationId\n        eventId: $eventId\n        delegationId: $delegationId\n        selecteds: $selecteds\n        deleteFromEvent: $deleteFromEvent\n    )\n}\n",e)}function Ts(e){return Vn("query OrganizationParametersInfos($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        ...OrganizationAdminInfos\n    }\n}\n",e,[Ro.OrganizationAdminInfosFragment])}function zs(e={}){return Un("mutation PositionsSlotsUsersInfosCheckIn($eventId: EventId!, $checkIn: PositionSlotCheckInInput!) {\n    positionsSlotsUsersInfosCheckIn(eventId: $eventId, checkIn: $checkIn)\n}\n",e)}function $s(e){return Vn("query UserPositions(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $userInfoId: UsersInfoId!\n) {\n    organization(id: $organizationId) {\n        userInfo(id: $userInfoId) {\n            ...FormsUsersInfosWished\n        }\n    }\n\n    event(id: $eventId) {\n        name\n        startAt\n        endAt\n        dayStartTime\n        hasFormWithPositionDisplay\n        hasFormWithSlotDisplay\n\n        volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n            id\n            volunteerMinutes\n\n            positionsSlotsUsersInfos {\n                ...UserPositionSlotUserInfo\n            }\n\n            preassignPositions {\n                id\n                name\n                range\n            }\n\n            preassignPositionsCategories {\n                id\n                name\n                range\n            }\n        }\n    }\n}\n",e,[Ro.FormsUsersInfosWishedFragment,Ro.UserPositionSlotUserInfoFragment])}function Os(e,t){return ss(cs,{variables:e,token:t||void 0,fragments:[]})}function Rs(e={}){return Un("mutation VolunteersRegistrationsMassDelete(\n    $eventId: EventId!\n    $selecteds: MassActionSelectedsInput!\n) {\n    numberOfMembers: volunteersRegistrationsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function Ps(e,t){return ss("query User(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $id: UsersInfoId!\n    $includeDelegations: Boolean!\n    $includeEvents: Boolean!\n    $includeForms: Boolean!\n    $includeTags: Boolean!\n    $includeRoles: Boolean!\n) {\n    data: organization(id: $organizationId) {\n        row: userInfo(id: $id) {\n            ...UserInfoCommunity\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.UserInfoCommunityFragment]})}function Ds(e,t){return ss(us,{variables:e,token:t||void 0,fragments:[Ro.UserInfoCommunityFragment]})}function Fs(e){return Vn("query Profile($organizationId: OrganizationId!) {\n    user {\n        email\n        language\n\n        userInfo(organizationId: $organizationId) {\n            id\n            fields\n        }\n    }\n}\n",e,[])}function Ms(e={}){return Un("mutation UserProfileUpdate(\n    $userId: UserId!\n    $userInfoId: UsersInfoId!\n    $userInfo: UsersInfoEmailInput!\n) {\n    userProfileUpdate(userId: $userId, userInfoId: $userInfoId, userInfo: $userInfo) {\n        email\n        language\n    }\n}\n",e)}function Ns(e={}){return Un("mutation EmailResend(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $userInfoId: UsersInfoId!\n    $emailType: EmailType!\n) {\n    emailResend(\n        organizationId: $organizationId\n        eventId: $eventId\n        userInfoId: $userInfoId\n        emailType: $emailType\n    ) {\n        id\n    }\n}\n",e)}function Ls(e){return Vn("query UserOverlaySlots(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $userInfoId: UsersInfoId!\n) {\n    organization(id: $organizationId) {\n        userInfo(id: $userInfoId) {\n            ...FormsUsersInfosWished\n        }\n    }\n\n    event(id: $eventId) {\n        hasFormWithSlotDisplay\n    }\n}\n",e,[Ro.FormsUsersInfosWishedFragment])}function Bs(e={}){return Un("mutation VolunteersRegistrationsAccreditationsValidate(\n    $eventId: EventId!\n    $delegationId: DelegationId!\n    $usersInfosIds: [UsersInfoId!]\n) {\n    volunteersRegistrationsAccreditationsValidate(\n        eventId: $eventId\n        delegationId: $delegationId\n        usersInfosIds: $usersInfosIds\n    )\n}\n",e)}function Vs(e={}){return Un("mutation VolunteersRegistrationsMassAccreditationStateUpdate(\n    $eventId: EventId!\n    $massStateUpdate: MassAccreditationStateUpdateInput!\n) {\n    numberOfMembers: volunteersRegistrationsMassAccreditationStateUpdate(\n        eventId: $eventId\n        massStateUpdate: $massStateUpdate\n    )\n}\n",e)}function Us(e={}){return Un("mutation VolunteersRegistrationsMassAssign($eventId: EventId!, $massAssign: MassAssignInput!) {\n    numberOfMembers: volunteersRegistrationsMassAssign(eventId: $eventId, massAssign: $massAssign)\n}\n",e)}function Ws(e={}){return Un("mutation VolunteersRegistrationsMassDelegationAdd(\n    $eventId: EventId!\n    $delegationId: DelegationId!\n    $selecteds: MassActionSelectedsInput!\n) {\n    numberOfMembers: volunteersRegistrationsMassDelegationAdd(\n        eventId: $eventId\n        delegationId: $delegationId\n        selecteds: $selecteds\n    )\n}\n",e)}function Gs(e={}){return Un("mutation VolunteersRegistrationsMassStateUpdate(\n    $eventId: EventId!\n    $massStateUpdate: MassStateUpdateInput!\n) {\n    numberOfMembers: volunteersRegistrationsMassStateUpdate(\n        eventId: $eventId\n        massStateUpdate: $massStateUpdate\n    )\n}\n",e)}function Hs(e){return Vn("query VolunteersSegments(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $privacy: CustomFieldPrivacy!\n    $loadForms: Boolean!\n    $loadSegments: Boolean!\n) {\n    organization(id: $organizationId) {\n        customFields(variety: UserInfo, privacy: $privacy) {\n            nodes {\n                ...SegmentCustomField\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        startAt\n        endAt\n        dayStartTime\n        isWeezeventConnected\n\n        forms @include(if: $loadForms) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        segmentsFolders(segmentType: Volunteers) @include(if: $loadSegments) {\n            ...SegmentsFoldersSegments\n        }\n    }\n}\n",e,[Ro.SegmentCustomFieldFragment,Ro.SegmentsFoldersSegmentsFragment])}function qs(e,t){return ss("query UpdateCellDelegations($eventId: EventId!) {\n    event(id: $eventId) {\n        delegations {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}function Ys(e={}){return Un("mutation VolunteerRegistrationUpdateField(\n    $eventId: EventId!\n    $volunteerRegistrationId: VolunteersRegistrationId!\n    $slug: String!\n    $value: JSON!\n) {\n    volunteerRegistrationUpdateField(\n        eventId: $eventId\n        volunteerRegistrationId: $volunteerRegistrationId\n        slug: $slug\n        value: $value\n    ) {\n        id\n    }\n}\n",e)}function Ks(e,t){return ss("query Volunteer(\n    $eventId: EventId!\n    $id: VolunteersRegistrationId!\n    $delegationId: DelegationId\n    $onlyVisibleAccreditationsSlots: Boolean\n    $includeAccreditations: Boolean!\n    $includeAccreditationsMatrix: Boolean!\n    $includeAvailability: Boolean!\n    $includeCanRegistrationStateUpdate: Boolean!\n    $includeComments: Boolean!\n    $includeDelegation: Boolean!\n    $includeEmails: Boolean!\n    $includeFormsUsersInfos: Boolean!\n    $includeForms: Boolean!\n    $includeIsEditable: Boolean!\n    $includeNumberOfAccreditations: Boolean!\n    $includeNumberOfAssignments: Boolean!\n    $includeNumberOfAssignmentsDays: Boolean!\n    $includeNumberOfAvailableDays: Boolean!\n    $includePositions: Boolean!\n    $includeRoles: Boolean!\n    $includeTags: Boolean!\n    $includeTeam: Boolean!\n    $includeVolunteerMinutes: Boolean!\n    $includeWishedPositions: Boolean!\n    $includePreassignedPositions: Boolean!\n    $includeWeezeventChecklists: Boolean!\n    $includeWeezevent: Boolean!\n    $includeWeezeventUrls: Boolean!\n) {\n    data: event(id: $eventId) {\n        row: volunteerRegistration(id: $id) {\n            ...VolunteerRegistration\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.VolunteerRegistrationFragment]})}function Zs(e){return Vn(hs,e,[Ro.VolunteerRegistrationFragment])}function Xs(e,t){return ss(hs,{variables:e,token:t||void 0,fragments:[Ro.VolunteerRegistrationFragment]})}function Js(e={}){return Un("mutation UsersInfosMassCampaignSend(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $delegationId: DelegationId\n    $campaignId: CampaignId!\n    $selecteds: MassActionSelectedsInput!\n) {\n    numberOfMembers: usersInfosMassCampaignSend(\n        organizationId: $organizationId\n        eventId: $eventId\n        delegationId: $delegationId\n        campaignId: $campaignId\n        selecteds: $selecteds\n    )\n}\n",e)}function Qs(e={}){return Un("mutation VolunteersRegistrationsMassWishedAccreditationsUpdate(\n    $eventId: EventId!\n    $delegationId: DelegationId!\n    $massAccredit: MassAccreditInput!\n) {\n    volunteersRegistrationsMassWishedAccreditationsUpdate(\n        eventId: $eventId\n        delegationId: $delegationId\n        massAccredit: $massAccredit\n    )\n}\n",e)}const er=()=>{const{code:e,source:t,organizationId:n,eventId:i}=Wn();return(0,F.useEffect)(()=>{const o=localStorage.getItem(B),s=localStorage.getItem(L);if(h(o)&&h(s)&&h(e)&&h(t)){localStorage.removeItem(B),localStorage.removeItem(L);const r=new M.TU({Username:o,Pool:W()});r.Session=s,r.setAuthenticationFlowType("CUSTOM_AUTH"),r.sendCustomChallengeAnswer(e,{async onSuccess(e){const o=e.getIdToken().getJwtToken();await ss(ms,{token:o}),n&&i&&t===Ze.VolunteerRegister?location.href=zo(n,i):n&&i&&t===Ze.VolunteerAssignments?location.href=$o(n,i):t===Ze.App?location.href=So.HOME:location.href="/"},onFailure(e){Jn("Could not sendCustomChallengeAnswer",e),location.href="/"}})}else location.href="/"},[]),null};var tr=n(5126);function nr(e){if(e){const[t,n,i]=e.split(" ");return{color:t,fontSize:n,fontWeight:i}}return{}}function ir(e){return"string"==typeof e?e:"number"==typeof e?e<=1?100*e+"%":`${e}px`:void 0}var or=n(3345);const sr={mobile:"screen and (max-width: 743px)",tablet:"screen and (min-width: 744px)",desktop:"screen and (min-width: 1280px)"},rr="-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'",{styled:ar,theme:lr,config:dr,getCssText:cr,createTheme:ur,keyframes:hr,reset:mr}=(0,or.GC)({theme:{colors:{gray25:"#fcfcfd",gray50:"#f9fafb",gray100:"#f2f4f7",gray200:"#e4e7ec",gray300:"#d0d5dd",gray400:"#98a2b3",gray500:"#667085",gray600:"#475467",gray700:"#344054",gray800:"#1d2939",gray900:"#101828",grayDark50:"#f0f3f4",grayDark100:"#dfe4e7",grayDark500:"#667c8a",grayDark700:"#3d4a52",primary25:"#fcfaff",primary50:"#f8fbff",primary100:"#f0f8ff",primary200:"#eef7ff",primary300:"#dceeff",primary400:"#b3daff",primary500:"#359dfe",primary600:"#4ba7fe",primary700:"#0284fe",primary800:"#026dd6",primary900:"#01408f",error25:"#fffbfa",error50:"#fef3f2",error100:"#fee4e2",error200:"#fecdca",error300:"#fda29b",error400:"#f97066",error500:"#f04438",error600:"#d92d20",error700:"#b42318",error800:"#912018",error900:"#7a271a",warning25:"#fffcf5",warning50:"#fffaeb",warning100:"#fef0c7",warning200:"#fedf89",warning300:"#fec84b",warning400:"#fdb022",warning500:"#f79009",warning600:"#dc6803",warning700:"#b54708",warning800:"#93370d",warning900:"#7a2e0e",success25:"#f6fef9",success50:"#ecfdf3",success100:"#d1fadf",success200:"#a6f4c5",success300:"#6ce9a6",success400:"#32d583",success500:"#12b76a",success600:"#039855",success700:"#027a48",success800:"#05603a",success900:"#054f31",blue25:"#f5faff",blue50:"#edf4fd",blue100:"#dae9fb",blue200:"#b2ddff",blue300:"#84caff",blue400:"#53b1fd",blue500:"#4995ec",blue600:"#1570ef",blue700:"#1157a6",blue800:"#1849a9",blue900:"#194185",blueGray50:"#edeef8",blueGray100:"#daddf1",blueGray500:"#4352af",blueGray600:"#3e4784",blueGray700:"#29326b",blueGray900:"#272e3c",blueLight50:"#eff9fb",blueLight100:"#dff2f6",blueLight500:"#54bad1",blueLight600:"#0086C9",blueLight700:"#267a8d",purple25:"#fafaff",purple50:"#f4e7f8",purple100:"#ecd4f2",purple200:"#d9d6fe",purple300:"#bdb4fe",purple400:"#9b8afb",purple500:"#9033aa",purple600:"#6938ef",purple700:"#571f66",purple800:"#4a1fb8",purple900:"#3e1c96",purpleLight50:"#f9e7f8",purpleLight100:"#f2cef1",purpleLight500:"#9d2999",purpleLight700:"#5d185b",purpleDark50:"#f0ecf8",purpleDark100:"#ded5f0",purpleDark500:"#613eb1",purpleDark700:"#3a256a",pink25:"#fef6fb",pink50:"#fdf2fa",pink100:"#fce7f6",pink200:"#fcceee",pink300:"#faa7e0",pink400:"#f670c7",pink500:"#ee46bc",pink600:"#dd2590",pink700:"#c01574",pink800:"#9e165f",pink900:"#851651",orange50:"#fcefed",orange100:"#f9dbd7",orange500:"#e15241",orange700:"#962418",redLight50:"#fff1f3",redLight100:"#ffe4e8",redLight500:"#f63d68",redLight700:"#c01048",redDark50:"#fbeaef",redDark100:"#f7d9e2",redDark500:"#d63865",redDark700:"#871c3a",green50:"#eff6ee",green100:"#dfeedd",green500:"#67ad5c",green700:"#3c6935",greenDark50:"#eaf6f4",greenDark100:"#d5ece9",greenDark500:"#429488",greenDark700:"#275851",brown50:"#f3eeec",brown100:"#e5dbd7",brown500:"#74574a",brown700:"#44342c",white:"white"},space:{1:"4px",2:"8px",3:"12px",4:"16px",5:"20px",6:"24px",7:"32px",8:"40px",9:"48px",10:"64px",11:"80px",12:"96px",13:"128px"},fonts:{default:`'Open Sans', ${rr}`,grafik:`Graphik, ${rr}`,montserrat:`Montserrat, ${rr}`,madurai:`'Hind Madurai', ${rr}`,gravur:`'Gravur Condensed', ${rr}`,anton:`Anton, ${rr}`,brito:`'Brito Tri', ${rr}`,orbitron:`Orbitron, ${rr}`,dharma:`'Dharma Punk', ${rr}`,roboto:`Roboto, ${rr}`,poppins:`Poppins, ${rr}`,inter:`Inter, ${rr}`,paytone:`'Paytone One', ${rr}`,gothamBlack:`'Gotham Black', ${rr}`,gothamBold:`'Gotham Bold', ${rr}`,gothamBook:`'Gotham Book', ${rr}`,gothamMedium:`'Gotham Medium', ${rr}`,now:`'Now Medium', ${rr}`,franklinGothic:`'Franklin Gothic', ${rr}`,kobe:`Kobe, ${rr}`,nowMedium:`"Now Medium", ${rr}`,nowSemiBold:`"Now SemiBold", ${rr}`,badTyp:`BadTyp, ${rr}`,lemonMilk:`LemonMilk, ${rr}`,futura:`Futura, ${rr}`,urbanist:`Urbanist, ${rr}`,unbounded:`Unbounded, ${rr}`,magallanes:`Magallanes, ${rr}`,parisine:`ParisineBold, ${rr}`,bricolage:`Bricolage, ${rr}`,paris2024:`Paris2024, ${rr}`,dinCondensed:`DinCondensed, ${rr}`,gothamRoundedBook:`"Gotham Rounded Book", ${rr}`,gothamRoundedBold:`"Gotham Rounded Bold", ${rr}`,gothamRoundedMedium:`"Gotham Rounded Medium", ${rr}`,albert:`"Albert Sans", ${rr}`,bebasNeue:`BebasNeue, ${rr}`,encode:`"Encode Sans", ${rr}`,gilroy:`Gilroy, ${rr}`,tuskerGrotesk:`TuskerGrotesk, ${rr}`,rubik:`Rubik, ${rr}`,bnCartaNoirBold:`"BN Carta Noir Bold", ${rr}`,firaSans:`"Fira Sans", ${rr}`,arimo:`Arimo, ${rr}`,neueMontreal:`NeueMontreal, ${rr}`,helveticaBlackCondensed:`HelveticaBlackCondensed, ${rr}`,zuumeMedium:`"Zuume Medium", ${rr}`,zuumeBold:`"Zuume Bold", ${rr}`,formulaCondensedBold:`FormulaCondensedBold, ${rr}`,raleway:`Raleway, ${rr}`,avenir:`Avenir, ${rr}`,work:`"Work Sans", ${rr}`,movement:`Movement, ${rr}`,atrament:`Atrament, ${rr}`,sharpGrotesk:`SharpGrotesk, ${rr}`,utopiales:`Utopiales, ${rr}`,lato:`Lato, ${rr}`,helveticaNeue97BlackCondensed:`HelveticaNeue97BlackCondensed, ${rr}`,graphie:`Graphie, ${rr}`,archerBoldPro:`ArcherBoldPro, ${rr}`,acumin:`Acumin, ${rr}`,kabel:`Kabel, ${rr}`,moonstruck:`Moonstruck, ${rr}`,chillax:`Chillax, ${rr}`,neufileGrotesk:`NeufileGrotesk, ${rr}`,tungsten:`Tungsten, ${rr}`},fontSizes:{textXs:"12px",textSm:"14px",textMd:"16px",textLg:"18px",textXl:"20px",displayXs:"24px",displaySm:"30px",displayMd:"36px",displayLg:"48px",displayXl:"60px",display2Xl:"72px"},fontWeights:{regular:400,medium:500,semiBold:600,bold:700},radii:{1:"4px",2:"8px",3:"12px"},shadows:{xs:"0px 1px 2px rgba(16, 24, 40, 0.05)",sm:"0px 1px 3px rgba(16, 24, 40, 0.1), 0px 1px 2px rgba(16, 24, 40, 0.06)",md:"0px 4px 8px -2px rgba(16, 24, 40, 0.1), 0px 2px 4px -2px rgba(16, 24, 40, 0.06)",mdReverse:"0px -4px 8px -2px rgba(16, 24, 40, 0.1), 0px -2px 4px -2px rgba(16, 24, 40, 0.06)",lg:"0px 12px 16px -4px rgba(16, 24, 40, 0.1), 0px 4px 6px -2px rgba(16, 24, 40, 0.05)",xl:"0px 20px 24px -4px rgba(16, 24, 40, 0.1), 0px 8px 8px -4px rgba(16, 24, 40, 0.04)","2xl":"0px 24px 48px -12px rgba(16, 24, 40, 0.25)","3xl":"0px 32px 64px -12px rgba(16, 24, 40, 0.2)"},sizes:{container:"1170px",containerTablet:"704px",modalSm:"480px",modalMd:"640px",modalLg:"720px",cellHeightSm:"48px",cellHeightMd:"64px",cellHeightXl:"120px",cellWidth:"120px"}},media:sr,utils:{bd:e=>{let t="$gray200",n="$2",i="$xs";if(h(e)){const o=function(e){if(e){const[t,n,i]=e.split(" ");return{borderColor:t,borderRadius:n,boxShadow:i}}return{}}(e);o.borderColor&&(t=`$${o.borderColor}`),o.borderRadius&&(n=`$${o.borderRadius}`),i=o.boxShadow?`$${o.boxShadow}`:void 0}return{borderColor:t,borderRadius:n,borderStyle:"solid",borderWidth:"1px",boxShadow:i}},clamp:e=>({display:"-webkit-box",overflow:"hidden","-webkit-line-clamp":e,"-webkit-box-orient":"vertical"}),ellipsis:()=>({overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}),px:e=>({paddingLeft:e,paddingRight:e}),py:e=>({paddingBottom:e,paddingTop:e})}}),gr=ur("weezcrew-theme",{}),pr=ar("div",{variants:{color:{inherit:{color:"inherit"},cyan:{color:"$cyan"},gray25:{color:"$gray25"},gray50:{color:"$gray50"},gray100:{color:"$gray100"},gray200:{color:"$gray200"},gray300:{color:"$gray300"},gray400:{color:"$gray400"},gray500:{color:"$gray500"},gray600:{color:"$gray600"},gray700:{color:"$gray700"},gray800:{color:"$gray800"},gray900:{color:"$gray900"},primary25:{color:"$primary25"},primary50:{color:"$primary50"},primary100:{color:"$primary100"},primary200:{color:"$primary200"},primary300:{color:"$primary300"},primary400:{color:"$primary400"},primary500:{color:"$primary500"},primary600:{color:"$primary600"},primary700:{color:"$primary700"},primary800:{color:"$primary800"},primary900:{color:"$primary900"},error25:{color:"$error25"},error50:{color:"$error50"},error100:{color:"$error100"},error200:{color:"$error200"},error300:{color:"$error300"},error400:{color:"$error400"},error500:{color:"$error500"},error600:{color:"$error600"},error700:{color:"$error700"},error800:{color:"$error800"},error900:{color:"$error900"},warning25:{color:"$warning25"},warning50:{color:"$warning50"},warning100:{color:"$warning100"},warning200:{color:"$warning200"},warning300:{color:"$warning300"},warning400:{color:"$warning400"},warning500:{color:"$warning500"},warning600:{color:"$warning600"},warning700:{color:"$warning700"},warning800:{color:"$warning800"},warning900:{color:"$warning900"},success25:{color:"$success25"},success50:{color:"$success50"},success100:{color:"$success100"},success200:{color:"$success200"},success300:{color:"$success300"},success400:{color:"$success400"},success500:{color:"$success500"},success600:{color:"$success600"},success700:{color:"$success700"},success800:{color:"$success800"},success900:{color:"$success900"},blue25:{color:"$blue25"},blue50:{color:"$blue50"},blue100:{color:"$blue100"},blue200:{color:"$blue200"},blue300:{color:"$blue300"},blue400:{color:"$blue400"},blue500:{color:"$blue500"},blue600:{color:"$blue600"},blue700:{color:"$blue700"},blue800:{color:"$blue800"},blue900:{color:"$blue900"},blueGray25:{color:"$blueGray25"},blueGray50:{color:"$blueGray50"},blueGray100:{color:"$blueGray100"},blueGray200:{color:"$blueGray200"},blueGray300:{color:"$blueGray300"},blueGray400:{color:"$blueGray400"},blueGray500:{color:"$blueGray500"},blueGray600:{color:"$blueGray600"},blueGray700:{color:"$blueGray700"},blueGray800:{color:"$blueGray800"},blueGray900:{color:"$blueGray900"},blueLight100:{color:"$blueLight100"},blueLight400:{color:"$blueLight400"},blueLight600:{color:"$blueLight600"},blueLight900:{color:"$blueLight900"},purple25:{color:"$purple25"},purple50:{color:"$purple50"},purple100:{color:"$purple100"},purple200:{color:"$purple200"},purple300:{color:"$purple300"},purple400:{color:"$purple400"},purple500:{color:"$purple500"},purple600:{color:"$purple600"},purple700:{color:"$purple700"},purple800:{color:"$purple800"},purple900:{color:"$purple900"},pink25:{color:"$pink25"},pink50:{color:"$pink50"},pink100:{color:"$pink100"},pink200:{color:"$pink200"},pink300:{color:"$pink300"},pink400:{color:"$pink400"},pink500:{color:"$pink500"},pink600:{color:"$pink600"},pink700:{color:"$pink700"},pink800:{color:"$pink800"},pink900:{color:"$pink900"},orange100:{color:"$orange100"},orange400:{color:"$orange400"},orange600:{color:"$orange600"},orange700:{color:"$orange700"},indigo100:{color:"$indigo100"},indigo600:{color:"$indigo600"},white:{color:"white"}},fontSize:{inherit:{fontSize:"inherit"},textXs:{fontSize:"$textXs"},textSm:{fontSize:"$textSm"},textMd:{fontSize:"$textMd"},textLg:{fontSize:"$textLg"},textXl:{fontSize:"$textXl"},displayXs:{fontSize:"$displayXs"},displaySm:{fontSize:"$displaySm"},displayMd:{fontSize:"$displayMd"},displayLg:{fontSize:"$displayLg"},displayXl:{fontSize:"$displayXl"},display2Xl:{fontSize:"$display2Xl"}},fontWeight:{inherit:{fontWeight:"inherit"},regular:{fontWeight:"$regular"},medium:{fontWeight:"$medium"},semiBold:{fontWeight:"$semiBold"},bold:{fontWeight:"$bold"}},textAlign:{start:{textAlign:"start"},end:{textAlign:"end"},center:{textAlign:"center"},justify:{textAlign:"justify"}},ellipsis:{true:{ellipsis:""}}},defaultVariants:{color:"inherit",fontSize:"inherit",fontWeight:"inherit",textAlign:"start"}}),fr=F.forwardRef((e,t)=>{const n={};return e.height&&(n.height=ir(e.height)),e.width&&(n.width=ir(e.width)),(0,i.jsx)(pr,{...(0,tr.A)(e,"font"),...nr(e.font),ref:t,css:{...n,...e.css}})});fr.displayName="Box";var xr=n(4625),_r=n(6347),Ir=n(8542);function vr(e){return"number"==typeof e&&!isNaN(e)}function br(e,t=96){return Math.round(25.4*e/t)}function jr(e){return e?{lat:e.latitude,lng:e.longitude}:null}const Cr=jr({latitude:43.6087733,longitude:3.87963579999996}),yr=13;function kr(e){return vr(e.latitude)&&vr(e.longitude)?(0,Ir.A)(e,["latitude","longitude"]):void 0}function Ar(e){return e===Xe.GoogleSatellite?"satellite":e===Xe.Google?"roadmap":e??Xe.Google}var wr=n(6996),Sr=n(2096);function Er(){return new google.maps.ImageMapType({getTileUrl:(e,t)=>((e,t)=>`https://data.geopf.fr/wmts?${["REQUEST=GetTile","SERVICE=WMTS","VERSION=1.0.0","STYLE=normal","TILEMATRIXSET=PM",`FORMAT=${encodeURIComponent("image/png")}`,"LAYER=GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2",`TILEMATRIX=${t}`,`TILEROW=${e.y}`,`TILECOL=${e.x}`].join("&")}`)(e,t),tileSize:new google.maps.Size(256,256),name:Xe.IgnPlan,maxZoom:18})}const Tr=(0,F.memo)(e=>{const t=(0,F.useCallback)(t=>{t&&(n.current&&(o.current?.setMap(null),n.current=null),n.current=new google.maps.Map(t,{zoom:e.coordinatesFieldsProps?.zoomProps.input.value??e.initialZoom??yr,center:jr(e.center)||Cr,gestureHandling:"cooperative",mapTypeControl:!1,streetViewControl:!1,mapTypeId:Ar(e.layer),...e.mapOptions||{}}),n.current.mapTypes.set(Xe.IgnPlan,Er()),n.current.addListener("zoom_changed",()=>{e.coordinatesFieldsProps&&e.coordinatesFieldsProps.zoomProps.input.onChange(n.current.getZoom())}),n.current.addListener("tilesloaded",()=>{e.onTilesloaded?.()}),r())},[]),n=(0,F.useRef)(null),o=(0,F.useRef)(null),s=(0,F.useRef)([]),r=()=>{s.current.forEach(e=>e.setMap(null)),Zo(e.traces)?s.current=e.traces.map(e=>{const t=e.points.map(([e,t])=>({lat:e,lng:t})),i=e.direction===Ct.None?[]:[{icon:{path:e.direction===Ct.Backward?google.maps.SymbolPath.BACKWARD_OPEN_ARROW:google.maps.SymbolPath.FORWARD_OPEN_ARROW,scale:4,strokeColor:e.color},offset:"0%",repeat:"200px"}],o=new google.maps.Polyline({path:t,geodesic:!0,strokeColor:e.color,strokeOpacity:1,strokeWeight:4,icons:i});return o.setMap(n.current),o}):s.current=[]};return(0,F.useEffect)(()=>{(()=>{if(o.current&&o.current.setMap(null),e.point&&n.current){const t=jr(e.point);n.current.setCenter(t),o.current=new google.maps.Marker({position:t,map:n.current,draggable:"object"==typeof e.coordinatesFieldsProps&&null!==e.coordinatesFieldsProps}),e.coordinatesFieldsProps&&o.current.addListener("dragend",t=>{e.coordinatesFieldsProps?.latitudeProps.input.onChange(t.latLng.lat()),e.coordinatesFieldsProps?.longitudeProps.input.onChange(t.latLng.lng())})}})()},[JSON.stringify(e.point)]),(0,F.useEffect)(()=>{n.current?.setMapTypeId(Ar(e.layer))},[e.layer]),(0,F.useEffect)(()=>{r()},[JSON.stringify(e.traces||[])]),(0,i.jsx)(fr,{ref:t,height:1,width:1,children:e.coordinatesFieldsProps?.zoomProps&&(0,i.jsx)(Sr.Yr,{name:e.coordinatesFieldsProps.zoomProps.input.name,children:e=>{n.current?.setZoom(e)}})})},wr.A);Tr.displayName="Map";const zr=()=>(0,ee.createPortal)((0,i.jsx)(fr,{className:"h-map-loaded",css:{background:"transparent",height:"1px",left:"-100px",position:"absolute",top:"-100px",width:"1px"}}),document.body),$r="query BackofficeOrganization($organizationId: OrganizationId!) {\n    data: backoffice {\n        row: organization(id: $organizationId) {\n            ...OrganizationBackoffice\n        }\n    }\n}\n";function Or(e,t){return ss("query AccreditationsCategories($eventId: EventId!) {\n    event(id: $eventId) {\n        accreditationsCategories {\n            id\n            name\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}function Rr(e={}){return Un("mutation AccreditationsMassDelete($eventId: EventId!, $selecteds: MassActionSelectedsInput!) {\n    numberOfAccreditations: accreditationsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function Pr(e={}){return Un("mutation AccreditationSlotUpdate(\n    $eventId: EventId!\n    $accreditationSlotId: AccreditationsSlotId!\n    $accreditationSlot: AccreditationsSlotInput!\n) {\n    accreditationSlotUpdate(\n        eventId: $eventId\n        accreditationSlotId: $accreditationSlotId\n        accrediationSlot: $accreditationSlot\n    ) {\n        id\n    }\n}\n",e)}function Dr(e){return Vn('query SendEmailInfos($eventId: EventId!, $usersInfosIds: [UsersInfoId!]!, $name: String) {\n    event(id: $eventId) {\n        segments(segmentType: Volunteers) {\n            id\n            name\n        }\n\n        volunteersRegistrations(\n            name: $name\n            limit: 50\n            sort: { attribute: "Name", direction: Asc }\n        ) {\n            nodes {\n                id\n\n                userInfo {\n                    id\n                    nameOrEmail\n                }\n            }\n        }\n\n        selectedVolunteersRegistrations: volunteersRegistrations(\n            userInfoIds: $usersInfosIds\n            sort: { attribute: "Name", direction: Asc }\n        ) {\n            nodes {\n                id\n\n                userInfo {\n                    id\n                    nameOrEmail\n                }\n            }\n        }\n    }\n}\n',e,[])}function Fr(e,t){return ss($r,{variables:e,token:t||void 0,fragments:[Ro.OrganizationBackofficeFragment]})}function Mr(e,t){return ss("query BackofficeOrganizations(\n    $name: String\n    $predicates: [Predicate!]\n    $limit: Int\n    $offset: Int\n    $sort: OrganizationSort\n) {\n    data: backoffice {\n        rows: organizations(\n            name: $name\n            predicates: $predicates\n            limit: $limit\n            offset: $offset\n            sort: $sort\n        ) {\n            nodes {\n                ...OrganizationBackoffice\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.OrganizationBackofficeFragment]})}function Nr(e){return Vn("query CampaignPreview(\n    $organizationId: OrganizationId!\n    $campaignId: CampaignId!\n    $userInfoId: UsersInfoId!\n) {\n    organization(id: $organizationId) {\n        campaign(id: $campaignId) {\n            subject\n            sendToEveryone\n            preview(userInfoId: $userInfoId)\n            attachments\n            sentAt\n            states\n\n            createdBy {\n                name\n                email\n                picture {\n                    url\n                }\n            }\n\n            documents {\n                ...DocumentEmailPreview\n            }\n\n            emailSender {\n                fromEmail\n                fromName\n            }\n\n            usersInfos {\n                id\n                nameOrEmail\n            }\n\n            segments {\n                id\n                name\n            }\n\n            positionsCategories {\n                id\n                name\n            }\n\n            positions {\n                id\n                name\n            }\n\n            positionsSlots {\n                id\n                nameOrRange\n\n                position {\n                    id\n                    name\n                }\n            }\n\n            tags {\n                id\n                name\n            }\n\n            accreditationsCategories {\n                id\n                name\n            }\n\n            accreditations {\n                id\n                name\n            }\n\n            accreditationsSlots {\n                id\n                name\n\n                accreditation {\n                    id\n                    name\n                }\n            }\n        }\n    }\n}\n",e,[Ro.DocumentEmailPreviewFragment])}function Lr(e={}){return Un("mutation UsersInfosMerge(\n    $organizationId: OrganizationId!\n    $mainUserInfoId: UsersInfoId!\n    $toMergeUsersInfosIds: [UsersInfoId!]!\n) {\n    usersInfosMerge(\n        organizationId: $organizationId\n        mainUserInfoId: $mainUserInfoId\n        toMergeUsersInfosIds: $toMergeUsersInfosIds\n    ) {\n        id\n    }\n}\n",e)}function Br(e={}){return Un("mutation CustomFieldsMassDelete(\n    $organizationId: OrganizationId!\n    $selecteds: MassActionSelectedsInput!\n) {\n    numberOfCustomFields: customFieldsMassDelete(\n        organizationId: $organizationId\n        selecteds: $selecteds\n    )\n}\n",e)}function Vr(e={}){return Un("mutation DelegationCreate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $delegation: DelegationInput!\n) {\n    delegationCreate(organizationId: $organizationId, eventId: $eventId, delegation: $delegation) {\n        id\n    }\n}\n",e)}function Ur(e={}){return Un("mutation DelegationUpdate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $delegationId: DelegationId!\n    $delegation: DelegationInput!\n) {\n    delegationUpdate(\n        organizationId: $organizationId\n        eventId: $eventId\n        delegationId: $delegationId\n        delegation: $delegation\n    ) {\n        id\n    }\n}\n",e)}function Wr(e={}){return Un("mutation DelegationDuplicate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $delegationId: DelegationId!\n) {\n    delegationDuplicate(\n        organizationId: $organizationId\n        eventId: $eventId\n        delegationId: $delegationId\n    ) {\n        id\n    }\n}\n",e)}function Gr(e){return Vn("query Delegations(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $level: OrganizationEventLevel!\n    $name: String\n    $predicates: [Predicate!]\n    $columnsSearch: [String!]\n    $limit: Int\n    $offset: Int\n    $sort: DelegationsSort\n    $includeAccreditationsSlots: Boolean!\n    $includeCampaigns: Boolean!\n    $includeChildren: Boolean!\n    $includeCreatedBy: Boolean!\n    $includeDocuments: Boolean!\n    $includeLeaders: Boolean!\n    $includeResources: Boolean!\n    $includeTags: Boolean!\n    $includeUsedCustomFieldsFilled: Boolean!\n) {\n    data: organization(id: $organizationId) {\n        rows: delegations(\n            level: $level\n            eventId: $eventId\n            name: $name\n            predicates: $predicates\n            columnsSearch: $columnsSearch\n            limit: $limit\n            offset: $offset\n            sort: $sort\n        ) {\n            nodes {\n                ...DelegationsDelegation\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",e,[Ro.DelegationsDelegationFragment])}function Hr(e={}){return Un("mutation DelegationsMassDelete(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $selecteds: MassActionSelectedsInput!\n) {\n    numberOfDelegations: delegationsMassDelete(\n        organizationId: $organizationId\n        eventId: $eventId\n        selecteds: $selecteds\n    )\n}\n",e)}function qr(e){return Vn("query AllEvents($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        events {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n}\n",e,[])}function Yr(e){return Vn("query Events(\n    $organizationId: OrganizationId!\n    $name: String\n    $predicates: [Predicate!]\n    $limit: Int\n    $offset: Int\n    $sort: EventsSort\n    $includeNumberOfMembers: Boolean!\n) {\n    data: organization(id: $organizationId) {\n        rows: events(\n            name: $name\n            predicates: $predicates\n            offset: $offset\n            limit: $limit\n            sort: $sort\n        ) {\n            nodes {\n                ...EventsEvent\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",e,[Ro.EventsEventFragment])}function Kr(e={}){return Un("mutation FormDuplicate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $formId: FormId!\n    $newEventId: EventId\n) {\n    formDuplicate(\n        organizationId: $organizationId\n        eventId: $eventId\n        formId: $formId\n        newEventId: $newEventId\n    ) {\n        id\n    }\n}\n",e)}function Zr(e){return Vn("query Forms($organizationId: OrganizationId!, $level: OrganizationEventLevel!, $eventId: EventId) {\n    organization(id: $organizationId) {\n        forms(level: $level, eventId: $eventId) {\n            nodes {\n                ...FormList\n            }\n        }\n    }\n}\n",e,[Ro.FormListFragment])}function Xr(e){return Vn("query Form($organizationId: OrganizationId!, $formId: FormId!) {\n    organization(id: $organizationId) {\n        form(id: $formId) {\n            name\n        }\n    }\n}\n",e,[])}function Jr(e={}){return Un("mutation PositionsMassLeadersEdit($eventId: EventId!, $massLeaders: MassLeadersInput!) {\n    numberOfPositions: positionsMassLeadersEdit(eventId: $eventId, massLeaders: $massLeaders)\n}\n",e)}function Qr(e){return Vn("query Organizations {\n    organizations {\n        id\n        name\n    }\n\n    user {\n        roles {\n            organizationId\n            type\n        }\n    }\n}\n",e,[])}function ea(e={}){return Un("mutation UserDelete {\n    userDelete {\n        id\n    }\n}\n",e)}function ta(e){return Vn("query Role($organizationId: OrganizationId!, $roleId: RoleId!) {\n    organization(id: $organizationId) {\n        role(id: $roleId) {\n            id\n            type\n            name\n            description\n            delegationCategoryPermissions\n            positionPermissions\n        }\n    }\n}\n",e,[])}function na(e={}){return Un("mutation RoleCreate($organizationId: OrganizationId!, $role: RoleInput!) {\n    roleCreate(organizationId: $organizationId, role: $role) {\n        id\n    }\n}\n",e)}function ia(e={}){return Un("mutation UserAccessDelete($organizationId: OrganizationId!, $scope: AccessScope!, $id: Int!) {\n    userAccessDelete(organizationId: $organizationId, scope: $scope, id: $id)\n}\n",e)}function oa(e={}){return Un("mutation UserAccessUpdate(\n    $organizationId: OrganizationId!\n    $scope: AccessScope!\n    $id: Int!\n    $roleId: RoleId!\n    $sendNotifications: Boolean\n) {\n    userAccessUpdate(\n        organizationId: $organizationId\n        scope: $scope\n        id: $id\n        roleId: $roleId\n        sendNotifications: $sendNotifications\n    )\n}\n",e)}function sa(e,t){return ss("query PositionsCategories($eventId: EventId!) {\n    event(id: $eventId) {\n        positionsCategories {\n            id\n            name\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}function ra(e={}){return Un("mutation PositionsMassDelete($eventId: EventId!, $selecteds: MassActionSelectedsInput!) {\n    numberOfPositions: positionsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function aa(e){return Vn("query Positions(\n    $eventId: EventId!\n    $name: String\n    $predicates: [Predicate!]\n    $hasCoordinates: Boolean\n    $limit: Int\n    $offset: Int\n    $sort: PositionsSort\n    $columnsSearch: [String!]\n    $includeCheckedInRate: Boolean!\n    $includeConditions: Boolean!\n    $includeCreatedBy: Boolean!\n    $includeLeaders: Boolean!\n    $includeTags: Boolean!\n    $includeTraces: Boolean!\n) {\n    data: event(id: $eventId) {\n        layer\n        latitude\n        longitude\n\n        rows: positions(\n            name: $name\n            predicates: $predicates\n            hasCoordinates: $hasCoordinates\n            columnsSearch: $columnsSearch\n            limit: $limit\n            offset: $offset\n            sort: $sort\n        ) {\n            nodes {\n                ...PositionsPosition\n            }\n\n            numberOfPages\n            totalCount\n        }\n\n        traces @include(if: $includeTraces) {\n            ...Trace\n        }\n    }\n}\n",e,[Ro.PositionsPositionFragment,Ro.TraceFragment])}function la(e,t){return ss('query PositionsMobile(\n    $eventId: EventId!\n    $predicates: [Predicate!]\n    $limit: Int\n    $offset: Int\n    $name: String\n) {\n    event(id: $eventId) {\n        positions(\n            predicates: $predicates\n            limit: $limit\n            offset: $offset\n            sort: { attribute: "Category", direction: Asc }\n            name: $name\n        ) {\n            nodes {\n                id\n                name\n                range\n                resources\n                assignedResources\n                isVisible\n\n                category {\n                    id\n                    name\n\n                    leaders {\n                        ...LeaderInfos\n                    }\n                }\n\n                slots {\n                    id\n                }\n            }\n\n            pageInfo {\n                ...FullPageInfo\n            }\n\n            totalCount\n        }\n    }\n}\n',{variables:e,token:t||void 0,fragments:[Ro.LeaderInfosFragment,Ro.FullPageInfoFragment]})}function da(e,t){return ss('query PositionSlotMembersMobile(\n    $eventId: EventId!\n    $positionSlotId: PositionsSlotId!\n    $predicates: [Predicate!]!\n    $limit: Int\n    $offset: Int\n) {\n    event(id: $eventId) {\n        positionSlot(id: $positionSlotId) {\n            name\n            positionCategoryId\n            range\n        }\n\n        volunteersRegistrations(\n            positionSlotId: $positionSlotId\n            predicates: $predicates\n            limit: $limit\n            offset: $offset\n            sort: { attribute: "Name", direction: Asc }\n        ) {\n            nodes {\n                id\n\n                positionSlotUserInfo(positionSlotId: $positionSlotId) {\n                    id\n                    state\n                }\n\n                userInfo {\n                    id\n                    name\n                    email\n                    picture {\n                        url\n                    }\n                }\n            }\n\n            pageInfo {\n                ...FullPageInfo\n            }\n\n            totalCount\n        }\n    }\n}\n',{variables:e,token:t||void 0,fragments:[Ro.FullPageInfoFragment]})}function ca(e,t){return ss("query PositionSlotsMobile($eventId: EventId!, $positionId: PositionId!, $limit: Int, $offset: Int) {\n    event(id: $eventId) {\n        positionsSlots(positionsIds: [$positionId], limit: $limit, offset: $offset) {\n            nodes {\n                ...PositionPositionSlot\n            }\n\n            pageInfo {\n                ...FullPageInfo\n            }\n\n            totalCount\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.PositionPositionSlotFragment,Ro.FullPageInfoFragment]})}function ua(e){return Vn("query PositionDashboard(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $positionId: PositionId!\n) {\n    organization(id: $organizationId) {\n        customFields(variety: Position) {\n            nodes {\n                ...CustomFieldWithCondition\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        position(id: $positionId) {\n            id\n            positionCategoryId\n            positionCategoryName\n            name\n            description\n            privateNote\n            color\n            icon\n            resources\n            assignedResources\n            preassignedResources\n            address\n            latitude\n            longitude\n            zoom\n            layer\n            isVisible\n            range\n            fields\n\n            links {\n                positionPlanningLink\n                positionSheetLink\n            }\n\n            traces {\n                ...Trace\n            }\n\n            customFields: positionsCustomFields {\n                customField {\n                    name\n                    fieldType\n\n                    values {\n                        id\n                        value\n                    }\n                }\n\n                conditionValue\n            }\n\n            leaders {\n                ...LeaderInfos\n            }\n\n            tags {\n                id\n                name\n            }\n        }\n    }\n}\n",e,[Ro.CustomFieldWithConditionFragment,Ro.TraceFragment,Ro.LeaderInfosFragment])}function ha(e={}){return Un("mutation PositionSlotUpdate(\n    $eventId: EventId!\n    $positionId: PositionId!\n    $positionSlotId: PositionsSlotId!\n    $positionSlot: PositionsSlotInput!\n) {\n    positionSlotUpdate(\n        eventId: $eventId\n        positionId: $positionId\n        positionSlotId: $positionSlotId\n        positionSlot: $positionSlot\n    ) {\n        id\n    }\n}\n",e)}function ma(e){return Vn("query UserFieldUpdate($organizationId: OrganizationId!, $slug: CustomFieldSlug!) {\n    organization: organizationPublic(id: $organizationId) {\n        customField: customFieldBySlug(slug: $slug) {\n            name\n            description\n        }\n    }\n}\n",e,[])}function ga(e,t){return ss("query CreateUserDelegationForm(\n    $organizationId: OrganizationId!\n    $delegationId: DelegationId\n    $eventId: EventId\n    $formId: FormId!\n) {\n    organization(id: $organizationId) {\n        country\n\n        delegation: delegationMaybe(id: $delegationId) {\n            id\n\n            accreditationsSlots(onlyVisible: true) {\n                ...DelegationAccreditationSlot\n            }\n        }\n\n        event: eventMaybe(id: $eventId) {\n            startAt\n            endAt\n            ranges(formId: $formId, delegationId: $delegationId)\n            country\n\n            accreditationsCategories {\n                ...FormRegisterAccreditationCategory\n            }\n\n            positionsCategories {\n                ...FormRegisterCategory\n            }\n        }\n\n        form(id: $formId) {\n            ...CreateUpdateMemberForm\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.DelegationAccreditationSlotFragment,Ro.FormRegisterAccreditationCategoryFragment,Ro.FormRegisterCategoryFragment,Ro.CreateUpdateMemberFormFragment]})}function pa(e={}){return Un("mutation CommentCreate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $userInfoId: UsersInfoId!\n    $comment: CommentInput!\n) {\n    commentCreate(\n        organizationId: $organizationId\n        eventId: $eventId\n        userInfoId: $userInfoId\n        comment: $comment\n    ) {\n        id\n    }\n}\n",e)}function fa(e){return Vn("query Comments($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n    organization(id: $organizationId) {\n        userInfo(id: $userInfoId) {\n            comments {\n                ...Comment\n            }\n        }\n    }\n}\n",e,[Ro.CommentFragment])}function xa(e){return Vn("query OrganizationUsersInfos(\n    $organizationId: OrganizationId!\n    $excludedEventId: EventId\n    $excludedDelegationId: DelegationId\n    $name: String\n) {\n    organization(id: $organizationId) {\n        usersInfos(\n            excludedEventId: $excludedEventId\n            excludedDelegationId: $excludedDelegationId\n            name: $name\n            limit: 25\n        ) {\n            nodes {\n                ...ExistingVolunteer\n            }\n        }\n    }\n}\n",e,[Ro.ExistingVolunteerFragment])}function _a(e={}){return Un("mutation VolunteersRegistrationsAdminAdd(\n    $eventId: EventId!\n    $usersInfosIds: [UsersInfoId!]!\n    $sendVolunteerRegistrationEmail: Boolean!\n) {\n    volunteersRegistrationsAdminAdd(\n        eventId: $eventId\n        usersInfosIds: $usersInfosIds\n        sendVolunteerRegistrationEmail: $sendVolunteerRegistrationEmail\n    ) {\n        id\n    }\n}\n",e)}function Ia(e){return Vn("query OrganizationImportInfos($organizationId: OrganizationId!, $variety: CustomFieldVariety) {\n    organization(id: $organizationId) {\n        customFields(\n            variety: $variety\n            fieldTypes: [\n                Address\n                Checkbox\n                Country\n                Date\n                Datetime\n                Language\n                Nationality\n                Number\n                Phone\n                Select\n                Sex\n                Text\n                Textarea\n                Time\n                Validation\n            ]\n        ) {\n            nodes {\n                ...CustomFieldImport\n            }\n        }\n    }\n}\n",e,[Ro.CustomFieldImportFragment])}function va(e={}){return Un("mutation VolunteersRegistrationsMassPreAssign(\n    $eventId: EventId!\n    $massPreAssign: MassPreAssignInput!\n) {\n    numberOfMembers: volunteersRegistrationsMassPreAssign(\n        eventId: $eventId\n        massPreAssign: $massPreAssign\n    )\n}\n",e)}function ba(e={}){return Un("mutation UsersInfosMassDelegationAdd(\n    $organizationId: OrganizationId!\n    $delegationId: DelegationId!\n    $selecteds: MassActionSelectedsInput!\n) {\n    numberOfMembers: usersInfosMassDelegationAdd(\n        organizationId: $organizationId\n        delegationId: $delegationId\n        selecteds: $selecteds\n    )\n}\n",e)}function ja(e,t){return ss("query VolunteersMobile(\n    $eventId: EventId!\n    $predicates: [Predicate!]!\n    $limit: Int\n    $offset: Int\n    $name: String\n) {\n    event(id: $eventId) {\n        volunteersRegistrations(\n            predicates: $predicates\n            limit: $limit\n            offset: $offset\n            name: $name\n        ) {\n            nodes {\n                id\n                state\n\n                userInfo {\n                    id\n                    name\n                    email\n                    picture {\n                        url\n                    }\n                }\n            }\n\n            pageInfo {\n                ...FullPageInfo\n            }\n\n            totalCount\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.FullPageInfoFragment]})}function Ca(e,t){return ss("query Workflows(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $level: OrganizationEventLevel!\n    $name: String\n    $predicates: [Predicate!]\n    $limit: Int\n    $offset: Int\n    $sort: WorkflowsSort\n    $includeAccreditations: Boolean!\n    $includeCampaign: Boolean!\n    $includeCustomField: Boolean!\n) {\n    data: organization(id: $organizationId) {\n        rows: workflows(\n            level: $level\n            eventId: $eventId\n            name: $name\n            predicates: $predicates\n            limit: $limit\n            offset: $offset\n            sort: $sort\n        ) {\n            nodes {\n                ...WorkflowsWorkflow\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.WorkflowsWorkflowFragment]})}function ya(e,t){return ss("query WorkflowsWorkflow(\n    $organizationId: OrganizationId!\n    $id: WorkflowId!\n    $includeAccreditations: Boolean!\n    $includeCampaign: Boolean!\n    $includeCustomField: Boolean!\n) {\n    data: organization(id: $organizationId) {\n        row: workflow(id: $id) {\n            ...WorkflowsWorkflow\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.WorkflowsWorkflowFragment]})}const ka=()=>{const{eventId:e,accreditationId:t}=Wn(),{data:n,loader:o}=Vn("query AccreditationMap($eventId: EventId!, $accreditationId: AccreditationId!) {\n    eventPublic(id: $eventId) {\n        accreditation(id: $accreditationId) {\n            layer\n            latitude\n            longitude\n            zoom\n        }\n    }\n}\n",{eventId:e,accreditationId:t},[]),[s,r]=(0,F.useState)(!1);if(o)return o;{const e=n.eventPublic.accreditation;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(Tr,{initialZoom:e.zoom,layer:e.layer,mapOptions:{disableDefaultUI:!0,keyboardShortcuts:!1},point:kr(e),onTilesloaded:()=>{r(!0)}})}),s&&(0,i.jsx)(zr,{})]})}};var Aa;function wa(e){return(0,Ir.A)(e,["direction","align","justify","wrap","gap","css","height","width"])}!function(e){e.Nav="nav",e.Header="header",e.Main="main"}(Aa||(Aa={}));const Sa=ar("div",{display:"flex",variants:{direction:{row:{flexDirection:"row"},column:{flexDirection:"column"},rowReverse:{flexDirection:"row-reverse"},columnReverse:{flexDirection:"column-reverse"}},align:{start:{alignItems:"flex-start"},center:{alignItems:"center"},end:{alignItems:"flex-end"},stretch:{alignItems:"stretch"},baseline:{alignItems:"baseline"}},justify:{start:{justifyContent:"flex-start"},center:{justifyContent:"center"},end:{justifyContent:"flex-end"},between:{justifyContent:"space-between"},evenly:{justifyContent:"space-evenly"}},wrap:{noWrap:{flexWrap:"nowrap"},wrap:{flexWrap:"wrap"},wrapReverse:{flexWrap:"wrap-reverse"}},gap:{1:{gap:"$1"},2:{gap:"$2"},3:{gap:"$3"},4:{gap:"$4"},5:{gap:"$5"},6:{gap:"$6"},7:{gap:"$7"},8:{gap:"$8"},9:{gap:"$9"},10:{gap:"$10"},11:{gap:"$11"},12:{gap:"$12"},13:{gap:"$13"}}},defaultVariants:{direction:"row",align:"stretch",justify:"start",wrap:"noWrap"}}),Ea=F.forwardRef(({onClick:e,...t},n)=>{const o={};return t.height&&(o.height=ir(t.height)),t.width&&(o.width=ir(t.width)),(0,i.jsx)(Sa,{...t,ref:n,css:{...o,...t.css},onClick:e})});Ea.displayName="Flex";var Ta=n(7356);let za=class{validate(e){return async t=>{try{return await e.validate(t,{abortEarly:!1,strict:!0}),{}}catch(e){return this.errorToObject(e)}}}validateSync(e,t){try{return e.validateSync(t,{abortEarly:!1,strict:!0}),{}}catch(e){return this.errorToObject(e)}}isValidSync(e,t){return 0===Object.keys(this.validateSync(e,t)).length}validateForForm(e){return async t=>{try{return await e.validate(t,{abortEarly:!1,strict:!0}),{}}catch(e){return e.inner.reduce((e,t)=>(0,Ta.Oe)(e,t.path,t.message),{})}}}errorToObject(e){return e.inner.reduce((e,t)=>({...e,[t.path]:t.message}),{})}};za=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)()],za);var $a=n(924),Oa=n(952);const Ra=(0,F.createContext)({}),Pa=ar("div",{variants:{height:{default:{height:"100%"},1:{minHeight:"$space$1"},2:{minHeight:"$space$2"},3:{minHeight:"$space$3"},4:{minHeight:"$space$4"},5:{minHeight:"$space$5"},6:{minHeight:"$space$6"},7:{minHeight:"$space$7"},8:{minHeight:"$space$8"},9:{minHeight:"$space$9"},10:{minHeight:"$space$10"},11:{minHeight:"$space$11"},12:{minHeight:"$space$12"},13:{minHeight:"$space$13"}},width:{default:{width:"100%"},1:{minWidth:"$space$1"},2:{minWidth:"$space$2"},3:{minWidth:"$space$3"},4:{minWidth:"$space$4"},5:{minWidth:"$space$5"},6:{minWidth:"$space$6"},7:{minWidth:"$space$7"},8:{minWidth:"$space$8"},9:{minWidth:"$space$9"},10:{minWidth:"$space$10"},11:{minWidth:"$space$11"},12:{minWidth:"$space$12"},13:{minWidth:"$space$13"}}},defaultVariants:{height:"default",width:"default"}});var Da=n(9241),Fa=n(2695),Ma=n(2326);const Na=["access","ticket","pay"],La=({children:e,height:t,replace:n,style:o,to:s,width:r,...a})=>{const l=new URL(s.toString(),location.origin),d={};t&&(d.height=ir(t)),r&&(d.width=ir(r));const c={alignItems:"inherit",color:"inherit",cursor:"pointer",display:"inherit",flexDirection:"inherit",flexWrap:"inherit",gap:"inherit",justifyContent:"inherit",textDecoration:"none",...d,...o};return l.origin!==location.origin||Na.includes(l.pathname.split("/")[1])?(0,i.jsx)("a",{href:l.href,rel:"noreferrer",style:c,target:"_blank",...a,children:e}):(0,i.jsx)(xr.N_,{replace:n,style:c,to:{pathname:l.pathname,hash:l.hash,search:l.search},...a,children:e})};function Ba(e){return(0,Ma.A)(e)}La.displayName="LinkWrapper";const Va=e=>{const t=e.iconStyle??"regular",n={};e.primaryColor&&(n["--fa-primary-color"]=e.primaryColor),e.secondaryColor&&(n["--fa-secondary-color"]=e.secondaryColor,n["--fa-secondary-opacity"]="1");const o=()=>(0,i.jsx)("i",{"aria-hidden":e["aria-hidden"]??!0,className:`fa-${t} fa-${e.icon} ${e.className||""}`,role:e.role,style:{...n,cursor:e.title?"help":"inherit"},title:e.title,onClick:e.to?void 0:e.onClick});return e.to?(0,i.jsx)(La,{target:e.target,to:e.to,onClick:e.onClick,children:o()}):o()};function Ua(e,t){"production"!==Q.Production&&console.warn(`Component ${e} is deprecated, use ${t} instead.`)}const Wa=ar("div",{alignItems:"center",display:"grid",gap:"6px 8px",gridTemplateColumns:"min-content auto"}),Ga=ar(Ea,{alignItems:"center",borderRadius:"$2",fontWeight:"$medium",gap:"$3",padding:"$3 $4","& i":{fontSize:"$textMd"},variants:{color:{primary:{background:"$primary50",border:"1px solid $primary400",color:"$primary700",[`${Wa}`]:{color:"$primary500"}},gray:{background:"$gray50",border:"1px solid $gray400",color:"$gray700",[`${Wa}`]:{color:"$gray500"}},error:{background:"$error50",border:"1px solid $error400",color:"$error700",[`${Wa}`]:{color:"$error500"}},warning:{background:"$warning50",border:"1px solid $warning400",color:"$warning700",[`${Wa}`]:{color:"$warning500"}},success:{background:"$success50",border:"1px solid $success400",color:"$success700",[`${Wa}`]:{color:"$success500"}}}},defaultVariants:{color:"primary"}}),Ha=e=>(Ua("common-front/src/designSystem/components/alert.tsx","common-front/src/designSystem/components/alert/alert.tsx"),(0,i.jsxs)(Ga,{"aria-live":e["aria-live"]??"polite",color:e.color,role:"alert",width:e.width,children:[e.leftIcon&&(0,i.jsx)(Ea,{align:"center",children:(0,i.jsx)(Va,{icon:e.leftIcon})}),(0,i.jsx)(fr,{css:{flex:"1"},children:e.children}),e.rightIcon&&(0,i.jsx)(Ea,{align:"center",css:{cursor:e.rightIconClick?"pointer":"default"},onClick:()=>{e.rightIconClick?.()},children:(0,i.jsx)(Va,{icon:e.rightIcon})})]})),qa={Root:Ha,Titled:Wa,Title:({children:e,icon:t})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Va,{icon:t,iconStyle:"solid"}),(0,i.jsx)(fr,{color:"gray800",children:e})]}),Text:({children:e})=>(0,i.jsx)(fr,{color:"gray800",css:{gridColumn:"2 / 3"},fontWeight:"regular",children:e})},Ya=ar("p",{fontStyle:"normal",padding:"unset",margin:"unset",lineHeight:"1.42857143","& > *:not(ul)":{display:"inline"},variants:{textStyle:{inherit:{color:"inherit",fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit"},heading:{color:"$gray900",fontSize:"$textLg",fontWeight:"$medium",lineHeight:"1.55556"},subheading:{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium",lineHeight:"1.5"},subtitle:{color:"$gray500",fontSize:"$textSm",fontWeight:"$regular",lineHeight:"1.42857"},bodyText:{color:"$gray800",fontSize:"$textSm"},abbreviation:{color:"$gray500",fontVariant:"small-caps",fontSize:"$textSm"}}},defaultVariants:{textStyle:"bodyText"}}),Ka=F.forwardRef(({children:e,...t},n)=>(0,i.jsx)(Ya,{ref:n,...t,children:e}));function Za(e){throw new Error("Didn't expect to get here")}Ka.displayName="Text";const Xa=e=>{if("error"===e.iconStyle)return(0,i.jsx)(Va,{icon:"circle-exclamation",iconStyle:"solid"});Za(e.iconStyle)},Ja=ar(Ea,{borderRadius:"$1",alignItems:"flex-start",gap:"$2",flex:"1 0 0",padding:"$4","& i":{fontSize:"$textMd"},variants:{alertStyle:{error:{background:"$error50",border:"1px solid $error500",color:"$gray800","& i":{color:"$error500"}}}},defaultVariants:{alertStyle:"error"}}),Qa=({min:e=2,max:t=6,textStyle:n="heading",children:o,...s})=>{t{const i=e?.parentElement;if(!i||n===t)return n;for(const e of Array(i.children))if(e[0]instanceof HTMLHeadingElement)return d(i,++n);return d(i,n)},[t]);return F.useEffect(()=>l(`h${d(r.current?.parentElement,e)}`),[e,t]),(0,i.jsx)(Ka,{ref:r,as:a,...s,textStyle:n,children:o})},el=e=>(0,i.jsxs)(Ja,{"aria-live":e["aria-live"]??"polite",role:"alert",width:e.width,children:[(0,i.jsx)(Ea,{align:"start",children:(0,i.jsx)(fr,{height:"20px",width:"20px",children:(0,i.jsx)(Xa,{iconStyle:"error"})})}),(0,i.jsx)(Ea,{align:"start",css:{gap:"2px"},direction:"column",children:e.children})]}),tl=({children:e})=>(0,i.jsx)(Qa,{css:{color:"$gray900",fontWeight:"$medium",fontSize:"$textSm",lineHeight:"1.42857"},children:e}),nl=({children:e})=>(0,i.jsx)(Ka,{children:e});function il(){return{history:Gn(),params:Wn(),translate:Ln()}}function ol(e){return e?(0,Oo.A)(Object.values(e).map(e=>"string"==typeof e?e:Array.isArray(e)?(0,Da.A)(e).map(e=>ol(e)).flat():ol(e)).flat()):[]}const sl=e=>{const{translate:t}=il(),{errors:n,submitErrors:o,showErrors:s}=(0,F.useContext)(Ra),r=ol((0,Fa.A)({},n,o));return s&&Zo(r)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(({children:n})=>e.featureFlags?.isV4?(0,i.jsxs)(el,{alertStyle:"error","aria-live":"assertive",id:e.errorId,children:[(0,i.jsx)(tl,{children:t("form_has_errors_14074")}),(0,i.jsx)(nl,{children:(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:n})})]}):(0,i.jsx)(Ha,{"aria-live":"assertive",color:"error",id:e.errorId,leftIcon:"circle-exclamation",children:(0,i.jsx)(fr,{width:1,children:(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-6)"},children:n})})}),{children:r.map((e,t)=>(0,i.jsx)("li",{children:e},t))}),!0!==e.hideSpacer&&(0,i.jsx)(Pa,{height:"6"})]}):null};function rl(e,t){Object.values(t.fields).forEach(e=>{e.data={...e.data,forceDisplayError:!0}})}const al=ar("input",{left:"-9999px",position:"absolute",top:"-9999px",visibility:"hidden"}),ll=e=>{const t=F.useRef(null),{setShowErrors:n}=F.useContext(Ra),o=i=>(i?.preventDefault?.(),e.formRenderProps.invalid?(n(!0),e.formRenderProps.form.mutators.forceErrors(),setTimeout(()=>{e.customErrorRef&&e.customErrorRef.current?(e.customErrorRef.current.scrollIntoView(),e.customErrorRef.current.scrollTop=0):!e.hideDefaultErrors&&t.current&&(t.current.scrollIntoView(),t.current.scrollTop=0)},100),!e.formRenderProps.hasValidationErrors&&e.formRenderProps.hasSubmitErrors?e.formRenderProps.handleSubmit():void 0):e.formRenderProps.handleSubmit());return(0,i.jsxs)(Ea,{ref:t,as:"form",onSubmit:o,...wa(e),children:[!e.hideDefaultErrors&&!e.customErrorRef&&(0,i.jsx)(sl,{}),(0,i.jsx)(al,{type:"submit",value:"Submit"}),e.render({dirty:e.formRenderProps.dirty,errors:e.formRenderProps.errors,form:e.formRenderProps.form,handleSubmit:o,invalid:e.formRenderProps.invalid,submitErrors:e.formRenderProps.submitErrors,submitting:e.formRenderProps.submitting,values:e.formRenderProps.values})]})},dl=e=>{const t=Nn(za),[n,o]=F.useState(!1);return(0,i.jsx)(Oa.lV,{initialValues:e.initialValues,initialValuesEqual:e.initialValuesEqual??wr.A,mutators:{...e.mutators,...$a.A,forceErrors:rl},render:t=>(0,i.jsx)(Ra.Provider,{value:{errors:t.errors,showErrors:n,submitErrors:t.submitErrors,setShowErrors:o},children:(0,i.jsx)(ll,{...(0,Ir.A)(e,["direction","align","justify","wrap","gap","css","height","width"]),customErrorRef:e.customErrorRef,formRenderProps:t,hideDefaultErrors:e.hideDefaultErrors,render:e.render})}),validate:n=>e.schema?t.validateForForm(e.schema)(n):"function"==typeof e.validate?e.validate(n):{},onSubmit:async(t,n,i)=>{const s=await e.onSubmit(t,n,i);return Object.keys(s||{}).length>0&&o(!0),s}})},cl=e=>(0,F.createElement)("svg",{width:e.width,height:e.height,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",className:"lds-rolling","data-testid":"loader",style:{background:"none"}},(0,F.createElement)("circle",{cx:"50",cy:"50",fill:"none",stroke:e.color,strokeWidth:e.strokeWidth,r:"16",strokeDasharray:"75.39822368615503 27.132741228718345",transform:"rotate(120 50 50)"},(0,F.createElement)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 50 50;360 50 50",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}))),ul=(0,F.memo)(function(){return(0,i.jsx)(Ea,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(cl,{color:"#162131",height:"200px",strokeWidth:"2",width:"200px"})})}),hl={alignItems:"center",borderRadius:"$1",cursor:"pointer",display:"flex",fontWeight:"$semiBold",gap:"$2",padding:"$1 $4",userSelect:"none","& .loader":{borderRadius:"$1"},variants:{color:{primary:{background:"$primary700",border:"1px solid $primary700",color:"white","&:hover":{background:"$primary800",border:"1px solid $primary800"},"& .loader":{background:"$primary700",border:"1px solid $primary700"},"& .loader:hover":{background:"$primary800",border:"1px solid $primary800"}},gray:{background:"$gray100",border:"1px solid $gray100",color:"$gray800","&:hover":{background:"$gray100",border:"1px solid $gray100"},"& .loader":{background:"$gray100",border:"1px solid $gray100"},"& .loader:hover":{background:"$gray100",border:"1px solid $gray100"}},white:{background:"white",border:"1px solid $gray300",color:"$gray700","&:hover":{background:"$gray50",color:"$gray800"},"& .loader":{background:"white",border:"1px solid $gray300"},"& .loader:hover":{background:"$gray50",color:"$gray800"}},error:{background:"$error600",border:"1px solid $error600",color:"white","&:hover":{background:"$error700",border:"1px solid $error600"},"& .loader":{background:"$error600",border:"1px solid $error600"},"& .loader:hover":{background:"$error700",border:"1px solid $error600"}},invisible:{background:"none",border:"none",color:"$primary700",fontSize:"$textSm",fontWeight:"$medium",padding:"$1 $2","&:hover":{color:"$primary900"},"& .h-button-content:has( + .loader)":{color:"transparent"}},"invisible-gray":{background:"none",border:"none",color:"$gray700",fontSize:"$textSm",fontWeight:"$medium",padding:"$1 $2","&:hover":{color:"$gray900"},"& .h-button-content:has( + .loader)":{color:"transparent"}}},disabled:{true:{cursor:"not-allowed"}},size:{sm:{height:"32px",fontSize:"$textSm"},md:{height:"40px",fontSize:"$textSm"},lg:{height:"44px",fontSize:"$textMd"},xl:{height:"48px",fontSize:"$textMd"},"2xl":{height:"60px",fontSize:"$textLg"}},iconOnly:{true:{justifyContent:"center",px:"0"}}},compoundVariants:[{color:"primary",disabled:!0,css:{color:"$gray400",background:"$gray100",border:"1px solid $gray100","&:hover":{background:"$gray100",border:"1px solid $gray100"},"& .loader":{background:"$gray100",border:"1px solid $gray100"},"& .loader:hover":{background:"$gray100",border:"1px solid $gray100"}}},{color:"gray",disabled:!0,css:{background:"$primary25",border:"1px solid $primary25",color:"$primary300","&:hover":{background:"$primary25",border:"1px solid $primary25"},"& .loader":{background:"$primary25",border:"1px solid $primary25"},"& .loader:hover":{background:"$primary25",border:"1px solid $primary25"}}},{color:"transparent",disabled:!0,css:{color:"$gray400",background:"$primary100",border:"1px solid $primary100","&:hover":{color:"$gray400",background:"$primary100",border:"1px solid $primary100"},"& .loader":{background:"$primary100",border:"1px solid $primary100"},"& .loader:hover":{background:"$primary100",border:"1px solid $primary100"}}},{color:"invisible",disabled:!0,css:{color:"$gray400","&:hover":{color:"$gray400"}}},{color:"invisible-gray",disabled:!0,css:{color:"$gray400","&:hover":{color:"$gray400"}}},{color:"error",disabled:!0,css:{background:"$error200",border:"1px solid $error200","&:hover":{background:"$error200",border:"1px solid $error200"},"& .loader":{background:"$error200",border:"1px solid $error200"},"& .loader:hover":{background:"$error200",border:"1px solid $error200"}}},{size:"sm",iconOnly:!0,css:{width:"32px"}},{size:"md",iconOnly:!0,css:{width:"40px"}},{size:"lg",iconOnly:!0,css:{width:"44px"}},{size:"xl",iconOnly:!0,css:{width:"48px"}},{size:"2xl",iconOnly:!0,css:{width:"56px"}}],defaultVariants:{color:"primary",size:"md"}},ml=ar("button",hl),gl=ar("div",hl),pl=F.forwardRef(({children:e,className:t,color:n,css:o,disabled:s,featureFlags:r,isLoading:a,leftIcon:l,onClick:d,to:c,rightIcon:u,size:h,textAlign:m=(r?.isV4?"center":void 0),title:g,...p},f)=>{const x=!!l&&!e&&!u||!l&&!e&&!!u,_={className:`button ${t||""}`,color:n,css:{width:r?.isV4?"100%":void 0,...o,position:"relative"},disabled:s,iconOnly:x,size:h,title:g},I={children:e,color:n,leftIcon:l,isLoading:a,rightIcon:u,textAlign:m};return c&&!s?(0,i.jsx)(La,{style:r?.isV4?{flex:"1"}:void 0,title:g,to:c,onClick:e=>{s||a||d&&d(e)},...p,children:(0,i.jsx)(gl,{..._,ref:f,children:(0,i.jsx)(fl,{...I})})}):(0,i.jsx)(ml,{..._,ref:f,type:"button",onClick:e=>{s||a||d&&d(e)},...p,children:(0,i.jsx)(fl,{...I})})});pl.displayName="Button",pl.toString=()=>".button";const fl=({children:e,color:t,isLoading:n,leftIcon:o,rightIcon:s,textAlign:r})=>(0,i.jsxs)(i.Fragment,{children:[o&&(0,i.jsx)(Ea,{children:(0,i.jsx)(Va,{icon:o})}),e&&(0,i.jsx)(fr,{className:"h-button-content",css:{flex:"1"},textAlign:r,children:e}),s&&(0,i.jsx)(Ea,{children:(0,i.jsx)(Va,{icon:s})}),n&&(0,i.jsx)(Ea,{align:"center",className:"loader",css:{height:"calc(100% + 2px)",left:"-1px",position:"absolute",top:"-1px",width:"calc(100% + 2px)",zIndex:10},justify:"center",children:(0,i.jsx)(cl,{color:t&&"primary"!==t&&"error"!==t?lr.colors.gray800.value:"white",height:"40px",strokeWidth:"3",width:"40px"})})]});var xl=n(9008);function _l(e){return e.data?.forceDisplayError&&e.invalid||e.touched&&!e.pristine&&e.invalid||!1}const Il=(e,t=!0)=>{t&&e?.preventDefault(),e?.nativeEvent?.stopImmediatePropagation(),e?.stopPropagation()};var vl=n(5664);function bl(){const[e]=(0,F.useState)(()=>(0,vl.A)("forminput-")),[t]=(0,F.useState)(()=>(0,vl.A)("forminputlabel-")),[n]=(0,F.useState)(()=>(0,vl.A)("forminputdesc-")),[i]=(0,F.useState)(()=>(0,vl.A)("forminputerror-"));return{inputId:e,labelId:t,descId:n,errorId:i}}const jl=({children:e,id:t})=>e?(0,i.jsx)(fr,{color:"gray500",fontSize:"textXs",id:t,children:e}):null,Cl=e=>e.children?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"error"===e.state?"error500":"gray500",fontSize:"textXs",id:e.id,role:"error"===e.state?"alert":void 0,children:e.children})]}):null,yl=({id:e,children:t,htmlFor:n,isClickable:o=!0})=>t?(0,i.jsx)("label",{htmlFor:n,id:e,style:{display:"block",cursor:"inherit",fontWeight:"$medium",marginBlockEnd:0},onClick:e=>{o||e.preventDefault()},children:(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",children:t})}):null,kl=ar("div",{alignItems:"center",borderRadius:"$1",display:"flex",gap:"$space$2",padding:"0 $space$3",position:"relative",width:"100%","& input::placeholder":{color:"$gray500"},"&:focus-within":{border:"2px solid $primary700"},variants:{state:{active:{backgroundColor:"white",border:"1px solid $gray300",color:"$gray900"},disabled:{background:"$gray50",border:"1px solid $gray300",color:"$gray500"},error:{backgroundColor:"white",border:"1px solid $error500"},search:{backgroundColor:"$gray100",border:"1px solid $gray300",color:"$gray500"}},cursor:{default:{cursor:"default"},text:{cursor:"text"},pointer:{cursor:"pointer"}},height:{fixed:{height:"40px"},fluid:{minHeight:"40px"}}},defaultVariants:{state:"active",height:"fixed"}}),Al=F.forwardRef(({height:e,cursor:t,css:n,icon:o,children:s,state:r,onClick:a,rightIcon:l,rightText:d,onRightIconClick:c,...u},m)=>(0,i.jsxs)(kl,{ref:m,className:"h-styled-input-container",css:n,cursor:t,height:e,role:"listbox",state:r,onClick:e=>{a?.(e)},...u,children:[o&&(0,i.jsx)(Ea,{css:{color:"$gray500"},role:"presentation",children:(0,i.jsx)(Va,{icon:o})}),s,"error"===r&&(0,i.jsx)(Ea,{className:"styled-input-container-circle-exclamation",css:{color:"$error500"},children:(0,i.jsx)(Va,{icon:"circle-exclamation"})}),l&&(0,i.jsx)(Ea,{css:{color:"$gray500",cursor:"function"==typeof c?"pointer":"inherit"},role:"presentation",onClick:e=>{c?.(e)},children:(0,i.jsx)(Va,{icon:l})}),h(d)&&(0,i.jsx)(fr,{css:{userSelect:"none"},font:"gray500 textSm regular",children:d})]}));Al.displayName="StyledInputContainer";const wl=F.forwardRef(({autoComplete:e,isEmail:t,shouldParseAsInt:n,css:o,label:s,description:r,hint:a,onRightIconClick:l,state:d,type:c,onChange:u,rightIcon:m,rightText:g,icon:p,...f},x)=>{const _=F.useRef(),I=F.useRef(),v=x??I,{inputId:b,descId:j,errorId:C}=bl();return(0,i.jsxs)(Ea,{ref:_,css:o,direction:"column",width:1,children:[(0,i.jsx)(yl,{htmlFor:b,children:s}),(0,i.jsx)(jl,{id:j,children:r}),(s||r)&&(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(Al,{cursor:"text",icon:p,rightIcon:m,rightText:g,state:d,onClick:()=>v.current?.focus(),onRightIconClick:e=>{Il(e),l?.(e)},children:(0,i.jsx)(fr,{color:"inherit",css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"},"& input::placeholder":{color:"search"===d?"$gray400":"$gray500",opacity:1},"& input::-ms-input-placeholder ":{color:"search"===d?"$gray400":"$gray500",opacity:1}},children:(0,i.jsx)("input",{ref:v,"aria-describedby":r?j:void 0,"aria-errormessage":"error"===d?C:void 0,"aria-invalid":"error"===d,autoComplete:e??"off",disabled:"disabled"===d,id:b,type:c??(t?"email":n?"number":"text"),onChange:e=>{if(t&&h(e.target.value))u(e.target.value.toLowerCase());else if(!0===n){const t=parseInt(e.target.value,10);isNaN(t)?u(0):u(t)}else u(e.target.value)},...f})})}),(0,i.jsx)(Cl,{id:C,state:d,children:a})]})});wl.displayName="TextInput";const Sl=({autoComplete:e,hint:t,shouldParseAsInt:n,name:o,state:s,...r})=>{const a=(0,F.useCallback)(e=>{switch(e){case Me.City:return"address-level1";case Me.DateOfBirth:return"bday";case Me.FirstName:return"given-name";case Me.LastName:return"family-name";case Me.PostalCode:return"postal-code";case Me.Street:return"street-address";case Me.Country:case Me.Language:case Me.Nationality:case Me.Phone:case Me.Picture:case Me.Sex:default:return}},[]),l=(0,F.useMemo)(()=>o.startsWith("formRegister.userInfo.fields.")?a(o.split(".").pop())??e:e,[o,e,a]),d=(0,F.useCallback)(e=>{const o=_l(e.meta);return(0,i.jsx)(wl,{autoComplete:l,hint:o?e.meta.error||e.meta.submitError:t,shouldParseAsInt:n||!1,state:o?"error":s,value:e.input.value,onBlur:e.input.onBlur,onChange:t=>{e.input.onChange(t)},onFocus:e.input.onFocus,...r})},[t,n,s,l,r]);return(0,i.jsx)(Oa.D0,{name:o,parse:xl.A,render:d})},El={AUTH_EMAIL:"heavent-auth-email",BACKOFFICE_INVOICES_COLUMNS:"heavent-backoffice-invoices-columns",BACKOFFICE_COLUMNS:"heavent-backoffice-columns",BACKOFFICE_LIMIT:"heavent-backoffice-limit",BACKOFFICE_PREDICATES:"heavent-backoffice-predicates",BACKOFFICE_SEARCH:"heavent-backoffice-search",BACKOFFICE_SORT:"heavent-backoffice-sort",CURRENT_EVENT_ID:"heavent-current-event-id",CURRENT_EVENT_NAME:"heavent-current-event-name",CURRENT_ORGANIZATION_ID:"heavent-current-organization-id",DELEGATIONS_SPACE_TAB:"heavent-delegations-space-tab",EVENT_ID:"heavent-event-id",HIDE_HUBSPOT:"hide-hubspot",ORGANIZATION_ID:"heavent-organization-id",POSITIONS_IMPORT_FORMATS:"heavent-positions-import-formats",POSITIONS_IMPORT_MAPPINGS:"heavent-positions-import-mappings",POSITIONS_IMPORT_MODE:"heavent-positions-import-mode",POSITIONS_IMPORT_PRESETS:e=>`heavent-positions-import-presets-${e}`,VOLUNTEERS_IMPORT_FORMATS:"heavent-volunteers-import-formats",VOLUNTEERS_IMPORT_MAPPINGS:"heavent-volunteers-import-mappings",VOLUNTEERS_IMPORT_MODE:"heavent-volunteers-import-mode",VOLUNTEERS_IMPORT_PRESETS:e=>`heavent-volunteers-import-presets-${e}`,DELEGATIONS_IMPORT_FORMATS:"heavent-delegations-import-formats",DELEGATIONS_IMPORT_MAPPINGS:"heavent-delegations-import-mappings",DELEGATIONS_IMPORT_PRESETS:e=>`heavent-delegations-import-presets-${e}`,DELEGATIONS_IMPORT_MODE:"heavent-delegations-import-mode",DELEGATION_MEMBERS_IMPORT_FORMATS:"heavent-delegation-members-import-formats",DELEGATION_MEMBERS_IMPORT_MAPPINGS:"heavent-delegation-members-import-mappings",DELEGATION_MEMBERS_IMPORT_PRESETS:e=>`heavent-delegation-members-import-presets-${e}`,DELEGATION_MEMBERS_IMPORT_MODE:"heavent-delegation-members-import-mode"};let Tl=class{translationService;constructor(e){this.translationService=e}t(e,...t){return this.translationService.translate(e,...t)}};Tl=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],Tl);let zl=class extends Tl{translationService;constructor(e){super(e),this.translationService=e}oneOfMessage(e,t){return this.t("_1_doit_tre_70659",e,this.translationService.formatListValues(t.map(e=>this.t(e))))}};zl=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],zl);function $l(e){return"string"==typeof e&&e.length>=16}function Ol(e){return"string"==typeof e&&null!==e.match(/\d/)}function Rl(e){return"string"==typeof e&&null!==e.match(/[A-Z]/)&&null!==e.match(/[a-z]/)}function Pl(e){return"string"==typeof e&&null!==e.match(/[^A-Za-z0-9]/)}let Dl=class extends zl{constructor(e){super(e)}signInSchema(){return l.Ik().shape({email:this.email()})}signInPasswordSchema(){return l.Ik().shape({email:this.email(),password:this.password()})}codeSchema(){return l.Ik().shape({code:this.code()})}emailSchema(){return l.Ik().shape({email:this.email()})}emailConfirmSchema(){return l.Ik().shape({email:this.email(),emailConfirm:this.emailConfirm()})}emailCodeSchema(){return l.Ik().shape({email:this.email(),code:this.code()})}email(){return l.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856"))}emailConfirm(){return l.Yj().required(this.t("la_confirmation_53449")).email(this.t("la_confirmation_53449")).test("same-as-email",this.t("l_e_mail_et_la_57164"),function(){return this.parent.email===this.parent.emailConfirm})}code(){return l.Yj().required(this.t("le_code_est_req_77618")).length(6,this.t("le_code_doit_co_37160"))}password(){return l.Yj().required(this.t("le_mot_de_passe_14773"))}passwordRules(){return l.Yj().required(this.t("le_mot_de_passe_24842")).test("valid-password",this.t("le_mot_de_passe_24842"),function(){return $l(this.parent.password)&&Ol(this.parent.password)&&Rl(this.parent.password)&&Pl(this.parent.password)})}};Dl=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],Dl);let Fl=class extends Dl{constructor(e){super(e)}step1Schema(){return l.Ik().shape({email:this.email()})}step2Schema(){return l.Ik().shape({email:this.email(),code:this.code()})}};Fl=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],Fl);var Ml,Nl,Ll,Bl=n(2302);function Vl(){return Vl=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.jsxs)(Ea,{align:"center",css:{background:"#232935",overflowX:"hidden",overflowY:"auto"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{css:{marginBottom:"40px","@desktop":{marginBottom:"80px"},"& svg":{height:"100%"}},height:32,children:(0,i.jsx)(Ul,{})}),(0,i.jsxs)(Ea,{css:{width:"100%","@mobile":{px:"$4"},"@desktop":{width:"540px"}},direction:"column",children:[(0,i.jsx)(Ea,{css:{background:"white",borderTopLeftRadius:"$2",borderTopRightRadius:"$2",padding:"$7"},width:1,children:e.children}),(0,i.jsx)(Ea,{css:{background:"$gray100",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",padding:"$7"},direction:"column",gap:"2",width:1,children:e.link})]}),(0,i.jsx)(Pa,{height:"7"})]}),Hl=e=>(0,i.jsx)(Ea,{align:"center",direction:{"@initial":"column","@desktop":"row"},gap:"1",justify:"center",width:1,children:e.children}),ql=e=>{const t=Ln(),n=Gn(),o=qn(),s=Nn(za),r=Nn(Fl),{mutate:a}=function(e={}){return Un("mutation LoginCodeEmailCreate($loginCodeEmail: LoginCodesEmailInput!) {\n    loginCodeEmailCreate(loginCodeEmail: $loginCodeEmail) {\n        insertedAt\n    }\n}\n",e)}(),[l,d]=(0,F.useState)(null),[c,u]=(0,F.useState)(0),[h,m]=(0,F.useState)(0),[g,p]=(0,F.useState)(!1),[f,x]=(0,F.useState)(Date.now());return(0,i.jsx)(Gl,{link:(0,i.jsxs)(Hl,{children:[(0,i.jsx)(fr,{color:"gray500",children:t("vous_n_avez_pas_69078")}),(0,i.jsx)(fr,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{n.push(So.AUTH_SIGN_IN_EMAIL)},children:t("r_essayer_21582")})]}),children:(0,i.jsx)(dl,{direction:"column",initialValues:{email:o.getItem(El.AUTH_EMAIL)||"",code:""},render:({handleSubmit:n,submitting:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:t("se_connecter_av_59438")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:t("saisissez_votre_01613")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Sl,{autoComplete:"email",isEmail:!0,label:t("adresse_e_mail_60930"),name:"email",placeholder:t("entrez_votre_ad_42451"),state:c>0||g?"disabled":"active"}),c>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sl,{autoComplete:"one-time-code",label:t("code_20843"),name:"code",placeholder:t("code_20843"),state:g?"disabled":void 0,type:"number"})]}),(0,i.jsx)(Pa,{height:"6"}),g?(0,i.jsx)(pl,{textAlign:"center",onClick:e.onFailure,children:t("recommencer_14712")}):(0,i.jsx)(pl,{isLoading:o,textAlign:"center",onClick:n,children:t(0===c?"recevoir_le_cod_88633":"se_connecter_63820")})]}),validate:e=>0===c?s.validateForForm(r.step1Schema())(e):s.validateForForm(r.step2Schema())(e),width:1,onSubmit:async n=>{if(0!==c){const{user:i,callbacks:o}=l;return function({code:e,user:t,callbacks:n}){return new Promise((i,o)=>{t.sendCustomChallengeAnswer(e,{...n,onSuccess:(...e)=>{n.onSuccess(...e),i(e)},onFailure:e=>{n.onFailure(e),o({type:"FAILED",error:e})},customChallenge:(...e)=>{n.customChallenge&&n.customChallenge(...e),o({type:"RETRY"})}})}).then(([e])=>e.getIdToken().getJwtToken())}({code:n.code,user:i,callbacks:o}).then(e.onSuccess,e=>{if("RETRY"===e.type)return m(h+1),{code:t("le_code_n_est_p_95065",3-(h+1))};{let i;return function(e,t,n){!async function(e){await fetch(`${R.HEAVENT_API_URL}/log/report`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}({message:"Could not auth",errorMessage:e,email:t,location:location.href,diff:Math.round((Date.now()-n)/1e3),userAgent:navigator.userAgent})}(e.message,n.email,f),p(!0),i=Fo.dw.fromMillis(Date.now()-f).as("minutes")>3?t("le_code_a_expir_45975"):t("le_code_n_est_p_12317"),{FORM_ERROR:i}}})}{await a({loginCodeEmail:{email:n.email,source:Ze.App}}),x(Date.now());const e=await async function(e,t,n){try{return await K(e,t,n)}catch(i){if(i!==V)throw i;try{return await q(e,N()),await K(e,t,n)}catch{throw new Error("Auth failure")}}}(n.email,Bl.A,Bl.A);d(e),u(1)}}})})},Yl=F.forwardRef(({css:e,hint:t,description:n,icon:o,state:s,onChange:r,label:a,onForgotPasswordClick:l,...d},c)=>{const u=Ln(),h=F.useRef(),[m,g]=F.useState("password"),{inputId:p,descId:f,errorId:x}=bl();return(0,i.jsxs)(Ea,{ref:h,css:e,direction:"column",width:1,onClick:e=>{e.preventDefault(),h.current?.querySelector("input")?.focus()},children:[(0,i.jsxs)(Ea,{gap:"3",width:1,children:[(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(yl,{htmlFor:p,children:a})}),"function"==typeof l&&(0,i.jsx)(fr,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{l?.()},children:u("mot_de_passe_ou_17690")})]}),(0,i.jsx)(jl,{id:f,children:n}),(a||n)&&(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(Al,{cursor:"text",icon:o,rightIcon:"password"===m?"eye":"eye-slash",state:s,onRightIconClick:e=>{Il(e),g("password"===m?"text":"password")},children:(0,i.jsx)(fr,{color:"inherit",css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"},"& input::placeholder":{color:"$gray500",opacity:1},"& input::-ms-input-placeholder ":{color:"$gray500",opacity:1}},children:(0,i.jsx)("input",{ref:c,"aria-describedby":n?f:void 0,"aria-errormessage":"error"===s?x:void 0,"aria-invalid":"error"===s,disabled:"disabled"===s,id:p,type:m,onChange:e=>{r(e.target.value)},...d})})}),(0,i.jsx)(Cl,{id:x,state:s,children:t})]})});Yl.displayName="PasswordInput";const Kl=({name:e,autoComplete:t,hint:n,state:o,...s})=>(0,i.jsx)(Oa.D0,{name:e,render:r=>{const a=_l(r.meta);return(0,i.jsx)(Yl,{autoComplete:t??"current-password",hint:a?r.meta.error:n,name:e,state:a?"error":o,value:r.input.value,onBlur:r.input.onBlur,onChange:e=>{r.input.onChange(e)},onFocus:r.input.onFocus,...s})}});let Zl=class extends Dl{constructor(e){super(e)}step1Schema(){return l.Ik().shape({email:this.email()})}step2Schema(){return l.Ik().shape({email:this.email(),code:this.code(),password:this.passwordRules()})}};Zl=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],Zl);const Xl=ar("div",{display:"grid",variants:{align:{start:{alignItems:"start"},center:{alignItems:"center"},end:{alignItems:"end"}},gap:{1:{gap:"$1"},2:{gap:"$2"},3:{gap:"$3"},4:{gap:"$4"},5:{gap:"$5"},6:{gap:"$6"},7:{gap:"$7"},8:{gap:"$8"},9:{gap:"$9"},10:{gap:"$10"},11:{gap:"$11"},12:{gap:"$12"},13:{gap:"$13"}},columnGap:{1:{columnGap:"$1"},2:{columnGap:"$2"},3:{columnGap:"$3"},4:{columnGap:"$4"},5:{columnGap:"$5"},6:{columnGap:"$6"},7:{columnGap:"$7"},8:{columnGap:"$8"},9:{columnGap:"$9"},10:{columnGap:"$10"},11:{columnGap:"$11"},12:{columnGap:"$12"},13:{columnGap:"$13"}},rowGap:{1:{rowGap:"$1"},2:{rowGap:"$2"},3:{rowGap:"$3"},4:{rowGap:"$4"},5:{rowGap:"$5"},6:{rowGap:"$6"},7:{rowGap:"$7"},8:{rowGap:"$8"},9:{rowGap:"$9"},10:{rowGap:"$10"},11:{rowGap:"$11"},12:{rowGap:"$12"},13:{rowGap:"$13"}}}}),Jl=F.forwardRef((e,t)=>{const n={gridTemplate:e.gridtemplate,gridTemplateColumns:e.gridtemplatecolumns,gridTemplateRows:e.gridtemplaterows};return e.height&&(n.height=ir(e.height)),e.width&&(n.width=ir(e.width)),(0,i.jsx)(Xl,{role:"grid",...e,ref:t,css:{...n,...e.css}})});Jl.displayName="Grid";const Ql=e=>(0,i.jsxs)(Ea,{align:"center",gap:{"@initial":"2","@desktop":"1"},children:[(0,i.jsx)(Ea,{align:"center",css:{background:e.isValid?"$success100":"white",border:e.isValid?"none":"1px solid $gray300",borderRadius:"16px",color:"$success500",fontSize:"11px",height:"16px",width:"16px"},justify:"center",children:e.isValid&&(0,i.jsx)(Va,{icon:"check"})}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:e.children})]}),ed=e=>{const t=Ln();return(0,i.jsxs)(Jl,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$md",gap:"$3 $1",gridTemplateColumns:"1fr",gridTemplateRows:"1fr 1fr 1fr 1fr",padding:"$4","@desktop":{gridTemplateColumns:"1fr 1fr",gridTemplateRows:"1fr 1fr"}},children:[(0,i.jsx)(Ql,{isValid:$l(e.password),children:t("16_caract_res_m_52434")}),(0,i.jsx)(Ql,{isValid:Ol(e.password),children:t("au_moins_un_chi_73862")}),(0,i.jsx)(Ql,{isValid:Rl(e.password),children:t("au_moins_une_ma_58302")}),(0,i.jsx)(Ql,{isValid:Pl(e.password),children:t("au_moins_un_car_54396")})]})},td=e=>{const t=Ln(),n=Gn(),o=qn(),s=Nn(za),r=Nn(Zl),[a,l]=(0,F.useState)(0);return(0,i.jsx)(Gl,{link:(0,i.jsxs)(Hl,{children:[(0,i.jsx)(fr,{color:"gray500",children:t("vous_n_avez_pas_69078")}),(0,i.jsx)(fr,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{n.push(So.AUTH_SIGN_IN_EMAIL)},children:t("r_essayer_21582")})]}),children:(0,i.jsx)(dl,{direction:"column",initialValues:{email:o.getItem(El.AUTH_EMAIL)||"",code:"",password:""},render:({handleSubmit:e,submitting:n,values:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:t("mot_de_passe_ou_17690")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:t("saisissez_votre_47959")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Sl,{autoComplete:"email",isEmail:!0,label:t("adresse_e_mail_60930"),name:"email",placeholder:t("entrez_votre_ad_42451"),state:a>0?"disabled":"active"}),a>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sl,{autoComplete:"one-time-code",label:t("code_re_u_par_e_75150"),name:"code",placeholder:t("code_20843")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Kl,{autoComplete:"new-password",label:t("nouveau_mot_de_46347"),name:"password",placeholder:t("entrez_votre_mo_51874")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(ed,{password:o.password})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(pl,{isLoading:n,textAlign:"center",onClick:e,children:t(0===a?"recevoir_le_cod_88633":"r_initialiser_l_12900")})]}),validate:e=>0===a?s.validateForForm(r.step1Schema())(e):s.validateForForm(r.step2Schema())(e),width:1,onSubmit:async t=>{0===a?(await X(t.email),l(1)):e.onSuccess(await J(t.email,t.code,t.password))}})})},nd=ar("input",{left:"-9999px",position:"absolute",top:"-9999px",visibility:"hidden"}),id=()=>(0,i.jsx)(nd,{tabIndex:-1,type:"submit",value:"Submit"}),od={Aso:{Aso:n(8301),HomeBackground:n(8144),Logo:n(2388)},Blanks:{Accreditation:n(7008),Member:n(5594)},Maps:{GooglePlan:n(1416),GoogleSatellite:n(6954),IgnPlan:n(4025)},AvatarGroup:n(384),Background404:n(4236),FormPositionRanked:n(4628),FormPositionUnranked:n(1205),Google:n(1931),GoogleMaps:n(1446),Ign:n(9882),Login:n(2647),Login2x:n(2281),LogoWeezeventSquare:n(6041),UserProfile:n(8264)},sd={Alert:n(2630),Check:n(3780),DnsBlank:n(1037),DnsWrongDomain:n(8184),Done:n(8652),Done2:n(3574),RecrewteerMarker:n(8798),Sad:n(5376),WeezeventBlankHandGlobe:n(2599),WeezeventBlankMessages:n(6687),WeezeventBlankPerson:n(7648),WeezeventBlankSwissArmyKnife:n(4362)};var rd=n(7480);const ad=[It.De,It.En,It.Es,It.Fr,It.Nl];function ld(e){if(h(e)){const t=(0,rd.A)(e.trim());return ad.includes(t)?t:null}return null}function dd(e,t){return t.has("lang")?ld(t.get("lang"))||It.En:e||ld(navigator.language)||It.En}const cd=R.EMAIL_FROM_NAME,ud=R.EMAIL_FROM;function hd(e){return e===It.Fr?"https://weezevent.com/fr/cgus/":e===It.Nl?"https://weezevent.com/nl/gebruiksvoorwaarden-diensten/":e===It.Es?"https://weezevent.com/es/cgus/":"https://weezevent.com/en-gb/terms-of-use/"}const md=e=>{const{translate:t,history:n}=il(),o=Nn(Dl),s=Nn(za),r=qn(),a=hd(dd(null,new URL(location.href).searchParams));return(0,i.jsx)(Gl,{link:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hl,{children:[(0,i.jsx)(fr,{color:"gray500",children:t("pas_encore_sur_13386")}),(0,i.jsx)(fr,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{n.push(So.AUTH_SIGN_UP_CREDENTIALS)},children:t("ouvrez_un_compt_91337")})]}),(0,i.jsx)(Hl,{children:(0,i.jsx)(fr,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{window.open(a,"_blank")},children:t("conditions_g_n_34786")})})]}),children:(0,i.jsx)(dl,{direction:"column",initialValues:{email:"",password:""},render:({handleSubmit:e,submitting:o,values:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:t("ravi_de_vous_re_24368")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:t("identifiez_vous_57743")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Sl,{autoComplete:"email",isEmail:!0,label:t("adresse_e_mail_60930"),name:"email",placeholder:t("entrez_votre_ad_42451")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Kl,{label:t("mot_de_passe_41738"),name:"password",placeholder:t("entrez_votre_mo_51874"),onForgotPasswordClick:()=>{r.setItem(El.AUTH_EMAIL,s.email),n.push(So.AUTH_FORGOT_PASSWORD)}}),(0,i.jsx)(id,{}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(pl,{isLoading:o,textAlign:"center",onClick:e,children:t("se_connecter_63820")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{align:"center",gap:"4",children:[(0,i.jsx)(fr,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}}),(0,i.jsx)(fr,{color:"gray500",fontSize:"textXs",children:t("ou_67404")}),(0,i.jsx)(fr,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{r.setItem(El.AUTH_EMAIL,s.email),n.push(So.AUTH_SIGN_IN_CODE)},children:[(0,i.jsx)(fr,{color:"gray500",fontSize:"textMd",children:(0,i.jsx)(Va,{icon:"envelope"})}),(0,i.jsx)(fr,{color:"gray700",children:t("se_connecter_av_59438")})]}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsxs)(Ea,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{window.location.href=Wl("Google")},children:[(0,i.jsx)(fr,{children:(0,i.jsx)("img",{alt:"Google logo",height:"24px",src:od.Google})}),(0,i.jsx)(fr,{color:"gray700",children:t("se_connecter_av_86208")})]})]}),validate:e=>s.validateForForm(o.signInPasswordSchema())(e),width:1,onSubmit:async n=>{try{return e.onSuccess(await Z(n.email,n.password)),{}}catch(e){if("NotAuthorizedException"===e.code&&"Incorrect username or password."===e.message||"UserNotFoundException"===e.code&&"User does not exist."===e.message)return{email:t("adresse_e_mail_73393")};throw e}}})})};let gd=class extends Dl{constructor(e){super(e)}step1Schema(){return l.Ik().shape({email:this.email(),password:this.passwordRules()})}step2Schema(){return l.Ik().shape({email:this.email(),code:this.code(),password:this.passwordRules()})}};gd=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],gd);const pd=e=>{const{history:t,translate:n}=il(),o=Nn(za),s=Nn(gd),[r,a]=(0,F.useState)(0),l=hd(dd(null,new URL(location.href).searchParams));return(0,i.jsx)(Gl,{link:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hl,{children:[(0,i.jsx)(fr,{color:"gray500",children:n("vous_avez_d_j_26391")}),(0,i.jsx)(fr,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{t.push(So.AUTH_SIGN_IN_EMAIL)},children:n("connectez_vous_14760")})]}),(0,i.jsx)(Hl,{children:(0,i.jsx)(fr,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{window.open(l,"_blank")},children:n("conditions_g_n_34786")})})]}),children:(0,i.jsx)(Oa.lV,{initialValues:{email:"",code:"",password:""},render:({handleSubmit:e,submitting:t,values:o})=>(0,i.jsxs)("form",{style:{width:"100%"},onSubmit:e,children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:n("cr_er_un_compte_71423")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:n("utilisez_recrew_64841")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Sl,{autoComplete:"email",isEmail:!0,label:n("adresse_e_mail_60930"),name:"email",placeholder:n("entrez_votre_ad_42451"),state:r>0?"disabled":"active"}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Kl,{label:n("nouveau_mot_de_46347"),name:"password",placeholder:n("entrez_votre_mo_51874"),state:r>0?"disabled":"active"}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(ed,{password:o.password}),r>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sl,{autoComplete:"one-time-code",label:n("code_re_u_par_e_75150"),name:"code",placeholder:n("code_20843"),type:"number"})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(pl,{isLoading:t,textAlign:"center",onClick:e,children:n(0===r?"recevoir_le_cod_04513":"cr_er_mon_compt_84515")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{align:"center",gap:"4",children:[(0,i.jsx)(fr,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}}),(0,i.jsx)(fr,{color:"gray500",fontSize:"textXs",children:n("ou_67404")}),(0,i.jsx)(fr,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{window.location.href=Wl("Google")},children:[(0,i.jsx)(fr,{children:(0,i.jsx)("img",{alt:"Google logo",height:"24px",src:od.Google})}),(0,i.jsx)(fr,{color:"gray700",children:n("s_inscrire_avec_54027")})]})]}),validate:e=>0===r?o.validateForForm(s.step1Schema())(e):o.validateForForm(s.step2Schema())(e),onSubmit:async t=>{0===r?(await X(t.email),a(1)):e.onSuccess(await J(t.email,t.code,t.password))}})})},fd=async e=>{await ss(ms,{token:e}),window.location.href=So.HOME},xd=e=>{e&&Jn("Auth failure",e),window.location.href=So.AUTH_SIGN_IN},_d=()=>(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{exact:!0,path:So.AUTH_FORGOT_PASSWORD,children:(0,i.jsx)(td,{onSuccess:fd})}),(0,i.jsx)(_r.qh,{exact:!0,path:So.AUTH_SIGN_IN_EMAIL,children:(0,i.jsx)(md,{onSuccess:fd})}),(0,i.jsx)(_r.qh,{exact:!0,path:So.AUTH_SIGN_IN_CODE,children:(0,i.jsx)(ql,{onFailure:xd,onSuccess:fd})}),(0,i.jsx)(_r.qh,{exact:!0,path:So.AUTH_SIGN_UP_CREDENTIALS,children:(0,i.jsx)(pd,{onSuccess:fd})}),(0,i.jsx)(_r.qh,{exact:!0,path:So.AUTH_SIGN_UP_CODE,children:(0,i.jsx)(Yn,{path:So.AUTH_SIGN_IN_EMAIL})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.AUTH_SIGN_IN_EMAIL})})]}),Id=e=>(F.useEffect(()=>{!e.loader&&e.onLoad&&e.onLoad()},[e.loader]),e.loader?e.loader:(0,i.jsx)(i.Fragment,{children:e.children||(0,i.jsx)("div",{})})),vd=()=>{const[,e]=location.search.substr(1).split("="),{data:t,loader:n}=Vn("query Tokens($code: String!) {\n    userTokens(code: $code) {\n        accessToken\n        idToken\n        refreshToken\n        email\n    }\n}\n",{code:e},[]);return(0,i.jsx)(Id,{loader:n,onLoad:()=>{!function(e){const t=new M.p4({IdToken:new M.Yw({IdToken:e.idToken}),RefreshToken:new M.c9({RefreshToken:e.refreshToken}),AccessToken:new M.pD({AccessToken:e.accessToken})}),n=e.email.trim().toLowerCase();new M.TU({Username:n,Pool:W()}).setSignInUserSession(t)}(t.userTokens),window.location.href=So.HOME}})},bd="www.partagetapassion.com",jd=new Map([[1792,"evenements.handicap-international.fr"],[858,bd],[1773,"communaute.rncb.fr"],[3306,"mariage.ravey.fr"],[3136,"registering.aso.fr"]]);function Cd(e){(0,F.useEffect)(()=>{const t=document.title;var n,i;return document.title=(n=location.host,(h(i=e)?`${i} | `:"")+(n===bd?"Partage Ta Passion":cd)),()=>{document.title=t}},[e])}function yd(e,t){const n=F.useCallback(e,t||[]);F.useEffect(()=>(document.addEventListener("click",n,!1),()=>{document.removeEventListener("click",n,!1)}),t||[])}function kd(e){const t=(0,F.useCallback)(t=>{"Esc"!==t.key&&"Escape"!==t.key||e()},[]);(0,F.useEffect)(()=>(document.addEventListener("keydown",t,!1),()=>{document.removeEventListener("keydown",t,!1)}),[])}const Ad="h-dropdown-open";function wd(e,t){e.dispatchEvent(new CustomEvent(Ad,{bubbles:!0,detail:{uuid:t??""}}))}const Sd=F.createContext({}),Ed=e=>{const t=F.useRef(N()),[n,o]=F.useState(e.isOpen??!1),[s,r]=F.useState(null),[a,l]=F.useState(null),d=F.useCallback(n=>{e.disabled||(o(n),e.onStateChange&&e.onStateChange(n),!0===n&&s&&wd(s,t.current))},[e.disabled,s,o,e.onStateChange]),c=F.useCallback(n=>{n.detail.uuid!==t.current&&!0!==e.doNotCloseOnOtherOpen&&d(!1)},[d]);return F.useEffect(()=>{e.isOpen!==n&&o(e.isOpen??!1)},[e.isOpen]),F.useEffect(()=>(document.addEventListener(Ad,c),()=>{document.removeEventListener(Ad,c)}),[c]),kd(()=>{d(!1)}),yd(()=>{d(!1)}),(0,i.jsx)(Sd.Provider,{value:{isOpen:n,referenceElement:s,popperElement:a,setIsOpen:d,setReferenceElement:r,setPopperElement:l},children:e.children})};function Td(){return F.useContext(Sd)}const zd=ar("div",{alignItems:"center",display:"flex",fontSize:"$textSm",fontWeight:"$regular",minHeight:"40px",px:"$4",py:"$2",userSelect:"none",width:"100%",ellipsis:"",variants:{color:{default:{cursor:"pointer",color:"$gray700","&:hover":{background:"$primary50",color:"$primary700"}},disabled:{color:"$gray400",cursor:"not-allowed"},heading:{color:"$gray500",fontSize:"$textXs",fontWeight:"$semiBold",cursor:"default"},red:{cursor:"pointer",color:"$error700","&:hover":{background:"$error50"}}}},defaultVariants:{color:"default"}}),$d=({children:e,color:t,css:n,download:o,to:s,onClick:r,target:a,role:l})=>"disabled"!==t&&s?(0,i.jsx)(La,{download:o,target:a,to:s,onClick:e=>r?.(e),children:(0,i.jsx)(zd,{color:t||"default",css:n,children:e})}):(0,i.jsx)(zd,{color:t||"default",css:n,role:l??"menuitem",tabIndex:s?void 0:"presentation"!==l?0:void 0,onClick:e=>r?.(e),children:e}),Od=({css:e,children:t,color:n,download:o,icon:s,isDisabled:r=!1,onClick:a,to:l,target:d})=>(0,i.jsx)($d,{color:n,css:{cursor:r?"not-allowed":"pointer",opacity:r?"0.6":"inherit",...e},download:o,target:d,to:l,onClick:e=>{r||(wd(e.target),a?.(e))},children:(0,i.jsxs)(Ea,{align:"center",gap:"3",height:1,width:1,children:[(0,i.jsx)(Ea,{align:"center",height:1,justify:"start",width:16,children:(0,i.jsx)(Va,{icon:s})}),(0,i.jsx)(fr,{css:{flex:"1",ellipsis:""},children:t})]})});var Rd=n(832);const Pd=e=>{const{isOpen:t,referenceElement:n,popperElement:o,setPopperElement:s}=Td(),{styles:r,attributes:a,update:l}=(0,Rd.E)(n,o,{placement:e.placement,modifiers:[{name:"offset",options:{offset:[0,e.offset??8]}}]}),d="match"===e.width?`${n?.getBoundingClientRect().width??240}px`:"number"==typeof e.width?`${e.width}px`:"fit-content";F.useEffect(()=>{l?.()},[l,t,n]),F.useEffect(()=>{if(n){const e=new ResizeObserver(()=>{l?.()});return e.observe(n),()=>{e.disconnect()}}return Bl.A},[l,n]);const c=(0,i.jsx)(Ea,{ref:s,"aria-hidden":!t,"aria-orientation":e["aria-orientation"],css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$lg",display:t?"flex":"none",maxHeight:e.maxHeight?`${e.maxHeight}px`:void 0,overflowX:"hidden",overflowY:"auto",py:"$2",width:d,zIndex:"400",...e.css,...r.popper,"&:empty":{opacity:0}},direction:"column",id:e.id,role:"menu",onClick:e=>Il(e,!1),...a.popper,tabIndex:-1,children:e.children});return t?e.renderOnPortal?(0,ee.createPortal)(c,document.body):c:null},Dd=e=>{const{isOpen:t,setIsOpen:n,setReferenceElement:o}=Td(),s=e.children,r=e=>{Il(e),n(!t),s.props.onClick?.(e)},a=F.cloneElement(F.Children.only(s),{ref(e){o(e)},onClick(e){e.preventDefault(),r(e)},onKeyPress(e){r(e)},tabIndex:0});return(0,i.jsx)(i.Fragment,{children:a})};var Fd=n(5315);function Md(e){try{if("#"!==e[0]||7!==e.length)return"black";{const t=parseInt(e.substring(1,3),16);return.299*t+.587*parseInt(e.substring(3,5),16)+.114*parseInt(e.substring(5),16)>150?"black":"white"}}catch{return"black"}}function Nd(e,t){const n="#"===e[0]?1:0;return`rgba(${parseInt(e.substring(0+n,2+n),16)}, ${parseInt(e.substring(2+n,4+n),16)}, ${parseInt(e.substring(4+n),16)}, ${t>1?t/100:t})`}const Ld=[0,50,100,200,300,400,500,600,700,800,900,950,1e3],Bd=Object.fromEntries(Object.keys(lr.colors).filter(e=>e.includes("700")).flatMap(e=>{const t=e.substring(0,e.length-3),n={50:lr.colors[`${t}50`].value,100:lr.colors[`${t}100`].value,500:lr.colors[`${t}500`].value,700:lr.colors[`${t}700`].value};return[[t,n],[n[700],n]]}));function Vd(e,t=700){const n=Bd[e.toLowerCase()];if(n)return n;{const n=(0,Fd.KI)(e),i=((e,t=700)=>Ld.map(n=>{if(0===n)return{stop:n,tweak:100};if(1e3===n)return{stop:n,tweak:0};if(n===t)return{stop:n,tweak:e};{const i=Math.abs((n-t)/100),o=n[e,n.copy({l:t/100}).formatHex()]))}}function Ud(e){return h(e)&&e.startsWith("#")&&7===e.length}const Wd=ar("div",{alignItems:"center",borderRadius:"$1",display:"flex",fontWeight:"$medium",gap:"$1",px:"$2",userSelect:"none",height:"fit-content","&:has(.h-badge-count)":{paddingRight:"$1"},"& > .h-badge-count":{borderRadius:"3px",height:"calc(100% - 8px)",marginLeft:"$1",px:"6px"},variants:{size:{sm:{height:"22px",fontSize:"12px","& > .h-badge-count":{fontSize:"10px"}},md:{height:"24px",fontSize:"12px","& > .h-badge-count":{fontSize:"10px"}},lg:{height:"28px",fontSize:"14px","& > .h-badge-count":{fontSize:"12px"}}},cursor:{default:{cursor:"default"},pointer:{cursor:"pointer"},text:{cursor:"text"}},ellipsis:{true:{maxWidth:"80%","& .h-badge-content":{ellipsis:!0,flex:"1"}}}},defaultVariants:{size:"sm",cursor:"default"}}),Gd=F.forwardRef((e,t)=>{const n=F.useMemo(()=>{const t=e.color||"gray",n=Vd(t);return"gray"===t?{background:"$gray100",color:"$gray700","& > .h-badge-left-icon":{color:"$gray500"},"& > .h-badge-count":{background:"$gray200"}}:"white"===t?{background:"white",border:"1px solid $gray300","& > .h-badge-count":{background:"$gray100"}}:"white-with-green-icon"===t?{background:"white",border:"1px solid $gray300","& > .h-badge-left-icon":{color:"$success500"}}:{background:n[50],color:n[700],"& > .h-badge-left-icon":{color:n[500]},"& > .h-badge-count":{background:n[100]}}},[e.color]);return(0,i.jsxs)(Wd,{ref:t,color:e.color,css:{maxWidth:"100%",...n,...e.css},cursor:e.cursor,ellipsis:e.ellipsis,size:e.size,onClick:e.onClick,children:[e.leftIcon&&(0,i.jsx)(Ea,{className:"h-badge-left-icon",css:{cursor:e.onLeftIconClick?"pointer":"inherit"},onClick:t=>{e.onLeftIconClick?.(t)},children:(0,i.jsx)(Va,{icon:e.leftIcon,iconStyle:e.leftIconStyle})}),e.children&&(0,i.jsx)(fr,{className:"h-badge-content",css:{flex:"1",overflow:"hidden"},title:e.title,onClick:t=>{e.onContentClick?.(t)},children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:"string"==typeof e.children?e.children:"",children:e.children})}),e.rightIcon&&(0,i.jsx)(Ea,{css:{cursor:e.onRightIconClick?"pointer":"inherit"},onClick:t=>{e.onRightIconClick?.(t)},children:(0,i.jsx)(Va,{icon:e.rightIcon})}),("number"==typeof e.count||h(e.count))&&(0,i.jsx)(Ea,{align:"center",className:"h-badge-count",children:e.count})]})});Gd.displayName="Badge";const Hd=hr({"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}),qd=F.memo(function(e){const t="circular"===e.variant?e.size:e.height,n="circular"===e.variant?e.size:e.width;return(0,i.jsx)(fr,{css:{animation:`${Hd} 1.5s ease-in-out 0.5s infinite`,background:"$gray200",borderRadius:"circular"===e.variant?"50%":e.borderRadius,color:"transparent",...e.css},height:t,width:n,children:e.children})});var Yd=n(9116),Kd=n(6618),Zd=n(2499),Xd=n(7456),Jd=n(4757);const Qd=({children:e,index:t,...n})=>(0,i.jsxs)(i.Fragment,{children:[0!==t&&(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{role:"group","aria-label":e?.toString(),font:"gray600 textXs semiBold",width:1,...n,children:e}),(0,i.jsx)(Pa,{height:"2"})]}),ec=ar("div",{alignItems:"center",border:"1px solid $gray300",cursor:"pointer",display:"flex",fontSize:"10px",fontWeight:"$semiBold",justifyContent:"center","& > i":{fontSize:"10px",fontWeight:"$semiBold"},variants:{size:{sm:{borderRadius:"4px",height:"16px",width:"16px"},md:{borderRadius:"6px",height:"20px",width:"20px"}},state:{unchecked:{background:"white","&:hover":{border:"1px solid $primary600"}},checked:{background:"$primary600",border:"none",color:"white"},indeterminate:{background:"$primary600",border:"none",color:"white",padding:"$1","& > div":{borderTop:"2px solid white",width:"100%"}}},disabled:{true:{}}},compoundVariants:[{state:"unchecked",disabled:!0,css:{background:"$gray100",borderColor:"$gray200","&:hover":{borderColor:"$gray200"}}},{state:"checked",disabled:!0,css:{background:"$gray100",borderColor:"$gray200",color:"$gray300"}},{state:"indeterminate",disabled:!0,css:{background:"$gray100",borderColor:"$gray200",color:"$gray300","& > div":{borderTopColor:"$gray300"}}}],defaultVariants:{size:"sm",state:"unchecked"}}),tc=({shouldPreventDefault:e=!0,...t})=>{const n=n=>{e&&Il(n),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked",n):t.onClick("checked",n))};return(0,i.jsxs)(ec,{"aria-describedby":t.descId,"aria-labelledby":t.labelId,disabled:t.disabled,id:t.inputId,role:"checkbox",size:t.size,state:t.state,tabIndex:t.tabIndex??0,onClick:e=>n(e),onKeyDown:e=>{"Space"===e.code&&n(e)},children:["checked"===t.state&&(0,i.jsx)("i",{className:"far fa-check"}),"indeterminate"===t.state&&(0,i.jsx)("div",{})]})},nc=({shouldPreventDefault:e=!0,...t})=>{const{descId:n,inputId:o,labelId:s}=bl(),r=void 0!==t.subtext&&null!==t.subtext,a=n=>{e&&n.preventDefault(),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked",n):t.onClick("checked",n))};return(0,i.jsxs)(Ea,{css:{cursor:t.disabled?"not-allowed":"pointer",userSelect:"none",...t.css},tabIndex:0,onClick:a,onKeyDown:e=>{"Space"===e.code&&a(e)},children:[(0,i.jsx)(Ea,{css:{alignItems:"center",height:"md"===t.size?"23px":"20px"},children:(0,i.jsx)(tc,{descId:n,disabled:t.disabled,inputId:o,labelId:s,shouldPreventDefault:!1,size:t.size,state:t.state,tabIndex:-1,onClick:Bl.A})}),(0,i.jsx)(Pa,{width:"2"}),(0,i.jsxs)(Ea,{css:{flexDirection:"column",fontSize:"md"===t.size?"$3":"$2"},children:[(0,i.jsx)(yl,{htmlFor:o,id:s,children:(0,i.jsx)(fr,{css:{color:t.disabled&&!r?"$gray300":"$gray800"},fontWeight:"medium",children:t.children})}),r&&(0,i.jsx)(fr,{color:"gray500",id:n,children:t.subtext})]})]})},ic=ar("div",{background:"white",alignItems:"center",cursor:"pointer",display:"flex",justifyContent:"center",variants:{size:{sm:{borderRadius:"16px",height:"16px",width:"16px"},md:{borderRadius:"20px",height:"20px",width:"20px"}},state:{unchecked:{border:"1px solid $gray300","&:hover":{border:"1px solid $primary600"}},checked:{border:"1px solid $primary600"}},disabled:{true:{cursor:"not-allowed"}}},compoundVariants:[{size:"sm",state:"checked",css:{"& > div":{background:"$primary600",borderRadius:"6px",height:"6px",width:"6px"}}},{size:"md",state:"checked",css:{"& > div":{background:"$primary600",borderRadius:"8px",height:"8px",width:"8px"}}},{state:"unchecked",disabled:!0,css:{background:"$gray100",borderColor:"$gray200","&:hover":{borderColor:"$gray200"}}},{state:"checked",disabled:!0,css:{background:"$gray100",borderColor:"$gray200","& > div":{background:"$gray300 !important"}}}],defaultVariants:{size:"sm",state:"unchecked"}}),oc=({shouldPreventDefault:e=!0,...t})=>{const n=n=>{e&&Il(n),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked"):t.onClick("checked"))};return(0,i.jsx)(ic,{"aria-describedby":t.descId,"aria-labelledby":t.labelId,disabled:t.disabled,id:t.inputId,role:"radio",size:t.size,state:t.state,tabIndex:t.tabIndex??0,onClick:n,onKeyDown:e=>{"Space"===e.key&&n(e)},children:"checked"===t.state&&(0,i.jsx)("div",{})})},sc=({shouldPreventDefault:e=!0,...t})=>{const{inputId:n,descId:o,labelId:s}=bl(),r="string"==typeof t.subtext&&t.subtext.length>0,a=n=>{e&&Il(n),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked"):t.onClick("checked"))};return(0,i.jsxs)(Ea,{css:{...t.css,cursor:t.disabled?"not-allowed":"pointer",userSelect:"none"},tabIndex:0,onClick:e=>{a(e)},onKeyDown:e=>{"Space"===e.key&&a(e)},children:[(0,i.jsx)(Ea,{css:{alignItems:"center",height:"md"===t.size?"23px":"20px"},children:(0,i.jsx)(oc,{descId:o,disabled:t.disabled,inputId:n,labelId:s,shouldPreventDefault:!1,size:t.size,state:t.state,tabIndex:-1,onClick:Bl.A})}),(0,i.jsx)(Pa,{width:"2"}),(0,i.jsxs)(Ea,{css:{flexDirection:"column",fontSize:"md"===t.size?"$3":"$2","& div":{cursor:"pointer !important"}},children:[(0,i.jsx)(yl,{htmlFor:n,id:s,children:(0,i.jsx)(fr,{css:{color:t.disabled&&!r?"$gray300":"$gray800"},fontWeight:"medium",children:t.children})}),t.subtext&&(0,i.jsx)(fr,{color:"gray500",id:o,children:t.subtext})]})]})},rc=({children:e,css:t,disabled:n,isCheckbox:o,isRadio:s,isSelected:r,onClick:a,subtext:l,value:d,...c})=>{const u=F.useCallback(()=>{n||a?.()},[n,a]),m=F.useCallback(e=>{"Enter"===e.key&&u?.()},[u]);return(0,i.jsxs)(Ea,{align:"center","aria-checked":o?r:void 0,"aria-label":e,"aria-selected":r,css:{cursor:n?"default":"pointer",minHeight:"40px",padding:"$2 $3",userSelect:"none","&:hover":{background:"$gray100",borderRadius:"$1"},...t},gap:"3",role:"option",tabIndex:0,width:1,onClick:u,onKeyDown:m,...c,children:[o&&(0,i.jsx)(tc,{disabled:n,shouldPreventDefault:!1,state:r?"checked":"unchecked",onClick:Bl.A}),s&&(0,i.jsx)(oc,{shouldPreventDefault:!1,state:r?"checked":"unchecked",onClick:Bl.A}),(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{color:"gray800",css:{ellipsis:!0},title:e,width:1,children:e}),h(l)&&(0,i.jsx)(fr,{color:"gray500",css:{ellipsis:!0},title:l,width:1,children:l})]}),!o&&!s&&r&&(0,i.jsx)(fr,{color:"primary700",children:(0,i.jsx)(Va,{icon:"check"})})]})};function ac(e){return F.Children.toArray(e).map(t=>{if("optgroup"===t.type)return[{id:(0,vl.A)(),type:"group",text:t.props.label}].concat(ac(t.props.children));if("option"===t.type)return{id:(0,vl.A)(),type:"option",text:t.props.children,value:t.props.value,disabled:t.props.disabled,selected:t.props.selected,radio:t.props["data-radio"],style:t.props.style};if(t.type===Symbol.for("react.fragment"))return ac(t.props.children);throw Jn("Unexpected child type",t,e),new Error("Unexpected child type")}).flat()}function lc(e){return Object.fromEntries(e.filter(e=>"option"===e.type).map(e=>[e.value,e.text]))}const dc=({children:e,createText:t,css:n,description:o,hint:s,icon:r,isCreateVisible:a,isSearchLoading:l,isSearchVisible:d,isSelectAllVisible:c,label:u,menuWidth:g,multiple:p,onChange:f,onClick:x,onCreateClick:_,placeholder:I,renderOnPortal:v,renderValue:b,searchElement:j,searchPlaceholder:C,state:y,triggerElem:k,values:A})=>{const w=Ln(),S=F.useCallback(e=>e?.focus({preventScroll:!0}),[]),[E,T]=F.useState(!1),[z,$]=F.useState(""),{inputId:O,descId:R}=bl(),P=F.useMemo(()=>ac(e),[e]),D=F.useMemo(()=>P.flatMap(e=>"option"===e.type?[e.value]:[]),[P]),M=F.useMemo(()=>{const e=(z||"").trim().toLowerCase();return P.filter(t=>""===e||"group"===t.type||t.text.toLowerCase().includes(e)).filter((e,t,n)=>{const i=n[t+1];return"option"===e.type||"option"===i?.type})},[P,z]),N=F.useMemo(()=>(0,Yd.A)((0,Kd.A)(M.filter(e=>"option"===e.type&&h(e.radio)),e=>e.radio),e=>e.map(e=>e.value)),[M]),L=F.useMemo(()=>lc(P),[P]),B=F.useMemo(()=>(0,wr.A)((0,Zd.A)(A),(0,Zd.A)(D)),[A,D]),V=F.useCallback(()=>{f(B?[]:D)},[f,D,B]),U=F.useMemo(()=>b?b(A[0],L[A[0]]):L[A[0]],[b,A,L]);return F.useEffect(()=>{E||$("")},[E]),(0,i.jsxs)(Ea,{css:n,direction:"column",width:1,children:[u&&(0,i.jsx)(yl,{htmlFor:O,children:u}),o&&(0,i.jsx)(jl,{id:R,children:o}),(u||o)&&(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ed,{disabled:"disabled"===y,isOpen:E,onStateChange:e=>T(e),children:[(0,i.jsx)(Dd,{children:k||(0,i.jsx)(Al,{"aria-describedby":R,"aria-label":(u??I)+(L[A[0]]?` (currently: ${L[A[0]]})`:""),"aria-multiselectable":p,"aria-owns":M.map(e=>e.id).join(" "),"aria-placeholder":I,css:{maxHeight:"200px",overflowY:"auto",padding:"$2 $3",userSelect:"none"},cursor:"disabled"===y?"default":"pointer",height:"fluid",icon:r,id:O,rightIcon:E?"chevron-up":"chevron-down",state:y,children:Zo(A)?p?(0,i.jsx)(Ea,{css:{flex:"1",overflowY:"auto"},gap:"2",height:1,role:"presentation",wrap:"wrap",children:A.map((e,t)=>(0,i.jsx)(Gd,{ellipsis:!0,rightIcon:"xmark",onRightIconClick:t=>{Il(t),f((0,Xd.A)(A,e))},children:L[e]},t))}):(0,i.jsx)(fr,{color:"gray800",css:{flex:"1",overflow:"hidden"},role:"presentation",children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:U,children:U})}):(0,i.jsx)(fr,{color:"gray500",css:{flex:"1"},role:"presentation",children:I})})}),(0,i.jsx)(Pd,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:v,width:g??"match",children:(0,i.jsxs)(Ea,{direction:"column",width:1,children:[(0,i.jsxs)(Ea,{css:{padding:"$3"},direction:"column",width:1,children:[d&&(0,i.jsxs)(i.Fragment,{children:[j||(0,i.jsx)(wl,{ref:S,icon:"magnifying-glass",placeholder:C||w("rechercher_50038"),state:"search",value:z,onChange:$}),(0,i.jsx)(Pa,{height:"3"})]}),(0,i.jsx)(fr,{css:{maxHeight:"250px",overflowY:"auto"},children:l?(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(qd,{borderRadius:"$1",height:40}),(0,i.jsx)(qd,{borderRadius:"$1",height:40}),(0,i.jsx)(qd,{borderRadius:"$1",height:40})]}):M.map((e,t)=>{if("group"===e.type)return(0,i.jsx)(Qd,{id:e.id,index:t,children:e.text},e.id);{const n=e.value,o=e.selected??A.includes(n),s=e.radio,r=!0===p&&m(s),a=!0===p&&h(s);return(0,i.jsx)(rc,{css:e.style,disabled:e.disabled,id:e.id,isCheckbox:r,isRadio:a,isSelected:o,value:e.value,onClick:()=>{if(x)x(n,o);else if(p&&r)f(o?(0,Xd.A)(A,n):A.concat(n));else if(p&&a){const e=(0,Jd.A)(A,N[s]).concat(o?[]:[n]);f(e)}else f(o?[]:[n]),T(!1)},children:e.text},t)}})})]}),a&&(0,i.jsxs)(Ea,{css:{background:"$gray50",boxShadow:"0px -1px 3px rgba(16, 24, 40, 0.1), 0px -1px 2px rgba(16, 24, 40, 0.06)",color:"$primary700",cursor:"pointer",padding:"$3 $4",userSelect:"none"},width:1,onClick:()=>{_?.(),T(!1)},children:["+ ",t||w("cr_er_82895")]}),c&&(0,i.jsx)(Ea,{css:{background:"$gray50",boxShadow:"0px -1px 3px rgba(16, 24, 40, 0.1), 0px -1px 2px rgba(16, 24, 40, 0.06)",color:"$primary700",cursor:"pointer",padding:"$3 $4",userSelect:"none"},width:1,onClick:V,children:w(B?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")})]})})]}),(0,i.jsx)(Cl,{state:y,children:s})]})},cc=e=>(0,i.jsx)(Ea,{align:"center",className:"table-header-row",css:{background:"$gray50",border:"1px solid $gray200",fontSize:"$textXs",fontWeight:"$medium",height:"44px",width:"100%",...e.css},role:"row",children:e.children}),uc=F.createContext({}),hc=e=>{const[t,n]=F.useState(null);return(0,i.jsx)(uc.Provider,{value:{clickedRowIndex:t,setClickedRowIndex:n},children:e.children})},mc=e=>(0,i.jsx)(hc,{children:(0,i.jsx)(Ea,{className:!0===e.hideBorder?"table-no-border":"table",css:{width:"100%","&.table > div:first-child":{borderTopLeftRadius:"$1",borderTopRightRadius:"$1"},"&.table > div:last-child":{borderBottomLeftRadius:"$1",borderBottomRightRadius:"$1"},"&.table-no-border .table-header-row":{borderLeft:"none",borderRight:"none",borderTop:"none"},"&.table-no-border .table-row":{borderLeft:"none",borderRight:"none"},"&.table-no-border .table-row:last-child":{borderBottom:"none"},...e.css},direction:"column",children:e.children})});function gc(e){const t=window.matchMedia(e),[n,i]=(0,F.useState)(t.matches);return(0,F.useEffect)(()=>{const e=()=>i(t.matches);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},[n,e]),n}function pc(){return gc(sr.mobile)}function fc(e,t){return{flex:t?"1 1 0":e?"0 0 0":"1",minWidth:t?`${t}px`:e?`${e}px`:void 0}}const xc=F.forwardRef((e,t)=>(0,i.jsx)(Ea,{ref:t,align:"center",className:"table-cell",css:{...fc(e.width,e.minWidth),color:"$gray800",overflow:"hidden",px:"$3",...e.css},height:1,role:"gridcell",onClick:t=>{e.onClick&&e.onClick(t)},...(0,Ir.A)(e,["direction","align","justify","wrap","gap"]),children:e.children}));xc.displayName="Cell";const _c=25,Ic=[25,50,100];var vc=n(7773);const bc=e=>(0,i.jsx)(pl,{css:{background:e.active?"$gray100":"white",border:0,borderInlineStart:"1px solid $gray300",color:e.disabled?"$gray400":"$gray700",cursor:e.cursor,fontWeight:"$medium",inlineSize:"40px",blockSize:"32px",alignItems:"center",justifyContent:"center",borderRadius:"unset"},color:"white",textAlign:"center",disabled:e.disabled,onClick:()=>{e.onClick()},children:e.children}),jc=e=>{const t=Ln(),n=pc(),o=e.limit??_c,s=Bn(),r=e.offset/o,a=(0,vc.A)(Math.max(0,r-2),Math.min(e.numberOfPages,r+3)),l=0===r,d=r===e.numberOfPages-1,c=Math.min(e.totalCount,(r+1)*o);return(0,i.jsxs)(xc,{css:{gap:"$6","@tablet":{justifyContent:"space-between"}},children:[(0,i.jsx)(fr,{width:150,css:{order:1,display:n?"none":void 0},children:!n&&e.showLimits&&(0,i.jsx)(Ea,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",width:"fit-content","& > button:first-child":{borderLeft:"none"}},children:Ic.map((t,n)=>(0,i.jsx)(bc,{active:o===t,cursor:"pointer",disabled:!1,onClick:()=>{e.setLimit?.(t)},children:t},n))})}),!n&&(e.totalCount>o?(0,i.jsxs)(Ea,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",order:3,"& > button:first-child":{borderLeft:"none"}},children:[(0,i.jsx)(bc,{active:!1,cursor:l?"default":"pointer",disabled:l,onClick:()=>e.setOffset(e.offset-o),children:(0,i.jsx)(Va,{icon:"arrow-left"})}),e.numberOfPages<=7?(0,vc.A)(0,e.numberOfPages).map(t=>(0,i.jsx)(bc,{active:r===t,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(t*o),children:t+1},t)):(0,i.jsxs)(i.Fragment,{children:[!a.includes(0)&&(0,i.jsx)(bc,{active:!1,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(0),children:"1"}),!a.includes(1)&&(0,i.jsx)(bc,{active:!1,cursor:"default",disabled:!1,onClick:Bl.A,children:(0,i.jsx)(Va,{icon:"ellipsis"})}),a.map(t=>(0,i.jsx)(bc,{active:r===t,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(t*o),children:t+1},t)),!a.includes(e.numberOfPages-2)&&(0,i.jsx)(bc,{active:!1,cursor:"default",disabled:!1,onClick:Bl.A,children:(0,i.jsx)(Va,{icon:"ellipsis"})}),!a.includes(e.numberOfPages-1)&&(0,i.jsx)(bc,{active:!1,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset((e.numberOfPages-1)*o),children:e.numberOfPages})]}),(0,i.jsx)(bc,{active:!1,cursor:d?"default":"pointer",disabled:d,onClick:()=>e.setOffset(e.offset+o),children:(0,i.jsx)(Va,{icon:"arrow-right"})})]}):(0,i.jsx)(fr,{css:{order:3}})),n&&(0,i.jsx)(Ea,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",order:1,width:"fit-content","& > button:first-child":{borderLeft:"none"}},children:(0,i.jsx)(bc,{active:!1,cursor:l?"default":"pointer",disabled:l,onClick:()=>e.setOffset(e.offset-o),children:(0,i.jsx)(Va,{icon:"arrow-left"})})}),(0,i.jsx)(fr,{textAlign:n?"center":"end",width:150,css:{order:2,flex:"1","@tablet":{order:3,flex:"unset"}},children:n?[...s(t("page_1_of_2_92409"),(0,i.jsx)("b",{children:r+1}),(0,i.jsx)("b",{children:e.numberOfPages}))]:t("_1_2_sur_3_79592",r*o+1,c,e.totalCount)}),n&&(0,i.jsx)(Ea,{css:{border:"1px solid $gray300",order:3,borderRadius:"$1",overflow:"hidden",width:"fit-content","& > button:first-child":{borderLeft:"none"}},children:(0,i.jsx)(bc,{active:!1,cursor:d?"default":"pointer",disabled:d,onClick:()=>e.setOffset(e.offset+o),children:(0,i.jsx)(Va,{icon:"arrow-right"})})})]})},Cc=e=>{const{setClickedRowIndex:t}=F.useContext(uc);return(0,i.jsx)(Ea,{align:"center",className:"table-row",css:{background:"white",borderBottom:"1px solid $gray200",borderLeft:"1px solid $gray200",borderRight:"1px solid $gray200",height:"64px",width:"100%",...e.css,"&:hover .dot-dot-dot":{display:"block"},"&:hover .h-controls":{display:"flex"}},role:"row",onClick:()=>{e.onClick?.()},onMouseLeave:n=>{t?.(null),e.onMouseLeave?.(n)},children:e.children})},yc=e=>(0,i.jsx)(Cc,{css:{borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",height:"56px",...e.css},children:e.children}),kc=({filters:e,headerCells:t,limit:n,numberOfPages:o,offset:s,rows:r,setLimit:a,setOffset:l,showLimits:d=!1,showPagination:c=!0,title:u,totalCount:h})=>{const m=(d||c)&&"number"==typeof o&&"number"==typeof s&&"function"==typeof l&&(h??0)>0;return(0,i.jsxs)(fr,{children:[(0,i.jsxs)(Ea,{align:"center",css:{background:"white",border:"1px solid $gray200",borderBottom:"none",borderTopLeftRadius:"$2",borderTopRightRadius:"$2",padding:"$3 $6"},gap:"3",children:[u&&(0,i.jsx)(fr,{color:"gray900",css:{flex:"1"},fontSize:"textLg",fontWeight:"medium",children:u}),e]}),(0,i.jsxs)(mc,{children:[(0,i.jsx)(cc,{css:{borderRadius:"0 !important",borderTop:"1px solid $gray200"},children:t}),r,m&&(0,i.jsx)(yc,{children:(0,i.jsx)(jc,{limit:n,numberOfPages:o,offset:s,setLimit:a,setOffset:l,showLimits:d,totalCount:h??0})})]})]})};function Ac(){const e=Ln();return t=>(0,Zd.A)(t.map(t=>({value:t,translation:e(t)})),({translation:e})=>c(e)).map(({value:e,translation:t},n)=>(0,i.jsx)("option",{value:e,children:t},n))}var wc=n(4741);function Sc(e,t=500){return(0,F.useCallback)((0,wc.A)(e,t),[])}function Ec(e,t=500){const[n,i]=(0,F.useState)(e),[o,s]=(0,F.useState)(e),r=Sc(e=>{s(e)},t);return[n,o,e=>{i(e),r(e)}]}const Tc=e=>(0,i.jsx)(Ea,{align:"center",className:"table-header-cell",css:{...fc(e.width,e.minWidth),color:"$gray500",overflow:"hidden",px:"$3",...e.css},height:1,role:"columnheader",tabIndex:0,onClick:()=>{e.onClick?.()},...(0,Ir.A)(e,["aria-label","direction","align","justify","wrap","gap"]),children:e.children}),zc=e=>(0,i.jsx)(Ea,{align:"center",css:{borderBottom:"1px solid $gray200",borderLeft:e.bx?"1px solid $gray200":void 0,borderRight:e.bx?"1px solid $gray200":void 0,padding:"$3",...e.css},height:72,width:1,children:(0,i.jsx)(qd,{borderRadius:"$1",height:1,width:1})});let $c=class{translationService;constructor(e){this.translationService=e}now(){return Fo.c9.utc()}invalid(){return Fo.c9.invalid("Invalid")}toLocaleString(e,t){return e.toLocaleString(t,{locale:this.translationService.language.toString().toLowerCase()})}};function Oc(e){return e.infos?.billingAddress?.company||""}function Rc(e){return e.infos?.vatExonerated?e.amountCents:1.2*e.amountCents}function Pc(e){switch(e){case Ye.Refunded:return{color:"warning",leftIcon:"rotate-left"};case Ye.Paid:return{color:"success",leftIcon:"check"};case Ye.Overdue:return{color:"error",leftIcon:"alarm-clock"};case Ye.Waiting:return{color:"error",leftIcon:"xmark"};default:return Za()}}var Dc;$c=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],$c),function(e){e.Amount="amount",e.AmountTTC="amountTTC",e.CustomerName="customerName",e.Date="date",e.Organization="organization",e.PaidAt="paidAt",e.State="state",e.TransactionId="transactionId"}(Dc||(Dc={}));const Fc=e=>{const t=Ln(),n=Nn($c),o=new Intl.NumberFormat("fr-fr",{style:"currency",currency:"EUR"}),s=(r=e.invoice).isRefunded?Ye.Refunded:r.paidAt?Ye.Paid:r.insertedAt{window.open(e.invoice.url)},children:t("t_l_charger_03283")})}),e.isBackoffice&&(0,i.jsx)(xc,{children:!e.invoice.paidAt&&!e.invoice.isRefunded&&(0,i.jsx)(fr,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{e.markAsPaid?.()},children:t("marqu_e_comme_p_72620")})})]})},Mc=ar("dialog",{background:"white",border:"none",display:"flex",flexDirection:"column",variants:{mobile:{true:{height:"100%",paddingBottom:"$6",paddingTop:"$8",width:"100%"},false:{borderRadius:"12px",maxHeight:"calc(100% - 80px)",py:"$7"}},size:{sm:{},md:{},lg:{}}},compoundVariants:[{mobile:!1,size:"sm",css:{width:"$modalSm"}},{mobile:!1,size:"md",css:{width:"$modalMd"}},{mobile:!1,size:"lg",css:{width:"$modalLg"}}],defaultVariants:{mobile:!1}}),Nc=ar("div",{display:"flex",flexDirection:"column",overflow:"auto",width:"100%",variants:{mobile:{true:{flex:"1",px:"$4"},false:{px:"$8"}}}}),Lc=ar("div",{display:"flex",gap:"$3",variants:{mobile:{true:{boxShadow:"0px -1px 3px rgba(16, 24, 40, 0.1), 0px -1px 2px rgba(16, 24, 40, 0.06)",flexDirection:"column",padding:"$6 $4 0 $4","& .h-button-content":{textAlign:"center"}},false:{flexDirection:"row",justifyContent:"flex-end",px:"$8"}}}}),Bc=({buttons:e,children:t,onClose:n,role:o,size:s})=>{const r=pc();return kd(n),Ua("common-front/src/components/modal.tsx","common-front/src/components/modal/modal.tsx"),(0,ee.createPortal)((0,i.jsx)(Ea,{align:"center",css:{background:"rgba(52, 64, 84, 0.7)",height:"100%",left:0,position:"absolute",top:0,width:"100%",zIndex:"300"},"data-testid":"modal-backdrop",justify:"center",role:"presentation",onMouseDown:n,children:(0,i.jsxs)(Mc,{mobile:r,open:!0,role:o,size:s,onClick:e=>Il(e,!1),onMouseDown:e=>Il(e,!1),children:[(0,i.jsx)(Nc,{mobile:r,children:t}),e&&(0,i.jsx)(Lc,{mobile:r,children:e})]})}),document.body)};var Vc=n(6666);const Uc=e=>{const t=Ln(),{mutate:n,isLoading:o}=function(e={}){return Un("mutation BackofficeInvoiceMarkAsPaid($invoiceId: InvoiceId!, $transactionId: String!) {\n    backofficeInvoiceMarkAsPaid(invoiceId: $invoiceId, transactionId: $transactionId)\n}\n",e)}(),{data:s}=Vn("query QontoTransactions {\n    backoffice {\n        qontoTransactions {\n            id\n            label\n            amount\n        }\n    }\n}\n",{},[]),[r,a]=(0,F.useState)(null);return(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(fr,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(Va,{icon:"file-invoice"})}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",textAlign:"center",children:t("marqu_e_une_fac_47139")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(dc,{isSearchVisible:!0,label:t("s_lectionner_un_46296"),values:r?[r]:[],onChange:e=>{a((0,Vc.A)(e)||null)},children:(s.backoffice?.qontoTransactions??[]).map(e=>(0,i.jsxs)("option",{value:e.id,children:[e.label," (",e.amount,"€)"]},e.id))}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{disabled:!r,isLoading:o,onClick:async()=>{await n({invoiceId:e.invoiceId,transactionId:r}),e.reload()},children:t("marqu_e_comme_p_72620")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},Wc=e=>{const[t,n]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{invoice:e.invoice,isBackoffice:!0,markAsPaid:()=>{n(!0)},showColumn:e.showColumn}),t&&(0,i.jsx)(Uc,{invoiceId:e.invoice.id,reload:e.reload,onClose:()=>{n(!1)}})]})},Gc=()=>{const{history:e,translate:t}=il(),n=qn(),o=Ac(),[s,r,a]=Ec(""),[l,d]=(0,F.useState)([]),[c,u]=(0,F.useState)(0),{data:m,isLoading:g,reload:p}=Vn("query BackofficeInvoices($name: String, $states: [InvoiceState!], $offset: Int) {\n    backoffice {\n        invoices(name: $name, states: $states, limit: 25, offset: $offset) {\n            nodes {\n                id\n                invoiceNumber\n                amountCents\n                smsAmountCents\n                paidAt\n                url\n                organizationsNames\n                dealId\n                isRefunded\n                insertedAt\n                infos\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{name:h(r)?r:void 0,states:Zo(l)?l:void 0,offset:c},[]);const[f,x]=(0,F.useState)(()=>{const e=n.getItem(El.BACKOFFICE_INVOICES_COLUMNS);return e?JSON.parse(e):[]}),_=(0,F.useCallback)(e=>{x(e),n.setItem(El.BACKOFFICE_INVOICES_COLUMNS,JSON.stringify(e))},[x]),I=(0,F.useCallback)(async e=>{try{const t=new URLSearchParams;e?t.set("date",e):Zo(l)&&t.set("states",l.join(","));const n=await fetch(`${R.HEAVENT_API_URL}/invoice/all?${t}`,{method:"post",headers:{[D]:await H()||""}}),{link:i}=await n.json();window.open(i,"_blank")}catch{window.alert(t("impossible_d_ex_55872"))}},[l]),v=e=>f.includes(e);return(0,i.jsx)(fr,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsxs)(Ea,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(fr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("factures_03552")}),(0,i.jsx)(fr,{children:(0,i.jsxs)(dc,{isSelectAllVisible:!0,multiple:!0,placeholder:"Colonnes visibles",values:f,onChange:_,children:[(0,i.jsx)("option",{value:"organization",children:t("organisation_71863")}),(0,i.jsx)("option",{value:"customerName",children:t("nom_du_client_28343")}),(0,i.jsx)("option",{value:"date",children:t("Date")}),(0,i.jsx)("option",{value:"paidAt",children:t("pay_e_le_92377")}),(0,i.jsx)("option",{value:"amount",children:t("montant_55595")}),(0,i.jsx)("option",{value:"amountTTC",children:t("montant_ttc_86677")}),(0,i.jsx)("option",{value:"state",children:t("status_06428")}),(0,i.jsx)("option",{value:"transactionId",children:t("id_de_la_transa_98869")})]})}),(0,i.jsx)(pl,{onClick:()=>{e.push(So.HOME)},children:"Home"}),(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsx)(Od,{icon:"eye",onClick:()=>{e.push(So.BACKOFFICE_ORGANIZATIONS)},children:t("voir_les_organi_78756")}),(0,i.jsx)(Od,{icon:"file-export",onClick:()=>I(null),children:"Exporter les factures sélectionnées"}),(0,i.jsx)(Od,{icon:"file-export",onClick:()=>I("this-month"),children:t("exporter_les_fa_11017")}),(0,i.jsx)(Od,{icon:"file-export",onClick:()=>I("last-month"),children:t("exporter_les_fa_01571")}),(0,i.jsx)(Od,{icon:"file-export",onClick:()=>I("all"),children:t("exporter_toutes_46318")})]})]})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(kc,{filters:(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("id_ou_nom_25064"),value:s,onChange:e=>{a(e),u(0)}})}),(0,i.jsx)(fr,{width:200,children:(0,i.jsx)(dc,{isSearchVisible:!0,multiple:!0,values:l,onChange:d,children:o(cn)})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:t("num_ro_de_factu_68150")}),v(Dc.Organization)&&(0,i.jsx)(Tc,{children:t("organisation_71863")}),v(Dc.CustomerName)&&(0,i.jsx)(Tc,{children:t("nom_du_client_28343")}),v(Dc.Date)&&(0,i.jsx)(Tc,{children:t("Date")}),v(Dc.PaidAt)&&(0,i.jsx)(Tc,{children:t("pay_e_le_92377")}),v(Dc.Amount)&&(0,i.jsx)(Tc,{children:t("montant_55595")}),v(Dc.AmountTTC)&&(0,i.jsx)(Tc,{children:t("montant_ttc_86677")}),v(Dc.State)&&(0,i.jsx)(Tc,{children:t("status_06428")}),v(Dc.TransactionId)&&(0,i.jsx)(Tc,{children:t("id_de_la_transa_98869")}),(0,i.jsx)(Tc,{}),(0,i.jsx)(Tc,{})]}),numberOfPages:m.backoffice?.invoices.numberOfPages??0,offset:c,rows:g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:m.backoffice.invoices.nodes.map(e=>(0,i.jsx)(Wc,{invoice:e,reload:p,showColumn:v},e.id))}),setOffset:u,title:t("liste_des_factu_86735"),totalCount:m.backoffice?.invoices.totalCount??0})]})})};let Hc=class{countries;countriesCodes;phoneCodes;constructor(e){const t=e.translate.bind(e);this.countries=(0,Zd.A)([{phoneCode:"+93",code:"AF",name:t("afghanistan_59344"),nationality:t("afghan_10143"),emoji:"🇦🇫",language:["ps","ps-AR"],smsPrice:.27},{phoneCode:"+35818",code:"AX",name:t("_land_islands_92853"),nationality:t("_land_island_62794"),emoji:"🇦🇽"},{phoneCode:"+355",code:"AL",name:t("albania_07621"),nationality:t("albanian_82021"),emoji:"🇦🇱",language:["sq","sq-AL"],smsPrice:.12},{phoneCode:"+213",code:"DZ",name:t("algeria_37723"),nationality:t("algerian_97855"),emoji:"🇩🇿",language:"ar-DZ",smsPrice:.285},{phoneCode:"+1684",code:"AS",name:t("american_samoa_95023"),nationality:t("american_samoan_76272"),emoji:"🇦🇸"},{phoneCode:"+376",code:"AD",name:t("andorra_45150"),nationality:t("andorran_97838"),emoji:"🇦🇩",smsPrice:.52},{phoneCode:"+244",code:"AO",name:t("angola_15815"),nationality:t("angolan_91942"),emoji:"🇦🇴",smsPrice:.17},{phoneCode:"+1264",code:"AI",name:t("anguilla_53408"),nationality:t("anguillan_92612"),emoji:"🇦🇮"},{phoneCode:"+1268",code:"AG",name:t("antigua_and_bar_05164"),nationality:t("antiguan_or_bar_26833"),emoji:"🇦🇬"},{phoneCode:"+54",code:"AR",name:t("argentina_92219"),nationality:t("argentine_14780"),emoji:"🇦🇷",language:"es-AR",smsPrice:.11},{phoneCode:"+374",code:"AM",name:t("armenia_90330"),nationality:t("armenian_87788"),language:["hy","hy-AM"],emoji:"🇦🇲"},{phoneCode:"+297",code:"AW",name:t("aruba_62942"),nationality:t("aruban_18515"),emoji:"🇦🇼",smsPrice:.33},{phoneCode:"+61",code:"AU",name:t("australia_84647"),nationality:t("australian_83553"),emoji:"🇦🇺",language:"en-AU",smsPrice:.093},{phoneCode:"+43",code:"AT",name:t("austria_67457"),nationality:t("austrian_39761"),emoji:"🇦🇹",language:"de-AT",smsPrice:.066},{phoneCode:"+994",code:"AZ",name:t("azerbaijan_14476"),nationality:t("azerbaijani_az_92428"),emoji:"🇦🇿",language:"az-AZ",smsPrice:.39},{phoneCode:"+1242",code:"BS",name:t("bahamas_33701"),nationality:t("bahamian_86817"),emoji:"🇧🇸"},{phoneCode:"+973",code:"BH",name:t("bahrain_43417"),nationality:t("bahraini_76209"),emoji:"🇧🇭",language:"ar-BH",smsPrice:.12},{phoneCode:"+880",code:"BD",name:t("bangladesh_48531"),nationality:t("bangladeshi_66399"),emoji:"🇧🇩",smsPrice:.425},{phoneCode:"+1246",code:"BB",name:t("barbados_57235"),nationality:t("barbadian_02319"),emoji:"🇧🇧"},{phoneCode:"+375",code:"BY",name:t("belarus_97102"),nationality:t("belarusian_60742"),emoji:"🇧🇾",language:["be","be-BY"],smsPrice:.31},{phoneCode:"+32",code:"BE",name:t("belgium_21048"),nationality:t("belgian_00407"),emoji:"🇧🇪",language:["fr-BE","nl-BE"],smsPrice:.094},{phoneCode:"+501",code:"BZ",name:t("belize_94460"),nationality:t("belizean_90827"),emoji:"🇧🇿",language:"en-BZ",smsPrice:0},{phoneCode:"+229",code:"BJ",name:t("benin_88614"),nationality:t("beninese_benin_55987"),emoji:"🇧🇯",smsPrice:.04},{phoneCode:"+1441",code:"BM",name:t("bermuda_84448"),nationality:t("bermudian_berm_58878"),emoji:"🇧🇲"},{phoneCode:"+975",code:"BT",name:t("bhutan_12608"),nationality:t("bhutanese_34101"),emoji:"🇧🇹",smsPrice:.39},{phoneCode:"+591",code:"BO",name:t("bolivia_plurin_43912"),nationality:t("bolivian_98429"),emoji:"🇧🇴",language:["es-BO","qu-BO"],smsPrice:.38},{phoneCode:"+5997",code:"BQ",name:t("bonaire_sint_e_69605"),nationality:t("bonaire_07340"),emoji:"🇧🇶"},{phoneCode:"+387",code:"BA",name:t("bosnia_and_herz_91990"),nationality:t("bosnian_or_herz_88694"),emoji:"🇧🇦",language:["bs-BA","hr-BA","sr-BA"],smsPrice:.46},{phoneCode:"+267",code:"BW",name:t("botswana_49258"),nationality:t("motswana_botsw_32461"),emoji:"🇧🇼",smsPrice:.13},{phoneCode:"+55",code:"BR",name:t("brazil_03275"),nationality:t("brazilian_74116"),emoji:"🇧🇷",language:"pt-BR",smsPrice:.051},{phoneCode:"+246",code:"IO",name:t("british_indian_92949"),nationality:t("british_43680"),emoji:"🇮🇴"},{phoneCode:"+673",code:"BN",name:t("brunei_darussal_84695"),nationality:t("bruneian_06218"),emoji:"🇧🇳",language:"ms-BN",smsPrice:.05},{phoneCode:"+359",code:"BG",name:t("bulgaria_97045"),nationality:t("bulgarian_79288"),emoji:"🇧🇬",language:["bg","bg-BG"],smsPrice:.16},{phoneCode:"+226",code:"BF",name:t("burkina_faso_55299"),nationality:t("burkinab_02690"),emoji:"🇧🇫",smsPrice:.032},{phoneCode:"+257",code:"BI",name:t("burundi_85561"),nationality:t("burundian_35605"),emoji:"🇧🇮",smsPrice:.05},{phoneCode:"+238",code:"CV",name:t("cabo_verde_28261"),nationality:t("cabo_verdean_88842"),emoji:"🇨🇻",smsPrice:.2},{phoneCode:"+855",code:"KH",name:t("cambodia_77971"),nationality:t("cambodian_19577"),emoji:"🇰🇭",smsPrice:.52},{phoneCode:"+237",code:"CM",name:t("cameroon_44200"),nationality:t("cameroonian_12953"),emoji:"🇨🇲",smsPrice:.024},{phoneCode:"+1",code:"CA",name:t("canada_52584"),nationality:t("canadian_90836"),emoji:"🇨🇦",language:["en-CA","fr-CA"],smsPrice:.03},{phoneCode:"+1345",code:"KY",name:t("cayman_islands_80923"),nationality:t("caymanian_07521"),emoji:"🇰🇾"},{phoneCode:"+236",code:"CF",name:t("central_african_74182"),nationality:t("central_african_89873"),emoji:"🇨🇫",smsPrice:.053},{phoneCode:"+235",code:"TD",name:t("chad_58721"),nationality:t("chadian_55061"),emoji:"🇹🇩",smsPrice:.035},{phoneCode:"+56",code:"CL",name:t("chile_06923"),nationality:t("chilean_69498"),emoji:"🇨🇱",language:"es-CL",smsPrice:.13},{phoneCode:"+86",code:"CN",name:t("china_40708"),nationality:t("chinese_12117"),emoji:"🇨🇳",language:["zh","zh-CN"],smsPrice:.055},{phoneCode:"+6189164",code:"CX",name:t("christmas_islan_46649"),nationality:t("christmas_islan_46649"),emoji:"🇨🇽"},{phoneCode:"+6189162",code:"CC",name:t("cocos_keeling_98180"),nationality:t("cocos_island_82627"),emoji:"🇨🇨"},{phoneCode:"+57",code:"CO",name:t("colombia_37632"),nationality:t("colombian_28222"),emoji:"🇨🇴",language:"es-CO",smsPrice:.033},{phoneCode:"+269",code:"KM",name:t("comoros_35439"),nationality:t("comoran_comori_49754"),emoji:"🇰🇲",smsPrice:.42},{phoneCode:"+242",code:"CG",name:t("congo_republic_97304"),nationality:t("congolese_04965"),emoji:"🇨🇬",smsPrice:.045},{phoneCode:"+243",code:"CD",name:t("congo_democrat_80102"),nationality:t("congolese_04965"),emoji:"🇨🇩",smsPrice:.2},{phoneCode:"+682",code:"CK",name:t("cook_islands_51542"),nationality:t("cook_island_99158"),emoji:"🇨🇰",smsPrice:.12},{phoneCode:"+506",code:"CR",name:t("costa_rica_57058"),nationality:t("costa_rican_17127"),emoji:"🇨🇷",language:"es-CR",smsPrice:.061},{phoneCode:"+225",code:"CI",name:t("c_te_d_ivoire_55380"),nationality:t("ivorian_01729"),emoji:"🇨🇮",smsPrice:.055},{phoneCode:"+385",code:"HR",name:t("croatia_52101"),nationality:t("croatian_62900"),emoji:"🇭🇷",language:["hr","hr-HR"],smsPrice:.13},{phoneCode:"+53",code:"CU",name:t("cuba_11922"),nationality:t("cuban_00956"),emoji:"🇨🇺",smsPrice:.08},{phoneCode:"+5999",code:"CW",name:t("cura_ao_46587"),nationality:t("cura_aoan_65055"),emoji:"🇨🇼"},{phoneCode:"+357",code:"CY",name:t("cyprus_86967"),nationality:t("cypriot_85282"),emoji:"🇨🇾",smsPrice:.083},{phoneCode:"+420",code:"CZ",name:t("czech_republic_57570"),nationality:t("czech_42120"),emoji:"🇨🇿",language:["cs","cs-CZ"],smsPrice:.08},{phoneCode:"+45",code:"DK",name:t("denmark_28356"),nationality:t("danish_44544"),emoji:"🇩🇰",language:["da","da-DK"],smsPrice:.06},{phoneCode:"+253",code:"DJ",name:t("djibouti_38156"),nationality:t("djiboutian_72034"),emoji:"🇩🇯",smsPrice:.12},{phoneCode:"+1767",code:"DM",name:t("dominica_13395"),nationality:t("dominican_54004"),emoji:"🇩🇲"},{phoneCode:["+1809","+1829","+1849"],code:"DO",name:t("dominican_repub_08891"),nationality:t("dominican_54004"),emoji:"🇩🇴",language:"es-DO"},{phoneCode:"+593",code:"EC",name:t("ecuador_25933"),nationality:t("ecuadorian_50591"),emoji:"🇪🇨",language:["es-EC","qu-EC"],smsPrice:.48},{phoneCode:"+20",code:"EG",name:t("egypt_61058"),nationality:t("egyptian_75798"),emoji:"🇪🇬",language:"ar-EG",smsPrice:.45},{phoneCode:"+503",code:"SV",name:t("el_salvador_37036"),nationality:t("salvadoran_02475"),emoji:"🇸🇻",language:"es-SV",smsPrice:.34},{phoneCode:"+240",code:"GQ",name:t("equatorial_guin_39570"),nationality:t("equatorial_guin_44537"),emoji:"🇬🇶",smsPrice:.21},{phoneCode:"+291",code:"ER",name:t("eritrea_67366"),nationality:t("eritrean_20355"),emoji:"🇪🇷",smsPrice:.045},{phoneCode:"+372",code:"EE",name:t("estonia_58256"),nationality:t("estonian_46354"),emoji:"🇪🇪",language:["et","et-EE"],smsPrice:.08},{phoneCode:"+251",code:"ET",name:t("ethiopia_72971"),nationality:t("ethiopian_03019"),emoji:"🇪🇹",smsPrice:.08},{phoneCode:"+500",code:"FK",name:t("falkland_island_59316"),nationality:t("falkland_island_15848"),emoji:"🇫🇰"},{phoneCode:"+298",code:"FO",name:t("faroe_islands_71549"),nationality:t("faroese_32806"),emoji:"🇫🇴",language:["fo","fo-FO"],smsPrice:.046},{phoneCode:"+679",code:"FJ",name:t("fiji_36369"),nationality:t("fijian_39649"),emoji:"🇫🇯",smsPrice:.21},{phoneCode:"+358",code:"FI",name:t("finland_07531"),nationality:t("finnish_24918"),emoji:"🇫🇮",language:["fi","fi-FI","se-FI","sv-FI"],smsPrice:.083},{phoneCode:"+33",code:"FR",name:t("france_26614"),nationality:t("french_86034"),emoji:"🇫🇷",language:["fr","fr-FR"],smsPrice:.045},{phoneCode:"+594",code:"GF",name:t("french_guiana_80598"),nationality:t("french_guianese_02041"),emoji:"🇬🇫",smsPrice:.17},{phoneCode:"+689",code:"PF",name:t("french_polynesi_50842"),nationality:t("french_polynesi_47751"),emoji:"🇵🇫",smsPrice:.18},{phoneCode:"+241",code:"GA",name:t("gabon_58286"),nationality:t("gabonese_62984"),emoji:"🇬🇦",smsPrice:.045},{phoneCode:"+220",code:"GM",name:t("gambia_93575"),nationality:t("gambian_30767"),emoji:"🇬🇲",smsPrice:.19},{phoneCode:"+995",code:"GE",name:t("georgia_93003"),nationality:t("georgian_79366"),emoji:"🇬🇪",language:["ka","ka-GE"]},{phoneCode:"+49",code:"DE",name:t("germany_31193"),nationality:t("german_36386"),emoji:"🇩🇪",language:["de","de-DE"],smsPrice:.089},{phoneCode:"+233",code:"GH",name:t("ghana_32464"),nationality:t("ghanaian_99745"),emoji:"🇬🇭",smsPrice:.033},{phoneCode:"+350",code:"GI",name:t("gibraltar_24360"),nationality:t("gibraltar_24360"),emoji:"🇬🇮",smsPrice:.076},{phoneCode:"+30",code:"GR",name:t("greece_28837"),nationality:t("greek_hellenic_39006"),emoji:"🇬🇷",language:["el","el-GR"],smsPrice:.061},{phoneCode:"+299",code:"GL",name:t("greenland_80916"),nationality:t("greenlandic_67508"),emoji:"🇬🇱",smsPrice:.036},{phoneCode:"+1473",code:"GD",name:t("grenada_04221"),nationality:t("grenadian_25686"),emoji:"🇬🇩"},{phoneCode:"+590",code:"GP",name:t("guadeloupe_95839"),nationality:t("guadeloupe_95839"),emoji:"🇬🇵"},{phoneCode:"+1671",code:"GU",name:t("guam_76384"),nationality:t("guamanian_guam_01132"),emoji:"🇬🇺"},{phoneCode:"+502",code:"GT",name:t("guatemala_49597"),nationality:t("guatemalan_60946"),emoji:"🇬🇹",language:"es-GT",smsPrice:.3},{phoneCode:["+441481","+447781","+447839","+447911"],code:"GG",name:t("guernsey_87507"),nationality:t("channel_island_53762"),emoji:"🇬🇬"},{phoneCode:"+224",code:"GN",name:t("guinea_20770"),nationality:t("guinean_42564"),emoji:"🇬🇳",smsPrice:.056},{phoneCode:"+245",code:"GW",name:t("guinea_bissau_80728"),nationality:t("bissau_guinean_66742"),emoji:"🇬🇼",smsPrice:.09},{phoneCode:"+592",code:"GY",name:t("guyana_92443"),nationality:t("guyanese_56902"),emoji:"🇬🇾",smsPrice:.3},{phoneCode:"+509",code:"HT",name:t("haiti_99471"),nationality:t("haitian_50142"),emoji:"🇭🇹",smsPrice:.3},{phoneCode:"+379",code:"VA",name:t("vatican_city_st_63732"),nationality:t("vatican_36370"),emoji:"🇻🇦"},{phoneCode:"+504",code:"HN",name:t("honduras_79402"),nationality:t("honduran_35392"),emoji:"🇭🇳",language:"es-HN",smsPrice:.267},{phoneCode:"+852",code:"HK",name:t("hong_kong_96239"),nationality:t("hong_kong_hong_64846"),emoji:"🇭🇰",language:"zh-HK",smsPrice:.079},{phoneCode:"+36",code:"HU",name:t("hungary_57981"),nationality:t("hungarian_magy_62212"),emoji:"🇭🇺",language:["hu","hu-HU"],smsPrice:.106},{phoneCode:"+354",code:"IS",name:t("iceland_79438"),nationality:t("icelandic_17689"),emoji:"🇮🇸",language:["is","is-IS"],smsPrice:.085},{phoneCode:"+91",code:"IN",name:t("india_39466"),nationality:t("indian_25592"),emoji:"🇮🇳",language:["gu","gu-IN","hi","hi-IN","kn","kn-IN","kok","kok-IN","mr","mr-IN","pa","pa-IN","sa","sa-IN","ta","ta-IN","te","te-IN"],smsPrice:.078},{phoneCode:"+62",code:"ID",name:t("indonesia_65003"),nationality:t("indonesian_29723"),emoji:"🇮🇩",language:["id","id-ID"],smsPrice:.464},{phoneCode:"+98",code:"IR",name:t("iran_76293"),nationality:t("iranian_persia_76791"),emoji:"🇮🇷",language:["fa","fa-IR"],smsPrice:.38},{phoneCode:"+964",code:"IQ",name:t("iraq_82027"),nationality:t("iraqi_31025"),emoji:"🇮🇶",language:"ar-IQ",smsPrice:.33},{phoneCode:"+353",code:"IE",name:t("ireland_62034"),nationality:t("irish_35774"),emoji:"🇮🇪",language:"en-IE",smsPrice:.065},{phoneCode:["+441624","+447524","+447624","+447924"],code:"IM",name:t("isle_of_man_64982"),nationality:t("manx_86314"),emoji:"🇮🇲"},{phoneCode:"+972",code:"IL",name:t("israel_20033"),nationality:t("israeli_69936"),emoji:"🇮🇱",language:["he","he-IL"],smsPrice:.3},{phoneCode:"+39",code:"IT",name:t("italy_14828"),nationality:t("italian_56623"),emoji:"🇮🇹",language:["it","it-IT"],smsPrice:.038},{phoneCode:"+1876",code:"JM",name:t("jamaica_55090"),nationality:t("jamaican_58881"),emoji:"🇯🇲",language:"en-JM"},{phoneCode:"+81",code:"JP",name:t("japan_61810"),nationality:t("japanese_82636"),emoji:"🇯🇵",language:["ja","ja-JP"],smsPrice:.08},{phoneCode:"+441534",code:"JE",name:t("jersey_78898"),nationality:t("channel_island_53762"),emoji:"🇯🇪"},{phoneCode:"+962",code:"JO",name:t("jordan_36280"),nationality:t("jordanian_41310"),emoji:"🇯🇴",language:"ar-JO",smsPrice:.39},{phoneCode:["+76","+77"],code:"KZ",name:t("kazakhstan_30541"),nationality:t("kazakhstani_ka_27277"),emoji:"🇰🇿",language:["kk","kk-KZ"]},{phoneCode:"+254",code:"KE",name:t("kenya_67944"),nationality:t("kenyan_92311"),emoji:"🇰🇪",language:["sw","sw-KE"],smsPrice:.3},{phoneCode:"+686",code:"KI",name:t("kiribati_25369"),nationality:t("i_kiribati_66745"),emoji:"🇰🇮",smsPrice:.036},{phoneCode:"+850",code:"KP",name:t("korea_democrat_48584"),nationality:t("north_korean_16553"),emoji:"🇰🇵",smsPrice:.045},{phoneCode:"+82",code:"KR",name:t("korea_republic_72269"),nationality:t("south_korean_89943"),emoji:"🇰🇷",language:["ko","ko-KR"],smsPrice:.029},{phoneCode:"+965",code:"KW",name:t("kuwait_22026"),nationality:t("kuwaiti_76148"),emoji:"🇰🇼",language:"ar-KW",smsPrice:.327},{phoneCode:"+996",code:"KG",name:t("kyrgyzstan_84406"),nationality:t("kyrgyzstani_ky_19120"),emoji:"🇰🇬",language:["ky","ky-KG"],smsPrice:.34},{phoneCode:"+856",code:"LA",name:t("lao_people_s_de_31069"),nationality:t("lao_laotian_28318"),emoji:"🇱🇦",smsPrice:.273},{phoneCode:"+371",code:"LV",name:t("latvia_73526"),nationality:t("latvian_53651"),emoji:"🇱🇻",language:["lv","lv-LV"],smsPrice:.057},{phoneCode:"+961",code:"LB",name:t("lebanon_49493"),nationality:t("lebanese_43182"),emoji:"🇱🇧",language:"ar-LB",smsPrice:.32},{phoneCode:"+266",code:"LS",name:t("lesotho_91086"),nationality:t("basotho_52532"),emoji:"🇱🇸",smsPrice:.35},{phoneCode:"+231",code:"LR",name:t("liberia_12077"),nationality:t("liberian_64388"),emoji:"🇱🇷",smsPrice:.3},{phoneCode:"+218",code:"LY",name:t("libya_26741"),nationality:t("libyan_35337"),emoji:"🇱🇾",language:"ar-LY",smsPrice:.38},{phoneCode:"+424",code:"LI",name:t("liechtenstein_56974"),nationality:t("liechtenstein_56974"),emoji:"🇱🇮",language:"de-LI"},{phoneCode:"+370",code:"LT",name:t("lithuania_95793"),nationality:t("lithuanian_94145"),emoji:"🇱🇹",language:["lt","lt-LT"],smsPrice:.06},{phoneCode:"+352",code:"LU",name:t("luxembourg_15613"),nationality:t("luxembourg_lux_47318"),emoji:"🇱🇺",language:["de-LU","fr-LU"],smsPrice:.1},{phoneCode:"+853",code:"MO",name:t("macao_74812"),nationality:t("macanese_chine_74224"),emoji:"🇲🇴",language:"zh-MO",smsPrice:.038},{phoneCode:"+389",code:"MK",name:t("macedonia_the_19021"),nationality:t("macedonian_20446"),emoji:"🇲🇰",language:["mk","mk-MK"],smsPrice:.095},{phoneCode:"+261",code:"MG",name:t("madagascar_57052"),nationality:t("malagasy_02353"),emoji:"🇲🇬",smsPrice:.029},{phoneCode:"+265",code:"MW",name:t("malawi_27143"),nationality:t("malawian_10093"),emoji:"🇲🇼",smsPrice:.3},{phoneCode:"+60",code:"MY",name:t("malaysia_54920"),nationality:t("malaysian_81474"),emoji:"🇲🇾",language:["ms","ms-MY"],smsPrice:.29},{phoneCode:"+960",code:"MV",name:t("maldives_67432"),nationality:t("maldivian_67878"),emoji:"🇲🇻",language:["dv","dv-MV"],smsPrice:.34},{phoneCode:"+223",code:"ML",name:t("mali_95091"),nationality:t("malian_malines_66005"),emoji:"🇲🇱",smsPrice:.055},{phoneCode:"+356",code:"MT",name:t("malta_73993"),nationality:t("maltese_52729"),emoji:"🇲🇹",language:["mt","mt-MT"],smsPrice:.08},{phoneCode:"+692",code:"MH",name:t("marshall_island_92726"),nationality:t("marshallese_30337"),emoji:"🇲🇭",smsPrice:.045},{phoneCode:"+586",code:"MQ",name:t("martinique_79541"),nationality:t("martiniquais_m_01923"),emoji:"🇲🇶"},{phoneCode:"+222",code:"MR",name:t("mauritania_77906"),nationality:t("mauritanian_68205"),emoji:"🇲🇷",smsPrice:.055},{phoneCode:"+230",code:"MU",name:t("mauritius_10801"),nationality:t("mauritian_09142"),emoji:"🇲🇺",smsPrice:.184},{phoneCode:["+262269","+262639"],code:"YT",name:t("mayotte_91167"),nationality:t("mahoran_45424"),emoji:"🇾🇹"},{phoneCode:"+52",code:"MX",name:t("mexico_21962"),nationality:t("mexican_80494"),emoji:"🇲🇽",language:"es-MX",smsPrice:.92},{phoneCode:"+691",code:"FM",name:t("micronesia_fed_39555"),nationality:t("micronesian_97912"),emoji:"🇫🇲",smsPrice:.045},{phoneCode:"+373",code:"MD",name:t("moldova_republ_08796"),nationality:t("moldovan_76486"),emoji:"🇲🇩"},{phoneCode:"+377",code:"MC",name:t("monaco_72117"),nationality:t("mon_gasque_mon_17281"),emoji:"🇲🇨",language:"fr-MC",smsPrice:.1},{phoneCode:"+976",code:"MN",name:t("mongolia_36757"),nationality:t("mongolian_33711"),emoji:"🇲🇳",language:["mn","mn-MN"],smsPrice:.33},{phoneCode:"+382",code:"ME",name:t("montenegro_78236"),nationality:t("montenegrin_68334"),emoji:"🇲🇪",smsPrice:.15},{phoneCode:"+1664",code:"MS",name:t("montserrat_38432"),nationality:t("montserratian_13585"),emoji:"🇲🇸"},{phoneCode:"+212",code:"MA",name:t("morocco_52420"),nationality:t("moroccan_14305"),emoji:"🇲🇦",language:"ar-MA"},{phoneCode:"+258",code:"MZ",name:t("mozambique_60988"),nationality:t("mozambican_68300"),emoji:"🇲🇿",smsPrice:.32},{phoneCode:"+95",code:"MM",name:t("myanmar_78678"),nationality:t("burmese_66869"),emoji:"🇲🇲",smsPrice:1.1},{phoneCode:"+264",code:"NA",name:t("namibia_19026"),nationality:t("namibian_01490"),emoji:"🇳🇦",smsPrice:.048},{phoneCode:"+674",code:"NR",name:t("nauru_16303"),nationality:t("nauruan_52578"),emoji:"🇳🇷",smsPrice:.21},{phoneCode:"+977",code:"NP",name:t("nepal_49088"),nationality:t("nepali_nepales_64761"),emoji:"🇳🇵",smsPrice:.35},{phoneCode:"+31",code:"NL",name:t("netherlands_38005"),nationality:t("dutch_netherla_42451"),emoji:"🇳🇱",language:["nl","nl-NL"],smsPrice:.095},{phoneCode:"+687",code:"NC",name:t("new_caledonia_14574"),nationality:t("new_caledonian_12113"),emoji:"🇳🇨",smsPrice:.1},{phoneCode:"+64",code:"NZ",name:t("new_zealand_61929"),nationality:t("new_zealander_71823"),emoji:"🇳🇿",language:["en-NZ","mi","mi-NZ"],smsPrice:.14},{phoneCode:"+505",code:"NI",name:t("nicaragua_14531"),nationality:t("nicaraguan_06649"),emoji:"🇳🇮",language:"es-NI",smsPrice:.17},{phoneCode:"+227",code:"NE",name:t("niger_59137"),nationality:t("nigerien_06144"),emoji:"🇳🇪",smsPrice:.067},{phoneCode:"+234",code:"NG",name:t("nigeria_77810"),nationality:t("nigerian_43407"),emoji:"🇳🇬",smsPrice:.47},{phoneCode:"+683",code:"NU",name:t("niue_97570"),nationality:t("niuean_70518"),emoji:"🇳🇺",smsPrice:.045},{phoneCode:"+6723",code:"NF",name:t("norfolk_island_62377"),nationality:t("norfolk_island_62377"),emoji:"🇳🇫"},{phoneCode:"+1670",code:"MP",name:t("northern_marian_94262"),nationality:t("northern_marian_82360"),emoji:"🇲🇵"},{phoneCode:"+47",code:"NO",name:t("norway_14236"),nationality:t("norwegian_50751"),emoji:"🇳🇴",language:["nb","nb-NO","nn-NO","se-NO"],smsPrice:.064},{phoneCode:"+968",code:"OM",name:t("oman_20900"),nationality:t("omani_15042"),emoji:"🇴🇲",language:"ar-OM",smsPrice:.21},{phoneCode:"+92",code:"PK",name:t("pakistan_59697"),nationality:t("pakistani_12622"),emoji:"🇵🇰",language:["ur","ur-PK"],smsPrice:.5},{phoneCode:"+680",code:"PW",name:t("palau_46088"),nationality:t("palauan_73033"),emoji:"🇵🇼",smsPrice:.1},{phoneCode:"+970",code:"PS",name:t("palestine_stat_33253"),nationality:t("palestinian_06829"),emoji:"🇵🇸",smsPrice:.35},{phoneCode:"+507",code:"PA",name:t("panama_16821"),nationality:t("panamanian_07882"),emoji:"🇵🇦",language:"es-PA",smsPrice:.17},{phoneCode:"+675",code:"PG",name:t("papua_new_guine_56959"),nationality:t("papua_new_guine_50302"),emoji:"🇵🇬",smsPrice:.2},{phoneCode:"+595",code:"PY",name:t("paraguay_66859"),nationality:t("paraguayan_50310"),emoji:"🇵🇾",language:"es-PY",smsPrice:.124},{phoneCode:"+51",code:"PE",name:t("peru_23048"),nationality:t("peruvian_85045"),emoji:"🇵🇪",language:["es-PE","qu-PE"],smsPrice:.31},{phoneCode:"+63",code:"PH",name:t("philippines_65361"),nationality:t("philippine_fil_40400"),emoji:"🇵🇭",language:["en-PH","tl","tl-PH"],smsPrice:.243},{phoneCode:"+64",code:"PN",name:t("pitcairn_59104"),nationality:t("pitcairn_island_58961"),emoji:"🇵🇳"},{phoneCode:"+48",code:"PL",name:t("poland_13527"),nationality:t("polish_26779"),emoji:"🇵🇱",language:["pl","pl-PL"],smsPrice:.036},{phoneCode:"+351",code:"PT",name:t("portugal_19698"),nationality:t("portuguese_08463"),emoji:"🇵🇹",language:["pt","pt-PT"],smsPrice:.025},{phoneCode:["+1787","+1939"],code:"PR",name:t("puerto_rico_88176"),nationality:t("puerto_rican_10401"),emoji:"🇵🇷",language:"es-PR"},{phoneCode:"+974",code:"QA",name:t("qatar_70548"),nationality:t("qatari_58016"),emoji:"🇶🇦",language:"ar-QA",smsPrice:.3},{phoneCode:"+262",code:"RE",name:t("r_union_34094"),nationality:t("r_unionese_r_u_86871"),emoji:"🇷🇪",smsPrice:.055},{phoneCode:"+40",code:"RO",name:t("romania_41618"),nationality:t("romanian_49647"),emoji:"🇷🇴",language:["ro","ro-RO"],smsPrice:.09},{phoneCode:"+7",code:"RU",name:t("russian_federat_68392"),nationality:t("russian_12506"),emoji:"🇷🇺",language:["ru","ru-RU","tt","tt-RU"],smsPrice:2.63},{phoneCode:"+250",code:"RW",name:t("rwanda_84901"),nationality:t("rwandan_47719"),emoji:"🇷🇼",smsPrice:.1},{phoneCode:"+590",code:"BL",name:t("saint_barth_lem_80830"),nationality:t("barth_lemois_35003"),emoji:"🇧🇱",smsPrice:.09},{phoneCode:"+290",code:"SH",name:t("saint_helena_a_39384"),nationality:t("saint_helenian_19012"),emoji:"🇸🇭",smsPrice:.1},{phoneCode:"+1869",code:"KN",name:t("saint_kitts_and_74455"),nationality:t("kittitian_or_ne_99867"),emoji:"🇰🇳"},{phoneCode:"+1758",code:"LC",name:t("saint_lucia_60679"),nationality:t("saint_lucian_97267"),emoji:"🇱🇨"},{phoneCode:"+590",code:"MF",name:t("saint_martin_f_87295"),nationality:t("saint_martinois_75974"),emoji:"🇸🇽"},{phoneCode:"+508",code:"PM",name:t("saint_pierre_an_55649"),nationality:t("saint_pierrais_60177"),emoji:"🇵🇲",smsPrice:.13},{phoneCode:"+1784",code:"VC",name:t("saint_vincent_a_23833"),nationality:t("saint_vincentia_81882"),emoji:"🇻🇨"},{phoneCode:"+685",code:"WS",name:t("samoa_25648"),nationality:t("samoan_97653"),emoji:"🇼🇸",smsPrice:.21},{phoneCode:"+378",code:"SM",name:t("san_marino_47437"),nationality:t("sammarinese_71553"),emoji:"🇸🇲",smsPrice:.045},{phoneCode:"+239",code:"ST",name:t("sao_tome_and_pr_10491"),nationality:t("s_o_tom_an_21489"),emoji:"🇸🇹",smsPrice:.045},{phoneCode:"+966",code:"SA",name:t("saudi_arabia_06433"),nationality:t("saudi_saudi_ar_22967"),emoji:"🇸🇦",language:"ar-SA",smsPrice:.215},{phoneCode:"+221",code:"SN",name:t("senegal_38099"),nationality:t("senegalese_64680"),emoji:"🇸🇳",smsPrice:.034},{phoneCode:"+381",code:"RS",name:t("serbia_45061"),nationality:t("serbian_68735"),emoji:"🇷🇸",smsPrice:.46},{phoneCode:"+248",code:"SC",name:t("seychelles_67712"),nationality:t("seychellois_69858"),emoji:"🇸🇨",smsPrice:.3},{phoneCode:"+232",code:"SL",name:t("sierra_leone_02995"),nationality:t("sierra_leonean_86179"),emoji:"🇸🇱",smsPrice:.4},{phoneCode:"+65",code:"SG",name:t("singapore_37928"),nationality:t("singaporean_41916"),emoji:"🇸🇬",language:"zh-SG",smsPrice:.064},{phoneCode:"+1721",code:"SX",name:t("sint_maarten_d_57391"),nationality:t("sint_maarten_82241"),emoji:"🇸🇽"},{phoneCode:"+421",code:"SK",name:t("slovakia_10924"),nationality:t("slovak_69840"),emoji:"🇸🇰",language:["sk","sk-SK"],smsPrice:.068},{phoneCode:"+386",code:"SI",name:t("slovenia_75447"),nationality:t("slovenian_slov_38562"),emoji:"🇸🇮",language:["sl","sl-SI"],smsPrice:.18},{phoneCode:"+677",code:"SB",name:t("solomon_islands_05259"),nationality:t("solomon_island_59052"),emoji:"🇸🇧",smsPrice:.155},{phoneCode:"+252",code:"SO",name:t("somalia_56358"),nationality:t("somali_somalia_97997"),emoji:"🇸🇴",smsPrice:.35},{phoneCode:"+27",code:"ZA",name:t("south_africa_61184"),nationality:t("south_african_82152"),emoji:"🇿🇦",language:["af-ZA","en-ZA","ns","ns-ZA","tn","tn-ZA","xh","xh-ZA","zu","zu-ZA"],smsPrice:.13},{phoneCode:"+500",code:"GS",name:t("south_georgia_a_39555"),nationality:t("south_georgia_o_65055"),emoji:"🇬🇸",smsPrice:.12},{phoneCode:"+211",code:"SS",name:t("south_sudan_88232"),nationality:t("south_sudanese_69140"),emoji:"🇸🇸"},{phoneCode:"+34",code:"ES",name:t("spain_40048"),nationality:t("spanish_74199"),emoji:"🇪🇸",language:["ca","ca-ES","es","es-ES","eu-ES","gl-ES"],smsPrice:.044},{phoneCode:"+94",code:"LK",name:t("sri_lanka_51563"),nationality:t("sri_lankan_09436"),emoji:"🇱🇰",smsPrice:.4},{phoneCode:"+249",code:"SD",name:t("sudan_18427"),nationality:t("sudanese_42330"),emoji:"🇸🇩",smsPrice:.322},{phoneCode:"+597",code:"SR",name:t("suriname_78561"),nationality:t("surinamese_38193"),emoji:"🇸🇷",smsPrice:.3},{phoneCode:"+4779",code:"SJ",name:t("svalbard_and_ja_38511"),nationality:t("svalbard_26353"),emoji:"🇸🇯"},{phoneCode:"+268",code:"SZ",name:t("swaziland_91614"),nationality:t("swazi_88825"),emoji:"🇸🇿",smsPrice:.3},{phoneCode:"+46",code:"SE",name:t("sweden_85663"),nationality:t("swedish_90836"),emoji:"🇸🇪",language:["se-SE","sv","sv-SE"],smsPrice:.098},{phoneCode:"+41",code:"CH",name:t("switzerland_07889"),nationality:t("swiss_23240"),emoji:"🇨🇭",language:["de-CH","fr-CH","it-CH"],smsPrice:.098},{phoneCode:"+963",code:"SY",name:t("syrian_arab_rep_72539"),nationality:t("syrian_06992"),emoji:"🇸🇾",language:["ar-SY","syr","syr-SY"],smsPrice:.37},{phoneCode:"+886",code:"TW",name:t("taiwan_provinc_87264"),nationality:t("chinese_taiwan_24003"),emoji:"🇹🇼",language:"zh-TW",smsPrice:.105},{phoneCode:"+992",code:"TJ",name:t("tajikistan_97104"),nationality:t("tajikistani_21375"),emoji:"🇹🇯",smsPrice:.38},{phoneCode:"+255",code:"TZ",name:t("tanzania_unite_52757"),nationality:t("tanzanian_71935"),emoji:"🇹🇿",smsPrice:.38},{phoneCode:"+66",code:"TH",name:t("thailand_97396"),nationality:t("thai_51972"),emoji:"🇹🇭",language:["th","th-TH"],smsPrice:.066},{phoneCode:"+670",code:"TL",name:t("timor_leste_95604"),nationality:t("timorese_87542"),emoji:"🇹🇱",smsPrice:.22},{phoneCode:"+228",code:"TG",name:t("togo_60267"),nationality:t("togolese_55079"),emoji:"🇹🇬",smsPrice:.03},{phoneCode:"+690",code:"TK",name:t("tokelau_79536"),nationality:t("tokelauan_89444"),emoji:"🇹🇰",smsPrice:.045},{phoneCode:"+676",code:"TO",name:t("tonga_96982"),nationality:t("tongan_52630"),emoji:"🇹🇴",smsPrice:.2},{phoneCode:"+1868",code:"TT",name:t("trinidad_and_to_31939"),nationality:t("trinidadian_or_65515"),emoji:"🇹🇹",language:"en-TT"},{phoneCode:"+216",code:"TN",name:t("tunisia_36732"),nationality:t("tunisian_19451"),emoji:"🇹🇳",language:"ar-TN",smsPrice:.35},{phoneCode:"+90",code:"TR",name:t("turkey_65699"),nationality:t("turkish_85889"),emoji:"🇹🇷",language:["tr","tr-TR"],smsPrice:.033},{phoneCode:"+993",code:"TM",name:t("turkmenistan_86069"),nationality:t("turkmen_63945"),emoji:"🇹🇲"},{phoneCode:"+1649",code:"TC",name:t("turks_and_caico_34033"),nationality:t("turks_and_caico_41685"),emoji:"🇹🇨"},{phoneCode:"+688",code:"TV",name:t("tuvalu_52410"),nationality:t("tuvaluan_49403"),emoji:"🇹🇻",smsPrice:.12},{phoneCode:"+256",code:"UG",name:t("uganda_42928"),nationality:t("ugandan_07085"),emoji:"🇺🇬",smsPrice:.3},{phoneCode:"+380",code:"UA",name:t("ukraine_86632"),nationality:t("ukrainian_77624"),emoji:"🇺🇦",language:["uk","uk-UA"],smsPrice:.26},{phoneCode:"+971",code:"AE",name:t("united_arab_emi_58689"),nationality:t("emirati_emiria_12413"),emoji:"🇦🇪",language:"ar-AE",smsPrice:.12},{phoneCode:"+44",code:"GB",name:t("united_kingdom_16783"),nationality:t("british_43680"),emoji:"🇬🇧",language:["cy","cy-GB","en","en-GB"],smsPrice:.078},{phoneCode:"+1",code:"US",name:t("united_states_o_43878"),nationality:t("american_36800"),emoji:"🇺🇸",language:"en-US",smsPrice:.03},{phoneCode:"+598",code:"UY",name:t("uruguay_21979"),nationality:t("uruguayan_28212"),emoji:"🇺🇾",language:"es-UY",smsPrice:.1},{phoneCode:"+998",code:"UZ",name:t("uzbekistan_27729"),nationality:t("uzbekistani_uz_10593"),emoji:"🇺🇿",language:["uz","uz-UZ"],smsPrice:.39},{phoneCode:"+678",code:"VU",name:t("vanuatu_82756"),nationality:t("ni_vanuatu_van_02924"),emoji:"🇻🇺",smsPrice:.21},{phoneCode:"+58",code:"VE",name:t("venezuela_boli_00470"),nationality:t("venezuelan_52634"),emoji:"🇻🇪",language:"es-VE",smsPrice:.31},{phoneCode:"+84",code:"VN",name:t("vietnam_82968"),nationality:t("vietnamese_55360"),emoji:"🇻🇳",language:["vi","vi-VN"],smsPrice:.27},{phoneCode:"+1284",code:"VG",name:t("virgin_islands_14222"),nationality:t("british_43680"),emoji:"🇻🇬"},{phoneCode:"+1340",code:"VI",name:t("virgin_islands_12516"),nationality:t("american_36800"),emoji:"🇻🇮"},{phoneCode:"+681",code:"WF",name:t("wallis_and_futu_93206"),nationality:t("wallisian_or_fu_60327"),emoji:"🇼🇫",smsPrice:.09},{phoneCode:"+212",code:"EH",name:t("western_sahara_02173"),nationality:t("sahrawi_sahraw_96671"),emoji:"🇪🇭",smsPrice:.053},{phoneCode:"+967",code:"YE",name:t("yemen_76340"),nationality:t("yemeni_26632"),emoji:"🇾🇪",language:"ar-YE",smsPrice:.23},{phoneCode:"+260",code:"ZM",name:t("zambia_50513"),nationality:t("zambian_85114"),emoji:"🇿🇲",smsPrice:.324},{phoneCode:"+263",code:"ZW",name:t("zimbabwe_70209"),nationality:t("zimbabwean_42291"),emoji:"🇿🇼",language:"en-ZW",smsPrice:.35}],({name:e})=>d(e)),this.countriesCodes=this.countries.map(({code:e})=>e),this.phoneCodes=this.countries.flatMap(({phoneCode:e})=>Ko(e))}countryCodeExists(e){return!!e&&void 0!==this.countries.find(t=>t.code===e)}getCountriesIdName(e){const t=this.getDefaultCountryValues(e).user.country;return(0,Zd.A)(this.countries.map(({code:e,name:t})=>({id:e,name:t})),({id:e})=>e===t?1:2)}getNationalitiesIdName(e){const t=this.getDefaultCountryValues(e).user.nationality;return(0,Zd.A)(this.countries.map(({code:e,nationality:t})=>({id:e,name:t})),({id:e})=>e===t?1:2)}getNationality(e){return this.countries.find(t=>t.code===e)?.nationality}getName(e){return this.countries.find(t=>t.code===e)?.name}getDefaultCountryValues(e){let t=this.countries.find(({code:t})=>t===e);if(!t){try{t=this.countries.find(e=>Ko(e.language||[]).map(e=>e.toLowerCase()).includes(navigator.language.toLowerCase()))}catch{}t||(t=this.countries.find(({code:e})=>"FR"===e))}const n=Ko(t.language||[]);return{user:{language:n.some(e=>e.toLowerCase().startsWith("fr"))?It.Fr:n.some(e=>e.toLowerCase().startsWith("es"))?It.Es:n.some(e=>e.toLowerCase().startsWith("de"))?It.De:n.some(e=>e.toLowerCase().startsWith("nl"))?It.Nl:It.En,country:t.code,nationality:t.code},phone:{country:t.code,code:Ko(t.phoneCode)[0]}}}getSmsPriceByPhone(e){return this.countries.find(t=>Ko(t.phoneCode).some(t=>e.startsWith(t)))?.smsPrice}};Hc=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],Hc);const qc=[Ne.Date,Ne.Number,Ne.Text,Ne.Textarea],Yc=[Ne.Phone,Ne.Select,Ne.Text,Ne.Textarea];function Kc(e,t,n){const i=[],o=[];for(const s of t)if(!h(n)||s.name.trim().toLowerCase().includes(n.trim().toLowerCase())||h(s.label)&&s.label.trim().toLowerCase().includes(n.trim().toLowerCase())){const t=e.find(({slug:e})=>e===s.slug);t?i.push({filter:s,predicate:t}):o.push({filter:s,predicate:t})}return[i,o]}function Zc(e,t){return Zo(e.values)?e.values.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:t(n)},e)):Zo(e.valuesGroups)?e.valuesGroups.map(({name:e,values:t},n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n)):[]}let Xc=class extends Tl{countriesService;dateTimeService;constructor(e,t,n){super(n),this.countriesService=e,this.dateTimeService=t}filterPredicateToText(e){const{filter:t,predicate:n}=e;if(!n)return"";{const i=Fo.c9.isDateTime(n.value)?n.value:Fo.c9.fromISO(n.value,{zone:"utc"}),o=!i.isValid||t.fieldType!==Be.DateTimeRange&&t.fieldType!==Be.Datetime?i.isValid&&t.fieldType===Be.Date?this.dateTimeService.toLocaleString(i,Ho.DateOnly.MonthLong):n.value:this.dateTimeService.toLocaleString(i,Ho.DateTime),s=Fo.c9.isDateTime(n.value2)?n.value2:Fo.c9.fromISO(n.value2,{zone:"utc"}),r=!s.isValid||t.fieldType!==Be.DateTimeRange&&t.fieldType!==Be.Datetime?s.isValid&&t.fieldType===Be.Date?this.dateTimeService.toLocaleString(s,Ho.DateOnly.MonthLong):n.value2:this.dateTimeService.toLocaleString(s,Ho.DateTime);switch(n.operator){case dt.Contains:return"condition"===t.slug?this.conditionFilterToString(e):"wishedPositions"===t.slug?this.t("mission_souhait_38008",r,this.valueToString(t,o)):"wishedPositionsCategories"===t.slug?this.t("cat_gorie_souha_24744",r,this.valueToString(t,o)):"isDelegationLeader"===t.slug?this.t("est_responsable_13012",this.valueToString(t,o)):this.t("_1_contient_2_40552",t.name,o);case dt.NotContains:return this.t("_1_ne_contient_14612",t.name,o);case dt.Is:if("isLeader"===t.slug)return this.t("est_responsable_19679");if("isPositionLeader"===t.slug)return this.t("est_responsable_27270");if("isPositionCategoryLeader"===t.slug)return this.t("est_responsable_72923");if("isDelegationLeader"===t.slug)return this.t("est_responsable_87662");if("privacy"===t.slug)return this.t("visibilit_est_12738");if("campaign"===t.slug)return this.campaignFilterToString(e);if("campaignReply"===t.slug)return this.campaignReplyFilterToString(e);if("condition"===t.slug)return this.t("champ_dont_un_a_44854");if("numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug)return this.t("_1_pour_la_jou_73174",t.name,this.dateTimeService.toLocaleString(i,Ho.DateOnly.MonthLong),r);if(t.fieldType===Be.Date)return this.t("_1_est_gal_43375",t.name,this.valueDateToString(n.valueDate));if(t.fieldType===Be.DateTimeRange){const e=i?.isValid?this.dateTimeService.toLocaleString(i,Ho.DateOnly.MonthLong):n.value;return this.t("_1_est_gal_43375",t.name,e)}return this.t("_1_est_gal_43375",t.name,this.valueToString(t,o));case dt.IsNot:return"isLeader"===t.slug?this.t("n_est_pas_respo_55625"):"isPositionLeader"===t.slug?this.t("n_est_pas_respo_35508"):"isPositionCategoryLeader"===t.slug?this.t("n_est_pas_respo_07811"):"isDelegationLeader"===t.slug?this.t("n_est_pas_respo_91275"):"privacy"===t.slug?this.t("visibilit_est_55411"):"condition"===t.slug?this.t("champ_d_pendant_33676"):"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_61197",t.name,this.dateTimeService.toLocaleString(i,Ho.DateOnly.MonthLong),r):t.fieldType===Be.Date?this.t("_1_n_est_pas_38478",t.name,this.valueDateToString(n.valueDate)):this.t("_1_n_est_pas_38478",t.name,this.valueToString(t,o));case dt.IsEmpty:return this.t("_1_est_vide_08225",t.name);case dt.IsNotEmpty:return this.t("_1_n_est_pas_v_31530",t.name);case dt.IsValid:return this.t("_1_est_valide_45209",t.name);case dt.IsNotValid:return this.t("_1_n_est_pas_v_05077",t.name);case dt.GreaterThan:return"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_91055",t.name,this.dateTimeService.toLocaleString(i,Ho.DateOnly.MonthLong),r):this.t("_1_est_plus_gr_93527",t.name,n.value);case dt.GreaterThanEqual:return"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_41388",t.name,this.dateTimeService.toLocaleString(i,Ho.DateOnly.MonthLong),r):this.t("_1_est_gal_ou_95771",t.name,n.value);case dt.LessThan:return"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_99548",t.name,this.dateTimeService.toLocaleString(i,Ho.DateOnly.MonthLong),r):this.t("_1_est_plus_pe_18306",t.name,n.value);case dt.LessThanEqual:return"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_37455",t.name,this.dateTimeService.toLocaleString(i,Ho.DateOnly.MonthLong),r):this.t("_1_est_gal_ou_39305",t.name,n.value);case dt.Overlaps:return this.t("_1_chevauche_45834",t.name,o,r);case dt.NotOverlaps:return this.t("_1_ne_chevauch_01846",t.name,o,r);case dt.Engulfs:return this.t("_1_engloutis_32228",t.name,o,r);case dt.NotEngulfs:return this.t("_1_n_engloutis_52951",t.name,o,r);case dt.EngulfedBy:return this.t("_1_est_englout_36064",t.name,o,r);case dt.NotEngulfedBy:return this.t("_1_n_est_pas_e_89161",t.name,o,r);case dt.IsBefore:return"formsInsertedAt"===t.slug?this.t("_1_est_avant_l_83271",t.name,r):this.t("_1_est_avant_l_83271",t.name,o);case dt.IsAfter:return"formsInsertedAt"===t.slug?this.t("_1_est_apr_s_l_63712",t.name,r):this.t("_1_est_apr_s_l_63712",t.name,o);case dt.Between:return this.t("_1_est_entre_39871",t.name,o,r);case dt.StartsWith:return this.t("_1_commence_pa_47720",t.name,o);case dt.EndsWith:return this.t("_1_finit_par_65840",t.name,o);case dt.Today:return this.t("_1_est_aujourd_42954",t.name);default:return Za(n.operator)}}}getValues(e){return e.fieldType===Ne.Sex?jn.map(e=>({id:e,name:this.t(e)})):e.fieldType===Ne.Language?e.fieldProperty===Me.Language?ad.map(e=>({id:e,name:this.t(e)})):un.map(e=>({id:e,name:this.t(e)})):e.fieldType===Ne.Nationality?this.countriesService.getNationalitiesIdName():e.fieldType===Ne.Country?this.countriesService.getCountriesIdName():e.fieldType===Ne.Select&&Zo(e.values)?e.values.map(({id:e,value:t})=>({id:e,name:t})):[]}valueToString(e,t){const n=function(e){return Zo(e.values)?e.values:Zo(e.valuesGroups)?e.valuesGroups.flatMap(e=>e.values):[]}(e);return Zo(n)?Ko(t).map(e=>this.t(n.find(({id:t})=>t===e)?.name??e)).join(` ${this.t("ou_67404")} `):this.t(t)}valueDateToString(e){const t=[];return"number"==typeof e?.day&&-1!==e.day&&t.push(e.day),"number"==typeof e?.month&&-1!==e.month&&t.push(this.dateTimeService.toLocaleString(Fo.c9.now().set({month:e.month}),{month:"long"})),"number"==typeof e?.year&&-1!==e.year&&t.push(e.year),t.join(" ")}conditionFilterToString(e){if(e.predicate){const t=e.predicate.value.map(t=>e.filter.values?.find(e=>e.id===t)?.name??"");return 1===t.length?this.t("d_pend_du_champ_43516",t[0]):this.t("d_pend_des_cham_85348",t.join(", "))}return""}campaignFilterToString(e){if(e.predicate){const t=e.predicate.value.map(t=>e.filter.campaigns?.find(e=>e.id===t)?.name??"").join(", "),n=e.predicate.value2.map(e=>this.t(e)).join(", ");return this.t("a_re_u_un_messa_76546",t,n)}return""}campaignReplyFilterToString(e){if(e.predicate){const t=e.predicate.value.map(t=>e.filter.campaigns?.find(e=>e.id===t)?.name??"").join(", ");return this.t("la_r_ponse_des_14160",t,e.predicate.value2)}return""}customFieldsToFilters(e){return e.filter(({fieldType:e})=>[Be.Address,Be.Checkbox,Be.Country,Be.Date,Be.Datetime,Be.File,Be.Language,Be.Nationality,Be.Number,Be.Phone,Be.Select,Be.Sex,Be.Text,Be.Textarea,Be.Validation].includes(e)).map(e=>({...e,category:this.t("champs_de_formu_64126"),fieldType:e.fieldType,values:this.getValues(e),color:"warning",isEncrypted:e.isEncrypted}))}customFieldsToPossibleColumns(e){return e.map(e=>({slug:e.slug,name:e.name,label:e.label,customField:e,isSearchable:Yc.includes(e.fieldType),isSortable:!!qc.includes(e.fieldType)||e.fieldType===Ne.Select&&e.isSelectV2&&!e.canSelectMultiple,sortAttribute:e.slug,width:"picture"===e.slug?80:void 0,minWidth:"picture"===e.slug?void 0:180}))}};Xc=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hc,$c,Dn])],Xc);var Jc=n(1932),Qc=n(6360);const eu=({children:e,css:t,onClose:n,returnToFallback:o,size:s})=>{const r=Gn(),a=()=>{n?n():r.goBack(o??So.HOME)};return kd(a),Ua("common-front/src/designSystem/components/rightPanel.tsx","common-front/src/designSystem/components/newRightPanel.rightPanel.tsx"),(0,ee.createPortal)((0,i.jsx)(Ea,{css:{background:"rgba(52, 64, 84, 0.7)",height:"100%",left:0,position:"absolute",top:0,width:"100%",zIndex:"100",...t},"data-testid":"right-panel-backdrop",onClick:a,children:(0,i.jsxs)(Ea,{css:{background:"white",height:"100%",position:"absolute",right:"0",top:"0",width:"sm"===s?"480px":"650px"},"data-testid":"right-panel-body",direction:"column",onClick:e=>Il(e,!1),children:[(0,i.jsx)(fr,{color:"gray500",css:{cursor:"pointer",fontSize:"$textMd",position:"absolute",right:"$space$6",top:"$space$6"},onClick:a,children:(0,i.jsx)("i",{className:"far fa-xmark"})}),e]})}),document.body)},tu=F.forwardRef((e,t)=>(0,i.jsx)(Ea,{ref:t,css:{flex:"1",overflowY:"auto",px:"$6",...e.css},direction:"column",children:e.children}));tu.displayName="RightPanelBody";const nu=e=>(0,i.jsx)(fr,{color:"gray800",css:{borderTop:"1px solid $gray200",px:"$6",py:"$4"},children:e.children}),iu=ar("div",{alignItems:"center",borderRadius:"12px",cursor:"pointer",display:"flex",position:"relative","& > div":{background:"white",boxShadow:"$sm",position:"absolute",transition:"left 200ms ease-in"},variants:{disabled:{true:{cursor:"auto"}},size:{sm:{height:"16px",width:"30px","& > div":{borderRadius:"12px",height:"12px",width:"12px"}},md:{height:"24px",width:"44px","& > div":{borderRadius:"20px",height:"20px",width:"20px"}}},state:{unchecked:{background:"$gray200","& > div":{left:"2px"}},checked:{background:"$primary600"}}},compoundVariants:[{size:"sm",state:"checked",css:{"& > div":{left:"calc(100% - 2px - 12px)"}}},{size:"md",state:"checked",css:{"& > div":{left:"calc(100% - 2px - 20px)"}}},{disabled:!0,state:"checked",css:{background:"$gray100"}}],defaultVariants:{size:"sm"}}),ou=e=>(0,i.jsx)(iu,{"aria-checked":e.value,"aria-describedby":e.descId,"aria-label":e.label,"aria-labelledby":e.labelId,disabled:e.disabled,id:e.inputId,role:"checkbox",size:e.size,state:e.value?"checked":"unchecked",tabIndex:e.tabIndex??0,onClick:()=>{e.disabled||e.onChange(!e.value)},onKeyDown:t=>{e.disabled||"Space"!==t.code||(t.preventDefault(),e.onChange(!e.value))},children:(0,i.jsx)("div",{})}),su=e=>{const{inputId:t,descId:n,labelId:o}=bl(),s=h(e.subtext);return(0,i.jsxs)(Ea,{align:"center",css:{cursor:e.disabled?"auto":"pointer",userSelect:"none",...e.css},tabIndex:0,onClick:()=>{e.disabled||e.onChange(!e.value)},onKeyDown:t=>{e.disabled||"Space"!==t.code||(t.preventDefault(),e.onChange(!e.value))},children:[(0,i.jsx)(ou,{descId:n,disabled:e.disabled,inputId:t,labelId:o,size:e.size,tabIndex:-1,value:e.value,onChange:Bl.A}),(0,i.jsx)(Pa,{width:"2"}),(0,i.jsxs)(Ea,{css:{flex:"1",fontSize:"md"===e.size?"$3":"$2"},direction:"column",children:[(0,i.jsx)(yl,{htmlFor:t,id:o,children:(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:e.children})}),s&&(0,i.jsx)(fr,{color:"gray500",id:n,children:e.subtext})]})]})},ru=e=>{const t=Ln(),[n,o]=(0,F.useState)(""),[s,r]=(0,F.useState)((0,Zd.A)(e.columns.map(t=>({...t,isSelected:e.initialSelectedColumns.includes(t.slug)})),[({slug:t})=>{const n=e.initialSelectedColumns.indexOf(t);return-1===n?e.columns.length:n},({name:e})=>e]));return(0,i.jsxs)(eu,{css:e.css,size:"sm",onClose:e.onClose,children:[(0,i.jsxs)(tu,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textXl",children:e.title}),(0,i.jsx)(fr,{color:"gray500",children:e.subtitle}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:e.searchPlaceholder,value:n,onChange:o}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_champ_00325")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Qc.JY,{onDragEnd:({reason:e,source:t,destination:n})=>{"DROP"===e&&n&&t.index!==n.index&&r(es(s,t.index,n.index))},children:(0,i.jsx)(Qc.gL,{droppableId:"1",children:e=>(0,i.jsxs)(Ea,{direction:"column",gap:"2",...e.droppableProps,ref:e.innerRef,children:[s.map((e,t)=>(e=>{if(h(n)){const t=n.trim().toLowerCase();return e.name.trim().toLowerCase().includes(t)||h(e.label)&&e.label.trim().toLowerCase().includes(t)}return!0})(e)?(0,i.jsx)(Qc.sx,{draggableId:e.slug,index:t,children:n=>(0,i.jsxs)(Ea,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",...n.draggableProps,ref:n.innerRef,children:[(0,i.jsx)(fr,{color:"gray300",css:{cursor:"grab"},...n.dragHandleProps,children:(0,i.jsx)(Va,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{color:"gray800",css:{ellipsis:!0},title:e.name,width:1,children:e.name}),h(e.label)&&(0,i.jsx)(fr,{color:"gray500",css:{ellipsis:!0},title:e.label,width:1,children:e.label})]}),(0,i.jsx)(ou,{value:e.isSelected,onChange:()=>{var n,i;n=e,i=t,r((0,Jc.jM)(e=>{e[i].isSelected=!n.isSelected}))}})]})},e.slug):null),e.placeholder]})})}),(0,i.jsx)(Pa,{height:"6"})]}),(0,i.jsx)(nu,{children:(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{onClick:()=>{e.onSave(s.filter(e=>e.isSelected).map(e=>e.slug)),e.onClose()},children:e.saveButtonText}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})})]})};function au(e){const[t,n]=(0,F.useState)(e),[i,o]=(0,F.useState)(!1),s=(0,F.useMemo)(()=>{const e=Object.values(t).filter(e=>!0!==e.disabled),n=e.filter(e=>"checked"===e.state),i=n.map(e=>e.id),o=(0,Oo.A)(e.map(({state:e})=>e)),s=2===o.length?"indeterminate":"checked"===o[0]?"checked":"unchecked";return{numberOfSelected:n.length,selectAllState:s,selecteds:n,selectedsIds:i}},[t]),r=(0,F.useCallback)((e,t)=>{n(n=>({...n,[e]:{...n[e],state:t}})),"unchecked"===t&&o(!1)},[t,n,o]),a=(0,F.useCallback)(e=>{n(Object.fromEntries(Object.entries(t).filter(([e,t])=>!0!==t.disabled).map(([t,n])=>[t,{...n,state:e}]))),"unchecked"===e&&o(!1)},[t,n,o]);return{getSelectedsInput:(0,F.useCallback)((e,t)=>i?e?{ids:null,predicates:e,segmentId:null}:{ids:null,predicates:null,segmentId:t}:{ids:s.selectedsIds,predicates:null,segmentId:null},[i,s]),isAllSelected:i,numberOfSelected:s.numberOfSelected,selectAllState:s.selectAllState,selecteds:s.selecteds,selectedsIds:s.selectedsIds,setIsAllSelected:o,setStates:n,states:t,toggleRow:r,toggleSelectAll:a}}function lu(e){return{numberOfPages:(0,F.useMemo)(()=>e?.numberOfPages??1,[e]),totalCount:(0,F.useMemo)(()=>e?.totalCount??0,[e])}}var du=n(903);const cu=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.filterPredicate.predicate?.value??[]),[s,r]=(0,F.useState)(e.filterPredicate.predicate?.value2??[]),a=e.filterPredicate.filter.campaigns??[],l=(0,Oo.A)(a.filter(({id:e})=>n.includes(e)).map(({campaignType:e})=>e)),d=(0,Oo.A)(["NotSent",...l.includes(ue.Email)?en.filter(e=>e!==Ee.Queued):[],...l.includes(ue.Sms)?yn:[]]),c=Zo(n)&&Zo(s);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(dc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_un_28439"),values:n,onChange:o,children:a.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),n.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(dc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_un_62901"),values:s,onChange:r,children:d.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{disabled:!c,onClick:()=>{e.onAdd({operator:dt.Is,value:n,value2:s,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},uu=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.filterPredicate.predicate?.value??[]),[s,r]=(0,F.useState)(e.filterPredicate.predicate?.operator??dt.Contains),[a,l]=(0,F.useState)(e.filterPredicate.predicate?.value2??[]),d=e.filterPredicate.filter.campaigns??[],c=Zo(n)&&(s===dt.Contains&&h(a)||s===dt.IsEmpty||s===dt.IsNotEmpty);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(dc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_un_28439"),values:n,onChange:o,children:d.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),n.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"contains"===s?"checked":"unchecked",onClick:()=>{r(dt.Contains)},children:t("contient_34012")}),"contains"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{value:a,onChange:l})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isEmpty"===s?"checked":"unchecked",onClick:()=>{r(dt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNotEmpty"===s?"checked":"unchecked",onClick:()=>{r(dt.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{disabled:!c,onClick:()=>{e.onAdd({operator:s,value:n,value2:a,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},hu=ar("select",{backgroundColor:"$white",height:"100%",left:0,opacity:0,position:"absolute",top:0,width:"100%"}),mu=ar("div",{ellipsis:""}),gu=({autoComplete:e,children:t,css:n,label:o,description:s,shouldParseAsInt:r,shouldParseAsBoolean:a,onChange:l,hint:d,icon:c,state:u,value:h="",...m})=>{const g=F.useMemo(()=>lc(ac(t)),[t]),{inputId:p,descId:f,errorId:x}=bl();return(0,i.jsxs)(Ea,{css:n,direction:"column",width:1,children:[(0,i.jsx)(yl,{htmlFor:p,children:o}),(0,i.jsx)(jl,{id:f,children:s}),(o||s)&&(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Al,{cursor:"default",icon:c,state:u,children:[(0,i.jsx)(Ea,{align:"center",css:{flex:"1",overflow:"hidden"},height:1,width:1,children:(0,i.jsx)(mu,{children:g[h.toString()]})}),(0,i.jsx)(Ea,{css:{color:"$gray500"},children:(0,i.jsx)(Va,{icon:"chevron-down"})}),(0,i.jsx)(hu,{"aria-describedby":s?f:void 0,"aria-errormessage":"error"===u?x:void 0,"aria-invalid":"error"===u,autoComplete:e??"off",css:{cursor:"disabled"===u?"not-allowed":"pointer"},disabled:"disabled"===u,id:p,value:h.toString(),onChange:e=>{l(r?parseInt(e.target.value,10):a?"true"===e.target.value:e.target.value)},...m,children:t})]}),(0,i.jsx)(Cl,{id:x,state:u,children:d})]})},pu=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.filterPredicate.predicate?.operator??dt.Is),[s,r]=(0,F.useState)(e.filterPredicate.predicate?.value??!0);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sc,{state:"is"===n?"checked":"unchecked",onClick:()=>{o(dt.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsxs)(gu,{shouldParseAsBoolean:!0,value:s,onChange:r,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsxs)(gu,{shouldParseAsBoolean:!0,value:s,onChange:r,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]})]}),(0,i.jsx)(Pa,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{o(dt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{onClick:()=>{e.onAdd({operator:n,value:s,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},fu=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.filterPredicate.predicate?.operator??dt.Is),s=e.filterPredicate.filter.values??[],[r,a]=(0,F.useState)(Zo(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),l="is"===n||"isNot"===n||Zo(r);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sc,{state:"is"===n?"checked":"unchecked",onClick:()=>{o(dt.Is)},children:t("champ_dont_un_a_44854")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNot)},children:t("champ_d_pendant_33676")}),s.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{o(dt.Contains)},children:t("d_pends_du_cham_39787")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(dc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:s.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))})]}),(0,i.jsx)(Pa,{height:"1"})]})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{disabled:!l,onClick:()=>{e.onAdd({operator:n,value:r,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})};function xu(e){return h(e)?Fo.c9.fromISO(e):e}const _u=({value:e,css:t,label:n,description:o,hint:s,icon:r,min:a,onChange:l,max:d,state:c,rightIcon:u,onRightIconClick:m,zone:g,...p})=>{const f=e?xu(e):null,x=f?.isValid?f.toFormat(Mo):"",{inputId:_,descId:I,errorId:v}=bl();return(0,i.jsxs)(Ea,{css:t,direction:"column",width:1,children:[(0,i.jsx)(yl,{htmlFor:_,children:n}),(0,i.jsx)(jl,{id:I,children:o}),(n||o)&&(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(Al,{cursor:"default",icon:r,rightIcon:u,state:c,onRightIconClick:m,children:(0,i.jsx)(fr,{css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray500",fontSize:"$textSm",height:"100%",lineHeight:"20px",outline:"none",width:"100%"}},children:(0,i.jsx)("input",{"aria-describedby":o?I:void 0,"aria-errormessage":"error"===c?v:void 0,"aria-invalid":"error"===c,disabled:"disabled"===c,id:_,max:d?.toFormat(Mo),min:a?.toFormat(Mo),type:"date",value:x,onChange:e=>{h(e.target.value)?l(Fo.c9.fromFormat(e.target.value,Mo,{zone:g||"UTC"})):l(Fo.c9.invalid("Invalid"))},...p})})}),(0,i.jsx)(Cl,{id:v,state:c,children:s})]})};var Iu=n(3551);const vu=e=>{const t=Ln(),n=Nn($c),o=(0,F.useMemo)(()=>Fo.c9.now().startOf("year"),[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsxs)(gu,{shouldParseAsInt:!0,value:e.value.day,onChange:t=>{e.setValue({...e.value,day:t})},children:[(0,i.jsx)("option",{value:"-1",children:t("jour_74089")}),(0,vc.A)(1,32).map(e=>(0,i.jsx)("option",{value:e,children:e},e))]})]}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsxs)(gu,{shouldParseAsInt:!0,value:e.value.month,onChange:t=>{e.setValue({...e.value,month:t})},children:[(0,i.jsx)("option",{value:"-1",children:t("mois_10165")}),(0,vc.A)(1,13).map(e=>{const t=n.toLocaleString(o.set({month:e}),{month:"long"});return(0,i.jsx)("option",{value:e,children:t},e)})]})]}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsxs)(gu,{shouldParseAsInt:!0,value:e.value.year,onChange:t=>{e.setValue({...e.value,year:t})},children:[(0,i.jsx)("option",{value:"-1",children:t("ann_e_38546")}),(0,Iu.A)(1900,o.year+2).map(e=>(0,i.jsx)("option",{value:e,children:e},e))]})]}),(0,i.jsx)(Pa,{height:"1"})]})},bu=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.filterPredicate.predicate?.operator??dt.Is),[s,r]=(0,F.useState)(e.filterPredicate.predicate?.value??""),[a,l]=(0,F.useState)(e.filterPredicate.predicate?.value2??""),[d,c]=(0,F.useState)(e.filterPredicate.predicate?.valueDate??{day:-1,month:-1,year:-1}),u=["is","isNot"].includes(n)?"number"==typeof d.day&&-1!==d.day||"number"==typeof d.month&&-1!==d.month||"number"==typeof d.year&&-1!==d.year:["isBefore","isAfter"].includes(n)?Fo.c9.isDateTime(s)&&s.isValid:"between"!==n||Fo.c9.isDateTime(s)&&s.isValid&&Fo.c9.isDateTime(a)&&a.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sc,{state:"is"===n?"checked":"unchecked",onClick:()=>{o(dt.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsx)(vu,{setValue:c,value:d}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsx)(vu,{setValue:c,value:d}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isBefore"===n?"checked":"unchecked",onClick:()=>{o(dt.IsBefore)},children:t("est_avant_le_16689")}),"isBefore"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(_u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isAfter"===n?"checked":"unchecked",onClick:()=>{o(dt.IsAfter)},children:t("est_apr_s_le_79703")}),"isAfter"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(_u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"between"===n?"checked":"unchecked",onClick:()=>{o(dt.Between)},children:t("est_entre_born_59665")}),"between"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(_u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:s,onChange:r}),(0,i.jsx)(Pa,{width:"3"}),(0,i.jsx)(_u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:a,onChange:l})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"today"===n?"checked":"unchecked",onClick:()=>{o(dt.Today)},children:t("est_aujourd_hui_82571")}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{o(dt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{disabled:!u,onClick:()=>{e.onAdd({operator:n,value:s,value2:a,valueDate:d,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},ju=({value:e,css:t,label:n,description:o,hint:s,icon:r,min:a,onChange:l,max:d,rightIcon:c,onRightIconClick:u,state:m,zone:g,...p})=>{const f=e?h(e)?Fo.c9.fromISO(e,{zone:"utc"}):e:null,x=f?.isValid?f.toFormat(No):"",{inputId:_,descId:I,errorId:v}=bl();return(0,i.jsxs)(Ea,{css:t,direction:"column",width:1,children:[(0,i.jsx)(yl,{htmlFor:_,children:n}),(0,i.jsx)(jl,{id:I,children:o}),(n||o)&&(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(Al,{cursor:"default",icon:r,rightIcon:c,state:m,onRightIconClick:u,children:(0,i.jsx)(fr,{css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"}},children:(0,i.jsx)("input",{"aria-describedby":o?I:void 0,"aria-errormessage":"error"===m?v:void 0,"aria-invalid":"error"===m,disabled:"disabled"===m,id:_,max:d?.toFormat(No),min:a?.toFormat(No),type:"datetime-local",value:x,onChange:e=>{h(e.target.value)?l(Fo.c9.fromFormat(e.target.value,No,{zone:g||"UTC"})):l(Fo.c9.invalid("Invalid"))},...p})})}),(0,i.jsx)(Cl,{id:v,state:m,children:s})]})},Cu=e=>{const t=Ln(),n=(0,F.useMemo)(()=>e.filterPredicate.filter.useLocalZone?qo():void 0,[e.filterPredicate]),[o,s]=(0,F.useState)(e.filterPredicate.predicate?.operator??dt.Is),[r,a]=(0,F.useState)(e.filterPredicate.predicate?.value??""),[l,d]=(0,F.useState)(e.filterPredicate.predicate?.value2??""),c=["isBefore","isAfter"].includes(o)?Fo.c9.isDateTime(r)&&r.isValid:"between"!==o||Fo.c9.isDateTime(r)&&r.isValid&&Fo.c9.isDateTime(l)&&l.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sc,{state:"isBefore"===o?"checked":"unchecked",onClick:()=>{s(dt.IsBefore)},children:t("est_avant_le_16689")}),"isBefore"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{value:r,zone:n,onChange:a})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isAfter"===o?"checked":"unchecked",onClick:()=>{s(dt.IsAfter)},children:t("est_apr_s_le_79703")}),"isAfter"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{value:r,zone:n,onChange:a})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"between"===o?"checked":"unchecked",onClick:()=>{s(dt.Between)},children:t("est_entre_born_59665")}),"between"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{value:r,zone:n,onChange:a})]}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{value:l,zone:n,onChange:d})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"today"===o?"checked":"unchecked",onClick:()=>{s(dt.Today)},children:t("est_aujourd_hui_82571")}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isEmpty"===o?"checked":"unchecked",onClick:()=>{s(dt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNotEmpty"===o?"checked":"unchecked",onClick:()=>{s(dt.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{disabled:!c,onClick:()=>{e.onAdd({operator:o,value:r,value2:l,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},yu=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.filterPredicate.predicate?.operator??dt.Contains),[s,r]=(0,F.useState)(e.filterPredicate.predicate?.value??""),[a,l]=(0,F.useState)(e.filterPredicate.predicate?.value2??""),d=!!(Fo.c9.isDateTime(s)&&s.isValid&&["contains","notContains","is"].includes(n))||Fo.c9.isDateTime(a)&&a.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{o(dt.Contains)},children:t("contient_34012")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"is"===n?"checked":"unchecked",onClick:()=>{o(dt.Is)},children:t("contient_date_89885")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(_u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:s,onChange:r})]})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"notContains"===n?"checked":"unchecked",onClick:()=>{o(dt.NotContains)},children:t("ne_contient_pas_85399")}),"notContains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"overlaps"===n?"checked":"unchecked",onClick:()=>{o(dt.Overlaps)},children:t("chevauche_49445")}),"overlaps"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"notOverlaps"===n?"checked":"unchecked",onClick:()=>{o(dt.NotOverlaps)},children:t("ne_chevauche_pa_17307")}),"notOverlaps"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"engulfs"===n?"checked":"unchecked",onClick:()=>{o(dt.Engulfs)},children:t("engloutis_42346")}),"engulfs"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"notEngulfs"===n?"checked":"unchecked",onClick:()=>{o(dt.NotEngulfs)},children:t("n_engloutis_pas_42363")}),"notEngulfs"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"engulfedBy"===n?"checked":"unchecked",onClick:()=>{o(dt.EngulfedBy)},children:t("est_englouti_pa_47852")}),"engulfedBy"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"notEngulfedBy"===n?"checked":"unchecked",onClick:()=>{o(dt.NotEngulfedBy)},children:t("n_est_pas_englo_08733")}),"notEngulfedBy"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ju,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{disabled:!d,onClick:()=>{e.onAdd({operator:n,value:s,value2:a,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},ku=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.filterPredicate.predicate?.operator??dt.IsEmpty);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{o(dt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNotEmpty)},children:t("n_est_pas_vide_45804")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Au=e=>{const t=Ln(),n=(0,F.useMemo)(()=>(e.filterPredicate.filter.values||[]).map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e)),[e.filterPredicate.filter]),[o,s]=(0,F.useState)(e.filterPredicate.predicate?.operator??dt.Is),[r,a]=(0,F.useState)(e.filterPredicate.predicate?.value??[]),[l,d]=(0,F.useState)(e.filterPredicate.predicate?.value2??""),[c,u]=(0,F.useState)(e.filterPredicate.predicate?.valueDate??{day:-1,month:-1,year:-1}),h=Zo(r)&&["is","isNot"].includes(o)?"number"==typeof c.day&&-1!==c.day||"number"==typeof c.month&&-1!==c.month||"number"==typeof c.year&&-1!==c.year:!!["isBefore","isAfter"].includes(o)&&Fo.c9.isDateTime(l)&&l.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(dc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_un_13356"),values:r,onChange:a,children:n}),r.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"is"===o?"checked":"unchecked",onClick:()=>{s(dt.Is)},children:t("est_25967")}),"is"===o&&(0,i.jsx)(vu,{setValue:u,value:c}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNot"===o?"checked":"unchecked",onClick:()=>{s(dt.IsNot)},children:t("n_est_pas_97826")}),"isNot"===o&&(0,i.jsx)(vu,{setValue:u,value:c}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isBefore"===o?"checked":"unchecked",onClick:()=>{s(dt.IsBefore)},children:t("est_avant_le_16689")}),"isBefore"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(_u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:l,onChange:d})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isAfter"===o?"checked":"unchecked",onClick:()=>{s(dt.IsAfter)},children:t("est_apr_s_le_79703")}),"isAfter"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(_u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:l,onChange:d})]}),(0,i.jsx)(Pa,{height:"1"})]})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{disabled:!h,onClick:()=>{e.onAdd({operator:o,value:r,value2:l,valueDate:c,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},wu=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.filterPredicate.predicate?.operator??dt.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sc,{state:"is"===n?"checked":"unchecked",onClick:()=>{o(dt.Is)},children:t("est_administrat_15766")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNot)},children:t("n_est_pas_admin_58612")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Su=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.filterPredicate.predicate?.operator??dt.Is),s=(0,F.useMemo)(()=>Zc(e.filterPredicate.filter,t),[e.filterPredicate.filter]),[r,a]=(0,F.useState)(Zo(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),l="contains"!==n||Zo(r),d=(0,F.useMemo)(()=>Array.isArray(r)?r.length:0,[r]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sc,{state:"is"===n?"checked":"unchecked",onClick:()=>{o(dt.Is)},children:t("est_responsable_47377")}),(0,i.jsx)(Pa,{height:"3"}),"isDelegationLeader"===e.filterPredicate.filter.slug&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{o(dt.Contains)},children:t("est_responsable_00281")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(Ea,{css:{paddingLeft:"$6"},children:(0,i.jsx)(dc,{hint:t("_1_s_lectionn_51286",d),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:s})}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"})]}),(0,i.jsx)(sc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNot)},children:t("n_est_pas_respo_55625")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{disabled:!l,onClick:()=>{e.onAdd({operator:n,value:r,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Eu=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.filterPredicate.predicate?.operator??dt.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sc,{state:"is"===n?"checked":"unchecked",onClick:()=>{o(dt.Is)},children:t("est_inscrit_en_86193")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNot)},children:t("n_est_pas_inscr_25311")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Tu=ar("div",{variants:{direction:{horizontal:{width:"100%"},vertical:{height:"100%"}},color:{gray100:{},gray200:{}}},compoundVariants:[{direction:"horizontal",color:"gray100",css:{borderTop:"1px solid $gray100"}},{direction:"vertical",color:"gray100",css:{borderRight:"1px solid $gray100"}},{direction:"horizontal",color:"gray200",css:{borderTop:"1px solid $gray200"}},{direction:"vertical",color:"gray200",css:{borderRight:"1px solid $gray200"}}],defaultVariants:{color:"gray200"}}),zu=e=>(0,i.jsx)(Tu,{"aria-orientation":e.direction,color:e.color,css:e.css,direction:e.direction,role:"separator"}),$u=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:e.height}),(0,i.jsx)(Tu,{color:e.color,direction:"horizontal",role:"separator"}),(0,i.jsx)(Pa,{height:e.height})]}),Ou=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.filterPredicate.predicate?.operator??dt.Is),[s,r]=(0,F.useState)(e.filterPredicate.predicate?.value??""),[a,l]=(0,F.useState)(e.filterPredicate.predicate?.value2??""),[d,c]=(0,F.useState)(xu(e.filterPredicate.predicate?.value3??"")),[u,h]=(0,F.useState)(xu(e.filterPredicate.predicate?.value4??"")),[m,g]=(0,F.useState)(Fo.c9.isDateTime(d)&&d.isValid&&Fo.c9.isDateTime(u)&&u.isValid?"checked":"unchecked"),p=("checked"!==m||Fo.c9.isDateTime(d)&&d.isValid&&Fo.c9.isDateTime(u)&&u.isValid)&&["is","isNot","greaterThan","greaterThanEqual","lessThan","lessThanEqual"].includes(n)?"number"==typeof s:"between"!==n||"number"==typeof s&&"number"==typeof a;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sc,{state:"is"===n?"checked":"unchecked",onClick:()=>{o(dt.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{shouldParseAsInt:!0,value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{shouldParseAsInt:!0,value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"greaterThan"===n?"checked":"unchecked",onClick:()=>{o(dt.GreaterThan)},children:t("plus_grand_que_28412")}),"greaterThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{shouldParseAsInt:!0,value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"greaterThanEqual"===n?"checked":"unchecked",onClick:()=>{o(dt.GreaterThanEqual)},children:t("_gal_ou_plus_gr_76897")}),"greaterThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{shouldParseAsInt:!0,value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"lessThan"===n?"checked":"unchecked",onClick:()=>{o(dt.LessThan)},children:t("plus_petit_que_35846")}),"lessThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{shouldParseAsInt:!0,value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"lessThanEqual"===n?"checked":"unchecked",onClick:()=>{o(dt.LessThanEqual)},children:t("_gal_ou_plus_pe_38400")}),"lessThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{shouldParseAsInt:!0,value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"between"===n?"checked":"unchecked",onClick:()=>{o(dt.Between)},children:t("est_entre_born_59665")}),"between"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{shouldParseAsInt:!0,value:s,onChange:r}),(0,i.jsx)(Pa,{width:"3"}),(0,i.jsx)(wl,{shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Pa,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{o(dt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),"numberOfAssignmentsDays"===e.filterPredicate.filter.slug&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($u,{height:"3"}),(0,i.jsx)(nc,{state:m,onClick:g,children:t("filtrer_sur_une_06420")}),"checked"===m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsxs)(Ea,{gap:"3",children:[(0,i.jsx)(_u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:d,onChange:c}),(0,i.jsx)(_u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:u,onChange:h})]})]})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{disabled:!p,onClick:()=>{e.onAdd({operator:n,value:s,value2:a,value3:d,value4:u,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Ru=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.filterPredicate.predicate?.operator??dt.Is),[s,r]=(0,F.useState)(e.filterPredicate.predicate?.value??""),[a,l]=(0,F.useState)(e.filterPredicate.predicate?.value2??""),d=!!(Fo.c9.isDateTime(s)&&s?.isValid&&["is","isNot","greaterThan","greaterThanEqual","lessThan","lessThanEqual"].includes(n))&&"number"==typeof a;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_u,{label:t("jour_d_affectat_27334"),max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:s,onChange:r}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(yl,{children:e.filterPredicate.filter.name}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(sc,{state:"is"===n?"checked":"unchecked",onClick:()=>{o(dt.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"greaterThan"===n?"checked":"unchecked",onClick:()=>{o(dt.GreaterThan)},children:t("plus_grand_que_28412")}),"greaterThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"greaterThanEqual"===n?"checked":"unchecked",onClick:()=>{o(dt.GreaterThanEqual)},children:t("_gal_ou_plus_gr_76897")}),"greaterThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"lessThan"===n?"checked":"unchecked",onClick:()=>{o(dt.LessThan)},children:t("plus_petit_que_35846")}),"lessThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"lessThanEqual"===n?"checked":"unchecked",onClick:()=>{o(dt.LessThanEqual)},children:t("_gal_ou_plus_pe_38400")}),"lessThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{disabled:!d,onClick:()=>{e.onAdd({operator:n,value:s,value2:a,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Pu=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.filterPredicate.predicate?.operator??dt.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sc,{state:"is"===n?"checked":"unchecked",onClick:()=>{o(dt.Is)},children:t("Public")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNot)},children:t("Private")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Du=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.filterPredicate.predicate?.operator??dt.Is),s=(0,F.useMemo)(()=>Zc(e.filterPredicate.filter,t),[e.filterPredicate.filter]),[r,a]=(0,F.useState)(Zo(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),l="is"!==n&&"isNot"!==n||Zo(r),d=(0,F.useMemo)(()=>Array.isArray(r)?r.length:0,[r]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sc,{state:"is"===n?"checked":"unchecked",onClick:()=>{o(dt.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(Ea,{css:{paddingLeft:"$6"},children:(0,i.jsx)(dc,{hint:t("_1_s_lectionn_51286",d),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:s})}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(Ea,{css:{paddingLeft:"$6"},children:(0,i.jsx)(dc,{hint:t("_1_s_lectionn_51286",d),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:s})}),(0,i.jsx)(Pa,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{o(dt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{disabled:!l,onClick:()=>{e.onAdd({operator:n,value:r,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Fu=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.filterPredicate.predicate?.operator??(e.filterPredicate.filter.isEncrypted?dt.IsEmpty:dt.Contains)),[s,r]=(0,F.useState)(e.filterPredicate.predicate?.value??""),a="contains"!==n&&"notContains"!==n||h(s);return(0,i.jsxs)(i.Fragment,{children:[!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsx)(sc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{o(dt.Contains)},children:t("contient_34012")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"notContains"===n?"checked":"unchecked",onClick:()=>{o(dt.NotContains)},children:t("ne_contient_pas_85399")})]}),"notContains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"startsWith"===n?"checked":"unchecked",onClick:()=>{o(dt.StartsWith)},children:t("commence_par_11056")})]}),"startsWith"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"endsWith"===n?"checked":"unchecked",onClick:()=>{o(dt.EndsWith)},children:t("finit_par_79657")})]}),"endsWith"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{value:s,onChange:r})]}),(0,i.jsx)(Pa,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{o(dt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),e.showIsValid&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isValid"===n?"checked":"unchecked",onClick:()=>{o(dt.IsValid)},children:t("est_valide_72630")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNotValid"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNotValid)},children:t("n_est_pas_valid_75405")})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{disabled:!a,onClick:()=>{e.onAdd({operator:n,value:s,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Mu=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.filterPredicate.predicate?.operator??dt.Is),s=(0,F.useMemo)(()=>Zc(e.filterPredicate.filter,t),[e.filterPredicate.filter]),[r,a]=(0,F.useState)(Zo(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),[l,d]=(0,F.useState)(e.filterPredicate.predicate?.value2??1),c=Zo(r);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sc,{state:"is"===n?"checked":"unchecked",onClick:()=>{o(dt.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(dc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:s})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(dc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:s})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{o(dt.Contains)},children:t("est_le_choix_07450")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(wl,{shouldParseAsInt:!0,value:l,onChange:d})]}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(dc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:s})]}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{o(dt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{o(dt.IsNotEmpty)},children:t("n_est_pas_vide_45804")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{disabled:!c,onClick:()=>{e.onAdd({operator:n,value:r,value2:l,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})};var Nu=n(9669),Lu=n(8389),Bu=n(8047);const Vu=({children:e,dateTime:t,...n})=>{const o=h(t)?t:t.toISO();return(0,i.jsx)(Ka,{as:"time",textStyle:"inherit",dateTime:o,...n,children:e})};function Uu(e,t){const n=t.formats?.localeFormat||Ho.DateOnly.MonthLong,i=Ho.TimeOnly,o=t.language?{locale:t.language.toString().toLowerCase()}:{};t.formats?.displayWeekday&&(n.weekday="long");const s=e.start,r=e.end;return{startDateString:h(t.formats?.dateFormat)?s.toFormat(t.formats.dateFormat):s.toLocaleString(n,o),startTimeString:h(t.formats?.timeFormat)?s.toFormat(t.formats.timeFormat):s.toLocaleString(i,o),endDateString:h(t.formats?.dateFormat)?r.toFormat(t.formats.dateFormat):r.toLocaleString(n,o),endTimeString:h(t.formats?.timeFormat)?r.toFormat(t.formats.timeFormat):r.toLocaleString(i,o)}}function Wu(e){return Math.ceil(e.end.endOf("day").diff(e.start.startOf("day"),"days").days)}function Gu(e){return e.flatMap(e=>{const t=e.range,n=Wu(t);return n>1?(0,vc.A)(0,n).map(n=>{const i=t.start.plus({days:n}),o=i.startOf("day").equals(t.start.startOf("day"))?t.start:i.startOf("day"),s=i.endOf("day").equals(t.end.endOf("day"))?t.end:i.endOf("day");return{...e,range:Fo.IX.fromDateTimes(o,s)}}):[e]})}function Hu(e,t,n,i){const o=Math.ceil(n.endOf("day").diff(t.startOf("day"),"days").days),s=(0,vc.A)(0,o).map(e=>t.startOf("day").set({hour:i}).plus({day:e})),[r,a]=(0,Nu.A)(e,e=>e.range.start.hour===i&&0===e.range.start.minute);return a.flatMap(e=>e.range.splitAt(...s).map(t=>({...e,range:t}))).concat(r)}function qu(e){const t=e.filter(e=>e.isValid);if(Zo(t)){const e=(0,Zd.A)(t,e=>e.start.toMillis()),n=[e[0]];for(let t=1;te.start),i=n.reduce((e,t)=>Math.min(e,t.hour),t.minHour??8),o=i%2==0?i:i-1,s=e.map(e=>e.end),r=s.reduce((e,t)=>Math.max(e,t.hour),t.maxHour??20),a=r%2==0?r:r+1,l=(a-o)/2,d=(0,Lu.A)(n,e=>e.toMillis()).startOf("day"),c=(0,Bu.A)(s,e=>e.toMillis()).endOf("day"),u=Math.ceil(c.diff(d,"days").days);return{starts:n,ends:s,startHour:o,endHour:a,numberOfSlots:l,startDate:d,endDate:c,numberOfDays:u}}let Ku=class{translationService;constructor(e){this.translationService=e}toDisplayString(e,t={}){return function(e,t={}){const{startDateString:n,startTimeString:i,endDateString:o,endTimeString:s}=Uu(e,t);return e.start.year!==e.end.year||e.start.month!==e.end.month||e.start.day!==e.end.day?t.hideTime?`${n}–${o}`:t.hideDate?`${i}–${s}`:`${n} ${i}–${o} ${s}`:t.hideTime?`${n}`:t.hideDate?`${i}–${s}`:`${n} ${i}–${s}`}(e,{...t,language:this.translationService.language})}toComponents(e,t={}){return function(e,t={}){const{startDateString:n,startTimeString:o,endDateString:s,endTimeString:r}=Uu(e,t);return e.start.year!==e.end.year||e.start.month!==e.end.month||e.start.day!==e.end.day?t.hideTime?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vu,{dateTime:e.start,children:n}),"–",(0,i.jsx)(Vu,{dateTime:e.end,children:s})]}):t.hideDate?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vu,{dateTime:e.start,children:o}),"–",(0,i.jsx)(Vu,{dateTime:e.end,children:o})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Vu,{dateTime:e.start,children:[n," ",o]}),"–",(0,i.jsxs)(Vu,{dateTime:e.end,children:[s," ",r]})]}):t.hideTime?(0,i.jsx)(Vu,{dateTime:e.start,children:n}):t.hideDate?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vu,{dateTime:e.start,children:o}),"–",(0,i.jsx)(Vu,{dateTime:e.end,children:r})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Vu,{dateTime:e.start,children:[n," ",o]}),"–",(0,i.jsx)(Vu,{dateTime:e.end,children:r})]})}(e,{...t,language:this.translationService.language})}toLocaleString(e,t,n){return e.toLocaleString(n,t)}};Ku=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],Ku);var Zu=n(7231),Xu=n(6452),Ju=n(5582);const Qu=/^\d{2}:\d{2}$/,eh=/^\d{2}:\d{2}:\d{2}$/;function th(e){return h(e)&&(null!==e.match(Qu)||null!==e.match(eh))}function nh(e){if(th(e)){const[t,n]=e.split(":");return[parseInt(t,10),parseInt(n,10)]}return null}function ih(e,t,n,i={}){const o=h(t.name)?t.name:"",s=e.toDisplayString(t.range,i.interval?.options),r=(0,Da.A)([i.position?.includeName?n:"",o,i.slot?.includeRange||m(o)?s:"",i.position?.includeNameAtEnd?n:""]).join(" - ");return h(r)?r:n}function oh(e,t){return t.some(({id:t,range:n})=>e.id!==t&&n.overlaps(e.range))}function sh(e,t){const n=e.toISODate();return t.filter(e=>e.range.start.toISODate()===n)}function rh(e,t,n){return!n.hiddenPositionsSlotsIds.includes(e.id)&&(0===n.displayedPositionsSlotsIds.length||n.displayedPositionsSlotsIds.includes(e.id))&&(n.showFullPosition||!e.isFull)&&(n.slotDisplay===gt.Hide||n.positionFilter===mt.None||qu(t.map(Uo)).some(t=>t.engulfs(e.range)))}function ah(e,t,n,i,o,s){const r=[],a=[],l=[],d=e=>dh(e.position,s),c=(e,t)=>t.some(t=>t.engulfs(e.range)),u=Zo(o),h=Zo(i)||Zo(n)||Zo(t),m=u&&h?"both":u?"ranges":h?"positions":"none";e.forEach(e=>{const s=i.includes(e.id)||n.includes(e.position.id)||t.includes(e.positionCategory.id);"both"===m&&c(e,o)&&d(e)&&s||"ranges"===m&&c(e,o)&&d(e)||"positions"===m&&d(e)&&s?r.push(e):d(e)&&(0===o.length||c(e,o))?a.push(e):l.push(e)});const g=e=>e.range.start.toMillis();return{wishedPositionsSlots:(0,Zd.A)(r,g),possiblePositionsSlots:(0,Zd.A)(a,g),otherPositionsSlots:(0,Zd.A)(l,g)}}function lh(e,t){const n=t[e.customField.slug];return"boolean"==typeof n&&e.customField.fieldType===Ne.Checkbox?n===e.conditionValue:e.customField.fieldType===Ne.Select&&e.customField.canSelectMultiple&&Zo(n)?(0,Zu.A)(e.conditionValue,n??[]).length>0:e.customField.fieldType===Ne.Select&&"number"==typeof n&&e.conditionValue.includes(n)}function dh(e,t){if(!Zo(e?.conditionsCustomFields))return!0;switch(e.conditionsOperator){case ge.Or:return e.conditionsCustomFields.some(e=>lh(e,t));case ge.And:return e.conditionsCustomFields.every(e=>lh(e,t));default:return Za(e.conditionsOperator)}}function ch(e,t,n,i){return!i.hiddenPositionsIds.includes(e.id)&&(0===i.displayedPositionsIds.length||i.displayedPositionsIds.includes(e.id))&&dh(e,t)&&e.slots.some(e=>rh(e,n,i))}function uh(e){return h(e.address)}function hh(e){return vr(e.latitude)&&vr(e.longitude)}function mh(e){return uh(e)||hh(e)}function gh(e){return(0,Zd.A)(Object.values((0,Kd.A)(e,e=>e.position.name)).map(e=>{const t=e[0].positionCategory,n=e[0].position,i=e.map(e=>e.positionSlot.range.start.toMillis());return{id:n.id,category:t.name,text:h(n.acronym)?n.acronym:n.name,minDate:(0,Xu.A)(i),color:n.color,count:e.length,icon:n.icon}}),({category:e,text:t,minDate:n})=>[e.toLowerCase(),t.toLowerCase(),n])}function ph(e,t,n,i={}){const o=h(t.name)?t.name:"",s=t.date?h(i?.date?.format)?t.date.toFormat(i?.date?.format??""):e.toLocaleString(t.date,i?.date?.localeFormat||Ho.DateOnly.Numeric):"",r=(0,Da.A)([i?.accreditation?.includeName?n:"",o,s,i?.accreditation?.includeNameAtEnd?n:""]).join(" - ");return h(r)?r:h(i?.defaultName)?i?.defaultName:n}function fh(e,t,n,i){return!e.isBlocked&&n.accreditationDisplay!==ct.None&&!n.hiddenAccreditationsSlotsIds.includes(e.id)&&(0===n.displayedAccreditationsSlotsIds.length||n.displayedAccreditationsSlotsIds.includes(e.id))&&(n.showFullAccreditation||!e.isFull)&&(n.slotDisplay===gt.Hide||n.accreditationFilter===mt.None||!e.date||qu(t.map(Uo)).some(t=>Go(t,e.date)))||i.some(i=>i.accreditationSlotId===e.id&&!i.accreditationSlot.isBlocked&&(n.showFullAccreditation||!i.isFull&&!i.accreditationSlot.isFull)&&(n.slotDisplay===gt.Hide||n.accreditationFilter===mt.None||!i.accreditationSlot?.date||qu(t.map(Uo)).some(e=>Go(e,i.accreditationSlot.date))))}function xh(e){const t=e.filter(e=>e.date?.isValid),n=(0,Lu.A)(t.map(e=>e.date),e=>e.toMillis()),i=(0,Bu.A)(t.map(e=>e.date),e=>e.toMillis()),o=Math.ceil(i.endOf("month").diff(n.startOf("month"),"months").months),s=Math.ceil(i.diff(n,"days").days);return{minDate:n,maxDate:i,numberOfMonths:o,totalDaysDiff:s}}function _h(e,t,n,i){const o=(0,Jd.A)(e,t.flatMap(e=>e.date?.isValid&&n.equals(e.date.startOf("month"))?[e.id]:[]));return t.flatMap(e=>i.some(t=>e.date?.isValid&&t.startOf("day").equals(e.date.startOf("day")))?[e.id]:[]).concat(o)}function Ih(e){return(0,Zd.A)(e,e=>[e.date?.toMillis()??1,e.name.toLowerCase()])}var vh,bh,jh,Ch,yh;function kh(e){switch(e){case bh.AccreditationsMatrix:case yh.AccreditationsMatrix:return"table-cells";case Ch.Calendar:case yh.Calendar:return"calendar";case jh.Card:return"rectangle-list";case vh.List:case bh.List:case jh.List:case Ch.List:case yh.List:return"table";case Ch.Map:return"map-location";case vh.SlotsList:case Ch.SlotsList:return"table";default:return Za()}}function Ah(e,t){switch(t){case bh.AccreditationsMatrix:case yh.AccreditationsMatrix:return e("matrice_des_acc_84939");case Ch.Calendar:case yh.Calendar:return e("vue_planning_91663");case jh.Card:return e("vue_grille_37962");case vh.List:case bh.List:case jh.List:case Ch.List:case yh.List:return e("vue_liste_56882");case Ch.Map:return e("vue_carte_79064");case vh.SlotsList:case Ch.SlotsList:return e("vue_liste_cr_n_47406");default:return Za()}}!function(e){e.List="List",e.SlotsList="SlotsList"}(vh||(vh={})),function(e){e.AccreditationsMatrix="AccreditationsMatrix",e.List="List"}(bh||(bh={})),function(e){e.Card="Card",e.List="List"}(jh||(jh={})),function(e){e.Calendar="Calendar",e.List="List",e.Map="Map",e.SlotsList="SlotsList"}(Ch||(Ch={})),function(e){e.AccreditationsMatrix="AccreditationsMatrix",e.Calendar="Calendar",e.List="List"}(yh||(yh={}));var wh;function Sh(e,t,n){return t===yh.AccreditationsMatrix?{includeAccreditations:!1,includeAccreditationsMatrix:!0,includeAvailability:!1,includeComments:!1,includeEmails:!1,includeFormsUsersInfos:!1,includeForms:!1,includeDelegation:!1,includeNumberOfAccreditations:!1,includeNumberOfAssignments:!1,includeNumberOfAssignmentsDays:!1,includeNumberOfAvailableDays:!1,includePositions:!1,includeRoles:!1,includeTags:!1,includeTeam:!1,includeVolunteerMinutes:!1,includeWishedPositions:!1,includePreassignedPositions:!1,includeWeezeventChecklists:!1,includeWeezevent:!1,includeWeezeventUrls:!1}:{includeAccreditations:e.includes(wh.Accreditations)||e.includes(wh.AccreditationsCategories)||e.includes(wh.AccreditationsSlots)||e.includes(wh.WishedAccreditationSlots)||e.includes(wh.ScannedAccreditations),includeAccreditationsMatrix:!1,includeAvailability:e.includes(wh.Availability),includeComments:e.includes(wh.Comments),includeDelegation:e.includes(wh.Delegations)||e.includes(wh.DelegationCategory),includeEmails:e.includes(wh.CampaignsStates),includeFormsUsersInfos:e.includes(wh.CompletedForms)||e.includes(wh.FormsInsertedAt)||e.some(e=>e.startsWith("form_inserted_at"))||e.includes(wh.Availability)||e.includes(wh.TeamCode)||e.includes(wh.TeamMembers),includeForms:e.includes(wh.CompletedForms)||e.includes(wh.FormsInsertedAt)||e.some(e=>e.startsWith("form_inserted_at"))||e.includes(wh.Availability),includeNumberOfAccreditations:e.includes(wh.NumberOfAccreditations),includeNumberOfAssignments:e.includes(wh.NumberOfAssignments),includeNumberOfAssignmentsDays:e.includes(wh.NumberOfAssignmentsDays),includeNumberOfAvailableDays:e.includes(wh.NumberOfAvailableDays),includePositions:e.includes(wh.Positions)||e.includes(wh.PositionsCategories)||e.includes(wh.WishedPositions)||e.includes(wh.CheckedInPositions),includeRoles:e.includes(wh.Roles),includeTags:e.includes(wh.Tags),includeTeam:e.includes(wh.TeamCode)||e.includes(wh.TeamMembers),includeVolunteerMinutes:e.includes(wh.VolunteerMinutes),includeWishedPositions:e.includes(wh.WishedPositions),includePreassignedPositions:e.includes(wh.PreassignedPositionsCategories)||e.includes(wh.PreassignedPositions),includeWeezeventChecklists:e.includes(wh.WeezaccessChecklists),includeWeezevent:e.includes(wh.WeezeventBarcodeId)||e.includes(wh.WeezeventPairedAt),includeWeezeventUrls:!0===n?.includeWeezeventUrls&&(e.includes(wh.WeezeventBarcodeId)||e.includes(wh.WeezeventShortTag))}}!function(e){e.AccreditationState="accreditation_state",e.Accreditations="accreditations",e.AccreditationsCategories="accreditations_categories",e.AccreditationsSlots="accreditations_slots",e.Availability="availability",e.CampaignsStates="campaigns_states",e.CheckedInPositions="checed_in_positions",e.Comments="comments",e.CompletedForms="forms",e.DelegationCategory="delegation_category",e.Delegations="delegations",e.Email="email",e.FormsInsertedAt="forms_inserted_at",e.Id="id",e.InsertedAt="inserted_at",e.LocalId="local_id",e.Name="name",e.NumberOfAccreditations="number_of_accreditations",e.NumberOfAssignments="number_of_assignments",e.NumberOfAssignmentsDays="number_of_assignments_days",e.NumberOfAvailableDays="number_of_available_days",e.Positions="positions",e.PositionsCategories="positions_categories",e.PreassignedPositions="preassigned_positions",e.PreassignedPositionsCategories="preassigned_positions_categories",e.Roles="roles",e.ScannedAccreditations="scanned_accreditations",e.Tags="tags",e.TeamCode="teamCode",e.TeamMembers="teamMembers",e.VolunteerMinutes="volunteer_minutes",e.VolunteerRegistrationState="volunteer_registration_state",e.WeezaccessChecklists="weezevent_checklists",e.WeezeventBarcodeId="weezevent_barcode_id",e.WeezeventPairedAt="weezevent_paired_at",e.WeezeventShortTag="weezevent_short_tag",e.WishedAccreditationSlots="wished_accreditation_slots",e.WishedPositions="wished_positions"}(wh||(wh={}));let Eh=class extends Xc{constructor(e,t,n){super(e,t,n)}getVolunteersFilters(e,t,n,i,o,{hasAccreditations:s,hasDelegations:r,isWeezeventConnected:a}){return[...this.getBaseFilters(i),...this.getAvailabilitiesFilters(t,o),...this.getPositionsFilters(e,t,o),...s?this.getAccreditationsFilters(e,t,o):[],...r?this.getDelegationsFilters(e,t):[],...this.getSegmentsFilters(e,t,n,o),...this.getFormsFilters(t),...this.getTeamsFilters(),...a?this.getWeezeventFilters(t):[],...this.getEmailsFilters(t),...this.getCommentsFilter(e,t),{slug:"tag",name:this.t("Tag"),category:this.t("autres_99130"),fieldType:Be.Select,needLoading:!0,organizationId:e,eventId:t,tagContext:vt.UsersInfos},{slug:"sameEmail",name:this.t("nombre_de_profi_42316"),category:this.t("autres_99130"),fieldType:Be.Number,hideEmpty:!0},{slug:"possibleDuplicates",name:this.t("potentiel_doubl_87672"),category:this.t("autres_99130"),fieldType:Be.Checkbox,hideEmpty:!0},{slug:"isLeader",name:this.t("est_responsable_19679"),category:this.t("autres_99130"),fieldType:Be.Checkbox},{slug:"isPositionLeader",name:this.t("est_responsable_27270"),category:this.t("autres_99130"),fieldType:Be.Checkbox},{slug:"isPositionCategoryLeader",name:this.t("est_responsable_91796"),category:this.t("autres_99130"),fieldType:Be.Checkbox}]}getPositionMembersFilters(e,t,n,i){return[...this.getBaseFilters(n),...this.getAvailabilitiesFilters(t,i),...this.getPositionsFilters(e,t,i)]}getAccreditationMembersFilters(e,t,n,i,{hasDelegations:o}){return[...this.getBaseFilters(n),...this.getAccreditationsFilters(e,t,i),...o?this.getDelegationsFilters(e,t):[]]}getDelegationCategoryMembersFilters(e,t,n,i,o){return[...this.getBaseFilters(n),...this.getAccreditationsFilters(e,t,i),...o?this.getWeezeventFilters(t):[]]}getDelegationMembersFilters(e,t,n,i,o,s){return[...this.getBaseFilters(n),...this.getAccreditationsFilters(e,t,i),...o.positionDisplay===ht.None?[]:this.getPositionMembersFilters(e,t,n,i),...s?this.getWeezeventFilters(t):[]]}getVolunteersPossibleColumns(e,t,{hasAccreditations:n,isWeezeventConnected:i}){return[...this.getBaseColumns(e),...this.getFormsColumns(t),...this.getPositionsColumns(),...i?this.getWeezeventColumns():[],...n?this.getAccreditationsColumns():[],...this.getAvailabilitiesColumns(),...this.getDelegationsColumns(),{slug:wh.CampaignsStates,name:this.t("statut_des_camp_25280"),minWidth:320},{slug:wh.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:wh.Comments,name:this.t("commentaires_96492"),isSearchable:!0,minWidth:320},{slug:wh.Roles,name:this.t("r_les_61679"),minWidth:320}]}getPositionMembersPossibleColumns(e){return[...this.getBaseColumns(e),...this.getPositionsColumns()]}getAccreditationMembersPossibleColumns(e){return[...this.getBaseColumns(e),...this.getAccreditationsColumns(),...this.getDelegationsColumns()]}getDelegationCategoryMembersPossibleColumns(e,t){return[...this.getBaseColumns(e),...this.getAccreditationsColumns(),...t?this.getWeezeventColumns():[],{slug:wh.CampaignsStates,name:this.t("statut_des_camp_25280")},{slug:wh.Delegations,name:this.t("Delegation"),isSearchable:!0}]}getDelegationMembersPossibleColumns(e,{isWeezeventConnected:t,positionDisplay:n,slotDisplay:i}){return[...this.getBaseColumns(e),...this.getAccreditationsColumns(),...n===ht.None?[]:this.getPositionsColumns(),...i===gt.Hide?[]:this.getAvailabilitiesColumns(),...t?this.getWeezeventColumns():[],{slug:wh.CampaignsStates,name:this.t("statut_des_camp_25280")}]}getBaseColumns(e){return[{slug:wh.Email,name:this.t("e_mail_du_membr_69509"),isSearchable:!0,minWidth:180},{slug:wh.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:zt.Id,width:100},{slug:wh.LocalId,name:this.t("id_sur_l_v_nem_01171"),isSearchable:!0,isSortable:!0,sortAttribute:zt.LocalId,width:100},{slug:wh.Name,name:this.t("full_name"),isSearchable:!0,isSortable:!0,sortAttribute:zt.Name,minWidth:240},{slug:wh.InsertedAt,name:this.t("date_d_inscript_31369"),isSortable:!0,sortAttribute:zt.InsertedAt,width:240},...this.customFieldsToPossibleColumns(e)]}getAvailabilitiesColumns(){return[{slug:wh.Availability,name:this.t("disponibilit_s_49923"),minWidth:320}]}getFormsColumns(e){return[{slug:wh.CompletedForms,name:this.t("formulaires_rem_62495"),minWidth:320},{slug:wh.FormsInsertedAt,name:this.t("dates_de_rempli_65075"),minWidth:320},...(0,Zd.A)(e,e=>e.name).map(e=>({slug:`form_inserted_at_${e.id}`,name:this.t("date_de_remplis_00881",e.name),isSortable:!0,sortAttribute:`form_inserted_at_${e.id}`,minWidth:240})),{slug:wh.TeamCode,name:this.t("code_quipe_14296"),isSearchable:!0,isSortable:!0,sortAttribute:zt.TeamCode,minWidth:180},{slug:wh.TeamMembers,name:this.t("membres_de_l_q_00891"),minWidth:240}]}getPositionsColumns(){return[{slug:wh.NumberOfAssignments,name:this.t("nombre_d_affect_31455"),width:240},{slug:wh.NumberOfAssignmentsDays,name:this.t("nombre_de_jours_86280"),width:240},{slug:wh.NumberOfAvailableDays,name:this.t("nombre_de_jours_07962"),width:240},{slug:wh.Positions,name:this.t("missions_affect_97811"),minWidth:320},{slug:wh.PositionsCategories,name:this.t("cat_gories_de_m_93035"),minWidth:320},{slug:wh.VolunteerMinutes,name:this.t("nombre_de_minut_50497"),width:240},{slug:wh.VolunteerRegistrationState,name:this.t("status_d_affect_75769"),isSortable:!0,sortAttribute:zt.State,width:240},{slug:wh.WishedPositions,name:this.t("missions_souhai_23225"),minWidth:320},{slug:wh.PreassignedPositions,name:this.t("missions_pr_af_02950"),minWidth:320},{slug:wh.PreassignedPositionsCategories,name:this.t("cat_gories_pr_83825"),minWidth:320},{slug:wh.CheckedInPositions,name:this.t("missions_point_05292"),minWidth:320}]}getAccreditationsColumns(){return(0,Da.A)([{slug:wh.Accreditations,name:this.t("accr_ditations_33155"),minWidth:320},{slug:wh.AccreditationsCategories,name:this.t("cat_gories_d_ac_37678"),minWidth:320},{slug:wh.AccreditationState,name:this.t("statut_d_accr_d_75527"),isSortable:!0,sortAttribute:zt.AccreditationState,width:240},{slug:wh.NumberOfAccreditations,name:this.t("nombre_d_accr_d_02452"),width:240},{slug:wh.WishedAccreditationSlots,name:this.t("accr_ditations_74375"),minWidth:320},{slug:wh.ScannedAccreditations,name:this.t("accr_ditations_52153"),minWidth:320}])}getWeezeventColumns(){return[{slug:wh.WeezeventBarcodeId,name:this.t("TicketId"),isSearchable:!0,minWidth:240},{slug:wh.WeezeventShortTag,name:this.t("puce_50504"),isSearchable:!0,minWidth:180},{slug:wh.WeezeventPairedAt,name:this.t("appair_le_70213"),minWidth:180},{slug:wh.WeezaccessChecklists,name:this.t("listes_de_contr_55120"),minWidth:320}]}getDelegationsColumns(){return[{slug:wh.Delegations,name:this.t("Delegation"),isSearchable:!0,isSortable:!0,sortAttribute:zt.Delegation,minWidth:240},{slug:wh.DelegationCategory,name:this.t("cat_gorie_de_d_18027"),minWidth:240}]}getBaseFilters(e){return[{slug:"email",name:this.t("Email"),category:this.t("champs_de_formu_64126"),fieldType:Be.Text,hideEmpty:!0},{slug:"insertedAt",name:this.t("date_d_inscript_31369"),category:this.t("champs_de_formu_64126"),fieldType:Be.Date,hideEmpty:!0},...this.customFieldsToFilters(e)]}getAvailabilitiesFilters(e,t){return[{slug:"numberOfAvailableDays",name:this.t("nombre_de_jours_07962"),category:this.t("disponibilit_s_49923"),fieldType:Be.Number,hideEmpty:!0},{slug:"wishedSlots",name:this.t("disponibilit_s_49923"),category:this.t("disponibilit_s_49923"),fieldType:Be.DateTimeRange,startAt:t.startAt,endAt:t.endAt},{slug:"wishedSlotsCustom",name:this.t("disponibilit_s_26280"),category:this.t("disponibilit_s_49923"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,eventId:e},{slug:"numberOfWishedSlots",name:this.t("nombre_de_dispo_26405"),category:this.t("disponibilit_s_49923"),fieldType:Be.Number,hideEmpty:!0}]}getPositionsFilters(e,t,n){return[{slug:"volunteerRegistrationState",name:this.t("statut_d_affect_57444"),category:this.t("missions_63972"),fieldType:Be.Select,values:wn.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"position",name:this.t("missions_affect_97811"),category:this.t("missions_63972"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"hasOtherEventPosition",name:this.t("has_shift_on_ot_92375"),category:this.t("missions_63972"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:"positionSlotId",name:this.t("cr_neau_affect_50400_plural"),category:this.t("missions_63972"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"positionSlot",name:this.t("date_d_affectat_98566"),category:this.t("missions_63972"),fieldType:Be.DateTimeRange,startAt:n.startAt,endAt:n.endAt},{slug:"positionCategory",name:this.t("cat_gories_de_m_93035"),category:this.t("missions_63972"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"numberOfAssignments",name:this.t("nombre_d_affect_31455"),category:this.t("missions_63972"),fieldType:Be.Number,hideEmpty:!0},{slug:"numberOfAssignmentsPerDay",name:this.t("nombre_d_affect_22087"),category:this.t("missions_63972"),fieldType:Be.Number,hideEmpty:!0,startAt:n.startAt,endAt:n.endAt},{slug:"numberOfAssignmentsDays",name:this.t("nombre_de_jours_86280"),category:this.t("missions_63972"),fieldType:Be.Number,hideEmpty:!0,startAt:n.startAt,endAt:n.endAt},{slug:"preassignedPosition",name:this.t("missions_pr_af_02950"),category:this.t("missions_63972"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"preassignedPositionCategory",name:this.t("cat_gories_pr_83825"),category:this.t("missions_63972"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"wishedPositionsCategories",name:this.t("cat_gories_souh_80851"),category:this.t("missions_63972"),fieldType:Be.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedPositionsCategories",name:this.t("nombre_de_cat_g_05961"),category:this.t("missions_63972"),fieldType:Be.Number,hideEmpty:!0},{slug:"wishedPositions",name:this.t("missions_souhai_23225"),category:this.t("missions_63972"),fieldType:Be.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedPositions",name:this.t("nombre_de_missi_52579"),category:this.t("missions_63972"),fieldType:Be.Number,hideEmpty:!0},{slug:"wishedPositionsSlots",name:this.t("cr_neaux_souhai_90108"),category:this.t("missions_63972"),fieldType:Be.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedPositionsSlots",name:this.t("nombre_de_cr_ne_28370"),category:this.t("missions_63972"),fieldType:Be.Number,hideEmpty:!0},{slug:"volunteersMinutes",name:this.t("nombre_de_minut_50497"),category:this.t("missions_63972"),fieldType:Be.Number,hideEmpty:!0},{slug:"volunteersMinutesDays",name:this.t("nombre_de_minut_89574"),category:this.t("missions_63972"),fieldType:Be.Number,hideEmpty:!0,startAt:n.startAt,endAt:n.endAt},{slug:"checkInAt",name:this.t("point_le_93167"),category:this.t("missions_63972"),fieldType:Be.Date},{slug:"checkOutAt",name:this.t("d_point_le_29289"),category:this.t("missions_63972"),fieldType:Be.Date},{slug:"checkInState",name:this.t("statut_de_point_44328"),category:this.t("missions_63972"),fieldType:Be.Select,values:qt.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"checkInAtPositionSlot",name:this.t("cr_neaux_point_71408"),category:this.t("missions_63972"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"checkOutAtPositionSlot",name:this.t("cr_neaux_d_poin_45477"),category:this.t("missions_63972"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"overlappingAssignments",name:this.t("affectations_se_49339"),category:this.t("missions_63972"),fieldType:Be.Checkbox,hideEmpty:!0}]}getAccreditationsFilters(e,t,n){return(0,Da.A)([{slug:"accreditationState",name:this.t("statut_d_accr_d_75527"),category:this.t("accr_ditations_39450"),fieldType:Be.Select,values:Wt.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"numberOfAccreditations",name:this.t("nombre_d_accr_d_02452"),category:this.t("accr_ditations_39450"),fieldType:Be.Number,hideEmpty:!0},{slug:"accreditation",name:this.t("accr_ditations_39450"),category:this.t("accr_ditations_39450"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"hasOtherEventAccreditation",name:this.t("has_accreditati_31831"),category:this.t("accr_ditations_39450"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:"accreditationCategory",name:this.t("cat_gories_d_ac_37678"),category:this.t("accr_ditations_39450"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"wishedAccreditationsSlots",name:this.t("accr_ditations_74375"),category:this.t("accr_ditations_39450"),fieldType:Be.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedAccreditationsSlots",name:this.t("nombre_d_accr_d_92021"),category:this.t("accr_ditations_39450"),fieldType:Be.Number,hideEmpty:!0},{slug:"accreditationSlotId",name:this.t("cr_neaux_accr_d_70934"),category:this.t("accr_ditations_39450"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"accreditationSlot",name:this.t("date_d_accr_dit_26214"),category:this.t("accr_ditations_39450"),fieldType:Be.Date,startAt:n.startAt,endAt:n.endAt},{slug:"scannedAccreditationsSlots",name:this.t("accr_ditations_52153"),category:this.t("accr_ditations_39450"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,eventId:t}])}getDelegationsFilters(e,t){return[{slug:"delegation",name:this.t("inscrit_via_la_86398"),category:this.t("d_l_gations_78318"),fieldType:Be.Select,needLoading:!0,eventId:t},{slug:"delegationCategory",name:this.t("inscrit_via_la_12241"),category:this.t("d_l_gations_78318"),fieldType:Be.Select,needLoading:!0,organizationId:e,eventId:t},{slug:"isDelegationCategoryLeader",name:this.t("est_responsable_36610"),category:this.t("d_l_gations_78318"),fieldType:Be.Checkbox},{slug:"isDelegationLeader",name:this.t("est_responsable_87662"),category:this.t("d_l_gations_78318"),fieldType:Be.Checkbox,needLoading:!0,eventId:t}]}getSegmentsFilters(e,t,n,i){return[{slug:"segments",name:this.t("fait_partie_de_44650"),category:this.t("vues_personnali_80652"),fieldType:Be.Select,values:i.segmentsFolders.flatMap(e=>e.segments).filter(e=>e.id!==n),hideEmpty:!0},{slug:"usersSegments",name:this.t("fait_partie_de_44893"),category:this.t("vues_personnali_80652"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"positionsSegments",name:this.t("affecter_une_10657"),category:this.t("vues_personnali_80652"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"accreditationsSegments",name:this.t("affecter_une_91431"),category:this.t("vues_personnali_80652"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"delegationsSegments",name:this.t("affecter_une_45240"),category:this.t("vues_personnali_80652"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,eventId:t}]}getFormsFilters(e){return[{slug:"forms",name:this.t("formulaires_rem_62495"),category:this.t("Form_plural"),fieldType:Be.Select,needLoading:!0,eventId:e},{slug:"formsInsertedAt",name:this.t("dates_de_rempli_65075"),category:this.t("Form_plural"),fieldType:Be.Date,hideEmpty:!0,needLoading:!0,eventId:e}]}getTeamsFilters(){return[{slug:"isTeam",name:this.t("est_inscrit_en_86193"),category:this.t("_quipes_18817"),fieldType:Be.Checkbox,hideEmpty:!0},{slug:"teamCode",name:this.t("code_quipe_14296"),category:this.t("_quipes_18817"),fieldType:Be.Text},{slug:"numberOfTeamMembers",name:this.t("nombre_de_membr_82302"),category:this.t("_quipes_18817"),fieldType:Be.Number},{slug:"isTeamLeader",name:this.t("est_chef_d_qui_73792"),category:this.t("_quipes_18817"),fieldType:Be.Checkbox,hideEmpty:!0}]}getWeezeventFilters(e){return[{slug:wh.WeezeventBarcodeId,name:this.t("TicketId"),category:"Weezevent",fieldType:Be.Text,hideEmpty:!0},{slug:wh.WeezeventShortTag,name:this.t("puce_50504"),category:"Weezevent",fieldType:Be.Text},{slug:wh.WeezeventPairedAt,name:this.t("appair_le_70213"),category:"Weezevent",fieldType:Be.Datetime,useLocalZone:!0},{slug:wh.WeezaccessChecklists,name:this.t("listes_de_contr_55120"),category:"Weezevent",fieldType:Be.Select,needLoading:!0,eventId:e}]}getEmailsFilters(e){return[{slug:"campaign",name:this.t("campagne_97871"),category:this.t("e_mails_09850"),fieldType:Be.Campaign,needLoading:!0,eventId:e},{slug:"assignmentEmailSentAt",name:this.t("date_d_envoi_de_01614"),category:this.t("e_mails_09850"),fieldType:Be.Date},{slug:"assignmentEmailState",name:this.t("statut_de_de_l_36346"),category:this.t("e_mails_09850"),fieldType:Be.Select,values:en.filter(e=>e!==Ee.Queued).map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"accreditationEmailState",name:this.t("statut_de_l_e_m_97776"),category:this.t("e_mails_09850"),fieldType:Be.Select,values:en.filter(e=>e!==Ee.Queued).map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"emailBlacklist",name:this.t("ne_souhaite_plu_08853"),category:this.t("e_mails_09850"),fieldType:Be.Checkbox,hideEmpty:!0},{slug:"campaignReply",name:this.t("r_ponse_une_c_32448"),category:this.t("e_mails_09850"),fieldType:Be.Text,needLoading:!0,eventId:e}]}getCommentsFilter(e,t){return[{slug:"comments",name:this.t("commentaires_96492"),category:this.t("commentaires_96492"),fieldType:Be.Text},{slug:"lastCommentAt",name:this.t("date_du_dernier_73554"),category:this.t("commentaires_96492"),fieldType:Be.Date,hideEmpty:!0},{slug:"commentWrittenBy",name:this.t("commentaire_cr_96610"),category:this.t("commentaires_96492"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t}]}};function Th(e,t,n,i){const o=t.diff(e,"days").days;return(0,vc.A)(0,o+1).map(t=>e.plus({days:t})).filter(e=>i===ut.AllDays||n.some(t=>t.contains(e)||t.start.startOf("day").equals(e)||t.end.startOf("day").equals(e)))}function zh(e,t,n,i,o){const s=t.diff(e,"days").days;return(0,vc.A)(0,s+1).flatMap(t=>{const i=e.plus({days:t});return n.map(e=>{const[t,n]=e.startTime.split(":").map(e=>parseInt(e,10)),[o,s]=e.endTime.split(":").map(e=>parseInt(e,10)),r=i.set({hour:t,minute:n});let a=i.set({hour:o,minute:s});return(oo===ut.AllDays||i.some(t=>t.overlaps(e.interval)))}function $h(e,t){return h(e)?`${e} (${t.toFormat("HH:mm")})`:t.toFormat("HH:mm")}function Oh(e,t,n){const i=e.filter(e=>!t.equals(Vo(e)));return i.length===e.length&&n?[...e,Wo(t)]:i.length===e.length||n?e:i}Eh=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hc,$c,Dn])],Eh);const Rh=(e,t)=>(0,Zd.A)(Object.values((0,Kd.A)(t,e=>e.position.name)).map(t=>({name:t[0].position.name,values:(0,Zd.A)(t.map(t=>({id:t.id,name:ih(e,t,t.position.name,{position:{includeNameAtEnd:!0}}),startTime:t.range.start.toMillis()})),({startTime:e})=>e)})),({name:e})=>e),Ph=(e,t)=>(0,Zd.A)(Object.values((0,Kd.A)(t,e=>e.accreditation.name)).map(t=>({name:t[0].accreditation.name,values:(0,Zd.A)(t.map(t=>({id:t.id,name:ph(e,t,t.accreditation.name,{accreditation:{includeNameAtEnd:!0}})})),e=>e.name)})),({name:e})=>e),Dh=async(e,t,n)=>{const i=await H();if("createdBy"===n.slug&&n.organizationId){const{organization:e}=await function(e,t){return ss("query Admins($organizationId: OrganizationId!, $eventId: EventId) {\n    organization(id: $organizationId) {\n        usersInfos(eventId: $eventId, roleTypes: [OrganizationAdmin, EventAdmin]) {\n            nodes {\n                userId\n                email\n                name\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.values=e.usersInfos.nodes.map(({userId:e,email:t,name:n})=>({id:e,name:`${h(n)?n:"-"} - ${t}`})),n.needLoading=!1}else if("leaders"===n.slug&&n.organizationId){const{organization:e}=await function(e,t){return ss('query DelegationsSegmentsLeaders($organizationId: OrganizationId!, $eventId: EventId) {\n    organization(id: $organizationId) {\n        usersInfos(\n            eventId: $eventId\n            isDelegationLeader: true\n            sort: { attribute: "Name", direction: Asc }\n        ) {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n}\n',{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.values=e.usersInfos.nodes,n.needLoading=!1}else if("delegationCategory"===n.slug&&n.organizationId){const{organization:e}=await function(e,t){return ss("query VolunteersSegmentsDelegationsCategories(\n    $organizationId: OrganizationId!\n    $level: OrganizationEventLevel!\n    $eventId: EventId\n) {\n    organization(id: $organizationId) {\n        delegationsCategories(level: $level, eventId: $eventId) {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,level:n.eventId?et.Event:et.Organization,eventId:n.eventId},i);n.values=(0,Zd.A)(e.delegationsCategories.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("tag"===n.slug&&n.organizationId){const{organization:e}=await Os({organizationId:n.organizationId,eventId:n.eventId,context:n.tagContext},i);n.values=(0,Zd.A)(e.tags.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if(n.eventId){if(["preassignedPosition","position","wishedPositions"].includes(n.slug)){const{event:e}=await function(e,t){return ss("query VolunteersSegmentsPositions($eventId: EventId!) {\n    event(id: $eventId) {\n        positions {\n            nodes {\n                id\n                name\n                positionCategoryName\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,Zd.A)(Object.entries((0,Kd.A)(e.positions.nodes,e=>e.positionCategoryName)).map(([e,t])=>({name:t[0].positionCategoryName,values:(0,Zd.A)(t,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if("hasOtherEventPosition"===n.slug&&n.organizationId){const{organization:{positions:e}}=await function(e,t){return ss("query VolunteersSegmentsOtherPositions($organizationId: OrganizationId!, $eventId: EventId!) {\n    organization(id: $organizationId) {\n        positions(excludedEventId: $eventId) {\n            nodes {\n                id\n                name\n                positionCategoryName\n                event {\n                    id\n                    name\n                }\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.valuesGroups=(0,Zd.A)(Object.entries((0,Kd.A)(e.nodes,e=>e.positionCategoryName)).map(([e,t])=>({name:`${t[0].event.name}: ${t[0].positionCategoryName}`,values:(0,Zd.A)(t,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if(["positionSlotId","wishedPositionsSlots","checkInAtPositionSlot","checkOutAtPositionSlot"].includes(n.slug)){const{event:e}=await function(e,t){return ss("query VolunteersSegmentsPositionsSlots($eventId: EventId!) {\n    event(id: $eventId) {\n        positionsSlots {\n            nodes {\n                id\n                name\n                range\n\n                position {\n                    name\n                }\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=Rh(t,e.positionsSlots.nodes),n.needLoading=!1}else if(["positionCategory","preassignedPositionCategory","wishedPositionsCategories"].includes(n.slug)){const{event:e}=await function(e,t){return ss("query VolunteersSegmentsPositionsCategories($eventId: EventId!) {\n    event(id: $eventId) {\n        positionsCategories {\n            id\n            name\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.values=(0,Zd.A)(e.positionsCategories,e=>e.name.toLowerCase()),n.needLoading=!1}else if("wishedSlotsCustom"===n.slug){const{event:t}=await function(e,t){return ss("query VolunteeersSegmentsCustomSlotsPeriods($eventId: EventId!) {\n    event(id: $eventId) {\n        startAt\n        endAt\n        ranges\n\n        customSlotsPeriods {\n            name\n            startDate\n            endDate\n\n            customSlots {\n                name\n                startTime\n                endTime\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=((e,t)=>{const n=t.customSlotsPeriods.flatMap(e=>zh(e.startDate??t.startAt,e.endDate??t.endAt,e.customSlots,t.ranges,ut.AllDays));return(0,Zd.A)(Object.values((0,Kd.A)(n,({interval:e})=>e.start.startOf("day").toMillis())),e=>e[0].interval.start.startOf("day").toMillis()).map(t=>{const n=t[0].interval;return{name:e.toLocaleString(n.start.startOf("day"),Ho.DateOnly.WeekdayLongMonthLong),values:t.map(({name:e,interval:t})=>({id:t.toISO(),name:$h(e,t)}))}})})(e,t),n.needLoading=!1}else if("accreditation"===n.slug){const{event:e}=await function(e,t){return ss("query VolunteersSegmentsAccreditations($eventId: EventId!) {\n    event(id: $eventId) {\n        accreditations {\n            nodes {\n                id\n                name\n                accreditationCategoryName\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,Zd.A)(Object.entries((0,Kd.A)(e.accreditations.nodes,e=>e.accreditationCategoryName)).map(([e,t])=>({name:t[0].accreditationCategoryName,values:(0,Zd.A)(t,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if("hasOtherEventAccreditation"===n.slug&&n.organizationId){const{organization:{accreditations:e}}=await function(e,t){return ss("query VolunteersSegmentsOtherAccreditations($organizationId: OrganizationId!, $eventId: EventId!) {\n    organization(id: $organizationId) {\n        accreditations(excludedEventId: $eventId) {\n            nodes {\n                id\n                name\n                accreditationCategoryName\n                event {\n                    id\n                    name\n                }\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.valuesGroups=(0,Zd.A)(Object.entries((0,Kd.A)(e.nodes,e=>e.accreditationCategoryName)).map(([e,t])=>({name:`${t[0].event.name}: ${t[0].accreditationCategoryName}`,values:(0,Zd.A)(t,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if("accreditationCategory"===n.slug){const{event:e}=await function(e,t){return ss("query VolunteersSegmentsAccreditationsCategories($eventId: EventId!) {\n    event(id: $eventId) {\n        accreditationsCategories {\n            id\n            name\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.values=(0,Zd.A)(e.accreditationsCategories,e=>e.name.toLowerCase()),n.needLoading=!1}else if("positionsSegments"===n.slug){const{event:e}=await function(e,t){return ss("query VolunteersSegmentsPositionsSegments($eventId: EventId!) {\n    event(id: $eventId) {\n        segmentsFolders(segmentType: Positions) {\n            id\n            name\n            index\n\n            segments {\n                id\n                name\n                index\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,Zd.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,Zd.A)(e.segments,e=>e.index)})),n.needLoading=!1}else if("accreditationsSegments"===n.slug){const{event:e}=await function(e,t){return ss("query VolunteersSegmentsAccreditationsSegments($eventId: EventId!) {\n    event(id: $eventId) {\n        segmentsFolders(segmentType: Accreditations) {\n            id\n            name\n            index\n\n            segments {\n                id\n                name\n                index\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,Zd.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,Zd.A)(e.segments,e=>e.index)})),n.needLoading=!1}else if("delegationsSegments"===n.slug||"isDelegationLeader"===n.slug){const{event:e}=await function(e,t){return ss("query VolunteersSegmentsDelegationsSegments($eventId: EventId!) {\n    event(id: $eventId) {\n        segmentsFolders(segmentType: Delegations) {\n            id\n            name\n            index\n\n            segments {\n                id\n                name\n                index\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,Zd.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,Zd.A)(e.segments,e=>e.index)})),n.needLoading=!1}else if("forms"===n.slug||"form"===n.slug||"formsInsertedAt"===n.slug){const{event:e}=await function(e,t){return ss("query VolunteersSegmentsForms($eventId: EventId!) {\n    event(id: $eventId) {\n        forms {\n            nodes {\n                ...SegmentForm\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.SegmentFormFragment]})}({eventId:n.eventId},i);n.values=(0,Zd.A)(e.forms.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("campaign"===n.slug||"campaignReply"===n.slug){const{event:e}=await function(e,t){return ss("query VolunteersSegmentsCampaigns($eventId: EventId!) {\n    event(id: $eventId) {\n        campaigns(states: [Done, Scheduled, Template]) {\n            nodes {\n                ...SegmentCampaign\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.SegmentCampaignFragment]})}({eventId:n.eventId},i);n.campaigns=(0,Zd.A)(e.campaigns.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("delegation"===n.slug){const{event:e}=await function(e,t){return ss("query VolunteersSegmentsDelegations($eventId: EventId!) {\n    event(id: $eventId) {\n        delegations {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.values=(0,Zd.A)(e.delegations.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if(["accreditationSlotId","scannedAccreditationsSlots","wishedAccreditationsSlots"].includes(n.slug)){const{event:t}=await function(e,t){return ss("query VolunteersSegmentsAccreditationsSlots($eventId: EventId!) {\n    event(id: $eventId) {\n        accreditationsSlots(includeHidden: true) {\n            nodes {\n                id\n                name\n                date\n\n                accreditation {\n                    name\n                }\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=Ph(e,t.accreditationsSlots.nodes),n.needLoading=!1}else if(n.slug===wh.WeezaccessChecklists){const{event:e}=await function(e,t){return ss("query VolunteersWeezaccessChecklists($eventId: EventId!) {\n    event(id: $eventId) {\n        weezaccessChecklists {\n            id\n            name\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.values=(0,Zd.A)(e.weezaccessChecklists,e=>e.name.toLowerCase()),n.needLoading=!1}else if("commentWrittenBy"===n.slug){const{organization:e}=await function(e,t){return ss("query VolunteersSegmentsLoaders($organizationId: OrganizationId!, $eventId: EventId!) {\n    organization(id: $organizationId) {\n        admins: usersInfos(roleTypes: [OrganizationAdmin, EventAdmin]) {\n            nodes {\n                id\n                nameOrEmail\n            }\n        }\n\n        usersInfos(eventId: $eventId, hasRole: true) {\n            nodes {\n                id\n                nameOrEmail\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.values=(0,Zd.A)((0,Ju.A)(e.admins.nodes.concat(e.usersInfos.nodes),e=>e.id),e=>e.nameOrEmail.toLowerCase()).map(({id:e,nameOrEmail:t})=>({id:e,name:t})),n.needLoading=!1}}else if(n.organizationId)if("event"===n.slug){const{organization:e}=await function(e,t){return ss("query UsersSegmentsEvents($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        events {\n            nodes {\n                ...SegmentEvent\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.SegmentEventFragment]})}({organizationId:n.organizationId},i);n.values=(0,Zd.A)(e.events.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("forms"===n.slug||"formsInsertedAt"===n.slug){const{organization:e}=await function(e,t){return ss("query UsersSegmentsForms($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        forms(level: Organization) {\n            nodes {\n                ...SegmentForm\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.SegmentFormFragment]})}({organizationId:n.organizationId},i);n.values=(0,Zd.A)(e.forms.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("campaign"===n.slug){const{organization:e}=await function(e,t){return ss("query UsersSegmentsCampaigns($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        campaigns(level: Organization, states: [Done, Scheduled]) {\n            nodes {\n                ...SegmentCampaign\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.SegmentCampaignFragment]})}({organizationId:n.organizationId},i);n.campaigns=(0,Zd.A)(e.campaigns.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("positionCustomField"===n.slug||"accreditationCustomField"===n.slug){const{organization:e}=await function(e,t){return ss("query ConditionsCustomFields($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        customFields(variety: UserInfo, privacy: All, fieldTypes: [Checkbox, Select]) {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId},i);n.values=(0,Zd.A)(e.customFields.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("delegation"===n.slug){const{organization:e}=await function(e,t){return ss("query UsersSegmentsDelegations($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        name\n\n        delegations(level: Both) {\n            nodes {\n                id\n                name\n\n                event {\n                    id\n                    name\n                }\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId},i);n.valuesGroups=(0,Zd.A)(Object.entries((0,Kd.A)(e.delegations.nodes,e=>e.event?.id||-1)).map(([t,n])=>({name:n[0].event?.name??e.name,values:(0,Zd.A)(n,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if("usersSegments"===n.slug){const{organization:e}=await function(e,t){return ss("query VolunteersSegmentsUsersSegments($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        segmentsFolders(level: Organization, segmentType: Volunteers) {\n            id\n            name\n            index\n\n            segments {\n                id\n                name\n                index\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId},i);n.valuesGroups=(0,Zd.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,Zd.A)(e.segments,e=>e.index)})),n.needLoading=!1}};function Fh(e){const t=Nn($c),n=Nn(Ku),[i,o]=(0,F.useState)(!1);return(0,F.useEffect)(()=>{const i=e.filter(({filter:e})=>e.needLoading);Zo(i)&&(o(!0),Promise.all(i.map(({filter:e})=>Dh(t,n,e))).then(()=>{o(!1)}))},[e]),i}const Mh=e=>{const t=Ln(),n=e.filterPredicate.filter.slug,o=e.filterPredicate.filter.fieldType,s=function(e){const t=Nn($c),n=Nn(Ku),[i,o]=(0,F.useState)(!1);return(0,F.useEffect)(()=>{e.needLoading&&(o(!0),Dh(t,n,e).then(()=>{o(!1)}))},[e.needLoading]),i}(e.filterPredicate.filter);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",css:{color:"$gray500",cursor:"pointer",fontSize:"$textXs",fontWeight:"$semiBold"},gap:"3",onClick:e.onBack,children:[(0,i.jsx)("i",{className:"fa-regular fa-arrow-left"}),t("retour_la_lis_63860")]}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:e.filterPredicate.filter.name}),(0,i.jsx)(Pa,{height:"3"}),s?(0,i.jsx)(ul,{}):"condition"===n?(0,i.jsx)(fu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"isLeader"===n||"isPositionLeader"===n||"isPositionCategoryLeader"===n||"isDelegationLeader"===n?(0,i.jsx)(Su,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"isAdmin"===n?(0,i.jsx)(wu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"privacy"===n?(0,i.jsx)(Pu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"isTeam"===n?(0,i.jsx)(Eu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"wishedPositions"===n||"wishedPositionsCategories"===n?(0,i.jsx)(Mu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"formsInsertedAt"===n?(0,i.jsx)(Au,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"numberOfAssignmentsPerDay"===n||"volunteersMinutesDays"===n?(0,i.jsx)(Ru,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"campaignReply"===n?(0,i.jsx)(uu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):[Be.Address,Be.Text,Be.Textarea].includes(o)?(0,i.jsx)(Fu,{filterPredicate:e.filterPredicate,showIsValid:!1,onAdd:e.onAdd}):[Be.Country,Be.Language,Be.Nationality,Be.Select,Be.Sex].includes(o)?(0,i.jsx)(Du,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):[Be.Checkbox,Be.Validation].includes(o)?(0,i.jsx)(pu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):o===Be.Phone?(0,i.jsx)(Fu,{filterPredicate:e.filterPredicate,showIsValid:!0,onAdd:e.onAdd}):o===Be.Number?(0,i.jsx)(Ou,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):o===Be.DateTimeRange?(0,i.jsx)(yu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):o===Be.Date?(0,i.jsx)(bu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):o===Be.Datetime?(0,i.jsx)(Cu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):o===Be.File?(0,i.jsx)(ku,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):o===Be.Campaign?(0,i.jsx)(cu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):(0,i.jsx)("div",{children:"TODO"})]})};function Nh(e){switch(e){case Be.Address:return"map-location";case Be.Text:case Be.Textarea:return"text";case Be.Checkbox:return"square-check";case Be.Validation:return"check";case Be.Select:return"list-ul";case Be.Date:return"calendar";case Be.Datetime:return"calendar-day";case Be.Time:return"clock";case Be.File:return"file";case Be.Phone:return"phone";case Be.Language:return"language";case Be.Number:return"00";case Be.Sex:return"venus-mars";case Be.Nationality:case Be.Country:return"flag";case Be.DateTimeRange:return"calendar-range";case Be.Campaign:return"paper-plane";default:return Za()}}const Lh=e=>{const t=(0,F.useMemo)(()=>(0,Oo.A)(e.filtersPredicates.map(({filter:e})=>e.category)),[e.filtersPredicates]),n=(0,F.useMemo)(()=>(0,Kd.A)(e.filtersPredicates,({filter:e})=>e.category),[e.filtersPredicates]);return(0,i.jsx)(Ea,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",px:"$4"},direction:"column",children:t.map((t,o)=>{const s=n[t];return(0,i.jsxs)(F.Fragment,{children:[!e.isEdit&&(0,i.jsxs)(i.Fragment,{children:[0!==o&&(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(fr,{css:{paddingBottom:"$2",paddingTop:"$3"},font:"gray500 textXs semiBold",children:t})]}),s.map(t=>{const{filter:n}=t;return(0,i.jsxs)(Ea,{align:"center",css:{py:"$2"},gap:"3",children:[(0,i.jsx)(Ea,{align:"center",css:{borderRadius:"$1",height:"32px",width:"32px"},justify:"center",children:(0,i.jsx)(Va,{icon:Nh(n.fieldType)})}),(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{color:"gray900",css:{ellipsis:!0},fontWeight:"medium",title:n.name,width:1,children:n.name}),h(n.label)&&(0,i.jsx)(fr,{color:"gray500",css:{ellipsis:!0},title:n.label,width:1,children:n.label})]}),e.isEdit?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{e.onEdit(t)}}),(0,i.jsx)(pl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.onDelete(n.slug)}})]}):(0,i.jsx)(pl,{color:"white",leftIcon:"plus",size:"sm",onClick:()=>{e.onAdd(t)}})]},n.slug)})]},o)})})},Bh=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.selectedFilterPredicate),[s,r]=(0,F.useState)((0,du.A)(e.predicates)),a=(0,F.useCallback)(e=>{r((0,Jc.jM)(t=>{const n=t.findIndex(t=>t.slug===e.slug);-1===n?t.push(e):t[n]=e})),o(null)},[r,o]),l=(0,F.useCallback)(e=>{r((0,Jc.jM)(t=>{const n=t.findIndex(t=>t.slug===e);t.splice(n,1)}))},[r]),[d,c]=(0,F.useState)(""),[u,m]=Kc(s,e.possibleFilters,d);return(0,i.jsxs)(eu,{size:"sm",onClose:e.onClose,children:[(0,i.jsxs)(tu,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textXl",children:t("filtres_64574")}),h(e.subtitle)&&(0,i.jsx)(fr,{color:"gray500",children:e.subtitle}),(0,i.jsx)(Pa,{height:"6"}),n?(0,i.jsx)(Mh,{filterPredicate:n,onAdd:a,onBack:()=>{o(null)}}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wl,{placeholder:t("rechercher_un_f_22061"),value:d,onChange:c}),(0,i.jsx)(Pa,{height:"6"}),s.length>0&&u.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_filtr_29511")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Lh,{filtersPredicates:u,isEdit:!0,onDelete:l,onEdit:e=>{o(e)}}),(0,i.jsx)(Pa,{height:"8"})]}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_filtr_37728")}),m.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Lh,{filtersPredicates:m,isEdit:!1,onAdd:e=>{o(e)}})]})]}),(0,i.jsx)(Pa,{height:"6"})]}),null===n&&(0,i.jsx)(nu,{children:(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{onClick:()=>{e.onFilter(s),e.onClose()},children:e.buttonText||t("filtrer_78031")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})})]})},Vh=F.createContext({});function Uh(){return F.useContext(Vh)}const Wh=()=>{const e=Ln(),t=Nn(Xc),{filtersPredicates:n,clearNameCursors:o,setPredicates:s,setIsFilterOpen:r,setSelectedFilterPredicate:a,predicates:l}=Uh(),d=(0,F.useCallback)(()=>{o(),s([])},[o,s]),c=(0,F.useCallback)(e=>{a(e),r(!0)},[r,a]),u=(0,F.useCallback)(e=>{o(),s((0,Xd.A)(l,e.predicate))},[l,o,s]);return Fh(n),Zo(n)?(0,i.jsxs)(Ea,{align:"center",gap:"3",width:1,wrap:"wrap",children:[n.map((e,n)=>e.filter.needLoading?(0,i.jsx)(Gd,{leftIcon:"loader"},n):(0,i.jsx)(Gd,{cursor:"pointer",ellipsis:!0,rightIcon:"xmark",onContentClick:()=>{c(e)},onRightIconClick:()=>{u(e)},children:t.filterPredicateToText(e)},n)),(0,i.jsx)(fr,{color:"gray700",css:{cursor:"pointer"},fontWeight:"medium",onClick:d,children:e("r_initialiser_l_66835")})]}):null};function Gh(){return(0,F.useMemo)(()=>navigator.platform.toLowerCase().startsWith("mac"),[])}function Hh(e,t){const n=Gh(),i=(0,F.useCallback)(i=>{i.key===e&&(n&&i.metaKey||!n&&i.ctrlKey)&&t(i)},[e,t]);(0,F.useEffect)(()=>(document.addEventListener("keydown",i,!1),()=>{document.removeEventListener("keydown",i,!1)}),[e,t,i])}const qh=e=>{const{translate:t}=il(),{columnsSearch:n,setColumnsSearch:o}=Uh(),[s,r]=(0,F.useState)(""),a=(0,F.useMemo)(()=>h(s)?e.searchableColumns.filter(e=>e.name.toLowerCase().trim().includes(s.toLowerCase().trim())):e.searchableColumns,[e.searchableColumns,s]);return(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",css:{borderLeft:"none",borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"bars-filter"})}),(0,i.jsx)(Pd,{css:{padding:"0"},maxHeight:350,placement:"bottom-end",width:320,children:(0,i.jsxs)(Ea,{css:{padding:"$4 $6"},direction:"column",gap:"3",children:[(0,i.jsx)(fr,{font:"gray800 textMd medium",children:t("rechercher_sur_85243")}),(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("filtrer_78031"),state:"search",value:s,onChange:r}),(0,i.jsx)(Ea,{direction:"column",gap:"3",children:a.map(({slug:e,name:t})=>(0,i.jsx)(nc,{state:n.includes(e)?"checked":"unchecked",onClick:t=>{o(Jo(n,e,"checked"===t))},children:t},e))})]})})]})},Yh=()=>{const e=Ln(),{isEditMode:t,massActions:n,name:o,possibleColumns:s,possibleRenderings:r,reload:a,renderActions:l,rendering:d,setAreColumnsOpen:c,setIsEditMode:u,setIsFilterOpen:h,setName:m,setNameDebounced:g,setRendering:p,showEditColumns:f,showEditMode:x,showFilters:_,showMassActions:I,showSearchColumns:v,totalCount:b}=Uh(),j=I&&n.numberOfSelected>0,C=(0,F.useMemo)(()=>(0,Zd.A)(s.filter(e=>e.isSearchable),e=>e.name),[s]),y=(0,F.useMemo)(()=>v?{"& .h-styled-input-container":{borderBottomRightRadius:"0",borderTopRightRadius:"0"}}:{},[v]);return Hh("e",(0,F.useCallback)(()=>{x&&u(!t)},[t,x,u])),(0,i.jsxs)(Ea,{align:"center",gap:"4",children:[(0,i.jsxs)(Ea,{width:320,children:[(0,i.jsx)(wl,{css:y,icon:"magnifying-glass",placeholder:e("rechercher_50038"),value:o,onChange:e=>{m(e),g(e)}}),v&&(0,i.jsx)(qh,{searchableColumns:C})]}),j?(0,i.jsx)(Ea,{css:{flex:"1"},gap:"4",children:"function"==typeof l?l(n,b,a):null}):(0,i.jsxs)(Ea,{css:{flex:"1"},gap:"4",children:[_&&(0,i.jsx)(pl,{color:"gray",leftIcon:"bars-filter",onClick:()=>{h(!0)},children:e("filtres_64574")}),(0,i.jsx)(fr,{css:{flex:"1"}}),Zo(r)&&(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:kh(d),children:Ah(e,d)})}),(0,i.jsx)(Pd,{placement:"bottom-end",children:r.map(t=>(0,i.jsx)(Od,{icon:kh(t),onClick:()=>p(t),children:Ah(e,t)},t))})]}),f&&(0,i.jsx)(pl,{color:"white",leftIcon:"gear",onClick:()=>{c(!0)},children:e("_diter_les_colo_39630")}),x&&(0,i.jsx)(su,{value:t,onChange:u,children:e("mode_dition_93778")})]})]})},Kh=()=>(0,i.jsxs)(Ea,{css:{border:"1px solid $gray200",borderBottom:"none",borderTopLeftRadius:"$1",borderTopRightRadius:"$1",padding:"$3 $4"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Yh,{}),(0,i.jsx)(Wh,{})]}),Zh=e=>{const{translate:t}=il(),[n,o]=F.useState(e.predicates),[s,r]=F.useState(e.columns),[a,l]=F.useState(e.columnsSearch),[d,c]=F.useState(e.rendering),[u,m]=F.useState(e.name||""),[g,p]=F.useState(e.name||""),[f,x]=F.useState(e.limit),[_,I]=F.useState(e.sort),[v,b]=F.useState(0),j=Sc(e=>{p(e),C()}),C=F.useCallback(()=>{b(0)},[b]),y=F.useCallback(t=>{e.setName?.(t),m(t)},[e.setName,m]),k=F.useCallback(()=>{y(""),p(""),C()},[y,p,C]),A=F.useCallback(t=>{e.setPredicates?.(t),o(t)},[e.setPredicates,o]),w=F.useCallback(t=>{e.setColumns?.(t),r(t)},[e.setColumns,r]),S=F.useCallback(t=>{e.setColumnsSearch?.(t),l(t)},[e.setColumnsSearch,l]),E=F.useCallback(t=>{e.setRendering?.(t),c(t)},[e.setRendering,c]),T=F.useCallback(t=>{e.setLimit?.(t),x(t)},[e.setLimit,x]),z=F.useCallback(t=>{e.setSort?.(t),I(t),b(0)},[e.setSort,I,b]),$=F.useMemo(()=>JSON.stringify(e.predicates),[e.predicates]),O=F.useMemo(()=>JSON.stringify(e.columns),[e.columns]),R=F.useMemo(()=>JSON.stringify(e.columnsSearch),[e.columnsSearch]),P=F.useMemo(()=>JSON.stringify(e.rendering),[e.rendering]),D=F.useMemo(()=>JSON.stringify(e.sort),[e.sort]),M=F.useMemo(()=>JSON.stringify(n)!==$||JSON.stringify(s)!==O||JSON.stringify(a)!==R||JSON.stringify(d)!==P||JSON.stringify(_)!==D,[$,n,O,s,R,a,P,d,D,_]),N=F.useMemo(()=>e.columnsToIncludes?.(s,d)??{},[s,d,e.columnsToIncludes]),[L,B]=F.useState(null),[V,U]=F.useState(!1),W=F.useCallback(async()=>{U(!0);const t=await e.loadDataList({...N,...e.loadDataListParams||{},organizationId:e.organizationId||void 0,eventId:e.eventId||void 0,name:h(g)?g:null,columnsSearch:Zo(a)?a:null,predicates:n,limit:f,offset:v,sort:_},await H());B(t.data),U(!1)},[a,N,f,g,v,n,U,B,_,e.organizationId,e.eventId,e.loadDataList,e.loadDataListParams]),[G,q]=F.useState([]),{numberOfPages:Y,totalCount:K}=lu(L?.rows),[Z,X]=F.useState({}),J=F.useCallback(async t=>{X(e=>({...e,[t]:!0}));const n=(await e.loadRow({...N,...e.loadRowParams||{},organizationId:e.organizationId||void 0,eventId:e.eventId||void 0,id:t},await H())).data.row;q(e=>e.map(e=>e.id===t?n:e)),X(e=>({...e,[t]:!1}))},[N,X,e.organizationId,e.eventId,e.loadRow,e.loadRowParams]),Q=F.useCallback(t=>e.getMassActionId?.(t)??t.id,[e.getMassActionId]),ee=au({}),[te]=F.useMemo(()=>Kc(n,e.filters),[n,e.filters]),[ne,ie]=F.useState(!1),[oe,se]=F.useState(!1),[re,ae]=F.useState(!1),[le,de]=F.useState(null);return F.useEffect(()=>{W()},[a,N,f,g,v,n,_,e.organizationId,e.eventId,e.loadDataList]),F.useEffect(()=>{q(L?.rows?.nodes??[])},[L]),F.useEffect(()=>{ee.setStates(Object.fromEntries(G.map(e=>[`r${Q(e)}`,{id:Q(e),state:"unchecked"}])))},[G,ee.setStates]),(0,i.jsxs)(Vh.Provider,{value:{areColumnsOpen:re,clearNameCursors:k,columns:s,columnsSearch:a,data:G,filtersPredicates:te,getMassActionId:Q,idToLoading:Z,isEditMode:ne,isFilterOpen:oe,isLoading:V,isSaveVisible:M,limit:f,loadDataResult:L,massActions:ee,name:u,nameDebounced:g,numberOfPages:Y,offset:v,possibleColumns:e.possibleColumns,possibleRenderings:e.possibleRenderings,predicates:n,reload:W,reloadRow:J,renderActions:e.renderActions,rendering:d,selectedFilterPredicate:le,setAreColumnsOpen:ae,setColumns:w,setColumnsSearch:S,setIsEditMode:ie,setIsFilterOpen:se,setLimit:T,setName:y,setNameDebounced:j,setOffset:b,setPredicates:A,setRendering:E,setSelectedFilterPredicate:de,setSort:z,showEditColumns:e.showEditColumns,showEditMode:e.showEditMode,showFilters:e.showFilters,showMassActions:e.showMassActions,showRowDropdown:e.showRowDropdown,showRowEdit:e.showRowEdit,showSearchColumns:e.showSearchColumns,sort:_,totalCount:K},children:[(0,i.jsxs)(Ea,{css:{background:"white"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Kh,{}),e.children]}),oe&&(0,i.jsx)(Bh,{possibleFilters:e.filters,predicates:n,selectedFilterPredicate:le,onClose:()=>{se(!1)},onFilter:e=>{k(),A(e)}}),re&&(0,i.jsx)(ru,{columns:e.possibleColumns,initialSelectedColumns:s,saveButtonText:t("_diter_les_colo_39630"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_03763"),title:t("_dition_des_col_70300"),onClose:()=>{ae(!1)},onSave:w})]})},Xh={deserialize(e){const t=parseInt(e||"",10);return isNaN(t)?null:t},serialize:e=>e.toString(10)},Jh={deserialize(e){try{return JSON.parse(e||"")}catch{return null}},serialize:e=>JSON.stringify(e)},Qh={deserialize:e=>h(e)&&Fo.c9.fromISO(e)?.isValid?Fo.c9.fromISO(e):null,serialize:e=>e.toISO()};function em(e,t,n={}){const i=qn(),[o,s]=F.useState("function"==typeof n.deserialize?n.deserialize(i.getItem(e))||t:i.getItem(e)??t);return[o,F.useCallback(t=>{s(t),i.setItem(e,"function"==typeof n.serialize?n.serialize(t):t)},[e,s,i])]}const tm=e=>{return(0,i.jsxs)(Tc,{css:{cursor:"pointer",userSelect:"none",...e.css||{}},minWidth:e.minWidth,width:e.width,onClick:()=>{var t,n;e.setSort((t=e.sort,n=e.attribute,null===t||t.attribute!==n?{attribute:n,direction:_t.Asc}:t.direction===_t.Asc?{attribute:n,direction:_t.Desc}:null))},children:[e.children,(0,i.jsx)(Pa,{width:"2"}),(0,i.jsx)(Va,{icon:(t=e.sort,n=e.attribute,null===t||t.attribute!==n?"arrow-down-arrow-up":t.direction===_t.Asc?"arrow-up":"arrow-down")})]});var t,n},nm=e=>{const t=!!e.paginationRow;return(0,i.jsx)(hc,{children:(0,i.jsxs)(Ea,{direction:"column",width:1,children:[(0,i.jsxs)(Jl,{css:{borderLeft:"1px solid $gray200",borderRight:"1px solid $gray200",height:"100%",overflow:"auto hidden",width:"100%","& > div:first-child":{borderStartStartRadius:e.featureFlags?.isV4?"$radii$2":void 0,borderStartEndRadius:e.featureFlags?.isV4?"$radii$2":void 0},"& > div:last-child":{borderEndEndRadius:t?void 0:"$radii$2",borderEndStartRadius:t?void 0:"$radii$2"},"& .table-header-row, & .table-row":{borderLeft:"none",borderRight:"none"},...e.css},gridtemplaterows:"44px 1fr",children:[e.headerRow,(0,i.jsx)(fr,{css:{overflow:"auto"},children:e.children})]}),e.paginationRow]})})},im=({children:e,css:t,gap:n,justify:o,width:s})=>(0,i.jsx)(xc,{width:s??100,children:(0,i.jsx)(Ea,{align:"center",className:"h-controls",css:{cursor:"pointer",display:"none",...t},gap:n??"6",height:1,justify:o,width:1,onClick:Il,children:e})}),om=F.createContext({}),sm=e=>{const[t,n]=F.useState(!1),[o,s]=F.useState(null),[r,a]=F.useState(null);return(0,i.jsx)(om.Provider,{value:{isVisible:t,referenceElement:o,popperElement:r,setIsVisible:n,setReferenceElement:s,setPopperElement:a},children:e.children})};function rm(){return F.useContext(om)}const am=e=>{const{isVisible:t,referenceElement:n,popperElement:o,setPopperElement:s}=rm(),{styles:r,attributes:a,update:l}=(0,Rd.E)(n,o,{placement:e.placement,modifiers:[{name:"offset",options:{offset:[0,4]}}]});F.useEffect(()=>{l?.()},[t,n]);const d=(0,i.jsx)(Ea,{ref:s,align:"center",css:{background:"$gray900",borderRadius:"$1",color:"white",display:t?"flex":"none",px:"$3",py:"6px",zIndex:1e3,...r.popper},justify:"center",...a.popper,children:e.children});return e.renderOnPortal?(0,ee.createPortal)(d,document.body):d},lm=e=>{const{setIsVisible:t,setReferenceElement:n}=rm(),o=F.cloneElement(F.Children.only(e.children),{ref(e){n(e)},onMouseEnter(){t(!0)},onMouseLeave(){t(!1)},onFocus(){t(!0)},onBlur(){t(!1)}});return(0,i.jsx)(i.Fragment,{children:o})},dm=e=>{const{translate:t}=il(),{showRowEdit:n,getMassActionId:o,massActions:s,reload:r,reloadRow:a,showMassActions:l,showRowDropdown:d}=Uh(),c=s.states[`r${o(e.row)}`]?.state??"unchecked",u=F.useCallback(()=>{a(e.row.id)},[e.row.id,a]),h=d||n;return(0,i.jsxs)(Cc,{css:{background:"checked"===c?"$primary100":"white","&:hover":{background:"checked"===c?"$primary100":"$gray100"}},onMouseLeave:e=>{wd(e.target)},children:[l&&(0,i.jsx)(xc,{justify:"center",width:48,children:(0,i.jsx)(tc,{state:c,onClick:t=>{s.toggleRow(`r${o(e.row)}`,t)}})}),e.selectedColumns.map(t=>(0,i.jsx)(F.Fragment,{children:e.renderCell(t,e.row,u)},t.slug)),h&&(0,i.jsxs)(im,{justify:"center",children:[n&&e.getEditPath&&(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"pen",to:e.getEditPath(e.row)})})}),(0,i.jsx)(am,{placement:"top",children:t("_diter_62574")})]}),d&&e.renderRowDropdown?.(e.row,r)]}),e.renderRowPanels?.(e.row,u)]})},cm=e=>{const{columns:t,data:n,idToLoading:o,isLoading:s,limit:r,massActions:a,numberOfPages:l,offset:d,possibleColumns:c,setLimit:u,setOffset:h,setSort:m,showMassActions:g,showRowDropdown:p,showRowEdit:f,sort:x,totalCount:_}=Uh(),I=F.useMemo(()=>t.flatMap(e=>(0,Da.A)([c.find(t=>t.slug===e)])),[t,c]);return(0,i.jsx)(Ea,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(nm,{"aria-busy":s,headerRow:(0,i.jsxs)(cc,{children:[g&&(0,i.jsx)(Tc,{justify:"center",width:48,children:(0,i.jsx)(tc,{state:a.selectAllState,onClick:a.toggleSelectAll})}),I.map(e=>e.isSortable?(0,i.jsx)(tm,{attribute:e.sortAttribute,minWidth:e.minWidth,setSort:m,sort:x,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Tc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),(p||f)&&(0,i.jsx)(Tc,{width:100})]}),paginationRow:(0,i.jsx)(yc,{children:(0,i.jsx)(jc,{limit:r,numberOfPages:l,offset:d,setLimit:u,setOffset:h,showLimits:!0,totalCount:_})}),children:s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{})]}):n.map(t=>o[t.id]?(0,i.jsx)(zc,{},t.id):(0,i.jsx)(dm,{getEditPath:e.getEditPath,renderCell:e.renderCell,renderRowDropdown:e.renderRowDropdown,renderRowPanels:e.renderRowPanels,row:t,selectedColumns:I},t.id))})})};var um;!function(e){e.Features="features",e.Id="id",e.InsertedAt="insertedAt",e.MembersLimit="membersLimit",e.Name="name",e.NumberOfEvents="numberOfEvents",e.NumberOfMembers="numberOfMembers",e.PeriodEndAt="periodEndAt",e.PricePerMember="pricePerMember"}(um||(um={}));let hm=class extends Xc{constructor(e,t,n){super(e,t,n)}getFilters(){return[{slug:"features",name:this.t("fonctionnalit_s_47714"),category:this.t("organisation_71863"),fieldType:Be.Select,values:on.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"isAdmin",name:this.t("est_admin_98471"),category:this.t("organisation_71863"),fieldType:Be.Checkbox,hideEmpty:!0},{slug:"isActive",name:this.t("est_active_05309"),category:this.t("organisation_71863"),fieldType:Be.Checkbox,hideEmpty:!0},{slug:"useOldBilling",name:this.t("utilise_l_ancie_27299"),category:this.t("organisation_71863"),fieldType:Be.Checkbox},{slug:"isOverLimit",name:this.t("d_passe_la_limi_27046"),category:this.t("organisation_71863"),fieldType:Be.Checkbox,hideEmpty:!0},{slug:um.MembersLimit,name:this.t("nombre_de_membr_16400"),category:this.t("organisation_71863"),fieldType:Be.Number},{slug:um.PricePerMember,name:this.t("prix_par_membre_20633"),category:this.t("organisation_71863"),fieldType:Be.Number}]}getPossibleColumns(){return[{slug:um.Id,name:this.t("id_51738"),isSortable:!0,sortAttribute:tt.Id,width:100},{slug:um.Name,name:this.t("nom_de_l_organi_49583"),minWidth:240},{slug:um.InsertedAt,name:this.t("date_de_cr_atio_00749"),isSortable:!0,sortAttribute:tt.InsertedAt,width:200},{slug:um.PeriodEndAt,name:this.t("date_de_fin_de_17750"),isSortable:!0,sortAttribute:tt.PeriodEndAt,width:200},{slug:um.Features,name:this.t("fonctionnalit_s_47714"),minWidth:320},{slug:um.NumberOfEvents,name:this.t("nombre_d_v_nem_14214"),minWidth:180},{slug:um.NumberOfMembers,name:this.t("nombre_de_membr_49522"),minWidth:180},{slug:um.MembersLimit,name:this.t("nombre_de_membr_16400"),minWidth:180},{slug:um.PricePerMember,name:this.t("prix_par_membre_20633"),minWidth:180}]}};function mm(e){switch(e){case Fe.Accreditation:return"badge-check";case Fe.Api:return"code-branch";case Fe.Community:return"people-group";case Fe.CustomDocument:return"file";case Fe.Delegation:return"users";case Fe.Documents:return"file";case Fe.Eid:return"id-card";case Fe.KmlImport:return"cloud-arrow-up";case Fe.Languages:return"language";case Fe.Multiform:return"file-lines";case Fe.Skidata:return"person-skiing";case Fe.Sms:return"message";case Fe.Weezevent:return"ticket";case Fe.Zapier:return"bolt";default:return Za()}}hm=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hc,$c,Dn])],hm);const gm=e=>{const t=Nn($c);return e.column.slug===um.Id?(0,i.jsx)(xc,{width:e.column.width,children:e.row.id}):e.column.slug===um.Name?(0,i.jsx)(xc,{css:{"& a":{color:"$primary700 !important"}},children:(0,i.jsx)(La,{to:mi.ORGANIZATION({organizationId:e.row.id}),children:e.row.name})}):e.column.slug===um.InsertedAt?(0,i.jsx)(xc,{width:e.column.width,children:t.toLocaleString(e.row.insertedAt,Ho.DateOnly.MonthLong)}):e.column.slug===um.PeriodEndAt?(0,i.jsx)(xc,{width:e.column.width,children:t.toLocaleString(e.row.periodEndAt,Ho.DateOnly.MonthLong)}):e.column.slug===um.Features?(0,i.jsx)(xc,{children:(0,i.jsx)(Ea,{align:"center",css:{overflow:"auto",py:"$2"},gap:"2",height:1,width:1,wrap:"wrap",children:e.row.features.map(e=>(0,i.jsx)(Gd,{leftIcon:mm(e),children:e},e))})}):e.column.slug===um.NumberOfEvents?(0,i.jsx)(xc,{children:e.row.numberOfEvents}):e.column.slug===um.NumberOfMembers?(0,i.jsx)(xc,{children:e.row.membersStats.numberOfMembers}):e.column.slug===um.MembersLimit?(0,i.jsx)(xc,{children:e.row.membersLimit}):e.column.slug===um.PricePerMember?(0,i.jsx)(xc,{children:e.row.pricePerMember}):(0,i.jsx)(xc,{})},pm=e=>(0,i.jsxs)(Ed,{isOpen:e.isOpen,onStateChange:e.onStateChange,children:[(0,i.jsx)(Dd,{children:e.triggerElem||(0,i.jsx)(Ea,{align:"center",css:{cursor:"pointer"},height:20,justify:"center",width:20,children:(0,i.jsx)(Va,{icon:"ellipsis-vertical"})})}),(0,i.jsx)(Pd,{placement:"bottom-end",children:e.children})]}),fm=e=>{const t=Ln(),{user:n}=Zn(),{mutate:o,isLoading:s}=function(e={}){return Un("mutation BackofficeOrganizationUserAdd($organizationId: OrganizationId!) {\n    backofficeOrganizationUserAdd(organizationId: $organizationId)\n}\n",e)}(),{mutate:r,isLoading:a}=function(e={}){return Un("mutation BackofficeOrganizationUserRemove($organizationId: OrganizationId!) {\n    backofficeOrganizationUserRemove(organizationId: $organizationId)\n}\n",e)}(),l=e.organization.users.map(({id:e})=>e);return(0,i.jsxs)(pm,{children:[l.includes(n.id)?(0,i.jsx)(Od,{color:a?"disabled":"default",icon:"minus",onClick:async()=>{await r({organizationId:e.organization.id}),e.reload()},children:t("s_enlever_comme_18919")}):(0,i.jsx)(Od,{color:s?"disabled":"default",icon:"plus",onClick:async()=>{await o({organizationId:e.organization.id}),window.open(`${R.HEAVENT_APP_URL}${mi.ORGANIZATION({organizationId:e.organization.id})}`,"_blank"),e.reload()},children:t("s_ajouter_comme_70404")}),(0,i.jsx)(Od,{icon:"pen",to:So.EDIT_BACKOFFICE_ORGANIZATION(e.organization.id),children:t("_diter_62574")})]})},xm=()=>{const{history:e,translate:t}=il(),n=Nn(hm),[o,s]=em(El.BACKOFFICE_SEARCH,""),[r,a]=em(El.BACKOFFICE_COLUMNS,[um.Id,um.Name,um.InsertedAt,um.PeriodEndAt],Jh),[l,d]=em(El.BACKOFFICE_LIMIT,_c,Xh),[c,u]=em(El.BACKOFFICE_PREDICATES,[],Jh),[h,m]=em(El.BACKOFFICE_SORT,null,Jh);return(0,i.jsx)(fr,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsxs)(Ea,{css:{padding:"$7"},direction:"column",gap:"7",width:1,children:[(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(fr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("organisations_26509")}),(0,i.jsx)(pl,{color:"white",leftIcon:"plus",to:si(mi.ORGANIZATIONS),children:t("cr_er_une_organ_06669")}),(0,i.jsx)(pl,{leftIcon:"house",onClick:()=>{e.push(So.HOME)},children:"WeezCrew"}),(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(Pd,{placement:"bottom-end",children:(0,i.jsx)(Od,{icon:"eye",onClick:()=>{e.push(So.BACKOFFICE_INVOICES)},children:t("voir_les_factur_82290")})})]})]}),(0,i.jsx)(Zh,{columns:r,columnsSearch:[],eventId:null,filters:n.getFilters(),limit:l,loadDataList:Mr,loadRow:Fr,name:o,organizationId:null,possibleColumns:n.getPossibleColumns(),predicates:c,rendering:yh.List,setColumns:a,setLimit:d,setName:s,setPredicates:u,setSort:m,showEditColumns:!0,showEditMode:!1,showFilters:!0,showMassActions:!1,showRowDropdown:!0,showRowEdit:!0,showSearchColumns:!1,sort:h,children:(0,i.jsx)(cm,{getEditPath:e=>So.EDIT_BACKOFFICE_ORGANIZATION(e.id),renderCell:(e,t)=>(0,i.jsx)(gm,{column:e,row:t}),renderRowDropdown:(e,t)=>(0,i.jsx)(fm,{organization:e,reload:t})})})]})})},_m=ar("div",{margin:"auto",width:"$containerTablet","@desktop":{width:"$container"}}),Im=F.forwardRef((e,t)=>(0,i.jsx)(fr,{ref:t,css:{background:"$gray50",overflowX:"hidden",overflowY:"auto",py:"$10",...e.css},height:1,width:1,children:(0,i.jsx)(_m,{children:e.children})}));Im.displayName="CenteredContainer";const vm=ar("div",{display:"flex",flexDirection:"column",height:"100%",width:"100%",zIndex:"10","& .fsp-header":{px:"$7"},"& .fsp-category":{fontSize:"11px",fontWeight:"$semiBold",textTransform:"uppercase"},"& .fsp-title":{fontSize:"$textMd",fontWeight:"$semiBold"},variants:{color:{white:{"& .fsp-header":{background:"white",borderBottom:"1px solid $gray200"},"& .fsp-category":{color:"$gray600"},"& .fsp-title":{color:"$gray900"}},dark:{"& .fsp-header":{background:"$gray900"},"& .fsp-category":{color:"white"},"& .fsp-title":{color:"white"}}}},defaultVariants:{color:"white"}}),bm=e=>{const t=Gn();return(0,i.jsxs)(vm,{color:e.color,children:[(0,i.jsxs)(Ea,{align:"center",className:"fsp-header",gap:"4",height:65,width:1,children:[(0,i.jsx)(fr,{css:{flexShrink:3},width:300}),(0,i.jsxs)(Ea,{align:"center",css:{flex:"1"},direction:"column",children:[e.category&&(0,i.jsx)(fr,{className:"fsp-category",children:e.category}),(0,i.jsx)(fr,{className:"fsp-title",css:{maxWidth:"100%"},ellipsis:!0,children:e.title})]}),(0,i.jsxs)(Ea,{gap:"4",justify:"end",width:300,children:[e.button,(0,i.jsx)(pl,{color:"dark"===e.color?"gray":"white",css:{flexShrink:0},leftIcon:"xmark",onClick:()=>{"function"==typeof e.onClose?e.onClose():t.goBack(e.fallbackClosePath||So.HOME)}})]})]}),(0,i.jsx)(fr,{css:{height:"calc(100% - 65px)"},width:1,children:e.children})]})},jm=e=>(0,i.jsx)(Ea,{css:{background:"white",borderRadius:"$2",boxShadow:"$sm",padding:"$6 $7",...e.css},direction:"column",children:e.children}),Cm=F.memo(function(e){const t=Ln(),{descId:n,labelId:o}=bl(),[s,r]=F.useState(e.initialIsOpen),a=F.useCallback(t=>{r(t),e.onToggle?.(t)},[e.onToggle,r]),l=e.descId??n,d=e.labelId??o;return(0,i.jsxs)(Ea,{as:"fieldset",css:{background:"white",borderRadius:"$2",boxShadow:"$sm",border:"inherit",margin:"inherit",padding:"$6 $7",...e.css},direction:"column",children:[(0,i.jsxs)(Ea,{align:"center","aria-describedby":l,"aria-labelledby":d,as:"legend",css:{float:"left",width:"100%",border:"none",padding:"none",...s&&!e.centerTitleAndSubtitle?{borderBottom:"1px solid $gray200",paddingBottom:"$5"}:{}},gap:"4",children:[(0,i.jsxs)(Ea,{css:e.centerTitleAndSubtitle?{flex:"1",alignItems:"center",marginBottom:"var(--space32)"}:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",id:d,children:e.title}),h(e.subtitle)&&(0,i.jsx)(fr,{color:"gray500",dangerouslySetInnerHTML:{__html:e.subtitle},id:l})]}),!e.hideToggle&&(0,i.jsx)(fr,{children:(0,i.jsx)(ou,{label:t("toggle_section_92160"),size:"md",value:s,onChange:a})})]}),s&&(0,i.jsxs)(i.Fragment,{children:[!e.centerTitleAndSubtitle&&(0,i.jsx)(Pa,{height:"5"}),e.children]})]})}),ym=({name:e,children:t,...n})=>(0,i.jsx)(Oa.D0,{name:e,render:e=>{const o=!0===e.input.checked?"checked":"unchecked";return(0,i.jsx)(nc,{...n,state:o,onClick:()=>{e.input.onChange(!e.input.checked)},children:t})},type:"checkbox"}),km=(0,F.memo)(function({name:e,hint:t,state:n,...o}){return(0,i.jsx)(Oa.D0,{name:e,render:({input:s,meta:r})=>{const a=r.data?.forceDisplayError&&r.invalid||r.touched&&r.invalid;return(0,i.jsx)(_u,{hint:a?r.error:t,name:e,state:a?"error":n,value:s.value,onBlur:s.onBlur,onChange:s.onChange,onFocus:s.onFocus,...o})}})}),Am=({value:e,onChange:t,...n})=>{const[o,s]=(0,F.useState)(e?.toString()??""),[r,a]=(0,F.useState)(e);return r!==e&&(s(e?.toString()??""),a(e)),(0,i.jsx)(wl,{value:o,onChange:e=>{const n=parseFloat(e);s(e),a(isNaN(n)?null:n),t(isNaN(n)?null:n)},...n})},wm=({name:e,hint:t,state:n,...o})=>(0,i.jsx)(Oa.D0,{name:e,render:s=>{const r=_l(s.meta);return(0,i.jsx)(Am,{hint:r?s.meta.error:t,name:e,state:r?"error":n,value:s.input.value,onBlur:s.input.onBlur,onChange:s.input.onChange,onFocus:s.input.onFocus,...o})}}),Sm=({name:e,hint:t,state:n,multiple:o,...s})=>(0,i.jsx)(Oa.D0,{name:e,render:r=>{const a=_l(r.meta);return(0,i.jsx)(dc,{hint:a?r.meta.error:t,multiple:o,name:e,state:a?"error":n,values:o?Array.isArray(r.input.value)?r.input.value:[]:"number"==typeof r.input.value||h(r.input.value)?[r.input.value]:[],onChange:e=>{o?r.input.onChange(e):Zo(e)?r.input.onChange(e[0]):r.input.onChange(null)},...s})}}),Em=({css:e,label:t,description:n,state:o,icon:s,hint:r,rightIcon:a,rightText:l,onChange:d,value:c,...u})=>{const{inputId:h,descId:m,errorId:g}=bl();return(0,i.jsxs)(Ea,{css:e,direction:"column",width:1,children:[(0,i.jsx)(yl,{htmlFor:h,children:t}),(0,i.jsx)(jl,{id:m,children:n}),(t||n)&&(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(Al,{cursor:"text",height:"fluid",icon:s,rightIcon:a,rightText:l,state:o,children:(0,i.jsxs)(Jl,{css:{flex:"1",minHeight:"100px",py:"$3","& .replicated-text":{whiteSpace:"pre-wrap",visibility:"hidden"},"& textarea":{outline:"none",overflow:"hidden",resize:"none"},"& .replicated-text, & textarea":{background:"transparent",border:"none",gridArea:"1 / 1 / 2 / 2",width:"100%"},"& textarea::placeholder":{color:"$gray500",opacity:1},"& input::-ms-input-placeholder":{color:"$gray500",opacity:1}},children:[(0,i.jsx)("textarea",{"aria-describedby":n?m:void 0,"aria-errormessage":"error"===o?g:void 0,"aria-invalid":"error"===o,disabled:"disabled"===o,id:h,value:c,onChange:e=>{d(e.target.value)},...u}),(0,i.jsxs)(fr,{className:"replicated-text",children:[c," "]})]})}),(0,i.jsx)(Cl,{id:g,state:o,children:r})]})},Tm=({name:e,hint:t,state:n,...o})=>(0,i.jsx)(Oa.D0,{name:e,render:s=>{const r=_l(s.meta);return(0,i.jsx)(Em,{hint:r?s.meta.error:t,name:e,state:r?"error":n,value:s.input.value,onBlur:s.input.onBlur,onChange:e=>{s.input.onChange(e)},onFocus:s.input.onFocus,...o})}}),zm=e=>(0,i.jsx)(Oa.D0,{name:e.name,render:t=>(0,i.jsx)(su,{disabled:e.disabled,size:e.size,subtext:e.subtext,value:t.input.value,onChange:t.input.onChange,children:e.children})}),$m=l.gl(e=>e&&Fo.c9.fromISO(e).isValid);let Om=class extends zl{constructor(e){super(e)}organizationInputDefault(e){return{name:e.name,features:e.features,customBadges:e.customBadges,periodEndAt:e.periodEndAt,usersIds:e.users.map(({id:e})=>e),isBlocked:e.isBlocked,weezeventOrganizationId:e.weezeventOrganizationId,useOldBilling:e.useOldBilling,membersLimit:e.membersLimit,pricePerMember:e.pricePerMember,billingComment:e.billingComment}}organizationInputSchema(){return l.Ik().shape({name:l.Yj().required(this.t("le_nom_de_l_org_60618")),periodEndAt:$m.required(this.t("la_date_de_fin_04076")).typeError(this.t("la_date_de_fin_04076")),features:l.YO().of(l.Yj().oneOf(on,this.t("les_fonctionnal_36778"))),usersIds:l.YO().of(l.ai()),isBlocked:l.zM().required()})}updateOrganizationSchema(){return l.Ik().shape({organization:this.organizationInputSchema()})}};Om=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],Om);const Rm=ar("span",{variants:{color:{inherit:{color:"inherit"},cyan:{color:"$cyan"},gray25:{color:"$gray25"},gray50:{color:"$gray50"},gray100:{color:"$gray100"},gray200:{color:"$gray200"},gray300:{color:"$gray300"},gray400:{color:"$gray400"},gray500:{color:"$gray500"},gray600:{color:"$gray600"},gray700:{color:"$gray700"},gray800:{color:"$gray800"},gray900:{color:"$gray900"},primary25:{color:"$primary25"},primary50:{color:"$primary50"},primary100:{color:"$primary100"},primary200:{color:"$primary200"},primary300:{color:"$primary300"},primary400:{color:"$primary400"},primary500:{color:"$primary500"},primary600:{color:"$primary600"},primary700:{color:"$primary700"},primary800:{color:"$primary800"},primary900:{color:"$primary900"},error25:{color:"$error25"},error50:{color:"$error50"},error100:{color:"$error100"},error200:{color:"$error200"},error300:{color:"$error300"},error400:{color:"$error400"},error500:{color:"$error500"},error600:{color:"$error600"},error700:{color:"$error700"},error800:{color:"$error800"},error900:{color:"$error900"},warning25:{color:"$warning25"},warning50:{color:"$warning50"},warning100:{color:"$warning100"},warning200:{color:"$warning200"},warning300:{color:"$warning300"},warning400:{color:"$warning400"},warning500:{color:"$warning500"},warning600:{color:"$warning600"},warning700:{color:"$warning700"},warning800:{color:"$warning800"},warning900:{color:"$warning900"},success25:{color:"$success25"},success50:{color:"$success50"},success100:{color:"$success100"},success200:{color:"$success200"},success300:{color:"$success300"},success400:{color:"$success400"},success500:{color:"$success500"},success600:{color:"$success600"},success700:{color:"$success700"},success800:{color:"$success800"},success900:{color:"$success900"},blue25:{color:"$blue25"},blue50:{color:"$blue50"},blue100:{color:"$blue100"},blue200:{color:"$blue200"},blue300:{color:"$blue300"},blue400:{color:"$blue400"},blue500:{color:"$blue500"},blue600:{color:"$blue600"},blue700:{color:"$blue700"},blue800:{color:"$blue800"},blue900:{color:"$blue900"},blueGray25:{color:"$blueGray25"},blueGray50:{color:"$blueGray50"},blueGray100:{color:"$blueGray100"},blueGray200:{color:"$blueGray200"},blueGray300:{color:"$blueGray300"},blueGray400:{color:"$blueGray400"},blueGray500:{color:"$blueGray500"},blueGray600:{color:"$blueGray600"},blueGray700:{color:"$blueGray700"},blueGray800:{color:"$blueGray800"},blueGray900:{color:"$blueGray900"},blueLight100:{color:"$blueLight100"},blueLight400:{color:"$blueLight400"},blueLight600:{color:"$blueLight600"},blueLight900:{color:"$blueLight900"},purple25:{color:"$purple25"},purple50:{color:"$purple50"},purple100:{color:"$purple100"},purple200:{color:"$purple200"},purple300:{color:"$purple300"},purple400:{color:"$purple400"},purple500:{color:"$purple500"},purple600:{color:"$purple600"},purple700:{color:"$purple700"},purple800:{color:"$purple800"},purple900:{color:"$purple900"},pink25:{color:"$pink25"},pink50:{color:"$pink50"},pink100:{color:"$pink100"},pink200:{color:"$pink200"},pink300:{color:"$pink300"},pink400:{color:"$pink400"},pink500:{color:"$pink500"},pink600:{color:"$pink600"},pink700:{color:"$pink700"},pink800:{color:"$pink800"},pink900:{color:"$pink900"},orange100:{color:"$orange100"},orange400:{color:"$orange400"},orange600:{color:"$orange600"},orange700:{color:"$orange700"},indigo100:{color:"$indigo100"},indigo600:{color:"$indigo600"},white:{color:"white"}},fontSize:{inherit:{fontSize:"inherit"},textXs:{fontSize:"$textXs"},textSm:{fontSize:"$textSm"},textMd:{fontSize:"$textMd"},textLg:{fontSize:"$textLg"},textXl:{fontSize:"$textXl"},displayXs:{fontSize:"$displayXs"},displaySm:{fontSize:"$displaySm"},displayMd:{fontSize:"$displayMd"},displayLg:{fontSize:"$displayLg"},displayXl:{fontSize:"$displayXl"},display2Xl:{fontSize:"$display2Xl"}},fontWeight:{inherit:{fontWeight:"inherit"},regular:{fontWeight:"$regular"},medium:{fontWeight:"$medium"},semiBold:{fontWeight:"$semiBold"},bold:{fontWeight:"$bold"}}},defaultVariants:{color:"inherit",fontSize:"inherit",fontWeight:"inherit"}}),Pm=F.forwardRef((e,t)=>(0,i.jsx)(Rm,{...(0,tr.A)(e,"font"),...nr(e.font),ref:t,css:e.css}));Pm.displayName="Span";const Dm=1123,Fm=794,Mm=561,Nm=397,Lm=397,Bm=280,Vm=325,Um=204,Wm={A4:{height:"297mm",width:"210mm"},A5:{height:"210mm",width:"148mm"},A6:{height:"148mm",width:"105mm"}},Gm=(e,t)=>{t?.startsWith("/")||(console.warn(`Path '${t}' missing leading slash`),t="/"+t);const n=new x(R.HEAVENT_PUBLIC_URL);return jd.has(e)&&(n.host=jd.get(e)),n.pathname+=t,n.href},Hm=({organizationId:e,eventId:t,delegationId:n,formId:i,teamCode:o,query:s})=>{const r=new x(R.HEAVENT_PUBLIC_URL);return jd.has(e)&&(r.host=jd.get(e)),r.pathname+=`${(()=>{if(n)return"number"==typeof t?to.DELEGATION_FORM({organizationId:e,delegationId:n,eventId:t,formId:i}):to.DELEGATION_FORM({organizationId:e,delegationId:n,formId:i});{const n="number"==typeof t?Pi.EVENT_FORM({organizationId:e,eventId:t,formId:i}):mi.ORGANIZATION_FORM({organizationId:e,formId:i});return h(o)?`${n}/team/${o}`:n}})()}`,s?.preview&&r.searchParams.set("preview",s?.preview?.toString()),s?.previewState&&r.searchParams.set("state",s?.previewState?.toString()),r.href};var qm;!function(e){e.QR="qr",e.Code39="code39"}(qm||(qm={}));const Ym=(e,t)=>{const n=new x(R.HEAVENT_API_URL);return n.pathname+=`/barcode/${t?.barcodeType??qm.QR}`,n.searchParams.set("text",e),n.searchParams.set("color",t?.color??"000000"),t?.height&&n.searchParams.set("height",t?.height?.toString()),t?.width&&n.searchParams.set("width",t?.width?.toString()),n.href},Km=({organizationId:e,eventId:t,segmentId:n,key:i})=>{const o=new x(R.HEAVENT_API_URL);return o.pathname+=t?`/export/organization/${e}/event/${t}/volunteers/${n}`:`/export/organization/${e}/members/${n}`,o.searchParams.set("key",i),o.href};function Zm(e,t,n={}){const i=new x(R.HEAVENT_API_URL);i.pathname+=`/documents/${e}.${t}`;const o=new URLSearchParams(Object.entries(n).filter(([e,t])=>h(t)));for(const[e,t]of o)i.searchParams.set(e,t);return i.href}function Xm(e,t){return new x(`https://admin.${R.WEEZEVENT_DOMAIN}`,void 0,void 0,`access/O${e}/checkpoints/edit/${t}`).href}const Jm=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=(0,Zd.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/animaje/convention-page1.jpg) no-repeat`,backgroundSize:"cover",color:"#040f29",fontFamily:"$neufileGrotesk",pageBreakBefore:"always",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsxs)(fr,{css:{fontSize:"24px",fontWeight:"700",left:"72px",position:"absolute",textTransform:"uppercase",top:"334px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]}),(0,i.jsx)(fr,{css:{fontSize:"14px",fontWeight:"500",left:"72px",position:"absolute",textTransform:"uppercase",top:"364px"},children:n.fields?.phone?.internationalFormat||""}),(0,i.jsx)(fr,{css:{left:"650px",position:"absolute",top:"322px"},height:72,width:72,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsx)(Ea,{css:{left:"72px",position:"absolute",top:"558px"},direction:"column",gap:"1",children:o.map((e,t)=>(0,i.jsxs)(fr,{css:{fontSize:"12px",fontWeight:"500"},children:[(0,i.jsxs)(Pm,{css:{fontWeight:"700",textTransform:"capitalize"},children:[e.positionSlot.range.start.toFormat("cccc dd MMMM 'de' HH'h'mm",{locale:"fr"})," ","à ",e.positionSlot.range.end.toFormat("HH'h'mm")]})," ",": ",e.position.name]},t))})]}),(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/animaje/convention-page2.jpg) no-repeat`,backgroundSize:"cover",color:"#040f29",fontFamily:"$neufileGrotesk",pageBreakBefore:"always",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsxs)(fr,{css:{fontSize:"24px",fontWeight:"700",left:"72px",position:"absolute",textTransform:"uppercase",top:"222px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]}),(0,i.jsx)(fr,{css:{fontSize:"14px",fontWeight:"500",left:"72px",position:"absolute",textTransform:"uppercase",top:"252px"},children:n.fields?.phone?.internationalFormat||""}),(0,i.jsx)(fr,{css:{left:"650px",position:"absolute",top:"210px"},height:72,width:72,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsxs)(fr,{css:{fontSize:"12px",fontWeight:"700",left:"178px",position:"absolute",top:"455px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]}),(0,i.jsxs)(fr,{css:{fontSize:"12px",fontWeight:"700",left:"72px",position:"absolute",top:"537px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]}),(0,i.jsxs)(fr,{css:{fontSize:"12px",fontWeight:"700",left:"72px",position:"absolute",top:"617px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]})]})]})};function Qm(e,t,n){return e.filter(e=>{if(t?.isValid&&n?.isValid){const i=Fo.IX.fromDateTimes(t.startOf("day"),n.endOf("day"));return e.positionSlot.range.overlaps(i)}return!t?.isValid||e.positionSlot.range.start.startOf("day").equals(t.startOf("day"))})}function eg(e,t){const n=Object.fromEntries(Object.values((0,Kd.A)(t,e=>e.positionSlot.range.start.startOf("day").toMillis())).map(e=>[`positions.${e[0].positionSlot.range.start.toFormat("yyyyMMdd")}`,(0,Zd.A)((0,Oo.A)(e.map(e=>e.position.name))).join(" ")]));return{assignmentsDays:(0,Ju.A)((t||[]).map(({positionSlot:e})=>e.range.start),e=>e.startOf("day").toMillis()).map(t=>e.toLocaleString(t,Ho.DateOnly.WeekdayLongMonthLong)).join(", "),positionsCategories:(0,Zd.A)((0,Oo.A)((t||[]).map(e=>e.position.category.name))).join(", "),positions:(0,Zd.A)((0,Oo.A)((t||[]).map(e=>e.position.name))).join(", "),...n}}function tg(e){return{[`${e} p.h-small`]:{fontSize:"12px"},[`${e} h2`]:{fontSize:"20px",fontWeight:"$semiBold"},[`${e} h3`]:{fontSize:"18px",fontWeight:"$semiBold"},[`${e} h4`]:{fontSize:"16px",fontWeight:"$semiBold"},[`${e} a`]:{color:"$primary700"},[`${e} blockquote`]:{borderLeft:"3px solid $gray200",fontStyle:"italic",marginLeft:0,marginRight:0,px:"$4","& p":{margin:0,paddingBottom:"$2",paddingTop:"$2"}}}}const ng=e=>(0,i.jsx)(fr,{className:"h-rich-text",css:{...tg("&"),"& > p:first-child":{marginTop:0},"& > p:last-child":{marginBottom:0},"& figure":{margin:"auto","& img":{width:"100%"}},...e.css},dangerouslySetInnerHTML:{__html:e.text},width:1,onClick:e=>{const t=e.target;if(t){const n=t.closest("a");n&&(e.preventDefault(),window.open(n.getAttribute("href"),"_blank"))}}});function ig(e,t){return`https://www.google.com/maps/place/${e},${t}`}const og=4427,sg=4848,rg=e=>e===og?{color:"#ff5501"}:e===sg?{color:"#005a41"}:-1===e?{color:"#1e4850"}:{},ag=e=>e===og?{color:"white"}:e===sg?{color:"#005a41"}:-1===e?{color:"#1e4850"}:{},lg=e=>{const t=e.psuis[0].position,n=(0,Zd.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),o=t.leaders[0];return(0,i.jsxs)(Ea,{css:{background:`url(${s=e.eventId,s===og?`${R.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/semi.jpg`:s===sg?`${R.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/marathon.jpg`:-1===s?`${R.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/10k.jpg`:""}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsx)(fr,{css:{fontSize:"24px",left:"298px",position:"absolute",top:"101px",...ag(e.eventId)},textAlign:"center",width:409,children:e.userInfo.name}),(0,i.jsx)(fr,{css:{fontSize:"12px",left:"46px",position:"absolute",top:"374px"},children:h(e.options.habits)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fr,{css:{...ag(e.eventId),"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(ng,{text:e.options.habits})})})}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{css:{color:"#005a41",left:"46px",position:"absolute",top:"581px",...ag(e.eventId)},textAlign:"center",width:150,children:o.userInfo.name}),(0,i.jsx)(fr,{css:{left:"46px",position:"absolute",top:"602px",...ag(e.eventId)},textAlign:"center",width:150,children:o.userInfo.phone?.internationalFormat})]}),(0,i.jsxs)(Ea,{css:{left:"228px",position:"absolute",padding:"32px",top:"167px"},direction:"column",width:550,children:[(0,i.jsx)(fr,{css:{fontSize:"28px",fontWeight:"700",...rg(e.eventId)},textAlign:"center",children:t.name}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{css:{fontWeight:"700",textTransform:"uppercase",...rg(e.eventId)},children:"Date et heure de la mission"}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(Ea,{css:{fontSize:"12px"},direction:"column",gap:"1",children:n.map((e,t)=>{const n=e.range.start;return(0,i.jsxs)(fr,{children:[n.toFormat("cccc dd MMMM yyyy",{locale:"fr"})," à"," ",n.toFormat("H'h'mm",{locale:"fr"})]},t)})}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{css:{fontWeight:"700",textTransform:"uppercase",...rg(e.eventId)},children:"Détail de la mission"}),(0,i.jsx)(Pa,{height:"1"}),h(t.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fr,{css:{color:"black",fontSize:"12px","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(ng,{text:t.description})})}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{css:{fontWeight:"700",textTransform:"uppercase",...rg(e.eventId)},children:"Lieu de rendez-vous"}),(0,i.jsx)(Pa,{height:"1"}),uh(t)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{css:{fontSize:"12px"},children:t.address}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsxs)(Ea,{gap:"3",width:1,children:[(0,i.jsx)(fr,{height:180,width:1,children:(0,i.jsx)("a",{href:ig(t.latitude,t.longitude),style:{background:`url(${R.HEAVENT_API_URL}/image/event/${e.eventId}/position/${t.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),h(t.fields?.cf45815?.url)&&(0,i.jsx)(fr,{css:{background:`url(${t.fields.cf45815.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204})]}),h(t.fields.cf44423)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{css:{fontWeight:"700",textTransform:"uppercase",...rg(e.eventId)},children:"Ton kit bénévole"}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{css:{fontSize:"12px"},dangerouslySetInnerHTML:{__html:t.fields.cf44423.replace(/\n/g," ")}})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{css:{fontWeight:"700",textTransform:"uppercase",...rg(e.eventId)},children:"Un imprévu ?"}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{css:{fontSize:"12px"},children:"Pour des raisons pratiques, il ne sera pas possible de procéder à des changements d’affectation sur le terrain. Merci de bien vouloir nous informer en cas d’indisponibilité le plus rapidement possible, afin de ne pas pénaliser le bon déroulement de l’épreuve"})]})]});var s},dg=[120785,134101],cg=e=>{const t=Qm(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,null).filter(({position:e})=>!dg.includes(e.id)),n=(0,Zd.A)(Object.entries((0,Kd.A)(t,({position:e})=>e.id)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:n.map(([t,n],o)=>(0,i.jsx)(lg,{eventId:e.event.id,options:e.options,psuis:n,userInfo:e.event.volunteerRegistration.userInfo},o))})};function ug(e={}){const t=p(e.firstName||"").trim();return`${p(e.lastName||"").trim().toUpperCase()} ${t}`.trim()}function hg(e,t,n=null){return e?.[t]?.value||n}const mg=(e,t)=>e.split(t).map(e=>e.trim().length>0?e.trim()[0]:"").join("").substring(0,3);function gg(e,t){if(h(e))return mg(e," ");if(h(t)){const[e]=t.split("@");return mg(e,".")}return""}const pg=[lr.colors.success600.value,lr.colors.blueGray600.value,lr.colors.blueLight600.value,lr.colors.purple600.value,lr.colors.pink600.value,lr.colors.warning600.value];function fg(e){const t=e.charCodeAt(0);return pg[t%pg.length]}const xg=({children:e})=>(0,i.jsx)(Ea,{align:"center",css:{background:"#14243f",borderRadius:"5px 5px 0px 0px",color:"white",flex:"1",fontWeight:"600",padding:"10px"},justify:"center",children:e}),_g=({children:e})=>(0,i.jsx)(Ea,{align:"center",css:{background:"white",border:"1px solid $gray200",color:"#142440",flex:"1",fontWeight:"600",padding:"10px"},justify:"center",children:e}),Ig=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=t.positionsSlotsUsersInfos.flatMap(e=>e.position.leaders)?.[0],s=(0,Zd.A)(t.positionsSlotsUsersInfos.filter(e=>23066===e.position.category.id),e=>e.positionSlot.range.start.toMillis()),r=(0,Zd.A)(t.positionsSlotsUsersInfos.filter(e=>23113===e.position.category.id),e=>e.positionSlot.range.start.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/cercle/fiche_livraison_masque.png) no-repeat`,backgroundSize:"cover",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsx)(fr,{css:{fontSize:"20px",fontWeight:"700",left:"32px",position:"absolute",textTransform:"uppercase",top:"193px"},children:hg(n.fields,"cf42835","salut")}),(0,i.jsxs)(fr,{css:{color:"#000dbd",fontSize:"17px",fontWeight:"600",left:"32px",position:"absolute",top:"225px"},children:[n.name," - ",n.fields?.phone?.internationalFormat]}),(0,i.jsxs)(fr,{css:{color:"#000dbd",fontSize:"17px",fontWeight:"600",left:"32px",position:"absolute",top:"251px"},children:[o?.userInfo.name," - ",o?.userInfo.phone?.internationalFormat]}),(0,i.jsx)(fr,{css:{position:"absolute",right:"32px",top:"188px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsxs)(Ea,{css:{position:"absolute",px:"32px",top:"411px"},direction:"column",width:1,children:[(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsxs)(Ea,{gap:"1",width:1,children:[(0,i.jsx)(xg,{children:"DATE"}),(0,i.jsx)(xg,{children:"HORAIRE"}),(0,i.jsx)(xg,{children:"TYPE"}),(0,i.jsx)(xg,{children:"N° IMMAT"})]}),s.map((e,t)=>(0,i.jsxs)(Ea,{gap:"1",width:1,children:[(0,i.jsx)(_g,{children:e.positionSlot.range.start.toFormat("dd/MM/yyyy")}),(0,i.jsx)(_g,{children:e.positionSlot.range.start.toFormat("HH:mm")}),(0,i.jsx)(_g,{children:hg(n.fields,"cf42931","")}),(0,i.jsx)(_g,{children:hg(n.fields,"cf42974","")})]},t))]}),Zo(r)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(fr,{css:{fontSize:"22px",fontWeight:"700"},children:"Reprise"}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsxs)(Ea,{gap:"1",width:1,children:[(0,i.jsx)(xg,{children:"DATE"}),(0,i.jsx)(xg,{children:"HORAIRE"}),(0,i.jsx)(xg,{children:"TYPE"}),(0,i.jsx)(xg,{children:"N° IMMAT"})]}),r.map((e,t)=>(0,i.jsxs)(Ea,{gap:"1",width:1,children:[(0,i.jsx)(_g,{children:e.positionSlot.range.start.toFormat("dd/MM/yyyy")}),(0,i.jsx)(_g,{children:e.positionSlot.range.start.toFormat("HH:mm")}),(0,i.jsx)(_g,{children:hg(n.fields,"cf42931","")}),(0,i.jsx)(_g,{children:hg(n.fields,"cf42974","")})]},t))]})]})]})]}),(0,i.jsx)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/cercle/fiche_livraison_masque_1.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Dm,width:Fm})]})},vg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=t.delegation,s=(0,Zd.A)((0,Ju.A)(n.formsUsersInfos.flatMap(e=>e.slots.map(e=>e.range.start.startOf("day"))),e=>e.toMillis()),e=>e.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/cercle/op_com_1.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsx)(fr,{css:{fontFamily:"$kabel",fontSize:"20px",fontWeight:"700",left:"46px",position:"absolute",textTransform:"uppercase",top:"306px",width:"582px"},children:n.name}),(0,i.jsxs)(fr,{css:{color:"#1e3159",fontSize:"17px",fontWeight:"600",left:"46px",position:"absolute",top:"338px",width:"582px"},children:["Nom du responsable : ",o?.leaders?.[0]?.name," ",o?.leaders?.[0]?.phone?.internationalFormat]}),(0,i.jsx)(fr,{css:{left:"658px",position:"absolute",top:"288px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(Ea,{css:{gap:"6px",left:"46px",position:"absolute",top:"641px"},children:s.map((e,t)=>(0,i.jsxs)(Ea,{align:"center",css:{border:"1px solid black",borderRadius:"$1",fontFamily:"$montserrat",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(fr,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(fr,{css:{fontSize:"10px",fontWeight:"500"},children:e.toFormat("MMM",{locale:"fr"})})]},t))})]}),(0,i.jsx)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/cercle/op_com_2.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Dm,width:Fm}),(0,i.jsx)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/cercle/op_com_3.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Dm,width:Fm})]})},bg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=t.delegation,s=(0,Zd.A)((0,Ju.A)(n.formsUsersInfos.flatMap(e=>e.slots.map(e=>e.range.start.startOf("day"))),e=>e.toMillis()),e=>e.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/cercle/fdr_press_et_partenaire_1.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsx)(fr,{css:{fontFamily:"$kabel",fontSize:"20px",fontWeight:"700",left:"46px",position:"absolute",textTransform:"uppercase",top:"306px",width:"582px"},children:n.name}),(0,i.jsxs)(fr,{css:{color:"#1e3159",fontSize:"17px",fontWeight:"600",left:"46px",position:"absolute",top:"338px",width:"582px"},children:["Nom du responsable : ",o?.leaders?.[0]?.name," ",o?.leaders?.[0]?.phone?.internationalFormat]}),(0,i.jsx)(fr,{css:{left:"658px",position:"absolute",top:"288px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(Ea,{css:{gap:"6px",left:"46px",position:"absolute",top:"641px"},children:s.map((e,t)=>(0,i.jsxs)(Ea,{align:"center",css:{border:"1px solid black",borderRadius:"$1",fontFamily:"$montserrat",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(fr,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(fr,{css:{fontSize:"10px",fontWeight:"500"},children:e.toFormat("MMM",{locale:"fr"})})]},t))})]}),(0,i.jsx)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/cercle/fdr_press_et_partenaire_2.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Dm,width:Fm}),(0,i.jsx)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/cercle/fdr_press_et_partenaire_3.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Dm,width:Fm})]})},jg=e=>"Staff"===e?`${R.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Staff.png`:`${R.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Visiteur.png`,Cg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=hg(n.fields,"population",""),s=t.delegation,r=(0,Zd.A)((0,Ju.A)(n.formsUsersInfos.flatMap(e=>e.slots.map(e=>e.range.start.startOf("day"))),e=>e.toMillis()),e=>e.toMillis()),a=(0,Zd.A)((0,Ju.A)(t.accreditationsUsersInfos.flatMap(e=>2826===e.accreditationCategory.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot.date]:[]),e=>e.toMillis()),e=>e.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:`url(${jg(o)}) no-repeat`,backgroundSize:"cover",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsx)(fr,{css:{fontSize:"20px",fontWeight:"700",left:"32px",position:"absolute",textTransform:"uppercase",top:"206px"},children:n.name}),(0,i.jsxs)(fr,{css:{color:"#1e3159",fontSize:"17px",fontWeight:"600",left:"32px",position:"absolute",top:"238px"},children:["Nom du responsable : ",s?.leaders?.[0]?.name," ",s?.leaders?.[0]?.phone?.internationalFormat]}),(0,i.jsx)(fr,{css:{position:"absolute",right:"32px",top:"188px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(Ea,{css:{gap:"6px",left:"32px",position:"absolute",top:"Staff"===o?"461px":"452px"},children:r.map((e,t)=>(0,i.jsxs)(Ea,{align:"center",css:{border:"1px solid black",borderRadius:"$1",fontFamily:"$montserrat",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(fr,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(fr,{css:{fontSize:"10px",fontWeight:"500"},children:e.toFormat("MMM",{locale:"fr"})})]},t))}),Zo(a)&&(0,i.jsx)(fr,{css:{fontSize:"22px",fontWeight:"800",left:"32px",position:"absolute",textTransform:"uppercase",top:"Staff"===o?"530px":"521px"},children:"Catering"}),(0,i.jsx)(Ea,{css:{gap:"6px",left:"32px",position:"absolute",top:"Staff"===o?"562px":"553px"},children:a.map((e,t)=>(0,i.jsxs)(Ea,{align:"center",css:{border:"1px solid black",borderRadius:"$1",fontFamily:"$montserrat",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(fr,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(fr,{css:{fontSize:"10px",fontWeight:"500"},children:e.toFormat("MMM",{locale:"fr"})})]},t))})]}),"Staff"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Staff-01.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Dm,width:Fm}),(0,i.jsx)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Staff-02.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Dm,width:Fm})]}),"Visiteur"===o&&(0,i.jsx)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Visiteur_2.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Dm,width:Fm})]})},yg=e=>e.includes("Régisseur")||e.includes("Team Delta")||e.includes("Warrior Chauffeur")?`${R.HEAVENT_ASSETS_URL}/badges/delta/2024/delta_tech_verso.jpg`:`${R.HEAVENT_ASSETS_URL}/badges/delta/2024/delta_qr_verso.jpg`,kg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=Nn($c),s=(0,F.useMemo)(()=>{const t=e.event.volunteerRegistration.positionsSlotsUsersInfos;return(0,Zd.A)(Object.entries((0,Kd.A)(t,e=>e.positionSlot.range.start.startOf("day").toMillis())),([e])=>e).map(([e,t])=>[o.toLocaleString(t[0].positionSlot.range.start,Ho.DateOnly.WeekdayLongMonthLong),t])},[e.event]),r=n.fields?.cf1666?.value;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:`url(${a=r,a.includes("Régisseur")||a.includes("Team Delta")||a.includes("Warrior Chauffeur")?`${R.HEAVENT_ASSETS_URL}/badges/delta/2024/delta_tech_recto.jpg`:`${R.HEAVENT_ASSETS_URL}/badges/delta/2024/delta_qg_recto.jpg`}) no-repeat`,backgroundSize:"contain",color:"black",pageBreakBefore:"always",position:"relative"},direction:"column",height:Dm,width:Fm,children:[(0,i.jsx)(fr,{css:{borderRadius:"100px",left:"60px",overflow:"hidden",position:"absolute",top:"286px"},height:100,width:100,children:h(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(fr,{css:{fontSize:"24px",fontWeight:"700",left:"177px",position:"absolute",top:"289px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(fr,{css:{fontSize:"24px",fontWeight:"700",left:"177px",position:"absolute",top:"322px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(fr,{css:{fontSize:"18px",left:"177px",position:"absolute",top:"359px"},children:r}),(0,i.jsxs)(Ea,{align:"center",css:{position:"absolute",right:"71px",top:"282px"},direction:"column",gap:"2",children:[(0,i.jsx)(fr,{height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(fr,{css:{fontSize:"10px"},children:t.ticketId})]})]}),(0,i.jsx)(Ea,{css:{background:`url(${yg(r)}) no-repeat`,backgroundSize:"contain",color:"black",pageBreakBefore:"always",position:"relative"},direction:"column",height:Dm,width:Fm,children:(0,i.jsx)(Ea,{css:{left:"76px",position:"absolute",top:"328px"},direction:"column",gap:"6",children:s.map(([e,t],n)=>(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{css:{fontSize:"18px",fontWeight:"700",textTransform:"uppercase"},children:e}),(0,i.jsx)(Ea,{direction:"column",children:t.map((e,t)=>(0,i.jsxs)(fr,{css:{fontSize:"16px"},children:[e.position.name," /"," ",e.positionSlot.range.toFormat("HH:mm",{separator:"-"})]},t))})]},n))})})]});var a},Ag=({css:e,children:t})=>(0,i.jsx)(Ea,{css:{alignItems:"center",border:"1px solid",flexDirection:"column",fontSize:"24px",fontWeight:700,height:"42px",justifyContent:"center",lineHeight:"24px",padding:"2px 0px",position:"absolute",width:"110px",...e},children:t}),wg=({css:e,children:t})=>(0,i.jsx)(fr,{css:{fontSize:"14px",fontWeight:600,lineHeight:"14px",...e},children:t}),Sg=["P0","P1","P1 Aire Régie","P2","P3","P4","ZONE 1 - PELOUSE","ZONE 2 - VESTIAIRES","ZONE 3 - TRIBUNES","ZONE 4 - MEDIAS","ZONE 5 - AIRE REGIE TV","ZONE 6 - HOSPITALITES","ZONE 7 - SERVICES","ZONE 8 - BORD TERRAIN","ZONE 9 - PRESIDENTIELLE","H-30","PC"],Eg=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,o=`${n.fields?.firstName?.value||""} ${(n.fields?.lastName?.value||"").toUpperCase()}`,s=t.accreditationsUsersInfos.reduce((e,t)=>Sg.includes(t.accreditation.name)?{...e,[t.accreditation.name]:t.accreditation.color}:e,{}),r=t.ticketId;return(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/dfco/accred-a4.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$default",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsx)(fr,{css:{left:"423px",position:"absolute",top:"145px"},height:91,width:91,children:h(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(fr,{css:{left:"530px",fontWeight:600,lineHeight:"normal",position:"absolute",top:"151px"},children:o}),(0,i.jsx)(fr,{css:{left:"530px",fontWeight:700,lineHeight:"normal",position:"absolute",textTransform:"uppercase",top:"176px"},children:n.fields.cf36682?.value||""}),s.P0&&(0,i.jsx)(Ag,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(fr,{children:"P0"})}),s.P1&&(0,i.jsx)(Ag,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(fr,{children:"P1"})}),s["P1 Aire Régie"]&&(0,i.jsx)(Ag,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(fr,{children:"P1 A-R"})}),s.P2&&(0,i.jsx)(Ag,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(fr,{children:"P2"})}),s.P3&&(0,i.jsx)(Ag,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(fr,{children:"P3"})}),s.P4&&(0,i.jsx)(Ag,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(fr,{children:"P4"})}),s["H-30"]&&(0,i.jsx)(fr,{css:{backgroundColor:s["H-30"],color:"#FFF",fontWeight:600,left:"698px",lineHeight:"14px",padding:"2px 4px",position:"absolute",textAlign:"center",top:"307px"},children:"H-30"}),s.PC&&(0,i.jsx)(fr,{css:{backgroundColor:s.PC,color:"#FFF",fontWeight:600,left:"746px",lineHeight:"14px",padding:"2px 4px",position:"absolute",textAlign:"center",top:"307px"},children:"PC"}),s["ZONE 1 - PELOUSE"]&&(0,i.jsxs)(Ag,{css:{backgroundColor:s["ZONE 1 - PELOUSE"],left:"421px",top:"337px"},children:[(0,i.jsx)(fr,{children:"1"}),(0,i.jsx)(wg,{children:"PELOUSE"})]}),s["ZONE 2 - VESTIAIRES"]&&(0,i.jsxs)(Ag,{css:{backgroundColor:s["ZONE 2 - VESTIAIRES"],left:"541px",top:"337px"},children:[(0,i.jsx)(fr,{children:"2"}),(0,i.jsx)(wg,{children:"VESTIAIRE"})]}),s["ZONE 3 - TRIBUNES"]&&(0,i.jsxs)(Ag,{css:{backgroundColor:s["ZONE 3 - TRIBUNES"],left:"661px",top:"337px"},children:[(0,i.jsx)(fr,{children:"3"}),(0,i.jsx)(wg,{children:"TRIBUNES"})]}),s["ZONE 4 - MEDIAS"]&&(0,i.jsxs)(Ag,{css:{backgroundColor:s["ZONE 4 - MEDIAS"],left:"421px",top:"387px"},children:[(0,i.jsx)(fr,{children:"4"}),(0,i.jsx)(wg,{children:"MEDIAS"})]}),s["ZONE 5 - AIRE REGIE TV"]&&(0,i.jsxs)(Ag,{css:{backgroundColor:s["ZONE 5 - AIRE REGIE TV"],left:"541px",top:"387px"},children:[(0,i.jsx)(fr,{children:"5"}),(0,i.jsx)(wg,{children:"AIRE REGIE TV"})]}),s["ZONE 6 - HOSPITALITES"]&&(0,i.jsxs)(Ag,{css:{backgroundColor:s["ZONE 6 - HOSPITALITES"],left:"661px",top:"387px"},children:[(0,i.jsx)(fr,{children:"6"}),(0,i.jsx)(wg,{children:"HOSPITALITÉS"})]}),s["ZONE 7 - SERVICES"]&&(0,i.jsxs)(Ag,{css:{backgroundColor:s["ZONE 7 - SERVICES"],left:"421px",top:"437px"},children:[(0,i.jsx)(fr,{children:"7"}),(0,i.jsx)(wg,{children:"SERVICES"})]}),s["ZONE 8 - BORD TERRAIN"]&&(0,i.jsxs)(Ag,{css:{backgroundColor:s["ZONE 8 - BORD TERRAIN"],left:"541px",top:"437px"},children:[(0,i.jsx)(fr,{children:"8"}),(0,i.jsx)(wg,{children:"BORD TERRAIN"})]}),s["ZONE 9 - PRESIDENTIELLE"]&&(0,i.jsxs)(Ag,{css:{backgroundColor:s["ZONE 9 - PRESIDENTIELLE"],left:"661px",top:"437px"},children:[(0,i.jsx)(fr,{children:"9"}),(0,i.jsx)(wg,{children:"PRESIDENTIELLE"})]}),(0,i.jsxs)(Ea,{css:{alignItems:"center",flexDirection:"column",gap:"4px",left:"478px",position:"absolute",top:"489px",width:"234px"},children:[(0,i.jsx)(fr,{height:28,width:1,children:(0,i.jsx)("img",{height:"100%",src:Ym(r,{barcodeType:qm.Code39,height:28,width:234}),width:"100%"})}),(0,i.jsx)(fr,{css:{fontSize:"10px"},children:r})]})]})},Tg=({css:e,children:t})=>(0,i.jsx)(Ea,{css:{alignItems:"center",border:"1px solid",flexDirection:"column",fontSize:"14px",fontWeight:700,height:"18px",justifyContent:"center",lineHeight:"14px",padding:"2px 0px",position:"absolute",width:"22px",...e},children:t}),zg=["ZONE 1 - PELOUSE","ZONE 2 - VESTIAIRES","ZONE 3 - TRIBUNES","ZONE 4 - MEDIAS","ZONE 5 - AIRE REGIE TV","ZONE 6 - HOSPITALITES","ZONE 7 - SERVICES","ZONE 8 - BORD TERRAIN","ZONE 9 - PRESIDENTIELLE"],$g=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,o=t.accreditationsUsersInfos.reduce((e,t)=>zg.includes(t.accreditation.name)?{...e,[t.accreditation.name]:t.accreditation.color}:e,{}),s=t.ticketId;return(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/dfco/accred-badge.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$default",position:"relative"},height:204,width:643,children:[(0,i.jsx)(fr,{css:{left:"400px",position:"absolute",top:"39px"},height:87,width:87,children:h(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(fr,{css:{left:"497px",fontSize:"10px",fontWeight:600,lineHeight:"normal",position:"absolute",top:"59px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(fr,{css:{left:"497px",fontSize:"10px",fontWeight:600,lineHeight:"normal",position:"absolute",textTransform:"uppercase",top:"73px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(fr,{css:{left:"497px",fontSize:"10px",fontWeight:700,lineHeight:"normal",position:"absolute",textTransform:"uppercase",top:"88px"},children:n.fields.cf36682?.value||""}),o["ZONE 1 - PELOUSE"]&&(0,i.jsx)(Tg,{css:{backgroundColor:o["ZONE 1 - PELOUSE"],left:"363px",top:"174px"},children:(0,i.jsx)(fr,{children:"1"})}),o["ZONE 2 - VESTIAIRES"]&&(0,i.jsx)(Tg,{css:{backgroundColor:o["ZONE 2 - VESTIAIRES"],left:"391px",top:"174px"},children:(0,i.jsx)(fr,{children:"2"})}),o["ZONE 3 - TRIBUNES"]&&(0,i.jsx)(Tg,{css:{backgroundColor:o["ZONE 3 - TRIBUNES"],left:"419px",top:"174px"},children:(0,i.jsx)(fr,{children:"3"})}),o["ZONE 4 - MEDIAS"]&&(0,i.jsx)(Tg,{css:{backgroundColor:o["ZONE 4 - MEDIAS"],left:"447px",top:"174px"},children:(0,i.jsx)(fr,{children:"4"})}),o["ZONE 5 - AIRE REGIE TV"]&&(0,i.jsx)(Tg,{css:{backgroundColor:o["ZONE 5 - AIRE REGIE TV"],left:"475px",top:"174px"},children:(0,i.jsx)(fr,{children:"5"})}),o["ZONE 6 - HOSPITALITES"]&&(0,i.jsx)(Tg,{css:{backgroundColor:o["ZONE 6 - HOSPITALITES"],left:"503px",top:"174px"},children:(0,i.jsx)(fr,{children:"6"})}),o["ZONE 7 - SERVICES"]&&(0,i.jsx)(Tg,{css:{backgroundColor:o["ZONE 7 - SERVICES"],left:"531px",top:"174px"},children:(0,i.jsx)(fr,{children:"7"})}),o["ZONE 8 - BORD TERRAIN"]&&(0,i.jsx)(Tg,{css:{backgroundColor:o["ZONE 8 - BORD TERRAIN"],left:"559px",top:"174px"},children:(0,i.jsx)(fr,{children:"8"})}),o["ZONE 9 - PRESIDENTIELLE"]&&(0,i.jsx)(Tg,{css:{backgroundColor:o["ZONE 9 - PRESIDENTIELLE"],left:"587px",top:"174px"},children:(0,i.jsx)(fr,{children:"9"})}),(0,i.jsxs)(Ea,{css:{alignItems:"center",flexDirection:"column",gap:"4px",left:"93px",position:"absolute",top:"166px",width:"136px"},children:[(0,i.jsx)(fr,{height:20,width:1,children:(0,i.jsx)("img",{height:"100%",src:Ym(s,{barcodeType:qm.Code39,height:20,width:166}),width:"100%"})}),(0,i.jsx)(fr,{css:{fontSize:"8px"},children:s})]})]})};var Og=n(7957);function Rg(e){return(0,Zd.A)(Object.entries((0,Kd.A)(e,e=>`${e.position.name}-${e.positionSlot.range.start.startOf("day").toMillis()}`)).map(([e,t])=>{const n=(0,Zd.A)(t,e=>e.positionSlot.range.start.toMillis());return{name:t[0].position.name,ranges:n.map(e=>e.positionSlot.range),slotsNames:(0,Da.A)((0,Oo.A)(n.map(({positionSlot:e})=>e.name)))}}),({ranges:e})=>e[0].start.toMillis())}var Pg=n(791);const Dg=e=>{switch(e){case 16:return 7;case 24:return 10;case 32:return 14;case 40:return 16;case 48:return 18;case 56:return 20;case 64:return 24;case 88:return 30;case 96:return 36;case 110:return 40;case 160:return 48;case 310:return 120}},Fg=e=>{const[t,n]=(0,F.useState)(h(e.image)?e.image:void 0);if((0,F.useEffect)(()=>{h(e.image)&&n(e.image)},[e.image]),h(t))return(0,i.jsx)("div",{style:{border:e.border,borderRadius:e.size+"px",height:`${e.size}px`,overflow:"hidden",width:`${e.size}px`},children:(0,i.jsx)("img",{alt:"Avatar",src:t,style:{height:`${e.size}px`,width:`${e.size}px`,verticalAlign:"baseline"}})});{const t=gg(e.name,e.email);return(0,i.jsx)("div",{style:{borderRadius:e.size+"px",height:e.size+"px",overflow:"hidden",width:e.size+"px"},children:(0,i.jsx)("div",{className:"h-avatar-initials",style:{alignItems:"center",background:fg(t),color:"white",display:"flex",fontSize:`${Dg(e.size)}px`,height:"100%",justifyContent:"center",textTransform:"uppercase",width:"100%"},children:t})})}},Mg=e=>{const t=e.event.volunteerRegistration.userInfo,n=(0,Oo.A)(e.assignments.map(({name:e})=>e)).length,o=e.assignments.flatMap(e=>e.ranges),s=(0,Oo.A)(o.map(e=>e.start.startOf("day").toMillis())).length,r=(0,Pg.A)(o.map(e=>e.length("hours")));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ea,{css:{paddingTop:"$6"},justify:"center",width:1,children:(0,i.jsx)("img",{height:"56px",src:`${R.HEAVENT_ASSETS_URL}/badges/eurockeennes/eurockeennesLogo.png`,width:"103px"})}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(Fg,{email:t.email,image:t.fields?.picture?.url,name:t.name,size:40}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray800 textMd semiBold",children:t.name}),(0,i.jsxs)(Ea,{gap:"3",children:[(0,i.jsxs)(fr,{color:"gray500",children:["Nb. de missions : ",n]}),(0,i.jsxs)(fr,{color:"gray500",children:["Nb. de jours : ",s]}),(0,i.jsxs)(fr,{color:"gray500",children:["Temps total affecté : ",r,"h"]})]})]})]})]})};let Ng=class{translationService;constructor(e){this.translationService=e}minutesToHoursMinutesString(e){const t=Fo.dw.fromObject({minutes:e},{locale:this.translationService.language.toString().toLowerCase()}).shiftTo("hours","minutes");return 0===t.minutes?t.shiftTo("hours").toHuman({unitDisplay:"narrow"}):0===t.hours?t.shiftTo("minutes").toHuman({unitDisplay:"narrow"}):t.toHuman({unitDisplay:"narrow"})}};Ng=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],Ng);const Lg=e=>{const t=Nn($c),n=Nn(Ng);return(0,i.jsxs)(Ea,{css:{background:"white",pageBreakBefore:0!==e.index?"always":void 0,px:"$8"},direction:"column",width:1,children:[e.header,(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(fr,{font:"gray800 textMd semiBold",children:"Planning des missions Eurockéennes 2023"}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsxs)(mc,{children:[(0,i.jsxs)(cc,{children:[(0,i.jsx)(Tc,{children:"Nom de la mission"}),(0,i.jsx)(Tc,{width:410,children:"Date"}),(0,i.jsx)(Tc,{width:120,children:"Total"})]}),e.assignments.map((e,o)=>{const s=Zo(e.slotsNames),r=(0,Pg.A)(e.ranges.map(e=>e.toDuration("minutes").minutes));return(0,i.jsxs)(Cc,{css:{height:s?"54px":"44px"},children:[(0,i.jsx)(xc,{css:{color:"$gray900",fontWeight:"$medium"},children:e.name}),(0,i.jsxs)(xc,{direction:"column",gap:"1",justify:"center",width:410,children:[s&&(0,i.jsx)(fr,{color:"gray900",width:1,children:e.slotsNames.join(", ")}),(0,i.jsxs)(fr,{width:1,children:[(0,rd.A)(t.toLocaleString(e.ranges[0].start,Ho.DateOnly.WeekdayLongMonthLong))," ",e.ranges.map(e=>`${e.start.toFormat("HH:mm")}-${e.end.toFormat("HH:mm")}`).join(" | ")]})]}),(0,i.jsx)(xc,{width:120,children:n.minutesToHoursMinutesString(r)})]},o)})]})]})},Bg=e=>{const t=(0,F.useMemo)(()=>Rg(e.event.volunteerRegistration.positionsSlotsUsersInfos),[e.event]),n=(0,F.useMemo)(()=>(0,i.jsx)(Mg,{assignments:t,event:e.event}),[t,e.event]);return(0,i.jsx)(i.Fragment,{children:(0,Og.A)(t,17).map((e,t)=>(0,i.jsx)(Lg,{assignments:e,header:n,index:t},t))})},Vg=e=>(0,i.jsx)(i.Fragment,{children:e.event.volunteersRegistrations.nodes.map((t,n)=>(0,i.jsx)(Ea,{css:{background:"white",pageBreakBefore:0!==n?"always":void 0},direction:"column",width:1,children:(0,i.jsx)(Bg,{event:{...e.event,volunteerRegistration:t}})},t.utid))}),Ug=e=>(0,i.jsxs)(Ea,{align:"center",width:1,children:[(0,i.jsx)(Ea,{align:"center",css:{background:e.backgroundColor,color:"white",fontWeight:700},height:24,justify:"center",width:30,children:e.zoneNumber}),(0,i.jsx)(Pa,{width:"2"}),(0,i.jsx)(fr,{css:{fontSize:"13px",fontWeight:700},children:e.zoneText})]}),Wg=()=>(0,i.jsx)(fr,{height:24,width:1}),Gg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=4444===e.event.id,s=t.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym),r=s.includes("CAT 1"),a=s.includes("CAT 2"),l=s.includes("CAT 3"),d=s.includes("CAT 4"),c=s.includes("CAT 5"),u=s.includes("CAT 6"),m=o?`${R.HEAVENT_ASSETS_URL}/badges/fcg/2425/bg_badge_saison.jpg`:`${R.HEAVENT_ASSETS_URL}/badges/fcg/2425/bg_badge_match.jpg`;return(0,i.jsxs)(Ea,{css:{background:`url(${m}) no-repeat`,backgroundSize:"cover",fontFamily:"$montserrat",position:"relative"},height:563,width:397,children:[(0,i.jsx)(fr,{css:{border:"2px solid #004994",left:"38px",position:"absolute",top:"38px"},height:80,width:80,children:h(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsxs)(Ea,{css:{color:"#00384f",fontSize:"12px",fontWeight:"900",left:"128px",lineHeight:"18px",position:"absolute",textTransform:"uppercase",top:"52px"},direction:"column",children:[(0,i.jsx)(fr,{children:n.fields.cf10106?.value||""}),(0,i.jsx)(fr,{children:n.fields?.firstName?.value||""}),(0,i.jsx)(fr,{children:n.fields?.lastName?.value||""})]}),(0,i.jsx)(fr,{css:{border:"2px solid #004994",left:"273px",padding:"$1",position:"absolute",top:"38px"},height:80,width:80,children:h(t.utid)&&(0,i.jsx)("img",{height:"100%",src:Ym(t.utid,{color:"5d9dcb"}),width:"100%"})}),!o&&(0,i.jsx)(Ea,{align:"center",css:{color:"#00384f",fontSize:"30px",fontWeight:"900",height:"54px",left:"129px",lineHeight:"24px",position:"absolute",textTransform:"uppercase",top:"183px",width:"230px"},justify:"center",wrap:"wrap",children:e.event.name}),(0,i.jsxs)(Ea,{css:{gap:"7px",left:"38px",position:"absolute",top:"293px"},children:[(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[r?(0,i.jsx)(Ug,{backgroundColor:"#8ec89a",zoneNumber:1,zoneText:"Terrain"}):(0,i.jsx)(Wg,{}),a?(0,i.jsx)(Ug,{backgroundColor:"#ddca00",zoneNumber:2,zoneText:"Zone mixte"}):(0,i.jsx)(Wg,{}),l?(0,i.jsx)(Ug,{backgroundColor:"#cd1719",zoneNumber:3,zoneText:"Espaces Media"}):(0,i.jsx)(Wg,{})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[d?(0,i.jsx)(Ug,{backgroundColor:"#009fe3",zoneNumber:4,zoneText:"Tribunes"}):(0,i.jsx)(Wg,{}),c?(0,i.jsx)(Ug,{backgroundColor:"#d89fc7",zoneNumber:5,zoneText:"Espaces et Salon VIP"}):(0,i.jsx)(Wg,{}),u?(0,i.jsx)(Ug,{backgroundColor:"#010000",zoneNumber:6,zoneText:"PC Sécurité"}):(0,i.jsx)(Wg,{})]})]})]})},Hg=e=>(0,i.jsx)(i.Fragment,{children:(0,Og.A)(e.event.volunteersRegistrations.nodes,4).map((t,n)=>(0,i.jsx)(Ea,{css:{pageBreakBefore:0!==n?"always":void 0},justify:"between",width:Fm,wrap:"wrap",children:t.map(t=>(0,i.jsx)(Gg,{event:{...e.event,volunteerRegistration:t}},t.userInfo.id))},`page-${n}`))}),qg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=(0,Zd.A)(Object.values((0,Kd.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.startOf("day").toMillis())),e=>e[0].positionSlot.range.start.startOf("day")),s="MRP"===n.fields?.cf32955?.value,r=(0,Zd.A)(t.accreditationsUsersInfos.flatMap(e=>2927===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),a=(0,Zd.A)(t.accreditationsUsersInfos.flatMap(e=>2938===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),l=(0,Zd.A)(t.accreditationsUsersInfos.flatMap(e=>2928===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),d=t.accreditationsUsersInfos.some(e=>2931===e.accreditation.id||2932===e.accreditation.id),c=(0,Zd.A)(t.accreditationsUsersInfos.flatMap(e=>2929===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),u=(0,Zd.A)(t.accreditationsUsersInfos.flatMap(e=>2930===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),m=t.accreditationsUsersInfos.some(e=>2933===e.accreditation.id);return(0,i.jsx)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/garorock/planning.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$inter",position:"relative"},height:Dm,width:Fm,children:(0,i.jsxs)(Ea,{css:{position:"absolute",px:"96px",top:"240px"},direction:"column",gap:"5",children:[s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ea,{direction:"column",gap:"4",children:o.map((e,t)=>{const n=e[0],o=(0,Zd.A)(Object.values((0,Kd.A)(e,e=>e.position.id)),e=>(0,Lu.A)(e,e=>e.positionSlot.range.start.toMillis()).positionSlot.range.start.toMillis());return(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{css:{color:"#faf5dc",fontSize:"16px",fontWeight:"700",textTransform:"capitalize"},children:n.positionSlot.range.start.toFormat("cccc dd MMMM",{locale:"fr"})}),o.map((e,t)=>{const n=e[0];return(0,i.jsxs)(fr,{css:{color:"#faf5dc",fontSize:"16px"},children:[n.position.name," :"," ",(o=e.map(({positionSlot:e})=>e.range),(0,Zd.A)(o,e=>e.start.toMillis()).map(e=>`${e.start.toFormat("H:mm")}-${e.end.toFormat("H:mm")}`).join(" | "))]},t);var o})]},t)})}),(0,i.jsx)(Ea,{justify:"center",width:602,children:(0,i.jsx)(fr,{height:4,width:332,children:(0,i.jsx)("img",{height:"100%",src:`${R.HEAVENT_ASSETS_URL}/badges/garorock/dot.png`,width:"100%"})})})]}),(0,i.jsxs)(Ea,{css:{color:"#faf5dc",fontSize:"16px"},direction:"column",gap:"5",children:[h(r)&&(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{children:"Un petit déjeuner au catering bénévole est prévu pour toi le(s) :"}),(0,i.jsx)(fr,{fontWeight:"medium",children:r})]}),h(a)&&(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{children:"Un petit déjeuner au Garotri est prévu pour toi le(s) :"}),(0,i.jsx)(fr,{fontWeight:"medium",children:a})]}),h(l)&&(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{children:"Un panier repas est prévu pour toi le(s) :"}),(0,i.jsx)(fr,{fontWeight:"medium",children:l})]}),d&&(0,i.jsx)(fr,{children:"Une somme d’argent te sera crédité sur ta carte pour tes jours de présence"}),h(c)&&(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{children:"Un repas au catering technique est prévu pour toi le(s) :"}),(0,i.jsx)(fr,{fontWeight:"medium",children:c})]}),h(u)&&(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{children:"Un repas au Garo snack d’une valeur de 6€ est prévu pour toi le(s) :"}),(0,i.jsx)(fr,{fontWeight:"medium",children:u})]}),m&&(0,i.jsx)(fr,{children:"Des tickets repas te seront fournis pour les utiliser sur tous les stands du festival"})]})]})})},Yg=e=>"All Access Pass"===e||"All Access Pass + A"===e?`${R.HEAVENT_ASSETS_URL}/badges/goldenCoast/pass_back.jpg`:`${R.HEAVENT_ASSETS_URL}/badges/goldenCoast/classique_back.jpg`,Kg=e=>{const t=e.event.volunteerRegistration.userInfo,n=t.fields?.cf37556?.value??"",o="All Access Pass"===n||"All Access Pass + A"===n?"#faed4f":"#294999";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:`url(${s=n,"All Access Pass"===s?`${R.HEAVENT_ASSETS_URL}/badges/goldenCoast/pass_front.jpg`:"All Access Pass + A"===s?`${R.HEAVENT_ASSETS_URL}/badges/goldenCoast/pass_plus_front.jpg`:`${R.HEAVENT_ASSETS_URL}/badges/goldenCoast/classique_front.jpg`}) no-repeat`,backgroundSize:"212px 317px",fontFamily:"$neueMontreal",position:"relative"},height:317,width:212,children:[(0,i.jsx)(fr,{css:{borderRadius:"4px",left:"55px",overflow:"hidden",position:"absolute",top:"105px"},height:102,width:102,children:h(t.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:t.fields.picture.url,width:"100%"})}),(0,i.jsx)(fr,{css:{color:o,fontSize:"24px",fontWeight:"700",position:"absolute",textTransform:"uppercase",top:"218px"},textAlign:"center",width:1,children:t.fields?.lastName?.value||""}),(0,i.jsx)(fr,{css:{color:o,fontSize:"24px",fontWeight:"700",position:"absolute",top:"248px"},textAlign:"center",width:1,children:t.fields?.firstName?.value||""}),(0,i.jsx)(fr,{css:{color:o,fontWeight:"700",position:"absolute",top:"286px"},textAlign:"center",width:1,children:t.fields.cf33258?.value})]}),(0,i.jsx)(Ea,{css:{background:`url(${Yg(n)}) no-repeat`,backgroundSize:"212px 317px",pageBreakBefore:"always"},height:317,width:212})]});var s},Zg=["TERRAIN","VESTIAIRES","ESPACE PRESSE","SALON NEODIF","SALON GEOFIT","SALON PRESTIGE"],Xg={TERRAIN:"Mode_Isolation_1.png",VESTIAIRES:"Mode_Isolation_2.png","ESPACE PRESSE":"Mode_Isolation_3.png","SALON NEODIF":"Mode_Isolation_4.png","SALON GEOFIT":"Mode_Isolation_5.png","SALON PRESTIGE":"Mode_Isolation_6.png"},Jg=({css:e,name:t})=>(0,i.jsx)(fr,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/hbc/lnh/${Xg[t]}) no-repeat`,backgroundSize:"cover",height:"30px",position:"absolute",width:"30px",...e}}),Qg=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,o=n.fields?.cf38222?.value,s=t.accreditationsUsersInfos.reduce((e,t)=>Zg.includes(t.accreditation.name)?{...e,[t.accreditation.name]:!0}:e,{});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/hbc/ldc/2025/bg_badge_recto.jpg) no-repeat`,backgroundSize:"cover",color:"#FFF",fontFamily:"$formulaCondensedBold",position:"relative"},height:476,width:363,children:[(0,i.jsx)(fr,{css:{fontSize:"26px",fontWeight:700,left:"34px",lineHeight:"normal",position:"absolute",textAlign:"center",textDecoration:"uppercase",top:"221px"},children:`${n.fields?.firstName?.value||""} ${n.fields?.lastName?.value||""}`.trim().toUpperCase()}),(0,i.jsx)(fr,{css:{fontSize:"13px",fontWeight:"700",left:"34px",lineHeight:"normal",position:"absolute",textAlign:"center",top:"172px"},children:n.fields.cf38077?.value}),(0,i.jsx)(fr,{css:{fontSize:"26px",fontWeight:700,left:"34px",lineHeight:"normal",position:"absolute",textAlign:"center",textDecoration:"uppercase",top:"301px"},children:(o||"").toUpperCase()}),s.TERRAIN&&(0,i.jsx)(Jg,{css:{left:"251px",top:"314px"},name:"TERRAIN"}),s.VESTIAIRES&&(0,i.jsx)(Jg,{css:{left:"299px",top:"314px"},name:"VESTIAIRES"}),s["ESPACE PRESSE"]&&(0,i.jsx)(Jg,{css:{left:"251px",top:"363px"},name:"ESPACE PRESSE"}),s["SALON NEODIF"]&&(0,i.jsx)(Jg,{css:{left:"299px",top:"363px"},name:"SALON NEODIF"}),s["SALON GEOFIT"]&&(0,i.jsx)(Jg,{css:{left:"251px",top:"412px"},name:"SALON GEOFIT"}),s["SALON PRESTIGE"]&&(0,i.jsx)(Jg,{css:{left:"299px",top:"412px"},name:"SALON PRESTIGE"})]}),(0,i.jsx)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/hbc/ldc/2025/bg_badge_verso.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:476,width:363})]})},ep=["TERRAIN","VESTIAIRES","ESPACE PRESSE","SALON NEODIF","SALON GEOFIT","SALON PRESTIGE"],tp={TERRAIN:"Mode_Isolation_1.png",VESTIAIRES:"Mode_Isolation_2.png","ESPACE PRESSE":"Mode_Isolation_3.png","SALON NEODIF":"Mode_Isolation_4.png","SALON GEOFIT":"Mode_Isolation_5.png","SALON PRESTIGE":"Mode_Isolation_6.png"},np=({css:e,name:t})=>(0,i.jsx)(fr,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/hbc/lnh/${tp[t]}) no-repeat`,backgroundSize:"cover",height:"47px",position:"absolute",top:"463px",width:"47px",...e}}),ip=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,o=n.fields?.cf38222?.value,s=t.accreditationsUsersInfos.reduce((e,t)=>ep.includes((t.accreditation?.name||"").toUpperCase())?{...e,[t.accreditation.name]:!0}:e,{});return(0,i.jsxs)(Ea,{css:{fontFamily:"$zuumeMedium",position:"relative"},height:Mm,width:Nm,children:[(0,i.jsx)(fr,{css:{left:"52px",position:"absolute",top:"205px"},height:111,width:111,children:h(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(fr,{css:{left:"69px",position:"absolute",top:"317px"},textAlign:"center",width:77,children:n.id}),(0,i.jsx)(fr,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"205px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(fr,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"229px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(fr,{css:{fontFamily:"$zuumeBold",fontSize:"25px",fontWeight:"700",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"261px"},children:n.fields.cf38077?.value}),(0,i.jsx)(fr,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",textDecoration:"uppercase",top:"298px"},children:o}),s.TERRAIN&&(0,i.jsx)(np,{css:{left:"45px"},name:"TERRAIN"}),s.VESTIAIRES&&(0,i.jsx)(np,{css:{left:"96px"},name:"VESTIAIRES"}),s["ESPACE PRESSE"]&&(0,i.jsx)(np,{css:{left:"149px"},name:"ESPACE PRESSE"}),s["SALON NEODIF"]&&(0,i.jsx)(np,{css:{left:"201px"},name:"SALON NEODIF"}),s["SALON GEOFIT"]&&(0,i.jsx)(np,{css:{left:"253px"},name:"SALON GEOFIT"}),s["SALON PRESTIGE"]&&(0,i.jsx)(np,{css:{left:"306px"},name:"SALON PRESTIGE"})]})},op=e=>{switch(e){case"ORGA":return`${R.HEAVENT_ASSETS_URL}/badges/lnh/Orga_Recto_v2.jpg`;case"Bénévoles":return`${R.HEAVENT_ASSETS_URL}/badges/lnh/Benevole_Recto.jpg`;case"MEDIA PRESSE":return`${R.HEAVENT_ASSETS_URL}/badges/lnh/Media_presse_Recto.jpg`;case"MEDIA PHOTOGRAPHE":return`${R.HEAVENT_ASSETS_URL}/badges/lnh/Media_Photo_Recto.jpg`;case"EQUIPES":return`${R.HEAVENT_ASSETS_URL}/badges/lnh/Equipe_Recto.jpg`;case"VIP":return`${R.HEAVENT_ASSETS_URL}/badges/lnh/VIP_recto.jpg`;default:return""}},sp=e=>{switch(e){case"ORGA":return"#6f2c91";case"Bénévoles":return"#72BF44";case"MEDIA PRESSE":return"#294EA2";case"MEDIA PHOTOGRAPHE":return"#ED1C24";case"EQUIPES":return"#EBCB00";case"VIP":return"#F7941D";default:return""}},rp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=hg(n.fields,"population",""),s=t.positionsSlotsUsersInfos[0]?.position?.name||"",r=(0,Oo.A)((0,Da.A)(t.accreditationsUsersInfos.map(e=>e.accreditation.acronym))),a="Bénévoles"===o?s:"ORGA"===o?n.fields.cf36081?.value:"EQUIPES"===o?n.fields?.cf36079?.value:"MEDIA PRESSE"===o||"MEDIA PHOTOGRAPHE"===o?n.fields?.cf36082?.value:"VIP"===o?n.fields?.cf36085?.value:"";return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Ea,{css:{background:`url(${op(o)}) no-repeat`,backgroundSize:"cover",fontFamily:"$tuskerGrotesk",fontWeight:"500",position:"relative"},height:321,width:212,children:[(0,i.jsx)(fr,{css:{left:"125px",position:"absolute",top:"30px"},height:58,width:58,children:h(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(fr,{css:{fontSize:"11px",left:"39px",position:"absolute",textTransform:"uppercase",top:"127px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(fr,{css:{fontSize:"11px",left:"39px",position:"absolute",textTransform:"uppercase",top:"156px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(fr,{css:{fontSize:"11px",left:"39px",position:"absolute",textTransform:"uppercase",top:"186px"},children:a}),(0,i.jsx)(Ea,{css:{gap:"2px",left:"31px",position:"absolute",top:"241px"},children:(0,vc.A)(1,9).map(e=>(0,i.jsx)(Ea,{align:"center",css:{background:"white",borderRadius:"17px",color:sp(o),fontFamily:"$gilroy",fontSize:"7px",fontWeight:"700",visibility:r.includes(e.toString(10))?"visible":"hidden"},height:17,justify:"center",width:17,children:e},e))})]})})},ap=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=Object.values((0,Kd.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.startOf("day").toMillis()));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/moorea/contremarque.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$unbounded",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsxs)(Ea,{css:{color:"$gray800",fontSize:"22px",fontWeight:"700",left:"96px",position:"absolute",top:"239px"},direction:"column",children:[(0,i.jsx)(fr,{children:n.fields?.firstName?.value||""}),(0,i.jsx)(fr,{children:n.fields?.lastName?.value||""})]}),(0,i.jsx)(fr,{css:{position:"absolute",right:"96px",top:"222px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsxs)(fr,{color:"gray800",css:{fontSize:"12px",left:"96px",position:"absolute",top:"548px"},children:["Chèr.e ",n.fields?.firstName?.value||"",","]})]}),(0,i.jsx)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/moorea/Planning.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$unbounded",pageBreakBefore:"always",position:"relative"},height:Dm,width:Fm,children:(0,i.jsx)(Ea,{css:{left:"92px",position:"absolute",top:"372px"},direction:"column",gap:"6",children:o.map((e,t)=>{const n=e[0];return(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(fr,{css:{color:"#a26fd2",fontSize:"16px",fontWeight:"700",textTransform:"uppercase"},children:n.positionSlot.range.start.toFormat("cccc dd MMMM yyyy",{locale:"fr"})}),e.map(({position:e,positionSlot:{range:t}},n)=>(0,i.jsxs)(fr,{children:[e.name," / ",t.start.toFormat("HH:mm"),"-",t.end.toFormat("HH:mm")]},n))]},t)})})})]})},lp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo;return(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/nuitssecretes/background.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$poppins",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsx)(fr,{css:{fontSize:"28px",fontWeight:"700",position:"absolute",textAlign:"center",top:"545px"},width:1,children:n.fields?.firstName?.value||""}),(0,i.jsx)(fr,{css:{fontSize:"28px",fontWeight:"700",position:"absolute",textAlign:"center",top:"584px"},width:1,children:n.fields?.lastName?.value||""}),(0,i.jsxs)(Ea,{align:"center",css:{position:"absolute",top:"654px"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(fr,{height:94,width:94,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:94,width:94}),width:"100%"})}),(0,i.jsx)(fr,{css:{fontSize:"10px"},children:t.ticketId})]})]})},dp=e=>{switch(e){case"PARTENAIRE":return`${R.HEAVENT_ASSETS_URL}/badges/openbrest/v2/VIP@3x.jpg`;case"PARTENAIRE - Fast Pass":default:return"";case"VIP LOGES":case"VIP LOGES Fast Pass":return`${R.HEAVENT_ASSETS_URL}/badges/openbrest/v2/vip_loges.png`;case"ADMINISTRATEUR":return`${R.HEAVENT_ASSETS_URL}/badges/openbrest/v2/ADMIN@3x.png`;case"MÉDIAS - JOURNALISTE":return`${R.HEAVENT_ASSETS_URL}/badges/openbrest/v2/MEDIAS_JOURNALISTE@3x.png`;case"MÉDIAS - PHOTOGRAPHE":return`${R.HEAVENT_ASSETS_URL}/badges/openbrest/v2/MEDIAS_PHOTOGRAPHE@3x.png`;case"BÉNÉVOLES":return`${R.HEAVENT_ASSETS_URL}/badges/openbrest/v2/STAFF@3x.png`;case"CHAUFFEUR":return`${R.HEAVENT_ASSETS_URL}/badges/openbrest/v2/CHAUFFEUR@3x.png`;case"RAMASSEUR DE BALLES":return`${R.HEAVENT_ASSETS_URL}/badges/openbrest/v2/ramasseurs.png`;case"JUGE DE LIGNE":return`${R.HEAVENT_ASSETS_URL}/badges/openbrest/v2/juge_lignes.png`;case"OFFICIEL ATP":return`${R.HEAVENT_ASSETS_URL}/badges/openbrest/v2/OFFICIEL@3x.png`;case"ORGANISATION":return`${R.HEAVENT_ASSETS_URL}/badges/openbrest/v2/ORGANISATION@3x.png`;case"PRESTATAIRE":return`${R.HEAVENT_ASSETS_URL}/badges/openbrest/v2/PRESTATAIRE@3x.png`;case"JOUEUR":return`${R.HEAVENT_ASSETS_URL}/badges/openbrest/v2/PLAYER@3x.png`;case"COACH":return`${R.HEAVENT_ASSETS_URL}/badges/openbrest/v2/COACH@3x.png`;case"GUEST":return`${R.HEAVENT_ASSETS_URL}/badges/openbrest/v2/GUEST@3x.png`;case"SUPERVISEUR":return`${R.HEAVENT_ASSETS_URL}/badges/openbrest/v2/supervisor_atp.png`}},cp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=n.fields?.cf31279?.value??"",s="OFFICIEL ATP"===o||"ORGANISATION"===o||"ADMINISTRATEUR"===o||"PRESTATAIRE"===o||"MÉDIAS - PHOTOGRAPHE"===o||"MÉDIAS - JOURNALISTE"===o||"VIP LOGES"===o||"VIP LOGES Fast Pass"===o||"PARTENAIRE"===o?`${n.fields?.firstName?.value||""} ${n.fields?.lastName?.value||""}`:n.fields?.firstName?.value||"",r="OFFICIEL ATP"===o||"ORGANISATION"===o?n.fields?.cf36132?.value:"ADMINISTRATEUR"===o||"PRESTATAIRE"===o||"MÉDIAS - PHOTOGRAPHE"===o||"MÉDIAS - JOURNALISTE"===o||"VIP LOGES"===o||"VIP LOGES Fast Pass"===o||"PARTENAIRE"===o?n.fields?.cf31319?.value:(n.fields?.lastName?.value||"").toUpperCase();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:`url(${dp(o)}) no-repeat`,backgroundSize:"cover",fontFamily:"$sharpGrotesk",position:"relative"},height:331,width:208,children:[(0,i.jsx)(fr,{css:{borderRadius:"$1",left:"61px",overflow:"hidden",position:"absolute",top:"169px"},height:80,width:80,children:h(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(fr,{css:{color:"white",fontWeight:"600",position:"absolute",top:"285px"},textAlign:"center",width:1,children:s}),(0,i.jsx)(fr,{css:{color:"white",fontWeight:"600",position:"absolute",top:"301px"},textAlign:"center",width:1,children:r})]}),(0,i.jsx)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/openbrest/v2/VERSO@3x.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:331,width:208,children:(0,i.jsx)(fr,{css:{left:"59px",position:"absolute",top:"115px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:90,width:90}),width:"100%"})})})]})},up=e=>{const t=e.event.volunteerRegistration.userInfo,n=t.fields.phone?.internationalFormat||"";return(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/p2n/planning_masque.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},direction:"column",height:Dm,width:Fm,children:[(0,i.jsx)(fr,{css:{left:"48px",position:"absolute",top:"47px"},children:(0,i.jsx)(Fg,{email:t.email,image:t.fields?.picture?.url,name:t.name,size:40})}),(0,i.jsxs)(Ea,{css:{left:"104px",position:"absolute",top:"45px"},direction:"column",children:[(0,i.jsx)(fr,{css:{color:"$gray800",fontSize:"16px",fontWeight:"600"},children:t.name}),(0,i.jsx)(fr,{color:"gray800",children:n})]}),(0,i.jsx)(fr,{css:{color:"black",fontSize:"24px",fontWeight:"700",position:"absolute",top:"112px"},textAlign:"center",width:1,children:e.title}),(0,i.jsx)(Ea,{css:{gap:"28px",flex:"1",left:"48px",position:"absolute",top:"172px",width:"calc(100% - 96px)"},direction:"column",children:e.children})]})},hp=Fo.IX.fromDateTimes(Fo.c9.fromObject({year:2025,month:6,day:6}).startOf("day"),Fo.c9.fromObject({year:2025,month:6,day:8}).endOf("day"));var mp;function gp(){return gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=Nn($c),n=e.psui.position,o=n.category,s=e.psui.positionSlot,r=(0,Zd.A)((0,Ju.A)(n.leaders.concat(o.leaders),e=>e.userInfo.id),e=>e.userInfo.name).map(e=>e.userInfo.name).join(", ");return(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{css:{color:"black",fontWeight:"700",textTransform:"uppercase"},children:t.toLocaleString(s.range.start,Ho.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(Ea,{align:"center",css:{"& svg":{fill:"black",height:"100%",width:"100%"}},height:16,justify:"center",width:16,children:(0,i.jsx)(pp,{})}),(0,i.jsxs)(fr,{color:"gray800",children:[(0,i.jsx)(Pm,{css:{fontWeight:"600"},children:n.name})," | De"," ",s.range.start.toFormat("H:mm")," à ",s.range.end.toFormat("H:mm")]})]}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{gap:"2",children:[(0,i.jsx)(Ea,{align:"center",css:{"& svg":{fill:"black",height:"100%",width:"100%"}},height:16,justify:"center",width:16,children:(0,i.jsx)(_p,{})}),(0,i.jsxs)(fr,{color:"gray800",children:[(0,i.jsx)(Pm,{css:{fontWeight:"600"},children:"Responsable : "}),r]})]}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{css:{color:"black"},children:(0,i.jsx)(ng,{css:{"& > p:first-child":{marginTop:0},"& > p:last-child":{marginBottom:0}},text:n.description})})]})},vp=e=>{const t=e.event.volunteerRegistration,[n,o]=(0,Nu.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.overlaps(hp));return(0,i.jsx)(i.Fragment,{children:Zo(n)&&(0,i.jsx)(up,{event:e.event,title:"Planning P2N 2025",children:(0,Zd.A)(n,({positionSlot:e})=>e.range.start.toMillis()).map(e=>(0,i.jsx)(Ip,{psui:e},e.id))})})},bp=e=>{const t=Nn($c);return(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(fr,{css:{color:"black",fontWeight:"700",textTransform:"uppercase"},children:e.psuis[0].position.name}),(0,Zd.A)(e.psuis,e=>e.positionSlot.range.start.toMillis()).map(e=>{const n=e.positionSlot;return(0,i.jsxs)(fr,{color:"gray800",css:{fontSize:"16px"},children:[(0,i.jsx)(Pm,{css:{fontWeight:"600",textTransform:"capitalize"},children:t.toLocaleString(n.range.start,{month:"long",day:"numeric",weekday:"long"})})," ","| De ",n.range.start.toFormat("H:mm")," à"," ",n.range.end.toFormat("H:mm")]},e.id)})]})},jp=e=>{const t=e.event.volunteerRegistration,[n,o]=(0,Nu.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.overlaps(hp)),s=(0,Zd.A)(Object.entries((0,Kd.A)(o,e=>e.position.name)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:Zo(o)&&(0,i.jsx)(up,{event:e.event,title:"Planning Montage/ Démontage P2N 2025",children:s.map(([e,t],n)=>(0,i.jsx)(bp,{psuis:t},n))})})},Cp=e=>{switch(e){case"BACKSTAGE":return`${R.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Backstage.png`;case"ALL ACCES":return`${R.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Orga_All_access.png`;case"BÉNÉVOLE":return`${R.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Benevole.png`;case"GENDARME":return`${R.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Gendarme.png`;case"MÉDIA":return`${R.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Media.png`;case"PARTENAIRE":return`${R.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Partenaire.png`;case"POMPIER":return`${R.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Pompier.png`;case"PRESTATAIRE":return`${R.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Prestataire.png`;case"PRÉVENTION":return`${R.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Prevention.png`;case"SÉCURITÉ":return`${R.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Securite.png`;default:return""}},yp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=3613===e.event.id?2434:2081,s=(0,Zd.A)(t.accreditationsUsersInfos.filter(({accreditation:e})=>e.id===o),e=>e.accreditationSlot.date?.toMillis()??0).map(({accreditationSlot:e})=>e.name).join(""),r=n.fields?.cf26723?.value??"";return(0,i.jsxs)(Ea,{css:{background:`url(${Cp(r)}) no-repeat`,backgroundSize:"cover",fontFamily:"$now",position:"relative"},height:325,width:208,children:[(0,i.jsx)(fr,{css:{color:"black",fontFamily:"$nowMedium",fontSize:"16px",fontWeight:"600",position:"absolute",textAlign:"center",textTransform:"uppercase",top:"111px",width:"100%"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(fr,{css:{color:"black",fontFamily:"$nowMedium",fontSize:"16px",fontWeight:"600",position:"absolute",textAlign:"center",textTransform:"uppercase",top:"139px",width:"100%"},children:n.fields?.lastName?.value||""}),(0,i.jsxs)(Ea,{align:"center",css:{position:"absolute",top:"170px",width:"100%"},children:[(0,i.jsx)(fr,{css:{color:"black",flex:"1",fontFamily:"$nowMedium",fontSize:"16px",fontWeight:"600",textAlign:"center"},children:s}),(0,i.jsx)(Ea,{css:{paddingRight:"5px"},width:169,children:(0,i.jsx)(fr,{height:26,width:1,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{barcodeType:qm.Code39,height:26,width:164}),width:"100%"})})})]}),["PRESTATAIRE","PRÉVENTION","SÉCURITÉ"].some(e=>e===r)&&(0,i.jsx)(Ea,{align:"center",css:{position:"absolute",top:"249px",width:"100%"},children:(0,i.jsx)(fr,{css:{color:"white",flex:"1",fontFamily:"$kobe",fontSize:"12px",fontWeight:"900",lineHeight:"12.78px",margin:"0 53px",textAlign:"center"},children:e.event.volunteerRegistration.delegation?.name.toUpperCase()})})]})},kp=e=>e.includes("BLEU_CLAIR")?`${R.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/bleu_clair_verso.jpg`:e.includes("BLEU_FONCE")?`${R.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/bleu_fonce_verso.jpg`:e.includes("JAUNE")?`${R.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/jaune_verso.jpg`:e.includes("ORANGE")?`${R.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/orange_verso.jpg`:e.includes("VERT")?`${R.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/vert_verso.jpg`:e.includes("VIOLET")?`${R.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/violet_verso.jpg`:"",Ap=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=t.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym),s=n.fields?.cf1019?.value;return(0,i.jsx)(Ea,{css:{background:`url(${kp(o)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:476,width:368,children:(0,i.jsx)(Ea,{align:"center",css:{color:"black",fontSize:"16px",fontWeight:"700",height:"39px",left:"29px",position:"absolute",top:"31px",width:"40px"},justify:"center",children:s})})},wp=e=>e.includes("BLEU_CLAIR")?`${R.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/bleu_clair/bleu_clair_recto.jpg`:e.includes("BLEU_FONCE")?`${R.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/bleu_fonce/bleu_fonce_recto.jpg`:e.includes("JAUNE")?`${R.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/jaune/jaune_recto.jpg`:e.includes("ORANGE")?`${R.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/orange/orange_recto.jpg`:e.includes("VERT")?`${R.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/vert/vert_recto.jpg`:e.includes("VIOLET")?`${R.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/violet/violet_recto.jpg`:"",Sp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=t.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym),s=(0,Oo.A)(t.positionsSlotsUsersInfos.map(e=>e.position.name)),r=o.includes("JAUNE")||o.includes("BLEU_CLAIR")?"black":"white",a=n.fields?.cf20600?.value??"",l=n.fields?.cf21104?.value??"",d=n.fields?.cf21129?.value??[];return(0,i.jsxs)(Ea,{css:{background:`url(${wp(o)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:476,width:368,children:[(0,i.jsx)(fr,{css:{position:"absolute",right:"40px",top:"43px"},height:65,width:65,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:65,width:65}),width:"100%"})}),(0,i.jsx)(fr,{css:{borderRadius:"107px",height:"107px",left:"131px",overflow:"hidden",position:"absolute",top:"127px",width:"107px"},children:n.fields?.picture&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(fr,{css:{color:r,fontSize:"18px",fontWeight:"700",position:"absolute",textAlign:"center",top:"242px",width:"100%"},children:n.name}),(0,i.jsx)(Ea,{css:{color:r,fontSize:"12px",gap:"2px",position:"absolute",top:"271px",width:"100%"},direction:"column",children:t.state===Et.NotApplicable||"Intervenant"===a?(0,i.jsx)(fr,{textAlign:"center",width:1,children:l}):"Direction"===a?Zo(d)?d.map((e,t)=>(0,i.jsx)(fr,{textAlign:"center",width:1,children:e},t)):null:s.map((e,t)=>(0,i.jsx)(fr,{textAlign:"center",width:1,children:e},t))}),(0,i.jsx)(fr,{css:{color:r,fontSize:"32px",fontWeight:"700",position:"absolute",textAlign:"center",textTransform:"uppercase",top:"364px",width:"100%"},children:a})]})},Ep=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sp,{event:e.event}),(0,i.jsx)(Ap,{event:e.event})]}),Tp=e=>{const t=e.psuis[0].position,n=(0,Zd.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),o=e.userInfo,s=t.leaders[0],r=t.leaders[1];return(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/paris20km/2024/assignment_v2.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$avenir",fontWeight:"500",pageBreakBefore:"always",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsx)(fr,{css:{borderRadius:"5px",left:"67px",overflow:"hidden",position:"absolute",top:"212px"},height:74,width:74,children:h(o.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:o.fields.picture.url,width:"100%"})}),(0,i.jsx)(fr,{css:{color:"white",fontSize:"15px",fontWeight:"900",left:"27px",position:"absolute",textTransform:"uppercase",top:"295px"},textAlign:"center",width:155,children:o.fields?.firstName?.value||""}),s&&(0,i.jsxs)(Ea,{align:"center",css:{color:"#00535e",gap:"2px",fontSize:"16px",fontWeight:"900",left:"12px",position:"absolute",top:"815px"},direction:"column",width:185,children:[(0,i.jsx)(fr,{children:s.userInfo.firstName}),(0,i.jsx)(fr,{children:s.userInfo.lastName}),(0,i.jsx)(fr,{children:s.userInfo.phone?.internationalFormat})]}),r&&(0,i.jsxs)(Ea,{align:"center",css:{color:"#00535e",gap:"2px",fontSize:"16px",fontWeight:"900",left:"12px",position:"absolute",top:"932px"},direction:"column",width:185,children:[(0,i.jsx)(fr,{children:r.userInfo.firstName}),(0,i.jsx)(fr,{children:r.userInfo.lastName}),(0,i.jsx)(fr,{children:r.userInfo.phone?.internationalFormat})]}),(0,i.jsxs)(Ea,{css:{left:"210px",padding:"24px 40px 0 40px",position:"absolute",top:"170px"},direction:"column",width:584,children:[(0,i.jsx)(Ea,{align:"center",css:{color:"#d7531e",fontSize:"18px",fontWeight:"900",textTransform:"uppercase"},height:38,justify:"center",width:1,children:t.name}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(fr,{css:{fontSize:"16px",fontWeight:"900"},children:"Date de ta mission :"}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Ea,{direction:"column",gap:"1",children:n.map((e,t)=>{const n=e.range.start,o=e.range.end,s=n.startOf("day").toMillis()===o.startOf("day").toMillis();return(0,i.jsxs)(fr,{css:{color:"#333333"},children:[n.toFormat("d MMMM yyyy HH:mm",{locale:"fr"})," -"," ",s?o.toFormat("HH:mm"):o.toFormat("d MMMM yyyy HH:mm",{locale:"fr"})]},t)})}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{css:{fontSize:"16px",fontWeight:"900"},children:"Détails de ta mission :"}),(0,i.jsx)(Pa,{height:"2"}),h(t.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fr,{css:{color:"black","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(ng,{text:t.description})})}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{css:{fontSize:"16px",fontWeight:"900"},children:"Lieu de rendez-vous :"}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{children:t.address}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{height:180,width:1,children:(0,i.jsx)("a",{href:ig(t.latitude,t.longitude),style:{background:`url(${R.HEAVENT_API_URL}/image/event/${e.eventId}/position/${t.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),h(t.fields.cf38416)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(fr,{children:t.fields.cf38416})]})]})]})},zp=e=>{const t=Qm(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,null).filter(({position:e})=>e.tags.some(e=>"Fiche personnalisée"===e.name)),n=(0,Zd.A)(Object.entries((0,Kd.A)(t,({position:e})=>e.id)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:n.map(([t,n],o)=>(0,i.jsx)(Tp,{eventId:e.event.id,psuis:n,userInfo:e.event.volunteerRegistration.userInfo},o))})},$p=e=>{const t=e.event.volunteerRegistration,n=t.userInfo;return(0,i.jsxs)(Ea,{css:{background:`url(${o=e.event.id,4183===o?`${R.HEAVENT_ASSETS_URL}/badges/paris20km/2024/accreditation_vip.jpg`:3694===o?`${R.HEAVENT_ASSETS_URL}/badges/paris20km/2024/intervenant.jpg`:""}) no-repeat`,backgroundSize:"cover",fontFamily:"$avenir",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsxs)(Ea,{css:{fontSize:"24px",fontWeight:"900",left:"80px",lineHeight:"28px",position:"absolute",top:"261px"},direction:"column",children:[(0,i.jsx)(fr,{children:n.fields?.firstName?.value||""}),(0,i.jsx)(fr,{children:n.fields?.lastName?.value||""})]}),(0,i.jsxs)(fr,{css:{color:"#d8541d",fontSize:"20px",fontWeight:"800",left:"80px",position:"absolute",top:"325px"},children:[(0,i.jsxs)(Pm,{css:{color:"black",fontWeight:"400"},children:[4183===e.event.id?"VIP":"Intervenant"," |"]})," ",n.fields.cf21104?.value]}),(0,i.jsx)(fr,{css:{position:"absolute",right:"80px",top:"261px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:90,width:90}),width:"100%"})})]});var o},Op=()=>(0,i.jsx)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/pastourelle2024/Badge_verso.png) no-repeat`,backgroundSize:"cover",overflow:"hidden",pageBreakBefore:"always",position:"relative"},direction:"column",height:597,width:435,children:(0,i.jsx)(fr,{css:{height:"518px",left:"25px",position:"absolute",top:"15px",width:"385px"},children:(0,i.jsx)("img",{height:"100%",src:`${R.HEAVENT_ASSETS_URL}/badges/pastourelle2024/contact.png`,width:"100%"})})});var Rp;function Pp(){return Pp=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.jsx)(Ea,{css:{position:"absolute",px:"34px",top:"516px"},justify:"between",width:1,children:e.event.volunteerRegistration.accreditationsUsersInfos.map((e,t)=>{const n=sx(e.accreditation.icon),o=Md(e.accreditation.color);return(0,i.jsxs)(Ea,{align:"center",direction:"column",gap:"1",justify:"center",width:75,children:[(0,i.jsx)(Ea,{align:"center",css:{background:e.accreditation.color,borderRadius:"$1","& svg":{fill:o,height:"50%",width:"50%"}},height:24,justify:"center",width:24,children:(0,i.jsx)(n,{})}),(0,i.jsx)(fr,{color:"gray800",css:{fontSize:"10px"},fontWeight:"medium",textAlign:"center",children:e.accreditation.name})]},t)})}),ax=e=>{const t=Nn($c),n=Nn(Ku),o=e.event.volunteerRegistration.userInfo,s=(0,Zd.A)(Object.values((0,Kd.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.startOf("day").toISO())),e=>e[0].positionSlot.range.start.startOf("day").toMillis()),r=(0,tr.A)(Ho.DateOnly.WeekdayLongMonthLong,"year"),a=o.fields?.cf16442?.value??"";return(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/pastourelle2024/Badge_orga-bene_recto.png) no-repeat`,backgroundSize:"cover",overflow:"hidden",position:"relative"},direction:"column",height:597,width:434,children:[(0,i.jsx)(fr,{color:"gray500",css:{fontSize:"12px",fontWeight:"500",position:"absolute",top:"248px"},textAlign:"center",width:1,children:o.name}),(0,i.jsx)(fr,{css:{position:"absolute",textTransform:"uppercase",top:"268px"},font:"gray800 displayXs bold",textAlign:"center",width:1,children:a||"Bénévole"}),(0,i.jsx)(Ea,{css:{position:"absolute",px:"60px",top:"312px"},direction:"column",gap:"2",children:s.map((e,o)=>(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{color:"gray800",css:{fontSize:"10px",textTransform:"capitalize"},children:t.toLocaleString(e[0].positionSlot.range.start,r)}),e.map((e,t)=>(0,i.jsxs)(fr,{color:"gray800",css:{fontSize:"10px"},fontWeight:"semiBold",children:[e.position.name," :"," ",n.toLocaleString(e.positionSlot.range,{locale:"fr-FR"},{hour:"numeric",minute:"numeric"})]},t))]},o))}),(0,i.jsx)(rx,{event:e.event})]})},lx=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ax,{event:e.event}),(0,i.jsx)(Op,{})]}),dx=()=>(0,i.jsx)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/pastourelle2024/Badge_verso.png) no-repeat`,backgroundSize:"cover",overflow:"hidden",pageBreakBefore:"always",position:"relative"},direction:"column",height:597,width:435,children:(0,i.jsx)(fr,{css:{height:"472px",left:"29px",position:"absolute",top:"45px",width:"376px"},children:(0,i.jsx)("img",{height:"100%",src:`${R.HEAVENT_ASSETS_URL}/badges/pastourelle2024/programme.png`,width:"100%"})})}),cx=e=>{const t=e.event.volunteerRegistration.userInfo,n=t.fields?.cf16442?.value??"";return(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/pastourelle2024/Badge_presta_recto.png) no-repeat`,backgroundSize:"cover",overflow:"hidden",position:"relative"},direction:"column",height:597,width:435,children:[(0,i.jsx)(fr,{css:{position:"absolute",textTransform:"uppercase",top:"430px"},font:"gray800 displayXs bold",textAlign:"center",width:1,children:n}),(0,i.jsx)(rx,{event:e.event})]})},ux=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cx,{event:e.event}),(0,i.jsx)(dx,{})]}),hx=({date:e})=>(0,i.jsxs)(Ea,{align:"center",css:{border:"1px solid black",borderRadius:"$1",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(fr,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("d")}),(0,i.jsx)(fr,{css:{fontSize:"10px",fontWeight:"500",textTransform:"uppercase"},children:e.toFormat("MMM",{locale:"fr"})})]}),mx=e=>e?`${R.HEAVENT_ASSETS_URL}/badges/pec/accorArena/bg_accor_v7.jpg`:`${R.HEAVENT_ASSETS_URL}/badges/pec/adidasArena/bg_adidas_v1.jpg`,gx=e=>(0,Zd.A)((0,Ju.A)(e.map(([e,t])=>t.startOf("day")),e=>e.toMillis()),e=>e.toMillis()),px=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=e.event.tags.some(e=>"🏟️ Accor Arena"===e.name),s=(0,Da.A)(t.accreditationsUsersInfos.map(e=>e.accreditation.acronym)),r=(0,Kd.A)(t.accreditationsUsersInfos.flatMap(e=>"Parking"!==e.accreditationCategory.name&&e.accreditationSlot.date?.isValid?[[e.accreditation.name,e.accreditationSlot.date]]:[]),([e])=>e),a=(0,Zd.A)((0,Ju.A)(t.accreditationsUsersInfos.flatMap(e=>"PARK 30"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),l=(0,Zd.A)((0,Ju.A)(t.accreditationsUsersInfos.flatMap(e=>"PARK 38"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),d=(0,Zd.A)((0,Ju.A)(t.accreditationsUsersInfos.flatMap(e=>"Liv. P30"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),c=(0,Zd.A)((0,Ju.A)(t.accreditationsUsersInfos.flatMap(e=>"Liv. P38"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),u=(0,Zd.A)((0,Ju.A)(t.accreditationsUsersInfos.flatMap(e=>"PKG"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),m=(0,Zd.A)((0,Ju.A)(t.accreditationsUsersInfos.flatMap(e=>"PL"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),g=Zo(a)||Zo(l)||Zo(d)||Zo(c)||Zo(u)||Zo(m),p=t.positionsSlotsUsersInfos[0],f=n.fields?.cf37410?.value??"",x=t.ticketId;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:`url(${mx(o)}) no-repeat`,backgroundSize:"cover",fontFamily:o?"$montserrat":"$franklinGothic",position:"relative"},height:Dm,width:Fm,children:[h(e.options.header?.content)&&(0,i.jsx)(fr,{css:{borderTopLeftRadius:"10px",borderTopRightRadius:"10px",left:"44px",overflow:"hidden",position:"absolute",top:"40px"},height:217,width:706,children:(0,i.jsx)("img",{height:"100%",src:e.options.header.content,width:"100%"})}),(0,i.jsx)(fr,{css:{left:"92px",position:"absolute",top:"285px"},children:(0,i.jsx)(Fg,{email:n.email,image:n.fields?.picture?.url,name:n.name,size:56})}),(0,i.jsx)(fr,{css:{color:"black",fontSize:"22px",fontWeight:"700",left:"172px",position:"absolute",top:"296px"},children:n.name}),(0,i.jsx)(fr,{css:{color:"#0000e3",fontSize:"18px",fontWeight:"700",left:"172px",position:"absolute",top:"324px"},children:t.delegation?.name??""}),(0,i.jsx)(fr,{css:{left:"614px",position:"absolute",top:"281px"},height:80,width:80,children:h(x)&&(0,i.jsx)("img",{height:"100%",src:Ym(x,{height:80,width:80}),width:"100%"})}),(0,i.jsx)(Ea,{css:{gap:"10px",left:"92px",position:"absolute",top:o?"521px":"501px"},width:610,wrap:"wrap",children:Object.entries(r).map(([e,t])=>(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:300,children:[(0,i.jsx)(fr,{css:{fontWeight:"600"},children:e}),(0,i.jsx)(Ea,{css:{gap:"6px"},width:300,wrap:"wrap",children:gx(t).map(e=>(0,i.jsx)(hx,{date:e},e.toMillis()))})]},`group-${t[0]}`))}),g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{lineHeight:"20px",left:"92px",position:"absolute",top:o?"643px":"623px"},direction:"column",children:[(0,i.jsx)(fr,{fontWeight:"semiBold",children:"Plaque d'immatriculation"}),(0,i.jsx)(fr,{children:n.fields.cf29549?.value})]}),(0,i.jsxs)(Ea,{css:{lineHeight:"20px",left:"402px",position:"absolute",top:o?"643px":"623px"},direction:"column",children:[(0,i.jsx)(fr,{fontWeight:"semiBold",children:"Type de véhicule"}),(0,i.jsx)(fr,{children:f})]}),(0,i.jsxs)(Ea,{css:{lineHeight:"20px",left:"92px",position:"absolute",top:"699px",visibility:Zo(a)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{fontWeight:"semiBold",children:"Parking Porte 30"}),(0,i.jsx)(Ea,{css:{gap:"6px"},width:300,wrap:"wrap",children:a.map(e=>(0,i.jsx)(hx,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Ea,{css:{lineHeight:"20px",left:"402px",position:"absolute",top:"699px",visibility:Zo(l)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{fontWeight:"semiBold",children:"Parking Porte 38"}),(0,i.jsx)(Ea,{css:{gap:"6px"},width:300,wrap:"wrap",children:l.map(e=>(0,i.jsx)(hx,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Ea,{css:{lineHeight:"20px",left:"92px",position:"absolute",top:"699px",visibility:Zo(d)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{fontWeight:"semiBold",children:"Livraison Porte 30"}),(0,i.jsx)(Ea,{css:{gap:"6px"},width:300,wrap:"wrap",children:d.map(e=>(0,i.jsx)(hx,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Ea,{css:{lineHeight:"20px",left:"402px",position:"absolute",top:"699px",visibility:Zo(c)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{fontWeight:"semiBold",children:"Livraison Porte 38"}),(0,i.jsx)(Ea,{css:{gap:"6px"},width:300,wrap:"wrap",children:c.map(e=>(0,i.jsx)(hx,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Ea,{css:{lineHeight:"20px",left:"92px",position:"absolute",top:"679px",visibility:Zo(u)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{fontWeight:"semiBold",children:"Parking Privé"}),(0,i.jsx)(Ea,{css:{gap:"6px"},width:300,wrap:"wrap",children:u.map(e=>(0,i.jsx)(hx,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Ea,{css:{lineHeight:"20px",left:"402px",position:"absolute",top:"679px",visibility:Zo(m)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{fontWeight:"semiBold",children:"Aire de livraison :"}),(0,i.jsx)(Ea,{css:{gap:"6px"},width:300,wrap:"wrap",children:m.map(e=>(0,i.jsx)(hx,{date:e},e.toMillis()))})]})]}):(0,i.jsx)(Ea,{align:"center",css:{fontWeight:"600",left:"97px",position:"absolute",top:"643px"},height:104,justify:"center",width:600,children:"Aucun véhicule autorisé"}),(0,i.jsxs)(Ea,{css:{gap:"10px",left:"92px",position:"absolute",top:o?"817px":"795px"},direction:"column",width:219,children:[s.includes("P38")&&(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{css:{fontWeight:"600"},children:"Porte 38 (selon horaire)"}),(0,i.jsx)(fr,{children:"Accor Arena"}),(0,i.jsx)(fr,{children:"8 Bd de Bercy,"}),(0,i.jsx)(fr,{children:"75012 Paris"})]}),s.includes("P30")&&(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{css:{fontWeight:"600"},children:"Porte 30"}),(0,i.jsx)(fr,{children:"Accor Arena"}),(0,i.jsx)(fr,{children:"222 Quai de Bercy,"}),(0,i.jsx)(fr,{children:"75012 Paris"})]}),s.includes("P4")&&(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{css:{fontWeight:"600"},children:"Porte 4"}),(0,i.jsx)(fr,{children:"Accor Arena"}),(0,i.jsx)(fr,{children:"8 Bd de Bercy,"}),(0,i.jsx)(fr,{children:"75012 Paris"})]}),s.includes("P35/36")&&(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{css:{fontWeight:"600"},children:"Porte 35/36"}),(0,i.jsx)(fr,{children:"Accor Arena"}),(0,i.jsx)(fr,{children:"Boulevard de Bercy,"}),(0,i.jsx)(fr,{children:"75012 Paris"})]}),s.includes("P28")&&(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{css:{fontWeight:"600"},children:"Porte 35/36"}),(0,i.jsx)(fr,{children:"Accor Arena"}),(0,i.jsx)(fr,{children:"222 Quai de Bercy,"}),(0,i.jsx)(fr,{children:"75012 Paris"})]}),s.includes("PP+PM")&&(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{css:{fontWeight:"600"},children:"Accès principal"}),(0,i.jsx)(fr,{children:"Avenue de la Porte de la Chapelle"}),(0,i.jsx)(fr,{children:"75018 Paris"})]}),s.includes("PP+PE")&&(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{css:{fontWeight:"600"},children:"Entrée prestataire et exploitation"}),(0,i.jsx)(fr,{children:"Avenue de la Porte de la Chapelle"}),(0,i.jsx)(fr,{children:"75018 Paris"})]}),s.includes("ORG + EXP")&&(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{css:{fontWeight:"600"},children:"Entrée organisation exploitation"}),(0,i.jsx)(fr,{children:"Avenue de la Porte de la Chapelle"}),(0,i.jsx)(fr,{children:"75018 Paris"})]})]})]}),p&&(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/pec/accorArena/Fiche_Affectation_Accor.jpg) no-repeat`,backgroundSize:"cover",fontFamily:o?"$montserrat":"$franklinGothic",pageBreakBefore:"always",position:"relative"},height:Dm,width:Fm,children:[h(e.options.header?.content)&&(0,i.jsx)(fr,{css:{borderTopLeftRadius:"10px",borderTopRightRadius:"10px",left:"44px",overflow:"hidden",position:"absolute",top:"44px"},height:217,width:706,children:(0,i.jsx)("img",{height:"100%",src:e.options.header.content,width:"100%"})}),(0,i.jsxs)(Ea,{css:{position:"absolute",px:"92px",top:"381px"},direction:"column",children:[(0,i.jsx)(fr,{css:{color:"black",fontSize:"14px",fontWeight:"700"},children:p.position.name}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray800",css:{fontWeight:"600",textTransform:"capitalize"},children:p.positionSlot.range.start.toLocaleString(Ho.DateOnly.WeekdayLongMonthLong,{locale:"fr"})}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(fr,{css:{color:"black"},children:(0,i.jsx)(ng,{css:{"& > p:first-child":{marginTop:0},"& > p:last-child":{marginBottom:0}},text:p.position.description})})]})]})]})},fx=e=>3376===e?`${R.HEAVENT_ASSETS_URL}/badges/playground/fiche_reims_v2.jpg`:3827===e?`${R.HEAVENT_ASSETS_URL}/badges/playground/fiche_corrida.jpg`:3823===e?`${R.HEAVENT_ASSETS_URL}/badges/playground/fiche_semi_boulogne.jpg`:3808===e?`${R.HEAVENT_ASSETS_URL}/badges/playground/fiche_toulouse.jpg`:5233===e?`${R.HEAVENT_ASSETS_URL}/badges/playground/fiche_unicef.jpg`:5158===e?`${R.HEAVENT_ASSETS_URL}/badges/playground/fiche_marseille.jpg`:5644===e||5341===e?`${R.HEAVENT_ASSETS_URL}/badges/playground/fiche_montpellier.jpg`:`${R.HEAVENT_ASSETS_URL}/badges/playground/fiche_gcsd_v3.jpg`,xx=e=>3376===e?{color:"#c2ab62",fontFamily:"$movement",fontSize:"24px",fontWeight:"900",textTransform:"uppercase"}:3827===e?{color:"#ec1c24",fontFamily:"$graphie",fontSize:"24px",fontWeight:"800",textTransform:"uppercase"}:3823===e?{color:"#ff9900",fontFamily:"$archerBoldPro",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"}:3808===e?{color:"#f39fc5",fontFamily:"$helveticaNeue97BlackCondensed",fontSize:"24px",fontWeight:"900",textTransform:"uppercase"}:5233===e?{color:"#1eaae3",fontFamily:"$roboto",fontSize:"24px",fontWeight:"800",textTransform:"uppercase"}:5158===e?{color:"#b3cc1b",fontFamily:"$acumin",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"}:5644===e||5341===e?{color:"#662483",fontFamily:"$chillax",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"}:{color:"#bfbe00",fontFamily:"$atrament",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},_x=e=>3827===e||5233===e?{top:"859px"}:5158===e?{top:"746px"}:5644===e||5341===e?{top:"744px"}:{top:"915px"},Ix=e=>{const t=e.vr.userInfo,n=e.positionSlotUserInfo.position,o=e.positionSlotUserInfo.positionSlot,s=n.leaders[0],r=n.leaders[1],a=3376===(l=e.eventId)?{color:"#2b2378",fontFamily:"$movement",fontSize:"18px",fontWeight:"900",textTransform:"uppercase"}:3827===l?{color:"#434343",fontFamily:"$graphie",fontSize:"16px",fontWeight:"800",textTransform:"uppercase"}:3823===l?{color:"#1d2b71",fontFamily:"$archerBoldPro",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"}:3808===l?{color:"#161b4a",fontFamily:"$helveticaNeue97BlackCondensed",fontSize:"18px",fontWeight:"900",textTransform:"uppercase"}:5233===l?{color:"#434343",fontFamily:"$roboto",fontSize:"18px",fontWeight:"800",textTransform:"uppercase"}:5158===l?{color:"#161b4a",fontFamily:"$acumin",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"}:5644===l||5341===l?{color:"#161b4a",fontFamily:"$chillax",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"}:{color:"black",fontFamily:"$atrament",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"};var l;return(0,i.jsxs)(Ea,{css:{background:`url(${fx(e.eventId)}) no-repeat`,backgroundSize:"cover",color:"#333333",position:"relative"},direction:"column",height:Dm,width:Fm,children:[(0,i.jsx)(fr,{css:{color:5233===e.eventId?"white":"#333333",fontSize:"22px",fontWeight:"700",position:"absolute",right:"40px",textTransform:"uppercase",top:"136px"},children:t.name}),(0,i.jsxs)(Ea,{css:{left:"210px",padding:"$7 $8 0 $8",position:"absolute",top:"170px"},direction:"column",width:584,children:[(0,i.jsx)(fr,{css:xx(e.eventId),textAlign:"center",width:1,children:n.name}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{css:a,children:"Détails de la mission :"}),(0,i.jsx)(Pa,{height:"2"}),h(n.description)&&(0,i.jsx)(fr,{css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(ng,{text:n.description})}),mh(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{css:a,children:"Lieu de mission :"}),uh(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{children:n.address})]}),hh(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{height:180,width:1,children:(0,i.jsx)("a",{href:ig(n.latitude,n.longitude),style:{background:`url(${R.HEAVENT_API_URL}/image/event/${e.eventId}/position/${n.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})})]})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{css:a,children:"À cette heure ci :"}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsxs)(Ea,{css:{gap:"22px"},width:1,children:[(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{css:{fontWeight:"700"},children:o.range.start.toFormat("dd MMMM yyyy",{locale:"fr"})}),(0,i.jsxs)(fr,{children:["De ",o.range.start.toFormat("H'h'mm")," à"," ",o.range.end.toFormat("H'h'mm")]})]}),s&&(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{css:{fontWeight:"700"},children:"Mon contact d'urgence"}),(0,i.jsxs)(fr,{children:[s.userInfo.firstName," :"," ",s.userInfo.phone?.internationalFormat]}),r&&(0,i.jsxs)(fr,{children:[r.userInfo.firstName," :"," ",r.userInfo.phone?.internationalFormat]})]})]}),(0,i.jsx)(Pa,{height:"6"}),h(n.fields.cf38780)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{css:a,children:"Transports"}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{dangerouslySetInnerHTML:{__html:n.fields.cf38780.split("\n").join(" ")}})]})]}),(0,i.jsx)(fr,{css:{left:"53px",position:"absolute",..._x(e.eventId)},height:104,width:104,children:(0,i.jsx)("img",{height:"100%",src:Ym(e.vr.ticketId,{height:104,width:104}),width:"100%"})})]})},vx=e=>{const t=(0,F.useMemo)(()=>(0,Zd.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.event.volunteerRegistration.positionsSlotsUsersInfos]);return(0,i.jsx)(i.Fragment,{children:t.map(t=>(0,i.jsx)(Ix,{eventId:e.event.id,positionSlotUserInfo:t,vr:e.event.volunteerRegistration},t.positionSlot.id))})},bx=e=>{const t=e.event.volunteerRegistration,n=t.userInfo;return(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/roiarthur/roiarthur.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsx)(fr,{css:{color:"#181d3a",fontSize:"18px",fontWeight:"700",left:"426px",position:"absolute",textAlign:"center",top:"89px"},width:320,children:n.name}),(0,i.jsxs)(fr,{css:{color:"#181d3a",fontSize:"12px",left:"426px",position:"absolute",textAlign:"center",top:"116px"},width:320,children:["Numéro code-barres : ",t.ticketId]}),(0,i.jsx)(fr,{css:{left:"530px",position:"absolute",top:"144px"},height:114,width:114,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:114,width:114}),width:"100%"})})]})},jx=(e,t)=>t?`${R.HEAVENT_ASSETS_URL}/badges/rose/v3/benevole/benevole_page1.jpg`:"Direction"===e||"All Access"===e?`${R.HEAVENT_ASSETS_URL}/badges/rose/v3/direction/direction_page1.jpg`:"Backstage"===e?`${R.HEAVENT_ASSETS_URL}/badges/rose/v3/backstage/backstage_page1.jpg`:"Stand & Food & Bar"===e?`${R.HEAVENT_ASSETS_URL}/badges/rose/v3/stand/stand_page1.jpg`:"Agora"===e||"Agora F"===e?`${R.HEAVENT_ASSETS_URL}/badges/rose/v3/agora/agora_page1.jpg`:"",Cx=(e,t)=>t?`${R.HEAVENT_ASSETS_URL}/badges/rose/v3/benevole/benevole_page2.jpg`:"Direction"===e||"All Access"===e?`${R.HEAVENT_ASSETS_URL}/badges/rose/v3/direction/direction_page2.jpg`:"Backstage"===e?`${R.HEAVENT_ASSETS_URL}/badges/rose/v3/backstage/backstage_page2.jpg`:"Agora"===e||"Agora F"===e?`${R.HEAVENT_ASSETS_URL}/badges/rose/v3/agora/agora_page2.jpg`:"",yx=(e,t)=>t?`${R.HEAVENT_ASSETS_URL}/badges/rose/v3/benevole/benevole_page3.jpg`:"Direction"===e||"All Access"===e?`${R.HEAVENT_ASSETS_URL}/badges/rose/v3/direction/direction_page3.jpg`:"Backstage"===e?`${R.HEAVENT_ASSETS_URL}/badges/rose/v3/backstage/backstage_page3.jpg`:"Stand & Food & Bar"===e?`${R.HEAVENT_ASSETS_URL}/badges/rose/v3/stand/stand_page3.jpg`:"Agora"===e||"Agora F"===e?`${R.HEAVENT_ASSETS_URL}/badges/rose/v3/agora/agora_page3.jpg`:"",kx=e=>(0,i.jsx)(fr,{css:{left:`${e.left}px`,position:"absolute",top:`${e.top}px`},children:(0,i.jsx)("img",{height:"19px",src:`${R.HEAVENT_ASSETS_URL}/badges/rose/v3/benevole/bracelet_asset.png`,width:"38px"})}),Ax=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=3571===e.event.id,s=hg(n.fields,"population"),r=t.accreditationsUsersInfos.find(e=>1602===e.accreditationCategory.id)?.accreditation.name||"",a="Direction"===r||"All Access"===r||"Backstage"===r,l=(0,Zd.A)((0,Ju.A)(t.accreditationsUsersInfos.flatMap(e=>e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),d=(0,Zd.A)((0,Ju.A)(t.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.start.startOf("day")),e=>e.toMillis()),e=>e.toMillis()),c=(o?d:l).filter(e=>[29,30,31,1].includes(e.day)),u=t.accreditationsUsersInfos.flatMap(e=>3229===e.accreditation.id?[e.accreditationSlot.name]:[]),m=t.accreditationsUsersInfos.flatMap(e=>3230===e.accreditation.id?[e.accreditationSlot.name]:[]),g=(0,Da.A)([u.includes("29")?"Midi":null,m.includes("29")?"Soir":null]).join(" & "),p=(0,Da.A)([u.includes("30")?"Midi":null,m.includes("30")?"Soir":null]).join(" & "),f=(0,Da.A)([u.includes("31")?"Midi":null,m.includes("31")?"Soir":null]).join(" & "),x=(0,Da.A)([u.includes("1")?"Midi":null,m.includes("1")?"Soir":null]).join(" & "),_=t.accreditationsUsersInfos.flatMap(e=>3436===e.accreditation.id?[e.accreditationSlot.name]:[]),I=t.accreditationsUsersInfos.flatMap(e=>3439===e.accreditation.id?[e.accreditationSlot.name]:[]),v=t.accreditationsUsersInfos.flatMap(e=>3437===e.accreditation.id?[e.accreditationSlot.name]:[]),b=t.accreditationsUsersInfos.flatMap(e=>3438===e.accreditation.id?[e.accreditationSlot.name]:[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:`url(${jx(r,o)}) no-repeat`,backgroundSize:"cover",fontFamily:"$neueMontreal",position:"relative"},height:Dm,width:Fm,children:[!o&&(0,i.jsx)(fr,{css:{color:"#ee78ac",fontFamily:"$helveticaBlackCondensed",fontSize:"22px",fontWeight:"900",left:"251px",position:"absolute",textTransform:"uppercase",top:"130px"},textAlign:"center",width:292,children:s}),!o&&(0,i.jsxs)(fr,{css:{color:"black",fontSize:"18px",fontWeight:"700",left:"299px",position:"absolute",top:"167px"},textAlign:"center",width:244,children:["Bracelet ",r]}),(0,i.jsxs)(fr,{css:{color:"black",fontSize:"24px",fontWeight:"700",lineHeight:"28px",left:"95px",position:"absolute",textTransform:"uppercase",top:"237px"},children:[n.fields?.firstName?.value||"",(0,i.jsx)("br",{}),n.fields?.lastName?.value||""]}),!o&&(0,i.jsx)(fr,{css:{color:"#ee78ac",fontSize:"18px",fontWeight:"700",left:"95px",position:"absolute",top:"295px"},children:t.delegation?.name}),(0,i.jsx)(fr,{css:{position:"absolute",right:"95px",top:"232px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(Ea,{css:{gap:"6px",left:"95px",position:"absolute",top:"430px"},children:c.map((e,t)=>(0,i.jsxs)(Ea,{align:"center",css:{border:"1px solid black",borderRadius:"4px",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(fr,{css:{color:"black",fontFamily:"Helvetica",fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(fr,{css:{color:"black",fontSize:"10px",fontWeight:"500",textTransform:"uppercase"},children:e.toFormat("MMMM",{locale:"fr"})})]},t))}),_.includes("29")&&(0,i.jsx)(kx,{left:289,top:803}),_.includes("30")&&(0,i.jsx)(kx,{left:402,top:803}),_.includes("31")&&(0,i.jsx)(kx,{left:515,top:803}),_.includes("1")&&(0,i.jsx)(kx,{left:628,top:803}),I.includes("29")&&(0,i.jsx)(kx,{left:289,top:839}),I.includes("30")&&(0,i.jsx)(kx,{left:402,top:839}),I.includes("31")&&(0,i.jsx)(kx,{left:515,top:839}),I.includes("1")&&(0,i.jsx)(kx,{left:628,top:839}),v.includes("29")&&(0,i.jsx)(kx,{left:289,top:875}),v.includes("30")&&(0,i.jsx)(kx,{left:402,top:875}),v.includes("31")&&(0,i.jsx)(kx,{left:515,top:875}),v.includes("1")&&(0,i.jsx)(kx,{left:628,top:875}),b.includes("29")&&(0,i.jsx)(kx,{left:289,top:911}),b.includes("30")&&(0,i.jsx)(kx,{left:402,top:911}),b.includes("31")&&(0,i.jsx)(kx,{left:515,top:911}),b.includes("1")&&(0,i.jsx)(kx,{left:628,top:911})]}),"Stand & Food & Bar"!==r&&(0,i.jsx)(Ea,{css:{background:`url(${Cx(r,o)}) no-repeat`,backgroundSize:"cover",fontFamily:"$neueMontreal",pageBreakBefore:"always",position:"relative"},height:Dm,width:Fm,children:a&&(0,i.jsxs)(Ea,{css:{fontWeight:"700",left:"95px",lineHeight:"20px",position:"absolute",top:"598px"},direction:"column",children:[h(g)&&(0,i.jsxs)(fr,{children:["29 août : ",g]}),h(p)&&(0,i.jsxs)(fr,{children:["30 août : ",p]}),h(f)&&(0,i.jsxs)(fr,{children:["31 août : ",f]}),h(x)&&(0,i.jsxs)(fr,{children:["1 septembre : ",x]})]})}),(0,i.jsx)(Ea,{css:{background:`url(${yx(r,o)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Dm,width:Fm}),!o&&"Agora"!==r&&(0,i.jsx)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/rose/v3/page4.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Dm,width:Fm})]})},wx=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=t.accreditationsUsersInfos.find(e=>1662===e.accreditationCategory.id),s=(0,Zd.A)((0,Ju.A)(t.accreditationsUsersInfos.flatMap(e=>e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis());return(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/rose/parking_vide.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsx)(Ea,{css:{position:"absolute",top:"232px"},justify:"center",width:1,children:(0,i.jsx)(fr,{css:{background:o?.accreditation.color,color:Md(o?.accreditation.color||"#000000"),fontSize:"50px",fontWeight:"800",padding:"$1 $3",textTransform:"uppercase"},children:o?.accreditation.name||"parking"})}),(0,i.jsx)(fr,{css:{fontFamily:"$bnCartaNoirBold",fontSize:"36px",fontWeight:"700",left:"48px",position:"absolute",textTransform:"uppercase",top:"353px"},children:n.name}),(0,i.jsx)(fr,{css:{position:"absolute",right:"57px",top:"359px"},height:100,width:100,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:100,width:100}),width:"100%"})}),(0,i.jsx)(Ea,{css:{gap:"6px",left:"48px",position:"absolute",top:"436px"},children:s.map((e,t)=>(0,i.jsxs)(Ea,{align:"center",css:{border:"1px solid black",borderRadius:"4px",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(fr,{css:{color:"black",fontFamily:"Helvetica",fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(fr,{css:{color:"black",fontSize:"10px",fontWeight:"500",textTransform:"uppercase"},children:e.toFormat("MMMM",{locale:"fr"})})]},t))})]})},Sx=e=>{const t=e.event.volunteerRegistration.userInfo.formsUsersInfos.map(e=>e.formId);return(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/salamandre/2024/verso_v2.jpg) no-repeat`,backgroundSize:"cover",overflow:"hidden",paddingBottom:"24px",paddingTop:"56px",px:"16px"},direction:"column",height:Lm-5,width:Bm,children:[(0,i.jsx)(fr,{css:{color:"#336998",fontSize:"10px",fontWeight:"700"},children:"Renseignements complémentaires"}),(0,i.jsx)(Pa,{height:"3"}),t.includes(2163)?e.event.volunteerRegistration.positionsSlotsUsersInfos.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Responsable de la mission"}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:(0,Oo.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos.flatMap(e=>e.position.leaders.map(e=>`${e.userInfo.name} : ${e.userInfo.phone?.internationalFormat??"-"}`))).join(", ")}),(0,i.jsx)(Pa,{height:"4"})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Responsable des bénévoles"}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:"Anika Andenmatten : 079 689 52 51"}),(0,i.jsx)(Pa,{height:"4"})]}),(0,i.jsx)(fr,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Police"}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:"117"}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Pompiers"}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:"118"}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Ambulance"}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:"144"})]})};var Ex;function Tx(){return Tx=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.jsxs)(Ea,{align:"center",direction:"column",gap:"1",children:[(0,i.jsx)(Ea,{align:"center",css:{background:"white",borderRadius:"34px",color:"#336998",height:"34px",width:"34px",svg:{fill:"#5a9e9f",height:"50%",width:"50%"}},justify:"center",children:"Camera"===e.icon?(0,i.jsx)(of,{}):(0,i.jsx)(zx,{})}),(0,i.jsx)(fr,{css:{color:"#761c31",fontSize:"10px"},children:e.name})]}),Ox={MAsoir:1,MERC:2,MEmatin:3,MEmidi:4,MEsoir:5,JEUD:6,JEmatin:7,JEmidi:8,JEsoir:9,VEND:10,VEmatin:11,VEmidi:12,VEsoir:13,SAM:14,SAmatin:15,SAmidi:16,SAsoir:17,DIM:18,DImatin:19,DImidi:20,DIsoir:21},Rx=e=>{const t=e.event.volunteerRegistration.userInfo,n=(0,Zd.A)(e.event.volunteerRegistration.accreditationsUsersInfos,e=>Ox[e.accreditation.acronym||""]||-1),o=e.event.volunteerRegistration.userInfo.formsUsersInfos.map(e=>e.formId),s=t.fields?.cf11135?.value??"",r=t.fields?.cf10429?.value??"";return(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/salamandre/2024/recto.jpg) no-repeat`,backgroundSize:"cover",overflow:"hidden",padding:"12px 14px",position:"relative"},direction:"column",height:Lm-5,width:Bm,children:[(0,i.jsx)(fr,{color:"white",css:{fontFamily:"$gravur",fontSize:"22px",left:"0",position:"absolute",textAlign:"center",top:"117px",width:"100%"},children:t.name}),(0,i.jsx)(fr,{color:"white",css:{fontSize:"20px",fontWeight:"800",left:"0",position:"absolute",textAlign:"center",top:"139px",width:"100%"},children:o.includes(2164)?s:r}),(0,i.jsx)(Jl,{css:{flex:"1",gap:"8px 40px",padding:"12px 36px",position:"absolute",top:"194px",left:0},gridtemplatecolumns:"repeat(3, 1fr)",gridtemplaterows:"repeat(3, 1fr)",height:187,width:1,children:n.map((e,t)=>(0,i.jsx)($x,{icon:e.accreditation.icon,name:e.accreditation.acronym||""},t))})]})},Px=e=>(0,i.jsxs)(Ea,{height:Lm,width:2*Bm,children:[(0,i.jsx)(Rx,{event:e.event}),(0,i.jsx)(Sx,{event:e.event})]}),Dx=e=>(0,i.jsx)(Ea,{height:Dm,width:Fm,children:(0,i.jsx)(Px,{event:e.event})}),Fx=e=>(0,i.jsx)(i.Fragment,{children:(0,Og.A)(e.event.volunteersRegistrations.nodes,8).map((t,n)=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(Ea,{css:{overflow:"hidden",pageBreakBefore:0!==n?"always":void 0},height:1,width:Dm,wrap:"wrap",children:t.map(t=>(0,i.jsx)(Rx,{event:{...e.event,volunteerRegistration:t}},`front-${t.userInfo.id}`))}),(0,i.jsx)(Ea,{css:{overflow:"hidden",pageBreakBefore:"always"},height:1,width:Dm,wrap:"wrap",children:(0,Og.A)(t,4).map(t=>(0,i.jsx)(Ea,{direction:"rowReverse",width:1,children:t.map(t=>(0,i.jsx)(Sx,{event:{...e.event,volunteerRegistration:t}},`back-${t.userInfo.id}`))},`group-${t[0].utid}`))})]},`page-${n}`))}),Mx="#e30613",Nx="#26306b",Lx={cf25078:"Parcours",cf25079:"Plan village",cf25080:"Poste vélo",cf25511:"Poste course à pied",cf25512:"Plan d'accès"},Bx=Object.keys(Lx),Vx=e=>{const t=Nn($c),n=e.positionSlotUserInfo.position,o=n.category,s=e.positionSlotUserInfo.positionSlot,r=o.leaders[0],a=Bx.some(e=>h(n.fields[e]?.url)),l=a||"Restauration athlètes"===o.name||"Ravitaillement"===o.name||"Retrait des dossards"===o.name;return(0,i.jsxs)(Ea,{css:{background:"white",fontFamily:"$roboto"},direction:"column",height:Dm,width:Fm,children:[(0,i.jsxs)(Ea,{height:185,width:1,children:[(0,i.jsx)(Ea,{height:1,width:185,children:h(e.options.logo?.content)&&(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"100%"})}),(0,i.jsx)(Ea,{css:{padding:"$4 $7"},width:609,children:(0,i.jsxs)(Ea,{direction:"column",justify:"between",width:1,children:[(0,i.jsxs)(Ea,{justify:"between",width:1,children:[(0,i.jsxs)(Ea,{direction:"column",width:1,children:[(0,i.jsx)(fr,{css:{color:Mx,fontSize:"34px",fontWeight:"700",lineHeight:"40px"},children:h(n.acronym)?n.acronym:n.name}),(0,i.jsxs)(fr,{css:{color:Mx,ellipsis:!0,fontSize:"18px",fontWeight:"700"},children:["POSTE / ",o.name]})]}),l&&(0,i.jsxs)(Ea,{direction:"column",width:1,children:[(0,i.jsx)(fr,{css:{color:Mx,fontSize:"18px",fontWeight:"700",textAlign:"right"},children:"Adresse"}),(0,i.jsx)(fr,{css:{color:Nx,fontSize:"16px",fontWeight:"500",textAlign:"right"},children:n.address})]})]}),l&&(0,i.jsxs)(Ea,{justify:"between",width:1,children:[(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{css:{color:Nx,fontSize:"18px",fontWeight:"700"},children:"Point GPS"}),(0,i.jsxs)(fr,{css:{color:Mx,fontSize:"16px",fontWeight:"500"},children:[n.latitude,", ",n.longitude]})]}),(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{css:{color:Nx,fontSize:"18px",fontWeight:"700",textAlign:"right"},children:"Horaires de mission"}),(0,i.jsxs)(fr,{css:{color:Mx,fontSize:"16px",fontWeight:"500",textAlign:"right",textTransform:"capitalize"},children:[t.toLocaleString(s.range.start,{month:"short",day:"numeric",weekday:"short"})," ","| ",s.range.start.toFormat("HH'h'mm")," -"," ",s.range.end.toFormat("HH'h'mm")]})]})]}),!l&&(0,i.jsx)(Ea,{width:1,children:(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{css:{color:Mx,fontSize:"18px",fontWeight:"700"},children:"Adresse"}),(0,i.jsx)(fr,{css:{color:Nx,fontSize:"16px",fontWeight:"500"},children:n.address})]})})]})})]}),(0,i.jsx)(fr,{css:{background:Mx},height:10,width:1}),(0,i.jsxs)(Ea,{css:{flex:"1",padding:"$6 $7"},direction:"column",gap:"1",width:1,children:[(0,i.jsx)(fr,{css:{color:Mx,fontSize:"20px",fontWeight:"700"},children:"VOTRE MISSION"}),(0,i.jsx)(fr,{css:{color:Nx,fontSize:"16px",fontWeight:"500","& .h-rich-text > p":{margin:0}},children:(0,i.jsx)(ng,{text:n.description})})]}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{css:{background:Mx},height:10,width:1}),(0,i.jsx)(Ea,{css:{padding:"$5 $7"},gap:"5",height:335,width:1,children:Bx.map(e=>{if(h(n.fields[e]?.url)){const t=Lx[e];return(0,i.jsxs)(Ea,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(fr,{css:{color:Mx,fontSize:"20px",fontWeight:"700"},children:t}),(0,i.jsx)(fr,{height:255,width:1,children:(0,i.jsx)("img",{height:"100%",src:n.fields[e].url,width:"100%"})})]},e)}return null})})]}),(0,i.jsx)(Ea,{align:"center",css:{background:Mx,color:"white",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},height:40,justify:"center",width:1,children:"Vous rencontrez un problème ?"}),(0,i.jsxs)(Ea,{css:{padding:"$4"},direction:"column",height:88,width:1,children:[(0,i.jsx)(fr,{css:{color:Nx,fontSize:"20px",fontWeight:"500",textAlign:"center"},width:1,children:"Contactez votre responsable de secteur"}),r&&(0,i.jsxs)(fr,{css:{color:Nx,fontSize:"20px",fontWeight:"700",textAlign:"center"},width:1,children:[r.userInfo.name," : ",r.userInfo.phone?.internationalFormat]})]}),(0,i.jsx)(Ea,{align:"center",css:{background:Nx,color:"white",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},height:40,justify:"center",width:1,children:"Merci"})]})},Ux=e=>(0,i.jsx)(i.Fragment,{children:e.event.volunteerRegistration.positionsSlotsUsersInfos.map((t,n)=>(0,i.jsx)(Vx,{options:e.options,positionSlotUserInfo:t,userInfo:e.event.volunteerRegistration.userInfo},n))}),Wx=e=>{switch(e){case"Organisateur":return`${R.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Organisation_Recto.jpg`;case"Bénévole":default:return`${R.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Benevole_Recto.jpg`;case"Partenaire":return`${R.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Partenaire_Recto.jpg`;case"Officiel":return`${R.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Officiel_Recto.jpg`;case"Exposant":return`${R.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Exposant_Recto.jpg`;case"Prestataire":return`${R.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Intervenant_Recto.jpg`}},Gx=e=>{switch(e){case"Organisateur":return`${R.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Organisation_Verso.jpg`;case"Bénévole":default:return`${R.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Benevole_Verso.jpg`;case"Partenaire":return`${R.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Partenaire_Verso.jpg`;case"Exposant":return`${R.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Exposant_Verso.jpg`;case"Prestataire":return`${R.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Intervenant_Verso.jpg`;case"Officiel":return`${R.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Officiel_Verso.jpg`}},Hx=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=n?.fields?.cf27672?.value||"Organisateur",s=(0,Zd.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),r="Organisateur"!==o&&"Bénévole"!==o,a="Organisateur"===o||"Bénévole"==o;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:`url(${Wx(o)}) no-repeat`,backgroundSize:"cover",fontFamily:"$montserrat",position:"relative"},height:597,width:435,children:[(0,i.jsx)(fr,{css:{color:"black",fontSize:"22px",fontWeight:"700",position:"absolute",top:"449px"},textAlign:"center",width:1,children:n.fields?.firstName?.value||""}),(0,i.jsx)(fr,{css:{color:"black",fontSize:"22px",fontWeight:"700",position:"absolute",top:"478px"},textAlign:"center",width:1,children:n.fields?.lastName?.value||""}),r&&(0,i.jsx)(fr,{css:{color:"black",fontSize:"18px",fontWeight:"500",position:"absolute",top:"519px"},textAlign:"center",width:1,children:n.fields?.cf27673?.value})]}),(0,i.jsx)(Ea,{css:{background:`url(${Gx(o)}) no-repeat`,backgroundSize:"cover",fontFamily:"$montserrat",pageBreakBefore:"always",position:"relative"},height:597,width:435,children:a&&(0,i.jsx)(Ea,{css:{position:"absolute",top:"83px"},direction:"column",gap:"2",width:1,children:s.map(e=>(0,i.jsxs)(fr,{css:{color:"black",fontSize:"12px",fontWeight:"500"},textAlign:"center",width:1,children:[e.position.name," :"," ",e.positionSlot.range.start.toFormat("dd MMMM yyyy H'h'mm",{locale:"fr"})," ","à ",e.positionSlot.range.end.toFormat("H'h'mm")]},e.id))})})]})},qx=e=>e.includes("Intervenant")?`${R.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Bordeaux.jpg`:e.includes("VIP")?`${R.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Dore.jpg`:e.includes("Protocole")?`${R.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Blanc.jpg`:e.includes("Accrédité")||e.includes("Spare")||e.includes("Press")||e.includes("Pro")?`${R.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Vert.jpg`:`${R.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Noir.jpg`,Yx=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=n.fields?.cf24297?.value||"Spare",s=o.includes("Protocole")?"black":"white";return(0,i.jsxs)(Ea,{css:{background:`url(${qx(o)}) no-repeat`,backgroundSize:"cover",fontFamily:"$utopiales",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsx)(fr,{css:{color:s,fontSize:"32px",position:"absolute",textTransform:"uppercase",top:"408px"},textAlign:"center",width:397,children:n.fields?.firstName?.value||""}),(0,i.jsx)(fr,{css:{color:s,fontSize:"32px",position:"absolute",textTransform:"uppercase",top:"447px"},textAlign:"center",width:397,children:n.fields?.lastName?.value||""}),(0,i.jsx)(fr,{css:{color:s,fontSize:"24px",position:"absolute",textTransform:"uppercase",top:"505px"},textAlign:"center",width:397,children:o.includes("Bénévole")?o:o.includes("VIP")?"Pass VIP":n.fields.cf38606?.value}),(0,i.jsx)(fr,{css:{fontFamily:"$default",fontSize:"16px",left:"397px",position:"absolute",top:"300px"},textAlign:"center",width:397,children:"Code membre :"}),(0,i.jsx)(fr,{css:{left:"543px",position:"absolute",top:"367px"},height:106,width:106,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:106,width:106}),width:"100%"})})]})},Kx=e=>e.includes("Intervenant")?`${R.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Inrae_Recto.jpg`:e.includes("VIP")?`${R.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Pass_vip_Recto.jpg`:e.includes("Protocole")?`${R.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Ville_de_Nantes_Recto.jpg`:e.includes("Accrédité")||e.includes("Spare")||e.includes("Press")||e.includes("Pro")?`${R.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Cea_Recto.jpg`:`${R.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Staff_Recto.jpg`,Zx=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=n.fields?.cf24297?.value||"Spare",s=o.includes("Protocole")?"black":"white";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:`url(${Kx(o)}) no-repeat`,backgroundSize:"cover",fontFamily:"$utopiales",position:"relative"},height:490,width:340,children:[(0,i.jsx)(fr,{css:{color:s,fontSize:"32px",position:"absolute",textTransform:"uppercase",top:"336px"},textAlign:"center",width:1,children:n.fields?.firstName?.value||""}),(0,i.jsx)(fr,{css:{color:s,fontSize:"32px",position:"absolute",textTransform:"uppercase",top:"375px"},textAlign:"center",width:1,children:n.fields?.lastName?.value||""}),(0,i.jsx)(fr,{css:{color:s,fontSize:"24px",position:"absolute",textTransform:"uppercase",top:"433px"},textAlign:"center",width:1,children:o.includes("Bénévole")?o:o.includes("VIP")?"Pass VIP":n.fields.cf38606?.value})]}),(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Verso.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:490,width:340,children:[(0,i.jsx)(fr,{css:{fontSize:"16px",position:"absolute",top:"258px"},textAlign:"center",width:1,children:"Code membre :"}),(0,i.jsx)(fr,{css:{left:"117px",position:"absolute",top:"315px"},height:106,width:106,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:106,width:106}),width:"100%"})})]})]})},Xx=Fo.IX.after(Fo.c9.fromObject({day:23,month:8,year:2024}),Fo.dw.fromObject({day:3})),Jx=e=>Fo.IX.fromDateTimes(Fo.c9.fromObject({day:e,month:8,year:2024,hour:7}),Fo.c9.fromObject({day:e,month:8,year:2024,hour:25===e?15:16})),Qx=e=>Fo.IX.fromDateTimes(Fo.c9.fromObject({day:e,month:8,year:2024,hour:25===e?15:16}),Fo.c9.fromObject({day:e+1,month:8,year:2024,hour:4})),e_=e=>Fo.IX.after(Fo.c9.fromObject({day:e,month:8,year:2024}),Fo.dw.fromObject({day:1})),t_=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,o=n.fields?.cf22493?.value??"",s=n.fields?.cf26370?.value??"",r=t.positionsSlotsUsersInfos.filter(e=>e.positionSlot.range.overlaps(Xx)),a=(0,Oo.A)(r.map(e=>e.position.category.name)).join(", "),l=r.reduce(([e,t,n],i)=>[e||i.positionSlot.range.overlaps(e_(23)),t||i.positionSlot.range.overlaps(e_(24)),n||i.positionSlot.range.overlaps(e_(25))],[!1,!1,!1]),d=(0,Da.A)((0,Oo.A)(t.positionsSlotsUsersInfos.flatMap(e=>[e.positionSlot.range.start?.day,e.positionSlot.range.end?.day])));let c=0;d.length>2?c=2:d.length>0&&(c=1);const u=l.reduce((e,t)=>t?e+12:e,0),h=r.reduce(([e,t],n)=>{const i=n.positionSlot.range;return[[e[0]||i.overlaps(Jx(23)),e[1]||i.overlaps(Jx(24)),e[2]||i.overlaps(Jx(25))],[t[0]||i.overlaps(Qx(23)),t[1]||i.overlaps(Qx(24)),t[2]||i.overlaps(Qx(25))]]},[[!1,!1,!1],[!1,!1,!1]]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/vandb/Contremarque_1.jpg) no-repeat`,backgroundSize:"cover",color:"#103725",fontFamily:"$firaSans",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsxs)(Ea,{css:{gap:"10px",justifyContent:"space-between",left:"109px",position:"absolute",top:"181px",right:"109px"},children:[(0,i.jsxs)(Ea,{css:{flexDirection:"column",gap:"6px"},children:[(0,i.jsx)(fr,{css:{fontFamily:"$badTyp",fontSize:"22px",fontWeight:500,lineHeight:"28px",textTransform:"uppercase"},children:n.name}),(0,i.jsxs)(fr,{css:{fontSize:"16px",lineHeight:"normal"},children:[(0,i.jsx)("span",{style:{fontWeight:700},children:o}),` | ${a}`]}),(0,i.jsxs)(fr,{css:{fontSize:"16px",lineHeight:"normal"},children:[(0,i.jsx)("span",{style:{fontWeight:700},children:"T-shirt :"}),` ${c} en taille ${s||""}`]}),(0,i.jsxs)(fr,{css:{fontSize:"16px",lineHeight:"normal"},children:[(0,i.jsx)("span",{style:{fontWeight:700},children:"Montant EXO :"}),` ${u}`]})]}),(0,i.jsxs)(Ea,{css:{alignItems:"flex-end",flexDirection:"column",gap:"4px"},children:[(0,i.jsx)(fr,{height:80,width:80,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsx)(fr,{css:{fontSize:"10px"},children:t.ticketId})]})]}),h[0][0]&&(0,i.jsx)(Ea,{css:{height:"32px",justifyContent:"center",left:"265px",padding:"4px 10px",position:"absolute",top:"809px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${R.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[0][1]&&(0,i.jsx)(Ea,{css:{height:"32px",justifyContent:"center",left:"407px",padding:"4px 10px",position:"absolute",top:"809px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${R.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[0][2]&&(0,i.jsx)(Ea,{css:{height:"32px",justifyContent:"center",left:"549px",padding:"4px 10px",position:"absolute",top:"809px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${R.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[1][0]&&(0,i.jsx)(Ea,{css:{height:"32px",justifyContent:"center",left:"265px",padding:"4px 10px",position:"absolute",top:"845px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${R.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[1][1]&&(0,i.jsx)(Ea,{css:{height:"32px",justifyContent:"center",left:"407px",padding:"4px 10px",position:"absolute",top:"845px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${R.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[1][2]&&(0,i.jsx)(Ea,{css:{height:"32px",justifyContent:"center",left:"549px",padding:"4px 10px",position:"absolute",top:"845px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${R.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})})]}),(0,i.jsx)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/vandb/Contremarque_2.jpg) no-repeat`,backgroundSize:"cover"},height:Dm,width:Fm})]})},n_=e=>(0,i.jsxs)(Ea,{align:"center",css:{visibility:e.visible?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{css:{border:"1px solid white",borderRadius:"6px"},height:24,width:24}),(0,i.jsx)(fr,{css:{color:"white",fontSize:"8px",fontWeight:"500"},children:e.children})]}),i_=e=>{switch(e){case"BENEVOLES":return"#f49538";case"PARTENAIRES":return"#fecc16";case"EXPOSANTS":return"#17bd6d";case"MEDIAS":case"PHOTOGRAPHE":case"VIDÉASTE":return"#fd5e97";case"FOURNISSEURS":case"PRESTATAIRES":case"OFFICIEL":return"#da43c2";case"MEDICAL":return"#ff0000";case"ORGANISATION":return"#36b3e9";default:return""}},o_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=n.fields?.cf18560?.value||"",s=t.accreditationsUsersInfos.map(e=>e.accreditation.acronym||"");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/vannes/2024/recto.png) no-repeat`,backgroundColor:i_(o),backgroundSize:"cover",fontFamily:"$montserrat",position:"relative"},height:454,width:378,children:[(0,i.jsx)(fr,{css:{fontSize:"20px",fontWeight:"700",left:"39px",position:"absolute",top:"167px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(fr,{css:{fontSize:"20px",fontWeight:"700",left:"39px",position:"absolute",top:"195px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(fr,{css:{fontSize:"20px",fontWeight:"500",left:"39px",position:"absolute",textTransform:"capitalize",top:"241px"},children:o.toLowerCase()}),(0,i.jsx)(Ea,{css:{left:"41px",position:"absolute",top:"347px"},gap:"2",children:(0,vc.A)(1,8).map(e=>(0,i.jsx)(Ea,{align:"center",css:{background:"#00e5ff",borderRadius:"32px",fontSize:"18px",fontWeight:"700",visibility:s.includes(e.toString(10))?"visible":"hidden"},height:32,justify:"center",width:32,children:e},e))})]}),(0,i.jsx)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/vannes/2024/verso_v2.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$montserrat",position:"relative"},height:454,width:378,children:(0,i.jsxs)(Ea,{css:{gap:"32px",left:"38px",position:"absolute",top:"374px"},children:[(0,i.jsx)(n_,{visible:s.includes("ven midi"),children:"Ven. Midi"}),(0,i.jsx)(n_,{visible:s.includes("sam midi"),children:"Sam. Midi"}),(0,i.jsx)(n_,{visible:s.includes("sam soir"),children:"Sam. Soir"}),(0,i.jsx)(n_,{visible:s.includes("dim"),children:"Dim."}),(0,i.jsx)(n_,{visible:s.includes("cocktail"),children:"Cocktail"})]})})]})};var s_;function r_(){return r_=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=Nn($c),n=e.positionSlotUserInfo.positionSlot,o=e.positionSlotUserInfo.position,s=o.category,r=o.leaders.concat(s.leaders)[0];return(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/vannes/2024/assignemnt_v3.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsx)(fr,{css:{background:"#00e5ff",borderRadius:"$1",color:"white",fontSize:"24px",fontWeight:"700",padding:"10px",position:"absolute",right:"44px",top:"32px"},children:o.name}),(0,i.jsxs)(Ea,{css:{left:"56px",padding:"$7",position:"absolute",top:"152px"},direction:"column",width:682,children:[(0,i.jsxs)(Ea,{justify:"between",width:1,children:[(0,i.jsxs)(Ea,{css:{color:"#1d2939",fontSize:"24px",fontWeight:"700",lineHeight:"28px"},direction:"column",children:[(0,i.jsx)(fr,{children:e.userInfo.fields?.firstName?.value||""}),(0,i.jsx)(fr,{children:e.userInfo.fields?.lastName?.value||""})]}),(0,i.jsxs)(Ea,{align:"end",css:{lineHeight:"28px"},direction:"column",children:[(0,i.jsx)(fr,{css:{fontSize:"22px",fontWeight:"600",textTransform:"capitalize"},children:t.toLocaleString(n.range.start,Ho.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(fr,{css:{fontSize:"16px",fontWeight:"700"},children:s.name})]})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(fr,{color:"gray800",children:["Nous te remercions chaleureusement d’avoir accepté de participer à l’organisation de la 24ème édition du"," ",(0,i.jsx)(Pm,{fontWeight:"bold",children:"Marathon de Vannes"})," en tant que bénévole."]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{css:{border:"1px solid $gray200",borderRadius:"5px",boxShadow:"$xs",padding:"$4"},children:[(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{css:{svg:{fill:"$gray700",height:"100%",width:"100%"}},height:16,width:16,children:(0,i.jsx)(pp,{})}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:"Mission affectée"}),(0,i.jsx)(fr,{color:"gray800",children:o.name})]})]}),(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{css:{svg:{fill:"$gray700",height:"100%",width:"100%"}},height:16,width:16,children:(0,i.jsx)(a_,{})}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:"Heure de la mission"}),(0,i.jsxs)(fr,{color:"gray800",children:["De"," ",t.toLocaleString(n.range.start,Ho.TimeOnly)," ","à"," ",t.toLocaleString(n.range.end,Ho.TimeOnly)]})]})]}),(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{css:{svg:{fill:"$gray700",height:"100%",width:"100%"}},height:16,width:16,children:(0,i.jsx)(Sf,{})}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:"Lieu de rendez-vous"}),(0,i.jsx)(fr,{color:"gray800",children:o.address})]})]}),(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{css:{svg:{fill:"$gray700",height:"100%",width:"100%"}},height:16,width:16,children:(0,i.jsx)(c_,{})}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:"Coordonnées GPS"}),(0,i.jsxs)(fr,{color:"gray800",children:[o.latitude,(0,i.jsx)("br",{}),o.longitude]})]})]})]}),(0,i.jsx)(fr,{height:255,width:308,children:(0,i.jsx)("a",{href:ig(o.latitude,o.longitude),style:{background:`url(${R.HEAVENT_API_URL}/image/event/${e.eventId}/position/${o.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})})]}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsxs)(Ea,{css:{lineHeight:"20px"},direction:"column",children:[(0,i.jsx)(fr,{fontWeight:"bold",children:"Description de la mission"}),h(o.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fr,{color:"gray800",css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(ng,{text:o.description})})})]}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsxs)(Ea,{css:{lineHeight:"20px"},direction:"column",children:[(0,i.jsx)(fr,{fontWeight:"bold",children:"Coordonnées des responsables"}),(0,i.jsx)(fr,{children:"Merci de te présenter avec cette convocation auprès de ton responsable sur place :"})]}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{fontSize:"textMd",fontWeight:"bold",textAlign:"center",width:1,children:r?`${r.userInfo.name} : ${r.userInfo.phone?.internationalFormat}`:""})]})]})},h_=e=>{const t=(0,F.useMemo)(()=>(0,Zd.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.event.volunteerRegistration.positionsSlotsUsersInfos]);return(0,i.jsx)(i.Fragment,{children:t.map(t=>(0,i.jsx)(u_,{eventId:e.event.id,positionSlotUserInfo:t,userInfo:e.event.volunteerRegistration.userInfo},t.positionSlot.id))})},m_=e=>(0,i.jsx)(Ea,{align:"center",css:{background:e.color,flex:"1",visibility:e.visible?"visible":"hidden"},height:28,justify:"center",width:45,children:(0,i.jsx)(fr,{css:{color:"white",fontFamily:"$raleway",fontSize:"17px",fontWeight:"700"},children:e.children})}),g_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=t.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym);return(0,i.jsxs)(Ea,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/vendanges/vendanges_2024.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:325,width:204,children:[(0,i.jsx)(fr,{css:{borderRadius:"92px",height:"92px",left:"56px",overflow:"hidden",position:"absolute",top:"133px",width:"92px"},children:n.fields?.picture&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture?.url,width:"100%"})}),(0,i.jsx)(fr,{css:{color:"#802c8d",fontFamily:"$raleway",fontSize:"12px",fontWeight:"800",position:"absolute",textAlign:"center",top:"240px",width:"100%"},children:n.name}),(0,i.jsxs)(Ea,{css:{left:"0",position:"absolute",top:"146px"},direction:"column",children:[(0,i.jsx)(m_,{color:"#98cd00",visible:o.includes("JEU 19"),children:"JEU"}),(0,i.jsx)(m_,{color:"#ff9f01",visible:o.includes("VEN 20")||o.includes("VEN 20 & SAM 21"),children:"VEN"}),(0,i.jsx)(m_,{color:"#a655b1",visible:o.includes("SAM 21")||o.includes("VEN 20 & SAM 21"),children:"SAM"})]}),(0,i.jsxs)(Ea,{css:{height:"53px",left:"0",position:"absolute",top:"272px",width:"100%"},children:[(0,i.jsx)(Ea,{align:"center",css:{background:"#6eafe2",height:"100%",flex:"1",visibility:o.includes("1")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(fr,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"1"})}),(0,i.jsx)(Ea,{align:"center",css:{background:"#9261a8",height:"100%",flex:"1",visibility:o.includes("2")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(fr,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"2"})}),(0,i.jsx)(Ea,{align:"center",css:{background:"#accb44",height:"100%",flex:"1",visibility:o.includes("3")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(fr,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"3"})}),(0,i.jsx)(Ea,{align:"center",css:{background:"#e7a726",height:"100%",flex:"1",visibility:o.includes("4")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(fr,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"4"})}),(0,i.jsx)(Ea,{align:"center",css:{background:"#d23780",height:"100%",flex:"1",visibility:o.includes("5")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(fr,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"5"})})]})]})},p_=e=>(0,i.jsx)(fr,{css:{background:`url(${e.url})`,backgroundSize:"cover",visibility:e.visible?"visible":"hidden"},height:27,width:27}),f_=e=>{switch(e){case"Organisation":return`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-rouge.jpg`;case"Intervenant":return`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-violet.jpg`;case"Media":return`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-vert.jpg`;case"Partenaire":return`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-gris.jpg`;case"Team":return`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-bleu.jpg`;case"Village":return`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-jaune.jpg`;default:return""}},x_=e=>{const t="Media"===hg(e.userInfo.fields,"population")?e.userInfo.fields?.cf37885?.value??"":e.delegation?.name??"";return t.includes("(")?t.substring(0,t.indexOf("(")).trim():t},__=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=hg(n.fields,"population",""),s=x_(t),r=t.accreditationsUsersInfos.map(e=>e.accreditation.acronym),a=r.includes("AAA")||r.includes("PVG")&&r.includes("PCM")&&r.includes("PCC")&&r.includes("ZE")&&r.includes("CAF"),l=n.fields?.cf37926?.value??"";return(0,i.jsxs)(Ea,{css:{background:`url(${f_(o)}) no-repeat`,backgroundSize:"cover",color:"#231c45",fontFamily:"$poppins",position:"relative"},height:325,width:204,children:[(0,i.jsx)(fr,{css:{left:"16px",position:"absolute",top:"81px"},height:78,width:78,children:(0,i.jsx)("img",{height:"100%",src:h(n.fields?.picture?.url)?n.fields.picture.url:`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v3/avatar_defaut.jpg`,width:"100%"})}),(0,i.jsx)(Ea,{css:{bottom:"133px",fontSize:"10px",fontWeight:"700",left:"16px",lineHeight:"10px",position:"absolute",textTransform:"uppercase"},width:106,wrap:"wrap",children:s}),(0,i.jsx)(fr,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v3/divider.png) no-repeat`,backgroundSize:"cover",height:"1px",left:"16px",position:"absolute",top:"194px",width:"78px"}}),(0,i.jsx)(fr,{css:{fontSize:"10px",fontWeight:"700",left:"16px",position:"absolute",textTransform:"uppercase",top:"198px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(fr,{css:{fontSize:"14px",fontWeight:"700",left:"16px",position:"absolute",textTransform:"uppercase",top:"208px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(fr,{css:{color:"white",fontSize:"13px",fontWeight:"700",left:"15px",position:"absolute",textTransform:"uppercase",top:"244px"},children:o}),(0,i.jsx)(fr,{css:{color:"rgba(255, 255, 255, 0.70)",fontSize:"10px",fontWeight:"700",left:"15px",position:"absolute",textTransform:"uppercase",top:"258px"},children:l}),r.includes("CLE")&&(0,i.jsx)(fr,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v5/Accompagnant.png) no-repeat`,backgroundSize:"cover",left:"100px",position:"absolute",top:"81px"},height:59,width:27}),(0,i.jsx)(fr,{css:{left:"139px",position:"absolute",top:"22px"},height:46,width:46,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:46,width:46}),width:"100%"})}),a?(0,i.jsx)(fr,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v3/All_Access.png) no-repeat`,backgroundSize:"cover",left:"133px",position:"absolute",top:"80px"},height:143,width:27}):(0,i.jsxs)(Ea,{css:{gap:"2px",left:"133px",position:"absolute",top:"80px"},direction:"column",children:[(0,i.jsx)(p_,{url:`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Ponton.png`,visible:r.includes("PVG")}),(0,i.jsx)(p_,{url:`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Media.png`,visible:r.includes("PCM")}),(0,i.jsx)(p_,{url:`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/PC_Course.png`,visible:r.includes("PCC")}),(0,i.jsx)(p_,{url:`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Equipage.png`,visible:r.includes("ZE")}),(0,i.jsx)(p_,{url:`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Cafe_de_Presse.png`,visible:r.includes("CAF")})]}),(0,i.jsxs)(Ea,{css:{gap:"2px",left:"164px",position:"absolute",top:"80px"},direction:"column",children:[(0,i.jsx)(p_,{url:`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Hospitalite.png`,visible:r.includes("VH")}),(0,i.jsx)(p_,{url:`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/24h.png`,visible:r.includes("H24")}),(0,i.jsx)(p_,{url:`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Regie_TV.png`,visible:r.includes("TV")}),(0,i.jsx)(p_,{url:`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Couloir_Ponton.png`,visible:r.includes("COU")}),(0,i.jsx)(p_,{url:`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Passerrelle.png`,visible:r.includes("PAS")})]})]})},I_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=x_(t),s=n.fields?.cf37884?.value||[],r=hg(n.fields,"population",""),a=n.fields?.cf37926?.value??"";return(0,i.jsxs)(Ea,{css:{background:`url(${l=s,l.some(e=>e.includes("Anglais"))?`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/contremarque/contremarque_en.jpg`:`${R.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/contremarque/contremarque_fr.jpg`}) no-repeat`,backgroundSize:"cover",color:"#231c45",fontFamily:"$poppins",position:"relative"},height:Dm,width:Fm,children:[(0,i.jsx)(fr,{css:{fontSize:"20px",fontWeight:"700",left:"431px",position:"absolute",textTransform:"uppercase",top:"68px"},children:r}),(0,i.jsx)(fr,{css:{fontSize:"18px",left:"431px",position:"absolute",top:"99px"},children:a}),(0,i.jsx)(fr,{css:{fontSize:"20px",fontWeight:"700",left:"431px",position:"absolute",top:"172px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(fr,{css:{fontSize:"20px",fontWeight:"700",left:"431px",position:"absolute",top:"201px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(fr,{css:{fontSize:"18px",left:"431px",position:"absolute",top:"238px"},children:o}),(0,i.jsx)(fr,{css:{position:"absolute",right:"60px",top:"64px"},height:84,width:84,children:(0,i.jsx)("img",{height:"100%",src:Ym(t.ticketId,{height:84,width:84}),width:"100%"})}),(0,i.jsx)(fr,{css:{fontSize:"9px",fontWeight:"700",position:"absolute",right:"60px",top:"150px"},children:t.ticketId})]});var l};function v_(e,t,n,o){switch(e){case pe.Animajeconvention:return(0,i.jsx)(Jm,{event:t});case pe.Asoassignment:return(0,i.jsx)(cg,{date:o,event:t,options:n});case pe.Cerclestaff:return(0,i.jsx)(Cg,{event:t});case pe.Cerclelivraison:return(0,i.jsx)(Ig,{event:t});case pe.Cerclepressandpartenaire:return(0,i.jsx)(bg,{event:t});case pe.Cercleopcom:return(0,i.jsx)(vg,{event:t});case pe.Delta:return(0,i.jsx)(kg,{event:t});case pe.Dfcoa4:return(0,i.jsx)(Eg,{event:t});case pe.Dfcosmall:return(0,i.jsx)($g,{event:t});case pe.Eurockeennes:return(0,i.jsx)(Bg,{event:t});case pe.Fcg:return(0,i.jsx)(Gg,{event:t});case pe.Garorockplanning:return(0,i.jsx)(qg,{event:t});case pe.Goldencoast:return(0,i.jsx)(Kg,{event:t});case pe.Hbcldc:return(0,i.jsx)(Qg,{event:t});case pe.Hbclnh:return(0,i.jsx)(ip,{event:t});case pe.Lnh:return(0,i.jsx)(rp,{event:t});case pe.Moorea:return(0,i.jsx)(ap,{event:t});case pe.Nuitssecretes:return(0,i.jsx)(lp,{event:t});case pe.Openbrest:return(0,i.jsx)(cp,{event:t});case pe.P2nassignment:return(0,i.jsx)(vp,{event:t});case pe.P2nassignmentmontagedemontage:return(0,i.jsx)(jp,{event:t});case pe.P2nbadge:return(0,i.jsx)(yp,{event:t});case pe.Paris20km:return(0,i.jsx)(Ep,{event:t});case pe.Paris20kmassignment:return(0,i.jsx)(zp,{date:o,event:t});case pe.Paris20kmcontremarque:return(0,i.jsx)($p,{event:t});case pe.Pastourelle:return(0,i.jsx)(lx,{event:t});case pe.Pastourelleexposant:return(0,i.jsx)(ux,{event:t});case pe.Pec:return(0,i.jsx)(px,{event:t,options:n});case pe.Playground:return(0,i.jsx)(vx,{event:t});case pe.Roiarthur:return(0,i.jsx)(bx,{event:t});case pe.Rose:return(0,i.jsx)(Ax,{event:t});case pe.Roseparking:return(0,i.jsx)(wx,{event:t});case pe.Salamandre:return(0,i.jsx)(Dx,{event:t});case pe.T24assignment:return(0,i.jsx)(Ux,{event:t,options:n});case pe.Triathlonlarochellebadge:return(0,i.jsx)(Hx,{event:t});case pe.Utopialesimprimeur:return(0,i.jsx)(Zx,{event:t});case pe.Utopialesa4:return(0,i.jsx)(Yx,{event:t});case pe.Vandbcontremarque:return(0,i.jsx)(t_,{event:t});case pe.Vannes:return(0,i.jsx)(o_,{event:t});case pe.Vannesassignment:return(0,i.jsx)(h_,{event:t});case pe.Vendanges:return(0,i.jsx)(g_,{event:t});case pe.Vendeeglobebadge:return(0,i.jsx)(__,{event:t});case pe.Vendeeglobecontremarque:return(0,i.jsx)(I_,{event:t});default:return Za()}}function b_(e){switch(e){case pe.Animajeconvention:return"Animaje Convention";case pe.Asoassignment:return"Fiche d'affectation ASO";case pe.Cerclestaff:return"Cercle Staff & Visiteurs";case pe.Cerclelivraison:return"Cercle Livraison";case pe.Cerclepressandpartenaire:return"Cercle Press & Partenaire";case pe.Cercleopcom:return"Cercle OPCom";case pe.Delta:return"Badge Delta";case pe.Dfcoa4:return"Badge Dijon DFCO A4";case pe.Dfcosmall:return"Badge Dijon DFCO Carte";case pe.Eurockeennes:return"Planning Les Eurockéennes";case pe.Fcg:return"Accréditation FCG";case pe.Garorockplanning:return"Planning Garorock";case pe.Goldencoast:return"Badge Golden Coast";case pe.Hbcldc:return"Badge HBC Ligue des Champions";case pe.Hbclnh:return"Badge HBC LNH";case pe.Lnh:return"Badge LNH";case pe.Moorea:return"Badge Moorea";case pe.Nuitssecretes:return"Badge Nuits Secrètes";case pe.Openbrest:return"Badge Open de Brest";case pe.P2nassignment:return"Fiche d'affectation P2N (Exploit)";case pe.P2nassignmentmontagedemontage:return"Fiche d'affectation P2N (Montage/Démontage)";case pe.P2nbadge:return"Badge P2N";case pe.Paris20km:return"Badge 20km de Paris";case pe.Paris20kmassignment:return"Fiche d'affectation 20km de Paris";case pe.Paris20kmcontremarque:return"Contremarque 20km de Paris";case pe.Pastourelle:return"Badge Pastourelle bénévoles";case pe.Pastourelleexposant:return"Badge Pastourelle staffs";case pe.Pec:return"Badge Paris Entertainment Company";case pe.Playground:return"Fiche d'affectation Playground";case pe.Roiarthur:return"Badge Roi Arthur";case pe.Rose:return"Contremarque Rose Festival";case pe.Roseparking:return"Rose Festival Pass Parking";case pe.Salamandre:return"Badge Salamandre";case pe.T24assignment:return"Fiche d'affectation T24";case pe.Triathlonlarochellebadge:return"Badge Triathlon la Rochelle";case pe.Utopialesimprimeur:return"Badge Utopiales (version imprimeur)";case pe.Utopialesa4:return"Badge Utopiales (version A4)";case pe.Vandbcontremarque:return"V and B Fest' Convocation";case pe.Vannes:return"Badge Marathon de Vannes";case pe.Vannesassignment:return"Fiche d'affectation Marathon de Vannes";case pe.Vendanges:return"Badge Les Vendanges Musicales";case pe.Vendeeglobebadge:return"Badge Vendée Globe";case pe.Vendeeglobecontremarque:return"Contremarque Vendée Globe";default:return Za()}}const j_=({css:e,children:t,hideIcon:n,to:o,...s})=>{const r=new URL(o.toString(),R.HEAVENT_APP_URL),a=n?void 0:["http:","https:"].includes(r.protocol)&&r.origin!==location.origin?"arrow-up-right-from-square":s.download?"arrow-down-to-bracket":void 0;return(0,i.jsx)(Ea,{align:"center",css:{cursor:"pointer",fontWeight:"$medium","&:hover":{textDecoration:"underline"},...e},gap:"2",children:(0,i.jsxs)(La,{to:r,...s,children:[t,a&&(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:a})})]})})};function C_(e,t,n){const i=Ho.DateOnly.MonthLong;return t.equals(n)?e.toLocaleString(t,i):[e.toLocaleString(t,Ho.DateOnly.MonthShort),e.toLocaleString(n,Ho.DateOnly.MonthShort)].join(" - ")}function y_(e){switch(e){case Re.Archived:case Re.Done:return"error";case Re.Ongoing:return"success";case Re.Upcoming:return"purple";default:return Za()}}function k_(e,t){const n=Fo.c9.now().setZone("utc",{keepLocalTime:!0}).startOf("day");return Fo.IX.fromDateTimes(e.startOf("day"),t.endOf("day")).contains(n)?n:e}j_.displayName="LinkText";const A_=e=>{const{translate:t}=il(),{mutate:n}=function(e={}){return Un("mutation BackofficeEventUnarchive($eventId: EventId!) {\n    backofficeEventUnarchive(eventId: $eventId)\n}\n",e)}();return(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{width:100,children:e.event.id}),(0,i.jsx)(xc,{children:(0,i.jsx)(j_,{to:Pi.EVENT({organizationId:e.organizationId,eventId:e.event.id}),children:e.event.name})}),(0,i.jsx)(xc,{children:(0,i.jsx)(Gd,{color:y_(e.event.state),children:t(e.event.state)})}),(0,i.jsx)(xc,{children:e.event.state===Re.Archived&&(0,i.jsx)(pl,{color:"invisible",onClick:async()=>{await n({eventId:e.event.id}),e.reload()},children:t("d_sarchiver_76082")})})]})},w_=e=>{const{history:t,translate:n}=il(),o=Ac(),s=Nn(Om),r=Nn(za),{mutate:a}=function(e={}){return Un("mutation BackofficeOrganizationUpdate(\n    $id: OrganizationId!\n    $organization: BackofficeOrganizationInput!\n) {\n    backofficeOrganizationUpdate(id: $id, organization: $organization) {\n        id\n    }\n}\n",e)}(),[l,d,c]=Ec(""),[u,m]=(0,F.useState)([]),[g,p]=(0,F.useState)({direction:_t.Asc,attribute:Oe.Name}),[f,x]=(0,F.useState)(0),{data:_,isLoading:I,reload:v}=Vn("query BackofficeEvents(\n    $organizationId: OrganizationId!\n    $name: String\n    $states: [EventState!]\n    $sort: EventsSort\n    $offset: Int\n) {\n    backoffice {\n        events(\n            organizationId: $organizationId\n            name: $name\n            states: $states\n            sort: $sort\n            limit: 25\n            offset: $offset\n        ) {\n            nodes {\n                id\n                name\n                state\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{organizationId:e.organization.id,name:h(d)?d:void 0,states:Zo(u)?u:void 0,sort:g,offset:f},[]);const{numberOfPages:b,totalCount:j}=lu(_.backoffice?.events),C=(0,F.useMemo)(()=>(0,Ju.A)(R.ADMINS.concat(e.organization.users).map(e=>({id:e.id,name:e.email})),({id:e})=>e),[e.organization]),y=(0,F.useMemo)(()=>(0,Zd.A)(Yt.map(e=>({value:e,name:b_(e)})),({name:e})=>e),[]),k=e=>{p(e),x(0)};return(0,i.jsx)(dl,{height:1,hideDefaultErrors:!0,initialValues:{organization:s.organizationInputDefault(e.organization)},render:({form:t,handleSubmit:s,submitting:r})=>(0,i.jsx)(bm,{button:(0,i.jsx)(pl,{isLoading:r,textAlign:"center",onClick:s,children:n("mettre_jour_l_12499")}),category:"Backoffice",fallbackClosePath:So.BACKOFFICE_ORGANIZATIONS,title:n("mise_jour_de_17055",e.organization.name),children:(0,i.jsxs)(Im,{children:[(0,i.jsx)(sl,{}),(0,i.jsxs)(jm,{children:[(0,i.jsx)(Sl,{label:n("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(km,{label:n("date_de_fin_de_17750"),name:"organization.periodEndAt"}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("fonctionnalit_s_47714"),multiple:!0,name:"organization.features",children:on.map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sm,{isSearchVisible:!0,label:n("badges_personna_27045"),multiple:!0,name:"organization.customBadges",children:y.map(({value:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sm,{isSearchVisible:!0,label:n("utilisateurs_ay_27051"),multiple:!0,name:"organization.usersIds",children:C.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sl,{label:n("id_de_l_organis_67465"),name:"organization.weezeventOrganizationId",rightIcon:"xmark",shouldParseAsInt:!0,onRightIconClick:()=>{t.change("organization.weezeventOrganizationId",null)}}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(ym,{name:"organization.isBlocked",children:n("bloquer_l_organ_81103")})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Cm,{hideToggle:!0,initialIsOpen:!0,title:n("facturation_53594"),children:[(0,i.jsx)(zm,{name:"organization.useOldBilling",children:n("utilise_l_ancie_40491")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(Sl,{label:n("nombre_de_membr_16400"),name:"organization.membersLimit",shouldParseAsInt:!0}),(0,i.jsx)(wm,{label:n("prix_par_membre_20633"),name:"organization.pricePerMember"})]}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{children:n("nombre_de_membr_20439",e.organization.membersStats.numberOfMembers)}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{children:n("nombre_de_membr_54470",e.organization.membersStats2024.numberOfMembers)}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Tm,{label:n("commentaire_sur_40207"),name:"organization.billingComment"})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Cm,{hideToggle:!0,initialIsOpen:!0,title:n("Event"),children:(0,i.jsx)(kc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{width:200,children:(0,i.jsx)(dc,{isSelectAllVisible:!0,multiple:!0,placeholder:n("status_06428"),values:u,onChange:e=>{m(e),x(0)},children:o(nn)})}),(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:n("rechercher_un_40024"),value:l,onChange:e=>{c(e),x(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{width:100,children:"ID"}),(0,i.jsx)(tm,{attribute:Oe.Name,setSort:k,sort:g,children:n("nom_de_l_v_nem_08711")}),(0,i.jsx)(Tc,{children:n("status_06428")}),(0,i.jsx)(Tc,{})]}),numberOfPages:b,offset:f,rows:I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):_.backoffice.events.nodes.map(t=>(0,i.jsx)(A_,{event:t,organizationId:e.organization.id,reload:v},t.id)),setOffset:x,title:n("liste_des_v_ne_29929"),totalCount:j})}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(jm,{children:(0,i.jsx)(pl,{isLoading:r,textAlign:"center",onClick:s,children:n("mettre_jour_l_12499")})})]})}),validate:r.validateForForm(s.updateOrganizationSchema()),width:1,onSubmit:async n=>{await a({id:e.organization.id,organization:n.organization}),t.goBack(So.BACKOFFICE)}})},S_=()=>{const{organizationId:e}=Wn(),{data:t,loader:n}=Vn($r,{organizationId:e},[Ro.OrganizationBackofficeFragment]);return n||(0,i.jsx)(w_,{organization:t.data.row})},E_=()=>(Cd(Ln()("back_office_83072")),(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{exact:!0,path:So.BACKOFFICE_ORGANIZATIONS,children:(0,i.jsx)(xm,{})}),(0,i.jsx)(_r.qh,{exact:!0,path:So.EDIT_BACKOFFICE_ORGANIZATION(":organizationId"),children:(0,i.jsx)(S_,{})}),(0,i.jsx)(_r.qh,{exact:!0,path:So.BACKOFFICE_INVOICES,children:(0,i.jsx)(Gc,{})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.BACKOFFICE_ORGANIZATIONS,replace:!0})})]})),T_=ar(Ea,{backgroundColor:"$blueGray900",".amicale-theme &, .volunteers-theme &":{backgroundColor:"white"},".mso-theme &":{backgroundColor:"$cyan"}}),z_=()=>(0,i.jsx)(Ul,{}),$_=F.forwardRef((e,t)=>(0,i.jsxs)(T_,{ref:t,align:"stretch",css:{overflow:"auto",padding:"$6"},justify:"between",width:1,children:[(0,i.jsx)(fr,{width:100}),(0,i.jsxs)(Ea,{align:"stretch",css:{height:"fit-content",py:"$2",width:"920px"},direction:"column",gap:"6",children:[(0,i.jsx)(Ea,{css:{marginBottom:"$7","& svg":{height:"100%"}},height:32,justify:"center",children:(0,i.jsx)(z_,{})}),e.children]}),(0,i.jsx)(Ea,{justify:"end",width:100,children:(0,i.jsx)(pl,{color:"gray",leftIcon:"xmark",onClick:e.onClose})})]}));$_.displayName="OnboardingView";const O_=["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Timbuktu","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Atka","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Ensenada","America/Fort_Nelson","America/Fort_Wayne","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montreal","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Acre","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Rosario","America/Santa_Isabel","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Shiprock","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Virgin","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/Palmer","Antarctica/Rothera","Antarctica/South_Pole","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Ashkhabad","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Chongqing","Asia/Chungking","Asia/Colombo","Asia/Dacca","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Harbin","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Istanbul","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kashgar","Asia/Kathmandu","Asia/Katmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macao","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Tel_Aviv","Asia/Thimbu","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ujung_Pandang","Asia/Ulaanbaatar","Asia/Ulan_Bator","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yangon","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Faroe","Atlantic/Jan_Mayen","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Canberra","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/North","Australia/Perth","Australia/Queensland","Australia/South","Australia/Sydney","Australia/Tasmania","Australia/Victoria","Australia/West","Australia/Yancowinna","Brazil/Acre","Brazil/East","Brazil/West","Canada/Atlantic","Canada/Central","Canada/Eastern","Canada/Mountain","Canada/Newfoundland","Canada/Pacific","Canada/Saskatchewan","Canada/Yukon","Chile/Continental","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belfast","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Nicosia","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Tiraspol","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Mexico/General","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Johnston","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Samoa","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis","Pacific/Yap"];function R_(e){return"string"!=typeof e||""===e.trim()||d(e.toLowerCase())===e}const P_=["country","code","number"];let D_=class extends zl{countriesService;constructor(e,t){super(e),this.countriesService=t}basePhoneInputDefault(){return{country:"",code:"",number:""}}phoneInputDefault(e){return{...this.basePhoneInputDefault(),...e.phone}}phoneInputSchema(){return l.Ik().shape({country:l.Yj().required(this.t("le_num_ro_de_t_76885")).oneOf(this.countriesService.countriesCodes,this.t("le_num_ro_de_t_76885")),code:l.Yj().required(this.t("le_num_ro_de_t_76885")).oneOf(this.countriesService.phoneCodes,this.t("le_num_ro_de_t_76885")),number:l.Yj().required(this.t("le_num_ro_de_t_76885"))})}phoneInputSchemaNotRequired(){return l.Ik().nullable().shape({country:l.Yj(),code:l.Yj(),number:l.Yj()})}};D_=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn,Hc])],D_);let F_=class extends zl{countriesService;phoneInputService;constructor(e,t,n){super(n),this.countriesService=e,this.phoneInputService=t}organizationInputDefault(){const e=this.countriesService.getDefaultCountryValues();return{name:"",adminFirstName:"",adminLastName:"",adminPhone:this.phoneInputService.phoneInputDefault(e)}}organizationInputSchema(e){let t=l.Ik().shape({name:l.Yj().required(this.t("le_nom_de_l_org_60618")),adminFirstName:l.Yj().required(this.t("le_pr_nom_est_r_10935")),adminLastName:l.Yj().required(this.t("le_nom_est_requ_61536")),adminPhone:this.phoneInputService.phoneInputSchema()});return e||(t=t.shape({termsAccepted:l.zM().oneOf([!0],this.t("il_est_n_cessai_83896")).required(this.t("il_est_n_cessai_83896"))})),t}createOrganizationSchema(e){return l.Ik().shape({organization:this.organizationInputSchema(e)})}organizationInfosInputDefault(e){const t=this.countriesService.getDefaultCountryValues();return{name:e.name??"",adminName:e.adminName??"",adminEmail:e.adminEmail??"",street:e.street??"",postalCode:e.postalCode??"",city:e.city??"",country:e.country??t.user.country,timeZone:e.timeZone??Fo.c9.local().zoneName,emailSenderId:e.emailSenderId,dateFormat:e.dateFormat,datetimeFormat:e.datetimeFormat,timeFormat:e.timeFormat}}organizationInfosInputSchema(){return l.Ik().shape({name:l.Yj().required(this.t("le_nom_de_l_org_60618")),adminName:l.Yj().required(this.t("le_nom_du_respo_43823")),adminEmail:l.Yj().required(this.t("l_e_mail_du_rep_90871")).email(this.t("l_e_mail_du_rep_90871")).test("clean-admin-email",this.t("l_e_mail_du_rep_90871"),function(){return R_(this.parent.adminEmail)}),street:l.Yj().required(this.t("l_adresse_est_r_40489")),postalCode:l.Yj().required(this.t("le_code_postal_43189")),city:l.Yj().required(this.t("la_ville_est_re_35239")),country:l.Yj().oneOf(this.countriesService.countriesCodes).required(this.t("le_pays_est_req_33749")),emailSenderId:l.ai().nullable(),dateFormat:l.Yj().required(this.t("le_format_est_r_17097")),datetimeFormat:l.Yj().required(this.t("le_format_est_r_17097")),timeFormat:l.Yj().required(this.t("le_format_est_r_17097"))})}updateOrganizationGeneralSchema(){return l.Ik().shape({organization:this.organizationInfosInputSchema()})}};F_=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hc,D_,Dn])],F_);let M_=class extends Tl{countriesService;organizationInputService;translationService;constructor(e,t,n){super(n),this.countriesService=e,this.organizationInputService=t,this.translationService=n}eventInputDefault(e){const t=this.countriesService.getDefaultCountryValues();return{name:e?.name??"",description:e?.description??"",startAt:e?.startAt??Fo.c9.invalid("Invalid"),endAt:e?.endAt??Fo.c9.invalid("Invalid"),languages:e?.languages??[t.user.language],timeZone:e?.timeZone??Fo.c9.local().zoneName,country:e?.country??t.user.country,layer:e?.layer??Xe.Google,latitude:e?.latitude??43.6087733,longitude:e?.longitude??3.87963579999996,emailSenderId:e?.emailSenderId,dayStartTime:e?.dayStartTime??"00:00",tagsIds:e?.tagsIds??[],fields:e?.fields??{},isWeezeventSynchronized:e?.isWeezeventSynchronized??!0}}eventInputSchema(){return l.Ik().shape({name:l.Yj().required(this.t("nom_de_l_v_nem_58512")),description:l.Yj(),startAt:$m.required(this.t("la_date_d_but_d_30022")).typeError(this.t("la_date_d_but_d_30022")),endAt:$m.required(this.t("la_date_de_fin_45068")).typeError(this.t("la_date_de_fin_45068")).test("after-start-at",this.t("la_date_de_fin_00429"),function(){return Fo.c9.isDateTime(this.parent.startAt)&&this.parent.startAt.isValid&&Fo.c9.isDateTime(this.parent.endAt)&&this.parent.endAt.isValid&&this.parent.endAt>=this.parent.startAt}),languages:l.YO().of(l.Yj().oneOf(ad,this.t("les_langues_doi_27712"))).required(this.t("les_langues_son_53717")).min(1,this.t("vous_devez_s_le_16610")),timeZone:l.Yj().required(this.t("le_fuseau_horai_37109")).oneOf(O_,this.t("le_fuseau_horai_37109")),latitude:l.ai().nullable().typeError(this.t("la_latitude_doi_17800")).min(-90,this.t("la_latitude_doi_17800")).max(90,this.t("la_latitude_doi_17800")),longitude:l.ai().nullable().typeError(this.t("la_longitude_do_28762")).min(-180,this.t("la_longitude_do_28762")).max(180,this.t("la_longitude_do_28762")),emailSenderId:l.ai().nullable(),dayStartTime:l.Yj().required(this.t("l_heure_laque_87748")),isWeezeventSynchronized:l.zM().required()})}eventOrganizationInputSchema(e){return l.Ik().shape({event:this.eventInputSchema(),organization:this.organizationInputService.organizationInputSchema(e)})}createUpdateEventSchema(){return l.Ik().shape({event:this.eventInputSchema()})}};M_=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hc,F_,Dn])],M_);const N_=e=>{if(0===e.names.length)return e.render(e.fields);{const[t,...n]=e.names;return(0,i.jsx)(Oa.D0,{name:t,render:o=>(0,i.jsx)(N_,{fields:{...e.fields||{},[t]:o},names:n,render:e.render,subscription:e.subscription}),subscription:e.subscription})}},L_=({value:e,onChange:t,css:n,label:o,state:s,description:r,hint:a,...l})=>{const c=Ln(),u=(0,F.useCallback)(e=>{e&&p(e.getBoundingClientRect().width)},[]),m=(0,F.useCallback)(e=>e?.focus({preventScroll:!0}),[]),[g,p]=(0,F.useState)(200),[f,x]=(0,F.useState)(!1),[_,I]=(0,F.useState)(""),v=Nn(Hc),b=(0,F.useMemo)(()=>(0,Zd.A)(v.countries.flatMap(e=>Ko(e.phoneCode).map(t=>({...e,phoneCode:t}))),({name:e})=>d(e)),[]),j=(0,F.useMemo)(()=>b.find(({code:t,phoneCode:n})=>t===e.country&&n===e.code),[e.country,e.code]),C=(0,F.useMemo)(()=>b.filter(e=>!h(_)||e.name.toLowerCase().includes(_.trim().toLowerCase())||e.phoneCode.includes(_.trim())),[b,_]),y=(0,F.useMemo)(()=>C.map((n,o)=>(0,i.jsx)($d,{onClick:()=>{t({...e,country:n.code,code:n.phoneCode}),I(""),x(!1)},children:(0,i.jsxs)(Ea,{gap:"2",width:1,children:[(0,i.jsx)(fr,{children:n.emoji}),(0,i.jsx)(fr,{css:{ellipsis:!0},children:n.name}),(0,i.jsx)(fr,{color:"gray500",children:n.phoneCode})]})},o)),[C,e,t]),{inputId:k,descId:A,errorId:w}=bl();return(0,i.jsxs)(Ea,{ref:u,css:n,direction:"column",width:1,children:[(0,i.jsx)(yl,{htmlFor:k,children:o}),(0,i.jsx)(jl,{id:A,children:r}),(o||r)&&(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{children:[(0,i.jsxs)(Ed,{isOpen:f,onStateChange:e=>x(e),children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(Al,{css:{borderRight:"none",borderBottomRightRadius:"0",borderTopRightRadius:"0",userSelect:"none",width:"100px","& .styled-input-container-circle-exclamation":{display:"none"}},cursor:"pointer",rightIcon:f?"chevron-up":"chevron-down",state:s,children:j&&(0,i.jsxs)(fr,{width:1,children:[j.emoji," ",j.phoneCode]})})}),(0,i.jsx)(Pd,{placement:"bottom-start",renderOnPortal:!0,width:g,children:(0,i.jsxs)(Ea,{direction:"column",height:Math.min(201,40*C.length+41),width:1,children:[(0,i.jsx)(fr,{css:{padding:"$2 $4","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"},"& input::placeholder":{color:"$gray500",opacity:1},"& input::-ms-input-placeholder ":{color:"$gray500",opacity:1}},height:40,children:(0,i.jsx)("input",{ref:m,"aria-label":c("indicatif_t_l_p_02025"),placeholder:c("rechercher_un_p_04678"),type:"text",value:_,onChange:e=>{I(e.target.value)}})}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ea,{css:{height:"calc(100% - 41px)",overflowY:"auto"},direction:"column",children:y})]})})]}),(0,i.jsx)(Al,{css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0",flex:"1"},cursor:"text",state:s,children:(0,i.jsx)(fr,{css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"},"& input::placeholder":{color:"$gray500",opacity:1},"& input::-ms-input-placeholder ":{color:"$gray500",opacity:1}},children:(0,i.jsx)("input",{"aria-describedby":r?A:void 0,"aria-errormessage":"error"===s?w:void 0,"aria-invalid":"error"===s,autoComplete:"tel-national",disabled:"disabled"===s,id:k,type:"tel",value:e.number,onChange:n=>{t({...e,number:n.target.value})},...l})})})]}),(0,i.jsx)(Cl,{id:w,state:s,children:a})]})},B_=(0,F.memo)(function({prefix:e,hint:t,state:n,...o}){const s=`${e}country`,r=`${e}code`,a=`${e}number`;return(0,i.jsx)(N_,{names:[s,r,a],render:e=>{const l=_l(e[r].meta)||_l(e[a].meta);return(0,i.jsx)(L_,{hint:l?e[r].meta.error||e[a].meta.error:t,state:l?"error":n,value:{country:e[s].input.value,code:e[r].input.value,number:e[a].input.value},onChange:t=>{e[s].input.onChange(t.country),e[r].input.onChange(t.code),e[a].input.onChange(t.number)},...o})}})}),V_=(0,F.memo)(function(){const e=Ln();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sl,{label:e("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(Sl,{label:e("pr_nom_66988"),name:"organization.adminFirstName"}),(0,i.jsx)(Sl,{label:e("last_name"),name:"organization.adminLastName"})]}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(B_,{label:e("Phone"),prefix:"organization.adminPhone."})]})}),U_=()=>{const e=Ln(),{user:t}=Zn();return(0,i.jsx)(ym,{name:"organization.termsAccepted",children:(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e("en_cr_ant_votre_88363",hd(dd(t?.language,new URL(location.href).searchParams)),cd)}})})},W_=e=>{const t=Ln(),n=Fo.c9.utc(),{event:o}=e.values;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sr.Yr,{name:"event.startAt",children:t=>{t.isValid&&!1===e.form.getFieldState("event.endAt").touched&&e.form.change("event.endAt",t)}}),(0,i.jsx)(Sl,{label:t("nom_de_l_v_nem_08711"),name:"event.name"}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsxs)(Ea,{gap:"6",children:[(0,i.jsx)(km,{label:t("date_de_d_but_43380"),min:n,name:"event.startAt"}),(0,i.jsx)(km,{label:t("date_de_fin_86920"),min:o.startAt&&o.startAt.isValid?o.startAt:n,name:"event.endAt"})]})]})},G_=()=>{const e=Ln(),t=Nn(M_),n=Nn(F_),o=Nn(za),{mutate:s}=function(e={}){return Un("mutation EventOrganizationCreate($eventOrganization: EventOrganizationInput!) {\n    eventOrganizationCreate(eventOrganization: $eventOrganization) {\n        id\n        organizationId\n    }\n}\n",e)}({redirectOnSuccess:!0}),r=Gn(),a=(0,F.useRef)(null),l=!!Zn().user?.termsAcceptedAt;return(0,i.jsx)(dl,{customErrorRef:a,height:1,initialValues:{event:t.eventInputDefault(),organization:n.organizationInputDefault()},render:({form:t,values:n,handleSubmit:o})=>(0,i.jsxs)($_,{ref:a,onClose:Y,children:[(0,i.jsx)(sl,{}),(0,i.jsx)(Cm,{centerTitleAndSubtitle:!0,hideToggle:!0,initialIsOpen:!0,subtitle:e("param_trer_votr_94121"),title:e("dites_en_nous_u_13238"),children:(0,i.jsx)(W_,{form:t,values:n})}),(0,i.jsx)(Cm,{hideToggle:!0,initialIsOpen:!0,subtitle:e("ajouter_le_nom_69919"),title:e("_propos_de_vot_88855"),children:(0,i.jsx)(V_,{})}),(0,i.jsxs)(jm,{children:[!l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(U_,{}),(0,i.jsx)(Pa,{height:"4"})]}),(0,i.jsx)(pl,{textAlign:"center",onClick:o,children:e("cr_er_l_v_neme_16731")})]})]}),validate:o.validateForForm(t.eventOrganizationInputSchema(l)),width:1,onSubmit:async e=>{const{eventOrganizationCreate:{id:t,organizationId:n}}=await s({eventOrganization:e});r.push(Pi.EVENT({organizationId:n,eventId:t}))}})},H_=()=>{const{data:e,loader:t}=Vn("query HomeOrganizations {\n    user {\n        roles {\n            organizationId\n        }\n    }\n}\n",{},[]),n=Gn();return(0,i.jsx)(Id,{loader:t,onLoad:()=>{const t=e.user?.roles?.[0]?.organizationId;t?n.replace(Pi.EVENTS({organizationId:t})):n.replace(So.CREATE_EVENT_WITH_ORGANIZATION)}})},q_=()=>{const{translate:e,history:t}=il(),n=Nn(F_),o=Nn(za),{mutate:s}=function(e={}){return Un("mutation OrganizationCreate($organization: OrganizationInput!) {\n    organizationCreate(organization: $organization) {\n        id\n    }\n}\n",e)}({redirectOnSuccess:!0}),r=(0,F.useRef)(null),{user:a}=Zn(),l=!!a?.termsAcceptedAt;return(0,i.jsx)(dl,{customErrorRef:r,height:1,hideDefaultErrors:!0,initialValues:{organization:n.organizationInputDefault()},render:({handleSubmit:n})=>(0,i.jsxs)($_,{ref:r,onClose:()=>t.goBack(So.BACKOFFICE),children:[(0,i.jsx)(sl,{}),(0,i.jsx)(Cm,{centerTitleAndSubtitle:!0,hideToggle:!0,initialIsOpen:!0,subtitle:e("ajouter_le_nom_69919"),title:e("_propos_de_vot_88855"),children:(0,i.jsx)(V_,{})}),(0,i.jsxs)(jm,{children:[!l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(U_,{}),(0,i.jsx)(Pa,{height:"4"})]}),(0,i.jsx)(pl,{textAlign:"center",onClick:n,children:e("cr_er_l_organis_55358")})]})]}),validate:o.validateForForm(n.createOrganizationSchema(l)),width:1,onSubmit:async e=>{const{organizationCreate:{id:n}}=await s({organization:e.organization});t.push(mi.ORGANIZATION({organizationId:n}))}})},Y_=({children:e,termsAccepted:t})=>{const{organizationId:n}=Wn(),o=Gn();return t||window.location.pathname.includes(So.ACCEPT_TERMS_AND_CONDITIONS(n))?(0,i.jsx)(i.Fragment,{children:e}):(0,i.jsx)(Yn,{path:So.ACCEPT_TERMS_AND_CONDITIONS(n),state:o.location})};var K_=n(5830);class Z_ extends K_.Ay{events;forms;organizations;segmentsFolders;constructor(){super("recrewteer"),this.version(6).stores({events:"id",forms:"id",organizations:"id",segmentsFolders:"id"})}}const X_=new Z_,J_=F.createContext({}),Q_=e=>{const{history:t,params:{organizationId:n}}=il(),{data:o,loader:s,reload:r}=Vn('query CommonOrganization($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        features\n    }\n\n    user {\n        email\n        language\n\n        userInfo(organizationId: $organizationId) {\n            name\n            firstName: fieldValue(slug: "firstName")\n            picture {\n                url\n            }\n        }\n    }\n}\n',{organizationId:n},[]),a=F.useCallback(e=>!!o.organization&&function(e,t){return e.features.includes(t)}(o.organization,e),[o.organization]);return s||(s||o.organization?(0,i.jsx)(J_.Provider,{value:{user:o.user,hasFeature:a,reload:r},children:e.children}):(setTimeout(()=>{t.replace(So.HOME)},100),null))},eI=F.createContext({}),tI=e=>{const{history:t,params:{organizationId:n},translate:o}=il(),{data:s,loader:r,reload:a}=Vn('query Organization($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        id\n        name\n        periodEndAt\n        features\n        customBadges\n        isBlocked\n        key\n        weezeventOrganizationId\n\n        invoices(state: Overdue) {\n            invoiceNumber\n            url\n            insertedAt\n        }\n\n        events(sort: { attribute: StartAt, direction: Desc }) {\n            nodes {\n                id\n                name\n                state\n                weezeventEventId\n            }\n        }\n\n        roles {\n            id\n            name\n            type\n        }\n    }\n\n    user {\n        email\n        language\n        termsAcceptedAt\n\n        roles(organizationId: $organizationId) {\n            type\n        }\n\n        userInfo(organizationId: $organizationId) {\n            name\n            firstName: fieldValue(slug: "firstName")\n            picture {\n                url\n            }\n        }\n\n        roles(organizationId: $organizationId) {\n            type\n        }\n    }\n}\n',{organizationId:n},[]),{hasFeature:l,reload:d}=F.useContext(J_),[c,u]=F.useState(),[h,m]=F.useState(null),g=F.useCallback(async e=>{const t=(0,Fa.A)(h,{id:n},e);await X_.organizations.put(t),m(t)},[n,h,m]),p=F.useMemo(()=>Zo(s.user?.roles??[]),[s.user]),f=F.useMemo(()=>(s.user?.roles??[]).some(e=>e.type===pt.OrganizationAdmin),[s.user]),x=F.useMemo(()=>(s.user?.roles??[]).some(e=>e.type===pt.OrganizationAdmin||e.type===pt.OrganizationReader),[s.user]),_=F.useMemo(()=>s.organization?{organizationRoles:s.organization.roles.filter(e=>e.type===pt.OrganizationAdmin||e.type===pt.OrganizationReader),eventRoles:s.organization.roles.filter(e=>e.type===pt.EventAdmin||e.type===pt.EventReader),delegationCategoryRoles:s.organization.roles.filter(e=>e.type===pt.Custom||e.type===pt.DelegationCategoryLeader),positionRoles:s.organization.roles.filter(e=>e.type===pt.Custom||e.type===pt.PositionEditor||e.type===pt.PositionReader)}:{organizationRoles:[],eventRoles:[],delegationCategoryRoles:[],positionRoles:[]},[s.organization]);return F.useEffect(()=>{s.organization&&(async()=>{let e=await X_.organizations.get(n);e||(e={id:n},await X_.organizations.put(e)),m(e)})()},[n,s.organization]),r||(r||s.organization?p?(0,i.jsx)(eI.Provider,{value:{isOrganizationAdmin:f,isOrganizationReader:x,localOrganization:h,organization:s.organization,roles:_,selectedEventId:c,user:s.user,hasFeature:l,reload:()=>{d(),a()},setSelectedEventId:u,updateLocalOrganization:g},children:(0,i.jsx)(Y_,{termsAccepted:null!==s.user.termsAcceptedAt,children:e.children})}):(0,i.jsx)(Bc,{size:"sm",onClose:Bl.A,children:(0,i.jsx)(fr,{textAlign:"center",children:o("vous_n_avez_pas_23261")})}):(setTimeout(()=>{t.replace(So.HOME)},100),null))};function nI(){return F.useContext(eI)}const iI=e=>{const t=Ln();return(0,i.jsxs)(Ea,{align:"center",direction:"column",children:[(0,i.jsx)(Ea,{align:"center",css:{background:"$primary500",borderRadius:"48px",fontSize:"$textXl",color:"white",height:"48px",width:"48px"},justify:"center",children:(0,i.jsx)(Va,{icon:e.icon})}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textMd",children:e.title||t("la_fonctionnali_59786")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:e.subtitle||t("si_vous_voulez_24448")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(pl,{to:`mailto:${R.EMAIL_FROM}`,children:t("contacter_l_qu_16617")})]})},oI={PLURAL:"campaigns",SINGLE:"campaign"},sI={CAMPAIGNS:oI.PLURAL,CAMPAIGN:e=>Qn([oI.SINGLE,e])},rI={CAMPAIGNS:({organizationId:e,eventId:t})=>Qn([t?Pi.EVENT({organizationId:e,eventId:t}):fi.COMMUNITY({organizationId:e}),sI.CAMPAIGNS]),CAMPAIGNS_SEGMENT:({organizationId:e,segmentId:t})=>Qn([rI.CAMPAIGNS({organizationId:e}),t]),CAMPAIGN:({organizationId:e,eventId:t,campaignId:n})=>Qn([t?Pi.EVENT({organizationId:e,eventId:t}):fi.COMMUNITY({organizationId:e}),sI.CAMPAIGN(n)]),CAMPAIGN_DASHBOARD:e=>Qn([rI.CAMPAIGN(e),ii.DASHBOARD]),CAMPAIGN_PREVIEW:({userInfoId:e,...t})=>Qn([rI.CAMPAIGN(t),ii.PREVIEW,e]),CREATE:e=>si(rI.CAMPAIGNS(e)),CREATE_TEMPLATE:e=>Qn([si(rI.CAMPAIGNS(e)),"template"]),UPDATE:e=>ri(rI.CAMPAIGN(e))},aI={PLURAL:"members",SINGLE:"member"},lI={PLURAL:"profiles",SINGLE:"profile"},dI="accreditations",cI="actions",uI="availabilities",hI="campaigns",mI="comments",gI="documents",pI="events",fI="history",xI="informations",_I="messages",II="positions",vI="forms",bI="form",jI="scans",CI=e=>Qn([aI.SINGLE,e]),yI=e=>Qn([lI.SINGLE,e]),kI={USER_PROFILE:({userInfoId:e,...t})=>Qn([mi.ORGANIZATION(t),yI(e)]),USER_PROFILES:e=>Qn([mi.ORGANIZATION(e),lI.PLURAL]),MEMBERS:e=>Qn(["delegationId"in e?to.DELEGATION(e):"eventId"in e&&e.eventId?Pi.EVENT(e):fi.COMMUNITY(e),aI.PLURAL]),MEMBER:({userInfoId:e,...t})=>Qn(["eventId"in t&&t.eventId?Pi.EVENT(t):fi.COMMUNITY(t),CI(e)]),MEMBER_INFORMATION:e=>Qn([kI.MEMBER(e),xI]),MEMBER_ACTIONS:e=>Qn([kI.MEMBER(e),cI]),MEMBER_AVAILABILITIES:e=>Qn([kI.MEMBER(e),uI]),MEMBER_COMMENTS:e=>Qn([kI.MEMBER(e),mI]),MEMBER_HISTORY:e=>Qn([kI.MEMBER(e),fI]),MEMBER_HISTORY_CAMPAIGNS:e=>Qn([kI.MEMBER(e),fI,hI]),MEMBER_HISTORY_EVENTS:e=>Qn([kI.MEMBER(e),fI,pI]),MEMBER_HISTORY_FORMS:e=>Qn([kI.MEMBER(e),fI,vI]),MEMBER_HISTORY_SCANS:e=>Qn([kI.MEMBER(e),fI,jI]),MEMBER_POSITIONS:e=>Qn([kI.MEMBER(e),II]),MEMBER_ACCREDITATIONS:e=>Qn([kI.MEMBER(e),dI]),MEMBER_FORMS:e=>Qn([kI.MEMBER(e),vI]),MEMBER_FORM:e=>Qn([kI.MEMBER(e),bI,e.formId]),MEMBER_FORM_EDIT:e=>ri(kI.MEMBER_FORM(e)),MEMBER_MESSAGES:e=>Qn([kI.MEMBER(e),_I]),MEMBER_DOCUMENTS:e=>Qn([kI.MEMBER(e),gI]),CREATE:e=>si(kI.MEMBERS(e))},AI={PLURAL:"workflows",SINGLE:"workflow"},wI=e=>Qn([AI.SINGLE,e]),SI={WORKFLOWS:({eventId:e,...t})=>Qn([e?Pi.EVENT({...t,eventId:e}):fi.COMMUNITY(t),AI.PLURAL]),WORKFLOW:({workflowId:e,eventId:t,...n})=>Qn([t?Pi.EVENT({...n,eventId:t}):fi.COMMUNITY(n),wI(e)]),CREATE:e=>si(SI.WORKFLOWS(e)),UPDATE:e=>ri(SI.WORKFLOW(e))};var EI;!function(e){e.Assignments="Assignments",e.Badge="Badge",e.Certificate="Certificate",e.UserHours="UserHours",e.UserPlanning="UserPlanning",e.UserPlanningDays="UserPlanningDays",e.UserPlanningList="UserPlanningList"}(EI||(EI={}));const TI=[EI.Assignments,EI.Badge,EI.Certificate,EI.UserHours,EI.UserPlanning,EI.UserPlanningDays,EI.UserPlanningList];function zI(e){let t=e;try{t=new URL(e).pathname}catch{}if(h(t)){const e=t.split(/[\\/]/).pop(),n=e.lastIndexOf(".");let i=e,o="";return n>=0&&(i=e.substring(0,n),o=e.substring(n+1).toLowerCase()),{path:t,name:i,extension:o}}return{path:"",name:"",extension:""}}const $I=["jpg","png","jpeg","gif"];var OI;!function(e){e.Csv="text/csv",e.Default="application/octet-stream",e.Excel="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",e.Gif="image/gif",e.Jpeg="image/jpeg",e.Pdf="application/pdf",e.Png="image/png",e.Zip="application/zip"}(OI||(OI={}));const RI=e=>{switch(e.toLowerCase()){case"csv":return OI.Csv;case"xls":case"xlsx":return OI.Excel;case"gif":return OI.Gif;case"jpg":case"jpeg":return OI.Jpeg;case"pdf":return OI.Pdf;case"png":return OI.Png;case"zip":return OI.Zip;default:return OI.Default}};function PI(e,t){const n=document.createElement("a");n.href=e,n.target="_blank",n.download=t,n.click()}async function DI(e,t,n,i){const o=await H(),{awsS3PostCredentials:{endpointUrl:s,policy:r,amzCredential:a,amzSignature:l,amzDate:d}}=await function(e,t){return ss("query AwsS3PostCredentials($organizationId: OrganizationId!, $acl: String!) {\n    awsS3PostCredentials(organizationId: $organizationId, acl: $acl) {\n        endpointUrl\n        policy\n        amzSignature\n        amzCredential\n        amzDate\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:e,acl:n},o),{name:c,extension:h}=zI(t.name),m=`organization/${e}/${N()}/${u(c)}.${h}`,g=new FormData;return g.append("key",m),g.append("acl",n),g.append("success_action_status","201"),g.append("X-Amz-Credential",a),g.append("X-Amz-Algorithm","AWS4-HMAC-SHA256"),g.append("X-Amz-Date",d),g.append("Policy",r),g.append("X-Amz-Signature",l),g.append("Content-Type",RI(h)),g.append("file",t),new Promise((e,o)=>{const r=new XMLHttpRequest;r.upload.onprogress=e=>{if(e.lengthComputable){const t=Math.round(e.loaded/e.total*100);i?.(t)}},r.onerror=()=>{o(new Error("Could not upload file to S3"))},r.onreadystatechange=()=>{if(4===r.readyState){const i=r.responseXML?.querySelector("Error Code");null!==i?(Jn("Could not upload file to S3",{code:i?.textContent??"",message:r.responseXML?.querySelector("Error Message")?.textContent??""}),o(new Error("Could not upload file to S3"))):e({acl:n,key:m,name:t.name,size:t.size})}},r.open("POST",s,!0),r.send(g)})}function FI(e,t){return`https://${t}.s3-eu-west-1.amazonaws.com/${e.key}`}function MI(e){return new Promise((t,n)=>{!function(e,n,i){const o=document.createElement("script");o.onload=()=>{t(!0)},o.onerror=()=>{i&&i()},o.src=e,document.body.appendChild(o)}(e,0,()=>{n(new Error(`Could not load ${e}`))})})}function NI(e,t,n){return 25===e?{transform:`translateX(${t}px) rotate(0.25turn)`,transformOrigin:"top left"}:50===e?{transform:"rotate(0.5turn)"}:75===e?{transform:`translateY(${n}px) rotate(0.75turn)`,transformOrigin:"top left"}:{}}const LI=ar("div",{alignItems:"center",background:"#434c5e",borderRadius:"$1",color:"white",cursor:"pointer",display:"flex",variants:{controls:{true:{height:"calc(100% - 10px)",paddingLeft:"10px",paddingRight:"10px",width:"200px"}},rotate:{true:{height:"40px",justifyContent:"center",marginLeft:"10px",width:"40px"}}}}),BI=ar("input",{"-webkit-appearance":"none",background:"transparent",marginLeft:"10px",marginRight:"10px",width:"100%","&::-webkit-slider-thumb":{"-webkit-appearance":"none",background:"white",borderRadius:"16px",cursor:"pointer",height:"16px",marginTop:"-7px",width:"16px"},"&::-webkit-slider-runnable-track":{background:"white",borderRadius:"2px",cursor:"pointer",height:"2px",width:"100%"},"&:focus::-webkit-slider-runnable-track":{background:"white"},"&::-moz-range-thumb":{background:"white",borderRadius:"16px",cursor:"pointer",height:"16px",width:"16px"},"&::-moz-range-track":{background:"white",borderRadius:"2px",cursor:"pointer",height:"2px",width:"100%"},"&::-ms-thumb":{background:"white",borderRadius:"16px",cursor:"pointer",height:"16px",width:"16px"},"&:focus":{ouline:"none"}});var VI;!function(e){e[e.EmptyFile=0]="EmptyFile",e[e.Pdf=1]="Pdf",e[e.Image=2]="Image"}(VI||(VI={}));class UI extends F.Component{contentRef;renderPagesDebounced;constructor(e){super(e);let t=VI.Image;"string"!=typeof this.props.fileUrl||0===this.props.fileUrl.trim().length?t=VI.EmptyFile:"pdf"===zI(this.props.fileUrl).extension&&(t=VI.Pdf),this.state={image:null,isLoading:!0,fileType:t,pdf:null,rotate:0,zoomLevel:100},this.renderPagesDebounced=(0,wc.A)(()=>{this.renderPdfPages()},200),this.contentRef=F.createRef()}componentDidMount(){var e;this.state.fileType===VI.Pdf?(e=this.props.fileUrl,(void 0===window.pdfjsLib?MI("https://cdn.jsdelivr.net/npm/pdfjs-dist@2.0.943/build/pdf.min.js"):Promise.resolve(!0)).then(()=>window.pdfjsLib.getDocument(e))).then(e=>{this.setState({pdf:e}),this.renderPdfPages()}):this.state.fileType===VI.Image&&this.loaderImage()}renderPdfPages(){this.state.fileType===VI.Pdf&&async function(e,t,n,i){Array.from(t.childNodes).forEach(e=>{t.removeChild(e)});for(let o=1;o<=e.numPages;o++){const s=await e.getPage(o),r=s.getViewport(n),a=document.createElement("div"),l=document.createElement("canvas"),d=l.getContext("2d"),c=NI(i,r.height,r.width);25===i||75===i?(a.style.height=`${r.width}px`,a.style.width=`${r.height}px`):(a.style.height=`${r.height}px`,a.style.width=`${r.width}px`),l.height=r.height,l.width=r.width,l.style.transform=c.transform||"",l.style.transformOrigin=c.transformOrigin||"",a.appendChild(l),t.appendChild(a),s.render({canvasContext:d,viewport:r})}}(this.state.pdf,this.contentRef.current,this.state.zoomLevel/100,this.state.rotate).then(()=>{this.setState({isLoading:!1})})}loaderImage(){if(this.state.fileType===VI.Image){const e=new Image;e.onload=()=>{const t=this.contentRef.current.getBoundingClientRect(),n=t.height/e.height,i=t.width/e.width,o=Math.min(n,i);let s=100;o<1&&(s=100*(o-.1*o)),this.setState({image:e,isLoading:!1,zoomLevel:s})},e.onerror=()=>{this.setState({isLoading:!1,fileType:VI.EmptyFile})},e.src=this.props.fileUrl}}imageHeight(){return this.state.image.height*(this.state.zoomLevel/100)}imageWidth(){return this.state.image.width*(this.state.zoomLevel/100)}zoomMinus(){this.setState({zoomLevel:Math.max(1,10*Math.floor((this.state.zoomLevel-10)/10))}),this.renderPagesDebounced()}zoomPlus(){this.setState({zoomLevel:10*Math.ceil((this.state.zoomLevel+10)/10)}),this.renderPagesDebounced()}rangeChange(e){this.setState({zoomLevel:parseInt(e.target.value,10)}),this.renderPagesDebounced()}rotate(){this.setState(e=>{const t=e.rotate+25;return{rotate:t>=100?0:t}}),this.renderPagesDebounced()}render(){return(0,i.jsx)(Mn,{children:({container:e})=>{const t=e.get(Dn);return(0,i.jsxs)(Ea,{css:{position:"relative"},direction:"column",height:1,width:1,children:[(0,i.jsx)(fr,{ref:this.contentRef,css:{height:"calc(100% - 50px)",overflow:"auto",padding:"10px",width:"100%",zIndex:"1","& > div":{margin:"auto",marginBottom:"20px"},"& > div:last-child":{marginBottom:"0"}}}),this.state.fileType===VI.Image&&!1===this.state.isLoading&&(0,i.jsx)(fr,{css:{background:"white",height:"calc(100% - 50px)",left:"0",overflow:"auto",padding:"10px",position:"absolute",top:"0",width:"100%",zIndex:"5","& > div:last-child":{marginBottom:"0"}},children:(0,i.jsx)("img",{src:this.state.image.src,style:{height:`${this.imageHeight()}px`,width:`${this.imageWidth()}px`,...NI(this.state.rotate,this.imageHeight(),this.imageWidth())}})}),!0===this.state.isLoading&&(0,i.jsx)(fr,{css:{background:"white",height:"calc(100% - 50px)",left:"0",position:"absolute",top:"0",width:"100%",zIndex:"10"},children:(0,i.jsx)(ul,{})}),this.state.fileType===VI.EmptyFile&&(0,i.jsx)(Ea,{align:"center",css:{background:"white",fontSize:"22px",height:"calc(100% - 50px)",left:"0",position:"absolute",top:"0",width:"100%",zIndex:"20"},justify:"center",children:t.translate("aucun_fichier_77247")}),(0,i.jsxs)(Ea,{align:"center",css:{height:"50px",width:"100%"},justify:"center",children:[(0,i.jsxs)(LI,{controls:!0,children:[(0,i.jsx)("i",{className:"fas fa-minus",onClick:this.zoomMinus.bind(this)}),(0,i.jsx)(BI,{max:"200",min:"1",step:"1",type:"range",value:this.state.zoomLevel,onChange:this.rangeChange.bind(this)}),(0,i.jsx)("i",{className:"fas fa-plus",onClick:this.zoomPlus.bind(this)})]}),(0,i.jsx)(LI,{rotate:!0,onClick:this.rotate.bind(this),children:(0,i.jsx)("i",{className:"far fa-undo"})})]})]})}})}}const WI=({acl:e,document:t,onDelete:n,...o})=>{const[s,r]=(0,F.useState)(!1),a=pc(),l="public-read"===e||h(t.url),d=h(t.url)?t.url:FI(t,R.HEAVENT_AWS_UPLOADS_BUCKET);return(0,i.jsxs)(Ea,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",fontSize:"$textSm",overflow:"hidden",padding:"$3",minHeight:"72px","@tablet":{border:"1px solid $gray300",borderRadius:"$2",fontSize:"$textMd",padding:"$3"}},gap:"4",width:1,...a&&{onClick:()=>{PI(d,t.name)}},...o,children:[(0,i.jsx)(Ea,{css:{flex:"1",minHeight:0,overflow:"hidden"},children:(0,i.jsx)(fr,{color:{"@initial":"gray800","@tablet":"gray700"},css:{ellipsis:!0},width:1,children:t.name})}),l&&(0,i.jsxs)(i.Fragment,{children:[!1===a&&(0,i.jsx)(fr,{css:{cursor:"pointer"},onClick:()=>{r(!0)},children:(0,i.jsx)(Va,{icon:"eye"})}),(0,i.jsx)(fr,{css:{cursor:"pointer"},...!1===a&&{onClick:()=>{PI(d,t.name)}},children:(0,i.jsx)(Va,{icon:"download"})})]}),n&&(0,i.jsx)(fr,{css:{cursor:"pointer"},onClick:n,children:(0,i.jsx)(Va,{icon:"trash-can"})}),s&&(0,ee.createPortal)((0,i.jsx)(Ea,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"250"},height:1,width:1,children:(0,i.jsx)(bm,{title:t.name,onClose:()=>r(!1),children:(0,i.jsx)(UI,{fileUrl:d})})}),document.body)]})},GI=({name:e,progress:t,...n})=>{const o=Math.min(100,Math.max(0,t));return(0,i.jsxs)(Ea,{css:{border:"1px solid $gray300",borderRadius:"$2",padding:"$4"},direction:"column",width:1,...n,children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"regular",children:e}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsxs)(Ea,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(fr,{css:{background:"$gray100",borderRadius:"$1",flex:"1",height:"8px",position:"relative"},children:(0,i.jsx)(fr,{css:{background:"$success500",borderRadius:"$1",height:"100%",left:0,position:"absolute",top:0,width:`${o}%`}})}),(0,i.jsxs)(fr,{color:"gray700",children:[o,"%"]})]})]})};var HI,qI=n(3112);function YI(e){return Ko(e).flatMap(e=>{switch(e){case HI.Archives:return["zip"];case HI.Csv:return["csv"];case HI.Gpx:return["gpx"];case HI.Images:return["jpg","png","jpeg","gif"];case HI.Kml:return["kml"];case HI.Pdf:return["pdf"];default:return Za()}})}function KI(e){return Ko(e).flatMap(e=>e===HI.Images?"image/*":YI(e).map(e=>`.${e}`)).join(",")}n(8181),function(e){e[e.Archives=0]="Archives",e[e.Csv=1]="Csv",e[e.Gpx=2]="Gpx",e[e.Images=3]="Images",e[e.Kml=4]="Kml",e[e.Pdf=5]="Pdf"}(HI||(HI={}));var ZI=n(9618);const XI=({allowCrop:e,onChange:t,hint:n,label:o,...s})=>{const r=Ln(),a=(0,F.useRef)(null),[l,d]=(0,F.useState)(!1),[c,u]=(0,F.useState)(null),[h,m]=(0,F.useState)(!1),g=YI(HI.Images),p=e=>{if(e&&e[0]){const t=URL.createObjectURL(e[0]),n=e[0].type,i=new FileReader;i.onload=i=>{u({src:t,type:(0,qI.h)(i.target?.result,n),name:e[0].name})},i.readAsArrayBuffer(e[0])}m(!0)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{gap:"4",width:1,children:[(0,i.jsx)(Ea,{align:"center",css:{background:l?"$primary50":"$gray50",border:l?"1px solid $primary300":"1px solid $gray200",borderRadius:"$1",cursor:"pointer"},height:126,justify:"center",width:126,onClick:()=>{a.current?.click()},onDragEnter:e=>{Il(e),d(!0)},onDragLeave:e=>{Il(e),d(!1)},onDragOver:e=>{Il(e),l||d(!0)},onDrop:n=>{Il(n),d(!1);const i=n.dataTransfer.files.item(0);i&&g.includes(zI(i.name).extension)&&(e?p(n.dataTransfer.files):t(i))},children:(0,i.jsx)(Ea,{align:"center",css:{background:l?"$primary100":"$gray100",borderRadius:"36px",color:l?"$primary600":"$gray600"},height:l?48:32,justify:"center",width:l?48:32,children:(0,i.jsx)(Va,{icon:"plus"})})}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",children:o}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray400",children:n})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{onClick:()=>{a.current?.click()},children:r("s_lectionner_un_50712")})})]}),(0,i.jsx)(fr,{css:{display:"none"},children:(0,i.jsx)("input",{ref:a,accept:KI(HI.Images),type:"file",onChange:n=>{n.target.files?.[0]&&(e?p(n.target.files):t(n.target.files[0]))},...s})})]}),e&&h&&c&&(0,i.jsx)(JI,{image:c,onChange:t,onClose:()=>m(!1)})]})},JI=({image:e,onChange:t,onClose:n})=>{const o=Ln(),s=(0,F.useRef)(null);return(0,F.useEffect)(()=>()=>{e&&e.src&&URL.revokeObjectURL(e.src)},[e]),(0,i.jsx)(Bc,{size:"md",onClose:n,children:(0,i.jsxs)(Ea,{css:{overflow:"auto"},direction:"column",gap:"3",children:[(0,i.jsx)(ZI.IOb,{ref:s,className:"cropper",defaultSize:({imageSize:e,visibleArea:t})=>({width:(t||e).width,height:(t||e).height}),src:e.src,stencilProps:{aspectRatio:1}}),(0,i.jsx)(pl,{size:"lg",textAlign:"center",onClick:()=>{const i=s.current?.getCanvas();i&&i.toBlob(n=>{if(n){const i=new File([n],e.name,{lastModified:(new Date).getTime(),type:e.type});t(i)}},e.type,.95),n()},children:o("submit_21373")})]})})},QI=({accept:e,allowCrop:t,capture:n,onChange:o,...s})=>{const r=Ln(),a=(0,F.useRef)(null),[l,d]=(0,F.useState)(!1),[c,u]=(0,F.useState)(null),[h,m]=(0,F.useState)(!1),g=YI(e||[]),p=e=>{if(e&&e[0]){const t=URL.createObjectURL(e[0]),n=e[0].type,i=new FileReader;i.onload=i=>{u({src:t,type:(0,qI.h)(i.target?.result,n),name:e[0].name})},i.readAsArrayBuffer(e[0])}m(!0)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",css:{background:l?"$primary50":"$gray50",border:l?"1px solid $primary300":"1px solid $gray200",borderRadius:"$2",cursor:"pointer",padding:"$4"},direction:"column",width:1,onClick:()=>{a.current?.click()},onDragEnter:e=>{Il(e),d(!0)},onDragLeave:e=>{Il(e),d(!1)},onDragOver:e=>{Il(e),l||d(!0)},onDrop:n=>{Il(n),d(!1);const i=n.dataTransfer.files.item(0);if(i&&(0===g.length||g.includes(zI(i.name).extension)))if(t){if(e!==HI.Images)throw new Error("Crop enabled on non-image file uploader");p(n.dataTransfer.files)}else o(i)},children:[(0,i.jsx)(Ea,{align:"center",css:{background:l?"$primary100":"$gray100",borderRadius:"36px",color:l?"$primary600":"$gray600"},height:l?48:32,justify:"center",width:l?48:32,children:(0,i.jsx)(Va,{icon:"cloud-arrow-up"})}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsxs)(Ea,{gap:"1",justify:"center",wrap:"wrap",children:[(0,i.jsx)(fr,{color:"primary700",fontWeight:"regular",children:r("cliquez_pour_s_77962")}),(0,i.jsx)(fr,{color:l?"primary600":"gray500",children:r("ou_glissez_d_po_61590")})]}),g.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:l?"primary600":"gray500",css:{textTransform:"uppercase"},children:g.join(", ")})]}),(0,i.jsx)(fr,{css:{width:.1,height:.1,opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},children:(0,i.jsx)("input",{ref:a,accept:e?KI(e):void 0,capture:n,type:"file",onChange:n=>{if(n.target.files?.[0])if(t){if(e!==HI.Images)throw new Error("Crop enabled on non-image file uploader");p(n.target.files)}else o(n.target.files[0])},...s})})]}),t&&h&&c&&(0,i.jsx)(JI,{image:c,onChange:o,onClose:()=>m(!1)})]})};var ev;!function(e){e[e.File=0]="File",e[e.Uploader=1]="Uploader",e[e.Uploading=2]="Uploading"}(ev||(ev={}));const tv=({acl:e,css:t,descId:n,description:o,errorId:s,inputId:r,label:a,labelId:l,hint:d,onChange:c,organizationId:u,state:h,value:m,...g})=>{const p=Ln(),[f,x]=(0,F.useState)(m?ev.File:ev.Uploader),[_,I]=(0,F.useState)(""),[v,b]=(0,F.useState)(0);return(0,i.jsxs)(Ea,{"aria-live":"polite",css:t,direction:"column",width:1,children:[(0,i.jsx)(yl,{htmlFor:r,id:l,children:a}),(0,i.jsx)(jl,{id:n,children:o}),(a||o)&&(0,i.jsx)(Pa,{height:"1"}),f===ev.File&&m?(0,i.jsx)(WI,{acl:e,"aria-label":p("delete_uploaded_14711"),document:m,id:r,role:"button",onDelete:()=>{c(null),x(ev.Uploader)}}):f===ev.Uploading?(0,i.jsx)(GI,{"aria-busy":!0,"aria-describedby":n,"aria-label":p("uploading_file_46483"),id:r,name:_,progress:v}):(0,i.jsx)(QI,{"aria-describedby":n,"aria-errormessage":s,"aria-invalid":"error"===h,"aria-label":p("upload_file_97740"),id:r,onChange:async t=>{x(ev.Uploading),I(t.name),b(0);try{const n=await DI(u,t,e,b);c({...n,file:t}),x(ev.File)}catch{x(ev.Uploader)}},...g}),(0,i.jsx)(Cl,{state:h,children:d})]})},nv=e=>{const t=Ln();return(0,i.jsxs)(Ea,{align:"center",gap:"1",children:[e.children,(0,i.jsxs)(fr,{color:"gray500",fontSize:"textXs",fontWeight:"regular",children:["(",t("facultatif_76747"),")"]})]})},iv=(0,F.createContext)({}),ov=ar("div",{background:"$gray50",border:"1px solid $gray100",borderRadius:"$2",display:"flex",gap:"$2",height:"44px",minHeight:"44px",padding:"$1",position:"relative",width:"100%"}),sv=ar("div",{alignItems:"center",color:"$gray500",cursor:"pointer",display:"flex",fontWeight:"$medium",height:"100%",justifyContent:"center",userSelect:"none",width:"100%",variants:{selected:{true:{background:"white",borderRadius:"6px",boxShadow:"$sm",color:"$gray700"}}}}),rv=e=>(0,i.jsx)(iv.Provider,{value:{selectedItem:e.selectedItem,onChange:e.onChange},children:(0,i.jsx)(ov,{children:e.children})}),av=e=>{const{selectedItem:t,onChange:n}=(0,F.useContext)(iv);return(0,i.jsx)(sv,{selected:t===e.item,onClick:()=>{n(e.item)},children:e.children})},lv=({value:e,css:t,label:n,description:o,hint:s,icon:r,onChange:a,state:l,...d})=>{const c=h(e)&&e.length>5?e.substring(0,5):e,{inputId:u,descId:m,errorId:g}=bl();return(0,i.jsxs)(Ea,{css:t,direction:"column",width:1,children:[(0,i.jsx)(yl,{htmlFor:u,children:n}),(0,i.jsx)(jl,{id:m,children:o}),(n||o)&&(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(Al,{cursor:"default",icon:r,state:l,children:(0,i.jsx)(fr,{css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"}},children:(0,i.jsx)("input",{"aria-describedby":o?m:void 0,"aria-errormessage":"error"===l?g:void 0,"aria-invalid":"error"===l,disabled:"disabled"===l,id:u,type:"time",value:c,onChange:e=>{a(e.target.value)},...d})})}),(0,i.jsx)(Cl,{id:g,state:l,children:s})]})},dv=({name:e,hint:t,state:n,...o})=>(0,i.jsx)(Oa.D0,{name:e,render:s=>{const r=_l(s.meta);return(0,i.jsx)(lv,{hint:r?s.meta.error:t,name:e,state:r?"error":n,value:s.input.value,onBlur:s.input.onBlur,onChange:s.input.onChange,onFocus:s.input.onFocus,...o})}});var cv=n(3333),uv=n(5488),hv=n.n(uv);n(4385),n(5833),n(9844),n(6871),n(2830);const mv=({css:e,label:t,description:n,state:o,initialValue:s,onChange:r,onBlur:a,onFocus:l,hint:d,placeholder:c,value:u,...h})=>{const{translate:m,params:{organizationId:g}}=il(),{language:p}=Nn(Dn),f=(0,F.useMemo)(()=>[{color:"white",label:m("blanc_36425")},{color:lr.colors.gray800.value,label:m("gris_fonc_51159")},{color:lr.colors.gray400.value,label:m("gris_clair_52465")},{color:lr.colors.primary900.value,label:m("bleu_fonc_40491")},{color:lr.colors.primary700.value,label:m("bleu_41949")},{color:lr.colors.error700.value,label:m("rouge_fonc_45023")},{color:lr.colors.error500.value,label:m("rouge_75079")},{color:lr.colors.warning300.value,label:m("jaune_53503")},{color:lr.colors.warning600.value,label:m("orange_64132")},{color:lr.colors.success700.value,label:m("vert_fonc_37265")},{color:lr.colors.success500,label:m("vert_27018")},{color:lr.colors.purple700.value,label:m("violet_fonc_77270")},{color:lr.colors.purple500.value,label:m("violet_54005")},{color:lr.colors.pink700.value,label:m("rose_fonc_98996")},{color:lr.colors.pink500.value,label:m("rose_49360")}],[]);return(0,i.jsxs)(Ea,{css:e,direction:"column",width:1,children:[(0,i.jsx)(yl,{children:t}),(0,i.jsx)(jl,{children:n}),(t||n)&&(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{css:{"--ck-border-radius":"$radii$1","--ck-color-toolbar-background":"$colors$gray100","& .ck.ck-toolbar":{borderColor:"error"===o?"$error500":"$gray300",borderBottom:"none","& .ck.ck-toolbar__separator":{background:"$gray200"},"& .ck.ck-button":{color:"$gray600","&:hover":{background:"$gray200",color:"$gray800",cursor:"pointer"},"&.ck-on, &.ck-on:hover:not(.ck-disabled)":{background:"$primary300",color:"$primary700"}}},"& .ck.ck-content":{borderColor:"error"===o?"$error500 !important":"$gray300 !important",borderStyle:"solid",borderWidth:"1px",borderTop:"none !important",color:"$gray800",minHeight:"100px",px:"$3","&.ck-editor__editable.ck-focused":{boxShadow:"none"},"& p.h-small":{fontSize:"12px"}},"& .ck.ck-editor__editable > .ck-placeholder::before":{color:"$gray500"},...tg("& .ck.ck-content")},width:1,children:(0,i.jsx)(cv.CKEditor,{config:{placeholder:c,fontColor:{colors:f},fontBackgroundColor:{colors:f},language:p.toString().toLowerCase(),simpleUpload:{uploadUrl:`${R.HEAVENT_API_URL}/image/upload?organizationId=${g}`},heading:{options:[{model:"paragraphSmall",view:{name:"p",classes:"h-small"},title:m("paragraphe_pet_01073"),class:"ck-heading_paragraph_small",converterPriority:"high"},{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading2"}]}},data:s,editor:hv(),onBlur:()=>{a?.()},onChange:(e,t)=>{r(t.getData())},onFocus:()=>{l?.()},...h})}),(0,i.jsx)(Cl,{state:o,children:d})]})},gv=({name:e,hint:t,state:n,...o})=>(0,i.jsx)(Oa.D0,{name:e,parse:xl.A,render:s=>{const r=_l(s.meta);return(0,i.jsx)(mv,{hint:r?s.meta.error:t,initialValue:s.input.value,name:e,state:r?"error":n,onChange:e=>{s.input.onChange(e)},...o})}}),pv=e=>{const{history:t,translate:n,params:{organizationId:o}}=il(),[s,r]=(0,F.useState)(e.values.campaign.documents);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sl,{label:n("sujet_36033"),name:"campaign.subject"}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(rv,{selectedItem:e.values.textOrHtml,onChange:t=>{e.form.change("textOrHtml",t)},children:[(0,i.jsx)(av,{item:"text",children:n("contenu_en_vers_04808")}),(0,i.jsx)(av,{item:"html",children:n("contenu_parti_04631")})]}),(0,i.jsx)(Pa,{height:"7"}),"text"===e.values.textOrHtml&&(0,i.jsx)(gv,{hint:(0,i.jsx)(fr,{css:{"& a":{color:"$primary700"}},dangerouslySetInnerHTML:{__html:n("vous_pouvez_ajo_23408")}}),label:n("contenu_29668"),name:"campaign.text"}),"html"===e.values.textOrHtml&&(0,i.jsx)(Tm,{hint:(0,i.jsx)(fr,{css:{"& a":{color:"$primary700"}},dangerouslySetInnerHTML:{__html:n("vous_pouvez_ajo_23408")}}),label:n("code_html_60711"),name:"campaign.html"}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Sm,{isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(nv,{children:n("_metteur_de_l_e_51616")}),name:"campaign.emailSenderId",onCreateClick:()=>{t.push(So.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(o))},children:e.emailsSenders.map(t=>(0,i.jsx)("option",{value:t.id,children:`${t.name} ${t.id===e.emailSenderId?n("_metteur_par_d_03442"):t.isValidToSendEmail?"":n("_e_mail_non_con_07618")}`},t.id))}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Sl,{isEmail:!0,label:(0,i.jsx)(nv,{children:n("adresse_de_r_po_86181")}),name:"campaign.replyTo"}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{align:"center",gap:"1",children:[(0,i.jsx)(fr,{color:"gray700",fontSize:"textMd",fontWeight:"semiBold",children:n("pi_ce_s_jointe_82370")}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{color:"gray500",children:(0,i.jsx)(Va,{icon:"circle-exclamation"})})}),(0,i.jsx)(am,{placement:"bottom",children:n("si_vos_pi_ces_j_95233")})]})]}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:n("int_grer_dans_v_73429")}),"event"===e.campaignType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"4"}),(0,i.jsxs)(Sm,{isSearchVisible:!0,label:n("documents_dit_25968"),multiple:!0,name:"campaign.attachments",children:[e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),TI.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))]})]}),s.map(t=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(tv,{acl:"public-read",organizationId:o,value:t,onChange:()=>{const n=(0,Xd.A)(s,t);r(n),e.form.change("campaign.documents",n)}})]},t.key)),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(tv,{acl:"public-read",label:n("fichier_personn_20046"),organizationId:o,value:null,onChange:t=>{const n=[...s,(0,tr.A)(t,"file")];r(n),e.form.change("campaign.documents",n)}}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(ym,{name:"campaign.hasCalendarInvite",children:(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[n("ajouter_une_inv_92123"),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{color:"gray500",children:(0,i.jsx)(Va,{icon:"circle-exclamation"})})}),(0,i.jsx)(am,{placement:"top",children:n("un_fichier_ics_01663")})]})]})}),e.values.campaign.hasCalendarInvite&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(Ea,{css:{paddingLeft:"$6"},width:1,children:(0,i.jsxs)(Ea,{css:{background:"$gray50",bd:!0,padding:"$4 $6"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Sl,{label:n("nom_de_l_v_nem_08711"),name:"campaign.calendarInviteName"}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(km,{label:n("date_de_d_but_43380"),name:"campaign.calendarInviteStartDate"}),(0,i.jsx)(dv,{label:n("heure_de_d_but_27566"),name:"campaign.calendarInviteStartTime"})]}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(km,{label:n("date_de_fin_86920"),name:"campaign.calendarInviteEndDate"}),(0,i.jsx)(dv,{label:n("heure_de_fin_95071"),name:"campaign.calendarInviteEndTime"})]})]})})]})]})},fv=[" ","@","£","$","¥","è","é","ù","ì","ò","Ç","Ø","ø","Å","å","Æ","æ","ß","É","!",'"',"#","¤","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","¡","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","Ä","Ö","Ñ","Ü","§","¿","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","ä","ö","ñ","ü","à"],xv=["^","{","}","\\","|","[","]","~","€","\n"],_v=fv.concat(xv);function Iv(e,t){const n=t?145:160,i=Array.from(e??"").reduce((e,t)=>fv.includes(t)?e+1:xv.includes(t)?e+2:e,0);return i<=n?{numberOfCharacters:i,numberOfSms:1}:{numberOfCharacters:i,numberOfSms:Math.ceil(i/153)}}const vv=e=>(0,i.jsx)(Oa.D0,{name:e.name,render:t=>{const n=t.input.checked?"checked":"unchecked";return(0,i.jsx)(sc,{disabled:e.disabled,size:e.size,state:n,subtext:e.subtext,onClick:()=>{t.input.onChange(e.value)},children:e.children})},type:"radio",value:e.value}),bv=e=>{const t=Ln(),n=e.formProps.values,{numberOfCharacters:o,numberOfSms:s}=Iv(n.campaign.text,n.customSender);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:t("voulez_vous_per_07528")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(vv,{name:"customSender",value:!1,children:t("non_je_souhait_47056")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"customSender",value:!0,children:t("oui_je_souhait_40974")}),e.formProps.values.customSender&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(fr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Sl,{hint:t("doit_commencer_93759"),name:"campaign.sender",placeholder:t("_metteur_du_mes_17005")})})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Tm,{hint:(0,i.jsx)(fr,{css:{"& a":{color:"$primary700"}},dangerouslySetInnerHTML:{__html:t("vous_pouvez_ajo_23408")}}),label:(0,i.jsxs)(Ea,{justify:"between",children:[(0,i.jsx)(fr,{children:t("contenu_29668")}),(0,i.jsx)(fr,{color:"gray500",children:t("_1_caract_re_04414",o,s)})]}),name:"campaign.text"})]})},jv=e=>{const t=Ln();return(0,i.jsxs)(i.Fragment,{children:[e.formProps.values.campaign.campaignType===ue.Email?(0,i.jsx)(pv,{campaignType:e.campaignType,customDocuments:e.customDocuments,emailSenderId:e.emailSenderId,emailsSenders:e.emailsSenders,form:e.formProps.form,values:e.formProps.values}):(0,i.jsx)(bv,{formProps:e.formProps}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{isLoading:e.formProps.submitting,onClick:e.formProps.handleSubmit,children:e.isTemplate?e.isEdit?t("mettre_jour_l_13576"):t("cr_er_le_mod_le_06346"):e.isSent?t("mettre_jour_l_32694"):t("suivant_desti_10756")})})]})},Cv=e=>(0,i.jsxs)(fr,{css:{borderRadius:"$1",boxShadow:"$sm",overflow:"hidden",width:"100%"},children:[(0,i.jsxs)(Ea,{align:"center",css:{background:e.isOpen?"$gray900":"white",cursor:e.canSelect?"pointer":"default",px:"$6"},gap:"4",height:64,width:1,onClick:()=>{e.canSelect&&e.onSelect()},children:[(0,i.jsx)(Ea,{align:"center",css:{background:e.isCompleted?"$success200":"white",border:e.isCompleted?"none":"1px solid $gray200",borderRadius:"32px",color:e.isCompleted?"$success700":"$gray800",fontWeight:"$medium"},height:32,justify:"center",width:32,children:e.isCompleted?(0,i.jsx)(Va,{icon:"check"}):e.stepNumber}),(0,i.jsx)(fr,{color:e.isOpen?"white":"gray800",fontSize:"textMd",fontWeight:"medium",children:e.title})]}),e.isOpen&&(0,i.jsx)(fr,{css:{background:"white",padding:"$6 70px",width:"100%"},children:e.children})]}),yv=e=>(0,i.jsx)(ll,{direction:"column",formRenderProps:e.formProps,render:e.render}),kv=e=>{const[t,n]=F.useState(!1),[o,s]=F.useState(0),r=Nn(za),a=F.Children.toArray(e.children);return(0,i.jsx)(Oa.lV,{initialValues:e.initialValues,initialValuesEqual:wr.A,mutators:{...$a.A,forceErrors:rl},render:r=>a.map((a,l)=>{const d=o>=l||e.isEdit&&r.valid;return(0,i.jsxs)(Ra.Provider,{value:{errors:r.errors,showErrors:t,submitErrors:r.submitErrors,setShowErrors:n},children:[(0,i.jsx)(Cv,{canSelect:d,isCompleted:o>l,isOpen:o===l,stepNumber:l+1,title:a.props.title,onSelect:()=>{d&&(n(!1),s(l))},children:F.cloneElement(a,{formProps:r})}),(0,i.jsx)(Pa,{height:"6"})]},l)}),validate:e=>r.validateForForm(a[o].props.schema)(e),onSubmit:async(t,i)=>{o===a.length-1?await e.onSubmit(t,i):(n(!1),s(o+1))}})};var Av=n(5526);const wv=/^[a-z][a-z0-9]{2,10}$/i;var Sv;!function(e){e.Accreditations="accreditations",e.Everyone="everyone",e.Positions="positions",e.Segments="segments",e.States="states",e.Users="users"}(Sv||(Sv={}));let Ev=class extends zl{constructor(e){super(e)}createUpdateCampaignValuesDefault(e,t,n,i,o){const s=this.campaignInputDefault(e,t,n,i,o);return{campaign:s,recipients:s.sendToEveryone?Sv.Everyone:Zo(s.states)?Sv.States:Zo(s.usersInfosIds)?Sv.Users:Zo(s.segmentsIds)?Sv.Segments:Zo(s.accreditationsCategoriesIds)||Zo(s.accreditationsIds)||Zo(s.accreditationsSlotsIds)?Sv.Accreditations:Sv.Positions,customSender:h(i?.sender),textOrHtml:h(i?.html)?"html":"text",delivery:s.state===ce.Scheduled&&i?.scheduledAt?.isValid?"later":"now"}}campaignStep1Fields(){return{name:l.Yj().required(this.t("le_nom_de_la_ca_63405")),campaignType:l.Yj().required(this.t("le_type_de_camp_96559")).oneOf(Ht,this.t("le_type_de_camp_56467"))}}campaignStep1Schema(){return l.Ik().shape({campaign:l.Ik().shape({...this.campaignStep1Fields()})})}campaignStep2Fields(){const e=this;return{sender:l.Yj().test("is-valid",this.t("l_metteur_ne_r_16421"),function(){return!h(this.parent.sender)||wv.test(this.parent.sender)}),text:l.Yj().test("non-empty-text",this.t("le_contenu_est_45048"),function(){return h(this.parent.text)||h(this.parent.html)}).test("only-valid-characters","",function(){if(this.parent.campaignType===ue.Email)return!0;{const n=(t=this.parent.text,new Set(Array.from(t??"").filter(e=>!_v.includes(e))));return!(n.size>0)||this.createError({message:e.translationService.translate("les_caract_res_84839",Array.from(n).join(", "))})}var t}).test("max-length",this.t("le_contenu_ne_p_25416"),function(){return this.parent.campaignType===ue.Email||this.parent.text.length<1e3}).test("no-percent-encoded-variables",this.t("le_texte_de_l_e_71717"),function(){return!(this.parent.text.includes("%7B")||this.parent.text.includes("%7D"))}),subject:l.Yj().when("campaignType",{is:ue.Email,then:e=>e.required(this.t("le_sujet_est_re_18923"))}),html:l.Yj().test("non-empty-text",this.t(this.t("le_code_html_es_52280")),function(){return h(this.parent.text)||h(this.parent.html)}),replyTo:l.Yj().email(this.t("l_adresse_de_r_53879")).test("clean-reply-to",this.t("l_adresse_de_r_53879"),function(){return R_(this.parent.replyTo)}),documents:l.YO().test("max-size",this.t("l_ensemble_des_32797"),function(){return this.parent.campaignType!==ue.Email||!Zo(this.parent.documents)||(0,Av.A)(this.parent.documents,e=>e.size)<2e7}),emailSenderId:l.ai().nullable(),attachments:l.YO().of(l.Yj()),hasCalendarInvite:l.zM().required(),calendarInviteName:l.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("nom_de_l_v_nem_58512")),otherwise:e=>e.nullable()}),calendarInviteStartDate:$m.when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("la_date_de_d_bu_05030")).typeError(this.t("la_date_de_d_bu_05030")),otherwise:e=>e.nullable()}),calendarInviteStartTime:l.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("heure_de_d_but_90785")),otherwise:e=>e.nullable()}),calendarInviteEndDate:$m.when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("la_date_de_fin_32246")).typeError(this.t("la_date_de_fin_32246")),otherwise:e=>e.nullable()}),calendarInviteEndTime:l.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("l_heure_de_fin_78626")),otherwise:e=>e.nullable()})}}campaignStep2Schema(){return l.Ik().shape({campaign:l.Ik().shape({...this.campaignStep2Fields()})})}campaignStep3Fields(){const e=this,t=function(){return!1!==this.parent.sendToEveryone||0!==this.parent.states.length||0!==this.parent.positionsCategoriesIds.length||0!==this.parent.positionsIds.length||0!==this.parent.positionsSlotsIds.length||0!==this.parent.tagsIds.length||0!==this.parent.accreditationsCategoriesIds.length||0!==this.parent.accreditationsIds.length||0!==this.parent.accreditationsSlotsIds.length||0!==this.parent.usersInfosIds.length||0!==this.parent.segmentsIds.length||this.createError({message:e.translationService.translate("vous_devez_s_le_80552")})};return{sendToEveryone:l.zM().required(this.t("requis_75853")),states:l.YO().of(l.Yj()).test("non-empty","",t),positionsCategoriesIds:l.YO().of(l.ai()).test("non-empty","",t),positionsIds:l.YO().of(l.ai()).test("non-empty","",t),positionsSlotsIds:l.YO().of(l.ai()).test("non-empty","",t),tagsIds:l.YO().of(l.ai()).test("non-empty","",t),accreditationsCategoriesIds:l.YO().of(l.ai()).test("non-empty","",t),accreditationsIds:l.YO().of(l.ai()).test("non-empty","",t),accreditationsSlotsIds:l.YO().of(l.ai()).test("non-empty","",t),usersInfosIds:l.YO().of(l.ai()).test("non-empty","",t),segmentsIds:l.YO().of(l.ai()).test("non-empty","",t)}}campaignStep3Schema(){return l.Ik().shape({campaign:l.Ik().shape({...this.campaignStep3Fields()})})}campaignStep4Fields(){return{scheduledAtDate:$m.when("state",{is:ce.Scheduled,then:e=>e.required(this.t("la_date_d_envoi_17792")).typeError(this.t("la_date_d_envoi_17792"))}),scheduledAtTime:l.Yj().when("state",{is:ce.Scheduled,then:e=>e.required(this.t("l_heure_d_envoi_53643")).matches(/\d{2}:\d{2}/,this.t("l_heure_d_envoi_53643"))})}}campaignStep4Schema(){return l.Ik().shape({campaign:l.Ik().shape({...this.campaignStep4Fields()})})}campaignInputSchema(){return l.Ik().shape({...this.campaignStep1Fields(),...this.campaignStep2Fields(),...this.campaignStep3Fields(),...this.campaignStep4Fields()})}createUpdateCampaignSchema(){return l.Ik().shape({campaign:this.campaignInputSchema()})}campaignInputDefault(e,t,n,i,o){let s=i?.segmentsIds??[],a=i?.usersInfosIds??[];if(h(o))try{const e=JSON.parse(r(o));e.segmentId&&(s=[e.segmentId]),Zo(e.usersInfosIds)&&(a=e.usersInfosIds)}catch{}const l=!Zo(s)&&!Zo(a)&&(i?.sendToEveryone??e);return{name:i?.name??"",state:i?.state??(t?ce.Template:ce.Draft),campaignType:i?.campaignType??ue.Email,sender:i?.sender??"",text:i?.text??"",subject:i?.subject??"",html:i?.html??"",replyTo:i?.replyTo??"",sendToEveryone:l,states:i?.states??[],positionsCategoriesIds:i?.positionsCategoriesIds??[],positionsIds:i?.positionsIds??[],positionsSlotsIds:i?.positionsSlotsIds??[],tagsIds:i?.tagsIds??[],accreditationsCategoriesIds:i?.accreditationsCategoriesIds??[],accreditationsIds:i?.accreditationsIds??[],accreditationsSlotsIds:i?.accreditationsSlotsIds??[],usersInfosIds:a,segmentsIds:s,scheduledAtDate:i?.scheduledAt??void 0,scheduledAtTime:i?.scheduledAt?.toFormat("HH:mm")??void 0,documents:i?.documents??[],emailSenderId:i?.emailSenderId??n,attachments:i?.attachments??[],hasCalendarInvite:i?.hasCalendarInvite??!1,calendarInviteName:i?.calendarInviteName??null,calendarInviteStartDate:i?.calendarInviteStartDate??null,calendarInviteStartTime:i?.calendarInviteStartTime??null,calendarInviteEndDate:i?.calendarInviteEndDate??null,calendarInviteEndTime:i?.calendarInviteEndTime??null}}};Ev=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],Ev);const Tv=[pt.OrganizationAdmin],zv=[pt.OrganizationAdmin,pt.EventAdmin];function $v(e){return e.roles.some(e=>zv.includes(e.type))}const Ov=[pt.OrganizationAdmin,pt.OrganizationReader],Rv=[pt.OrganizationAdmin,pt.OrganizationReader,pt.EventAdmin,pt.EventReader];function Pv(e,t,n){let i=e.roles;return void 0!==n&&(i=i.filter(t=>{switch(t.type){case pt.Custom:case pt.PositionEditor:case pt.PositionReader:return function(e,t,n){const i=e.usersPositionsCategories.some(e=>"ANY"===n.positionCategoryId?t.id===e.role.id:t.id===e.role.id&&e.positionCategoryId===n.positionCategoryId);if("positionId"in n){const o=e.usersPositions.some(e=>t.id===e.role.id&&e.positionId===n.positionId);return i||o}return i}(e,{id:t.id,type:t.type},n);default:return!0}})),t.map(e=>i.some(t=>"1"===t.positionPermissions[e]))}function Dv(e,t){return t.map(t=>e.roles.some(e=>"1"===e.delegationCategoryPermissions[t]))}const Fv=F.createContext({}),Mv=e=>{const{params:{eventId:t}}=il(),n=F.useMemo(()=>$v(e.userPermissions),[e.userPermissions]),o=F.useMemo(()=>function(e){return e.roles.some(e=>Rv.includes(e.type))}(e.userPermissions),[e.userPermissions]);return t?(0,i.jsx)(Fv.Provider,{value:{isEventAdmin:n,isEventReader:o,userPermissions:e.userPermissions,hasDelegationCategoryPermission:t=>function(e,t){return Dv(e,[t])[0]}(e.userPermissions,t),hasDelegationCategoryPermissions:t=>Dv(e.userPermissions,t),hasPositionPermission:(t,n)=>function(e,t,n){return Pv(e,[t],n)[0]}(e.userPermissions,t,n),hasPositionPermissions:(t,n)=>Pv(e.userPermissions,t,n)},children:e.children}):(0,i.jsx)(i.Fragment,{children:e.children})};function Nv(){return F.useContext(Fv)}var Lv=n(8923);const Bv=F.createContext({}),Vv=e=>{const[t,n]=F.useState(e.numberOfWaitingAccreditations),[o,s]=F.useState(e.numberOfWaitingAssigments),[r,a]=F.useState(null),l=F.useCallback(async t=>{const n=(0,Lv.A)(r,{id:e.event.id},t);await X_.events.put(n),a(n)},[e.event.id,r,a]),{isEventAdmin:d,isEventReader:c,userPermissions:u,hasDelegationCategoryPermission:h,hasDelegationCategoryPermissions:m,hasPositionPermission:g,hasPositionPermissions:p}=Nv();return F.useEffect(()=>{(async()=>{let t=await X_.events.get(e.event.id);t||(t={id:e.event.id},await X_.events.put(t)),a(t)})()},[e.event]),(0,i.jsx)(Bv.Provider,{value:{event:e.event,isEventAdmin:d,isEventReader:c,localEvent:r,numberOfWaitingAccreditations:t,numberOfWaitingAssigments:o,userPermissions:u,hasDelegationCategoryPermission:h,hasDelegationCategoryPermissions:m,hasPositionPermission:g,hasPositionPermissions:p,setNumberOfWaitingAccreditations:n,setNumberOfWaitingAssigments:s,updateLocalEvent:l},children:e.children})};function Uv(){return F.useContext(Bv)}const Wv=e=>{const t=(0,F.useRef)(null),n=(0,F.useCallback)(e=>{e&&(t.current=e,setTimeout(()=>{e.style.right=lr.space[6].value},100))},[]),o=(0,F.useCallback)(()=>{t.current.style.right="-400px",e.onClose()},[e.onClose]);return(0,ee.createPortal)((0,i.jsxs)(Ea,{ref:n,align:"center",className:"h-notification",css:{background:"black"===e.color?"$gray900":"error"===e.color?"$error400":"$success500",borderRadius:"$2",boxShadow:"$lg",maxHeight:"120px",padding:"$2 $4",position:"absolute",right:"-400px",top:"$6",transition:"0.5s right ease-in-out",zIndex:"1000"},gap:"3",role:"status",width:400,children:[(0,i.jsx)(Ea,{align:"center",css:{color:"white"},justify:"center",children:(0,i.jsx)(Va,{icon:"black"===e.color?"circle-exclamation":"error"===e.color?"circle-xmark":"circle-check",iconStyle:"solid"})}),(0,i.jsx)(fr,{color:"white",css:{flex:"1","& a":{color:"white",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:e.text},fontWeight:"medium"}),(0,i.jsx)(Ea,{align:"center",css:{color:"white",cursor:"pointer",fontSize:"$textMd"},height:32,justify:"center",width:32,onClick:o,children:(0,i.jsx)(Va,{icon:"xmark"})})]}),document.body)},Gv=2e3,Hv=F.createContext({}),qv=e=>{const t=Ln(),[n,o]=F.useState(!1),[s,r]=F.useState({color:"success",text:""}),a=F.useCallback(()=>{setTimeout(()=>{o(!1)},1200)},[o]),l=F.useCallback(e=>{o(!0),r("string"==typeof e?{text:e}:e),setTimeout(a,Fo.dw.fromObject({seconds:5}).toMillis())},[o,r,a]),{mutate:d}=function(e={}){return Un("mutation DelegationsImportResult(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $jobId: UUID!\n) {\n    delegationsImportResult(organizationId: $organizationId, eventId: $eventId, jobId: $jobId) {\n        state\n        event {\n            name\n        }\n    }\n}\n",e)}(),c=F.useRef(null),u=F.useCallback((e,n,i)=>{c.current=window.setInterval(async()=>{const{delegationsImportResult:{state:o,event:s}}=await d({organizationId:e,eventId:n,jobId:i});o===je.Done&&(clearInterval(c.current),l({color:"success",text:t("votre_import_es_98992",s.name)}))},Gv)},[]),{mutate:h}=function(e={}){return Un("mutation EventDocumentsExportResult($eventId: EventId!, $jobId: UUID!) {\n    eventDocumentsExportResult(eventId: $eventId, jobId: $jobId) {\n        state\n        url\n    }\n}\n",e)}(),m=F.useRef(null),g=F.useCallback((e,n)=>{m.current=window.setInterval(async()=>{const{eventDocumentsExportResult:i}=await h({eventId:e,jobId:n});i.state===De.Done&&(clearInterval(m.current),l({color:"success",text:t("l_export_de_vos_38257",i.url)}))},Gv)},[]),{mutate:p}=function(e={}){return Un("mutation ExportResult($organizationId: OrganizationId!, $eventId: EventId, $jobId: UUID!) {\n    exportResult(organizationId: $organizationId, eventId: $eventId, jobId: $jobId) {\n        state\n        url\n    }\n}\n",e)}(),f=F.useRef(null),x=F.useCallback((e,n,i)=>{f.current=window.setInterval(async()=>{const{exportResult:o}=await p({organizationId:e,eventId:n,jobId:i});o.state===De.Done&&(clearInterval(f.current),l({color:"success",text:t("votre_export_es_96069",o.url)}))},Gv)},[]),{mutate:_}=function(e={}){return Un("mutation FilesImportResult($organizationId: OrganizationId!, $jobId: UUID!) {\n    filesImportResult(organizationId: $organizationId, jobId: $jobId) {\n        state\n        event {\n            name\n        }\n    }\n}\n",e)}(),I=F.useRef(null),v=F.useCallback((e,n)=>{I.current=window.setInterval(async()=>{const{filesImportResult:{state:i,event:o}}=await _({organizationId:e,jobId:n});i===Le.Done&&(clearInterval(I.current),l({color:"success",text:o?t("votre_import_es_11791",o.name):t("votre_import_es_10672")}))},Gv)},[]),{mutate:b}=function(e={}){return Un("mutation PositionsImportResult($organizationId: OrganizationId!, $jobId: UUID!) {\n    positionsImportResult(organizationId: $organizationId, jobId: $jobId) {\n        state\n        event {\n            name\n        }\n    }\n}\n",e)}(),j=F.useRef(null),C=F.useCallback((e,n)=>{j.current=window.setInterval(async()=>{const{positionsImportResult:{state:i,event:o}}=await b({organizationId:e,jobId:n});i===st.Done&&(clearInterval(j.current),l({color:"success",text:t("votre_import_es_11848",o.name)}))},Gv)},[]),{mutate:y}=function(e={}){return Un("mutation VolunteersImportResult(\n    $organizationId: OrganizationId!\n    $delegationId: DelegationId\n    $jobId: UUID!\n) {\n    volunteersImportResult(\n        organizationId: $organizationId\n        delegationId: $delegationId\n        jobId: $jobId\n    ) {\n        state\n        event {\n            name\n        }\n    }\n}\n",e)}(),k=F.useRef(null),A=F.useCallback((e,n)=>{k.current=window.setInterval(async()=>{const{volunteersImportResult:{state:i,event:o}}=await y({organizationId:e,jobId:n});i===Tt.Done&&(clearInterval(k.current),l({color:"success",text:o?t("votre_import_es_37822",o.name):t("votre_import_es_14145")}))},Gv)},[]);return(0,i.jsx)(Hv.Provider,{value:{checkDelegationsImport:u,checkDocumentsExport:g,checkExport:x,checkFilesImport:v,checkPositionsImport:C,checkVolunteersImport:A,showNotification:l},children:(0,i.jsxs)(i.Fragment,{children:[n&&(0,i.jsx)(Wv,{color:s.color??"success",text:s.text,onClose:a}),e.children]})})};function Yv(){return F.useContext(Hv)}const Kv=F.createContext({});function Zv(){return F.useContext(Kv)}const Xv=(0,or.I4)("dialog",{background:"white",border:"none",display:"flex",flexDirection:"column",overflowY:"auto",padding:"0",variants:{mobile:{true:{height:"100%",width:"100%"},false:{borderRadius:"12px",maxHeight:"calc(100% - 80px)",width:"688px"}}},defaultVariants:{mobile:!1}}),Jv=e=>{const t=Ln(),{onClose:n}=Zv();return(0,i.jsxs)(Ea,{css:{borderTop:e.hideBorder?void 0:"1px solid $gray200",padding:"$6 $7"},gap:"3",justify:"end",children:[!e.hideCancelButton&&(0,i.jsx)(pl,{color:"white",onClick:n,children:t("annuler_48254")}),"function"==typeof e.children?e.children(n):e.children]})},Qv=e=>(0,i.jsx)(Ea,{direction:"column",...wa(e),css:{borderTop:e.hideBorder?void 0:"1px solid $gray200",padding:"$5 $7 $7 $7",...e.css},children:e.children}),eb=({icon:e,iconColor:t,children:n,subtitle:o,onClose:s})=>(0,i.jsxs)(Ea,{children:[(0,i.jsxs)(Ea,{align:"center",css:{flexGrow:"1",padding:"$6 $7 $5 $7"},gap:"4",children:[(0,i.jsx)(Ea,{align:"center",css:{border:"1px solid $gray200",borderRadius:"10px",boxShadow:"$xs",color:t||"$gray700",fontSize:"textMd",padding:"$3"},height:48,justify:"center",width:48,children:(0,i.jsx)(Va,{className:"fa-xl",icon:e})}),(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{font:"gray900 textLg medium",children:n}),h(o)&&(0,i.jsx)(fr,{color:"gray500",children:o})]})]}),s&&(0,i.jsx)(Ea,{align:"center",css:{color:"$gray500",cursor:"pointer",fontSize:"textMd",padding:"$2",margin:"$3 $3"},height:24,justify:"center",width:24,onClick:s,children:(0,i.jsx)(Va,{className:"fa-xl",icon:"xmark"})})]}),tb=({children:e})=>{const{isOpen:t,onClose:n}=Zv();return kd(n),t?(0,ee.createPortal)((0,i.jsx)(Ea,{align:"center",css:{background:"rgba(52, 64, 84, 0.7)",height:"100%",left:0,position:"absolute",top:0,width:"100%",zIndex:"300"},justify:"center",onClick:n,children:(0,i.jsx)(Xv,{onClick:e=>Il(e,!1),children:e})}),document.body):null},nb=e=>{const[t,n]=F.useState(e.isOpen??!1),o=F.useCallback(()=>{n(!1),e.onClose?.()},[n,e.onClose]);return F.useEffect(()=>{"boolean"==typeof e.isOpen&&n(e.isOpen)},[e.isOpen]),(0,i.jsx)(Kv.Provider,{value:{isOpen:t,onClose:o,setIsOpen:n},children:e.children})},ib=e=>{const{setIsOpen:t}=Zv(),n=e.children,o=F.useCallback(e=>{Il(e),t(!0),n.props.onClick?.(e)},[t,n]),s=F.useMemo(()=>F.cloneElement(F.Children.only(n),{onClick:o,onKeyPress:o,tabIndex:0}),[n,o]);return(0,i.jsx)(i.Fragment,{children:s})};var ob=n(7431);const sb=()=>{const{translate:e}=il(),t=Nn(Hc),[n,o]=(0,F.useState)(""),s=(0,F.useMemo)(()=>t.countries.filter(e=>"number"==typeof e.smsPrice),[t]),r=(0,F.useMemo)(()=>{if(h(n)){const e=c(n);return s.filter(t=>c(t.name).includes(e)||Ko(t.phoneCode).some(e=>e.includes(n)))}return s},[s,n]);return(0,i.jsxs)(nb,{children:[(0,i.jsx)(ib,{children:(0,i.jsx)(fr,{color:"primary700",children:e("voir_la_liste_d_69122")})}),(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"message",children:e("liste_des_prix_58579")}),(0,i.jsxs)(Qv,{css:{overflow:"auto"},direction:"column",gap:"3",height:300,children:[(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:"Rechercher un pays",state:"search",value:n,onChange:o}),(0,i.jsxs)(mc,{children:[(0,i.jsxs)(cc,{children:[(0,i.jsx)(Tc,{children:e("Country")}),(0,i.jsx)(Tc,{children:e("indicatif_40634")}),(0,i.jsx)(Tc,{children:e("prix_ht_10965")})]}),r.map(e=>{return(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{children:e.name}),(0,i.jsx)(xc,{children:e.phoneCode}),(0,i.jsx)(xc,{children:(0,ob.A)((t=e.smsPrice,t*(14/9)),3)})]},e.code);var t})]})]}),(0,i.jsx)(Jv,{})]})]})},rb=e=>{const t=Ln(),{hasFeature:n}=nI(),o=n(Fe.Sms);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sr.Yr,{name:"campaign.campaignType",children:t=>{t===ue.Sms?o?(e.formProps.form.change("campaign.text",""),e.formProps.form.change("campaign.html","")):e.formProps.form.change("campaign.campaignType",ue.Email):(e.formProps.form.change("campaign.text",""),e.formProps.form.change("campaign.html",""))}}),(0,i.jsx)(Sl,{label:e.isTemplate?t("nom_de_votre_mo_02364"):t("nom_de_votre_ca_08001"),name:"campaign.name"}),!e.isSent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",children:e.isTemplate?t("quel_type_de_mo_32965"):t("quel_type_de_ca_11960")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"campaign.campaignType",value:ue.Email,children:t("e_mail_13869")}),(0,i.jsx)(Pa,{height:"3"}),e.isAdmin&&(0,i.jsx)(vv,{disabled:!o,name:"campaign.campaignType",value:ue.Sms,children:(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{children:"SMS"}),(0,i.jsx)(sb,{}),!o&&(0,i.jsx)(fr,{color:"gray500",css:{"& a":{color:"$primary700"}},dangerouslySetInnerHTML:{__html:t("contactez_nous_22980",R.EMAIL_FROM,R.EMAIL_FROM)},fontSize:"textXs"})]})})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{onClick:e.formProps.handleSubmit,children:e.isTemplate?t("suivant_conte_33443"):t("suivant_conte_90603")})})]})},ab=e=>{const t=Ln(),{form:n,handleSubmit:o,values:s}=e.formProps;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sr.Yr,{name:"delivery",children:e=>{n.change("campaign.state","now"===e?ce.Draft:ce.Scheduled)}}),(0,i.jsx)(fr,{color:"gray800",children:t("quand_voulez_vo_96615")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"delivery",value:"now",children:t("je_souahite_l_e_46027")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"delivery",value:"later",children:t("je_souhaite_pro_98854")}),"later"===s.delivery&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(km,{min:Fo.c9.local(),name:"campaign.scheduledAtDate",placeholder:t("choisissez_la_d_30578")}),(0,i.jsx)(dv,{hint:t("le_fuseau_horai_57116",e.timeZone),name:"campaign.scheduledAtTime",placeholder:t("choisissez_l_he_55311")})]})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{onClick:o,children:t("suivant_r_cap_22677")})})]})};var lb,db;!function(e){e[e.READ_DELEGATION=0]="READ_DELEGATION",e[e.CREATE_DELEGATION=1]="CREATE_DELEGATION",e[e.EDIT_DELEGATION=2]="EDIT_DELEGATION",e[e.DELETE_DELEGATION=3]="DELETE_DELEGATION",e[e.VALIDATE_MEMBERS_ACCREDITATIONS=4]="VALIDATE_MEMBERS_ACCREDITATIONS"}(lb||(lb={})),function(e){e[e.READ_POSITION=0]="READ_POSITION",e[e.EDIT_POSITION=1]="EDIT_POSITION",e[e.EDIT_MEMBER=2]="EDIT_MEMBER",e[e.EDIT_ASSIGNMENT_STATE=3]="EDIT_ASSIGNMENT_STATE",e[e.READ_COMMENTS=4]="READ_COMMENTS",e[e.ADD_COMMENTS=5]="ADD_COMMENTS",e[e.EDIT_AVAILABILITIES=6]="EDIT_AVAILABILITIES",e[e.ASSIGN_MEMBER=7]="ASSIGN_MEMBER",e[e.SEND_CAMPAIGNS=8]="SEND_CAMPAIGNS"}(db||(db={}));const cb=e=>{const{translate:t,params:{eventId:n}}=il(),o=Nn($c),[s,r]=(0,F.useState)(!0),[a,l]=(0,F.useState)(!0),[d,c]=(0,F.useState)([]),[u,h]=(0,F.useState)([]),[m,g]=(0,F.useState)(!1),[p,f]=(0,F.useState)([]);return(0,F.useEffect)(()=>{(async()=>{if("accreditations"===e.recipients&&s){const e=await(t={eventId:n},i=await H(),ss("query CampaignEventAccreditationsRecipients($eventId: EventId!) {\n    event(id: $eventId) {\n        accreditationsCategories {\n            id\n            name\n        }\n\n        accreditations {\n            nodes {\n                id\n                name\n                accreditationCategoryName\n\n                slots {\n                    id\n                    name\n                    date\n                }\n            }\n        }\n    }\n}\n",{variables:t,token:i||void 0,fragments:[]}));c((0,Zd.A)(e.event.accreditationsCategories,e=>e.name)),h(Object.entries((0,Kd.A)(e.event.accreditations.nodes,e=>e.accreditationCategoryName))),g(Zo(e.event.accreditations.nodes.flatMap(e=>e.slots))),f(e.event.accreditations.nodes.map(e=>{const t=e.slots.map(t=>{const n=t.date?o.toLocaleString(t.date,Ho.DateOnly.MonthLong):"",i=t.date?`${t.name} - ${n} - ${e.name}`:`${t.name} - ${e.name}`;return{id:t.id,name:i}});return[e.name,t]})),r(!1),l(!1)}var t,i})()},[e.recipients,s]),e.recipients===Sv.Accreditations?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{css:{marginLeft:"$2"},children:a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qd,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(qd,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(qd,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!0,name:"campaign.accreditationsCategoriesIds",placeholder:t("ajouter_des_cat_17200"),children:d.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!0,name:"campaign.accreditationsIds",placeholder:t("ajouter_des_acc_26514"),children:u.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))}),m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!0,name:"campaign.accreditationsSlotsIds",placeholder:t("ajouter_des_cr_25566"),children:p.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))})]})]})})]}):null},ub=e=>{const t=nI(),n=Uv(),o=F.useMemo(()=>(t?.user?.roles.map(e=>e.type)||[]).concat(n?.userPermissions?.roles.map(e=>e.type)||[]),[t,n]);return F.useMemo(()=>!!o.includes(pt.OrganizationAdmin)||(Zo(e.rolesTypes)?Zo((0,Zu.A)(o,e.rolesTypes)):"function"==typeof n?.hasDelegationCategoryPermissions&&Zo(Ko(e.delegationCategoryPermissions))?n.hasDelegationCategoryPermissions(Ko(e.delegationCategoryPermissions)).some(e=>e):!("function"!=typeof n?.hasPositionPermissions||!Zo(Ko(e.positionsPermissions)))&&n.hasPositionPermissions(Ko(e.positionsPermissions),e.scope).some(e=>e)),[e.delegationCategoryPermissions,e.positionsPermissions,e.rolesTypes,e.scope,o,n])?(0,i.jsx)(i.Fragment,{children:e.children}):null},hb=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),s=Nn(Ku),{isEventAdmin:r}=Uv(),[a,l]=(0,F.useState)(!0),[d,c]=(0,F.useState)(!0),[u,m]=(0,F.useState)([]),[g,p]=(0,F.useState)([]),[f,x]=(0,F.useState)([]),[_,I]=(0,F.useState)([]);return(0,F.useEffect)(()=>{(async()=>{if("positions"===e.recipients&&a){const e=await(t={organizationId:n,eventId:o},i=await H(),ss("query CampaignEventPositionsRecipients($organizationId: OrganizationId!, $eventId: EventId!) {\n    organization(id: $organizationId) {\n        tags {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        positionsCategories {\n            id\n            name\n        }\n\n        positions {\n            nodes {\n                id\n                name\n                positionCategoryName\n\n                slots {\n                    id\n                    name\n                    range\n                }\n            }\n        }\n    }\n}\n",{variables:t,token:i||void 0,fragments:[]}));m((0,Zd.A)(e.event.positionsCategories,e=>e.name)),p(Object.entries((0,Kd.A)(e.event.positions.nodes,e=>e.positionCategoryName))),x(e.event.positions.nodes.map(e=>{const t=e.slots.map(t=>{const n=h(t.name)?`${t.name} - `:"",i=s.toDisplayString(t.range,{formats:{displayWeekday:!0}});return{id:t.id,name:`${n}${i} - ${e.name}`}});return[e.name,t]})),I(e.organization.tags.nodes),l(!1),c(!1)}var t,i})()},[e.recipients,a]),e.recipients===Sv.Positions?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{css:{marginLeft:"$6"},children:d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qd,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(qd,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(qd,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(qd,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(ub,{positionsPermissions:db.SEND_CAMPAIGNS,scope:{positionCategoryId:"ANY"},children:[(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsCategoriesIds",placeholder:t("ajouter_des_cat_15537"),children:u.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Pa,{height:"2"})]}),(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsIds",placeholder:t("ajouter_des_mis_44522"),children:g.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsSlotsIds",placeholder:t("ajouter_des_cr_25566"),children:f.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!0,name:"campaign.tagsIds",placeholder:t("ajouter_des_tag_57392"),children:_.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))})]})]})})]}):null},mb=e=>{const{translate:t,params:{eventId:n}}=il(),[o,s]=(0,F.useState)(!0),[r,a]=(0,F.useState)(!0),[l,d]=(0,F.useState)([]);return(0,F.useEffect)(()=>{(async()=>{if("segments"===e.recipients&&o){const e=await(t={eventId:n},i=await H(),ss("query CampaignEventSegmentsRecipients($eventId: EventId!) {\n    event(id: $eventId) {\n        segmentsFolders(segmentType: Volunteers) {\n            id\n            name\n\n            segments {\n                id\n                name\n            }\n        }\n    }\n}\n",{variables:t,token:i||void 0,fragments:[]}));d(e.event.segmentsFolders),s(!1),a(!1)}var t,i})()},[e.recipients,o]),"segments"===e.recipients?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{css:{marginLeft:"$6"},children:r?(0,i.jsx)(qd,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!0,name:"campaign.segmentsIds",placeholder:t("ajouter_des_vue_58990"),children:l.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})})]}):null};function gb({eventId:e,hasSelected:t,includePhone:n,nameDebounced:o,organizationId:s,populationsIds:r,reloadKey:a,userInfoIds:l}){const[d,c]=F.useState(!1),[u,m]=F.useState(null),g=F.useMemo(()=>(0,Zd.A)((0,Ju.A)((u?.usersInfos.nodes??[]).concat(u?.selectedUsersInfos?.nodes??[]),e=>e.id),e=>e.name.toLowerCase()),[u]),p=F.useMemo(()=>g.map(e=>(0,i.jsxs)("option",{value:e.id,children:[h(e.name)?e.name:"-"," (",n?e.phone?.internationalFormat||"-":e.email,")"]},e.id)),[g]);return F.useEffect(()=>{(async()=>{c(!0);const{organization:i}=await(a={organizationId:s,eventId:e,hasSelected:t,includePhone:n||!1,userInfoIds:l,name:h(o)?o:void 0,populationsIds:r},d=await H(),ss('query UsersSearch(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $hasSelected: Boolean!\n    $userInfoIds: [UsersInfoId!]!\n    $populationsIds: [BigInt!]\n    $name: String\n    $includePhone: Boolean!\n) {\n    organization(id: $organizationId) {\n        usersInfos(\n            eventId: $eventId\n            name: $name\n            populationsIds: $populationsIds\n            limit: 50\n            sort: { attribute: "Name", direction: Asc }\n        ) {\n            nodes {\n                id\n                email\n                name\n                phone: fieldValue(slug: "phone") @include(if: $includePhone)\n            }\n        }\n\n        selectedUsersInfos: usersInfos(ids: $userInfoIds) @include(if: $hasSelected) {\n            nodes {\n                id\n                email\n                name\n                phone: fieldValue(slug: "phone") @include(if: $includePhone)\n            }\n        }\n    }\n}\n',{variables:a,token:d||void 0,fragments:[]}));var a,d;m(i),c(!1)})()},[s,e,n,o,r,a]),{usersInfos:g,usersInfosOptions:p,isLoading:d}}const pb=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),[s,r,a]=Ec(""),{usersInfosOptions:l,isLoading:d}=gb({organizationId:n,eventId:o,includePhone:e.campaignType===ue.Sms,hasSelected:Zo(e.usersInfosIds),nameDebounced:r,userInfoIds:e.usersInfosIds});return"users"===e.recipients?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{css:{marginLeft:"$6"},children:(0,i.jsx)(Sm,{isSearchLoading:d,isSearchVisible:!0,multiple:!0,name:"campaign.usersInfosIds",placeholder:t("ajouter_des_mem_58427"),searchElement:(0,i.jsx)(wl,{icon:"magnifying-glass",name:s,placeholder:t("rechercher_un_m_05904"),state:"search",onChange:a}),children:l})})]}):null},fb=e=>{const t=Ln(),{isEventAdmin:n,hasPositionPermission:o}=Uv(),{form:s,handleSubmit:r,values:a}=e.formProps;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sr.Yr,{name:"recipients",children:e=>{if("everyone"===e)s.change("campaign.sendToEveryone",!0),s.change("campaign.states",[]),s.change("campaign.positionsCategoriesIds",[]),s.change("campaign.positionsIds",[]),s.change("campaign.positionsSlotsIds",[]),s.change("campaign.accreditationsCategoriesIds",[]),s.change("campaign.accreditationsIds",[]),s.change("campaign.accreditationsSlotsIds",[]),s.change("campaign.tagsIds",[]),s.change("campaign.usersInfosIds",[]),s.change("campaign.segmentsIds",[]);else if("states"===e)s.change("campaign.sendToEveryone",!1),s.change("campaign.positionsCategoriesIds",[]),s.change("campaign.positionsIds",[]),s.change("campaign.positionsSlotsIds",[]),s.change("campaign.accreditationsCategoriesIds",[]),s.change("campaign.accreditationsIds",[]),s.change("campaign.accreditationsSlotsIds",[]),s.change("campaign.tagsIds",[]),s.change("campaign.usersInfosIds",[]),s.change("campaign.segmentsIds",[]);else if("positions"===e)s.change("campaign.sendToEveryone",!1),s.change("campaign.states",[]),s.change("campaign.accreditationsCategoriesIds",[]),s.change("campaign.accreditationsIds",[]),s.change("campaign.accreditationsSlotsIds",[]),s.change("campaign.usersInfosIds",[]),s.change("campaign.segmentsIds",[]);else if("accreditations"===e)s.change("campaign.sendToEveryone",!1),s.change("campaign.states",[]),s.change("campaign.positionsCategoriesIds",[]),s.change("campaign.positionsIds",[]),s.change("campaign.positionsSlotsIds",[]),s.change("campaign.usersInfosIds",[]),s.change("campaign.segmentsIds",[]);else if("users"===e)s.change("campaign.sendToEveryone",!1),s.change("campaign.states",[]),s.change("campaign.positionsCategoriesIds",[]),s.change("campaign.positionsIds",[]),s.change("campaign.positionsSlotsIds",[]),s.change("campaign.accreditationsCategoriesIds",[]),s.change("campaign.accreditationsIds",[]),s.change("campaign.accreditationsSlotsIds",[]),s.change("campaign.tagsIds",[]),s.change("campaign.segmentsIds",[]);else{if("segments"!==e)throw new Error(`Recipients ${e} is not possible`);s.change("campaign.sendToEveryone",!1),s.change("campaign.states",[]),s.change("campaign.positionsCategoriesIds",[]),s.change("campaign.positionsIds",[]),s.change("campaign.positionsSlotsIds",[]),s.change("campaign.accreditationsCategoriesIds",[]),s.change("campaign.accreditationsIds",[]),s.change("campaign.accreditationsSlotsIds",[]),s.change("campaign.tagsIds",[]),s.change("campaign.usersInfosIds",[])}}}),(0,i.jsx)(Sr.Yr,{name:"campaign.sendToEveryone",children:e=>{e&&(s.change("campaign.states",[]),s.change("campaign.positionsCategoriesIds",[]),s.change("campaign.positionsIds",[]),s.change("campaign.positionsSlotsIds",[]),s.change("campaign.tagsIds",[]),s.change("campaign.accreditationsCategoriesIds",[]),s.change("campaign.accreditationsIds",[]),s.change("campaign.accreditationsSlotsIds",[]),s.change("campaign.usersInfosIds",[]))}}),(0,i.jsx)(Sr.Yr,{name:"campaign.positionsCategoriesIds",children:()=>{a.campaign.sendToEveryone&&a.campaign.positionsCategoriesIds.length>0&&s.change("campaign.positionsCategoriesIds",[])}}),(0,i.jsx)(Sr.Yr,{name:"campaign.positionsIds",children:()=>{a.campaign.sendToEveryone&&a.campaign.positionsIds.length>0&&s.change("campaign.positionsIds",[])}}),(0,i.jsx)(Sr.Yr,{name:"campaign.positionsSlotsIds",children:()=>{a.campaign.sendToEveryone&&a.campaign.positionsSlotsIds.length>0&&s.change("campaign.positionsSlotsIds",[])}}),(0,i.jsx)(Sr.Yr,{name:"campaign.tagsIds",children:()=>{a.campaign.sendToEveryone&&a.campaign.tagsIds.length>0&&s.change("campaign.tagsIds",[])}}),(0,i.jsx)(Sr.Yr,{name:"campaign.usersInfosIds",children:()=>{a.campaign.sendToEveryone&&a.campaign.usersInfosIds.length>0&&s.change("campaign.usersInfosIds",[])}}),(0,i.jsx)(Sr.Yr,{name:"campaign.segmentsIds",children:()=>{a.campaign.sendToEveryone&&a.campaign.segmentsIds.length>0&&s.change("campaign.segmentsIds",[])}}),(0,i.jsx)(fr,{color:"gray800",children:t("_qui_voulez_vo_96064")}),(0,i.jsx)(Pa,{height:"3"}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vv,{name:"recipients",value:"everyone",children:t("_tous_vos_memb_31761")}),(0,i.jsx)(Pa,{height:"3"})]}),n&&(0,i.jsx)(vv,{name:"recipients",value:"states",children:t("_certains_memb_35722")}),"states"===a.recipients&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{css:{marginLeft:"$6"},children:(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!0,name:"campaign.states",placeholder:t("ajouter_des_sta_70922"),children:wn.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))})})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"recipients",value:"positions",children:n?t("_certaines_cat_59188"):o(db.SEND_CAMPAIGNS,{positionCategoryId:"ANY"})?t("_certaines_cat_22161"):t("_certaines_mis_80674")}),(0,i.jsx)(hb,{recipients:a.recipients}),(0,i.jsx)(Pa,{height:"3"}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vv,{name:"recipients",value:"accreditations",children:t("_certaines_cat_14293")}),(0,i.jsx)(cb,{recipients:a.recipients}),(0,i.jsx)(Pa,{height:"3"})]}),(0,i.jsx)(vv,{name:"recipients",value:"users",children:t("_certains_memb_91094")}),(0,i.jsx)(pb,{campaignType:e.formProps.values.campaign.campaignType,recipients:a.recipients,usersInfosIds:e.formProps.values.campaign.usersInfosIds}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"recipients",value:"segments",children:t("_certaines_vue_55512")}),(0,i.jsx)(mb,{recipients:a.recipients}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{onClick:r,children:t("suivant_livra_97068")})})]})},xb=e=>{const{translate:t,params:{organizationId:n}}=il(),[o,s]=(0,F.useState)(!0),[r,a]=(0,F.useState)(!0),[l,d]=(0,F.useState)([]);return(0,F.useEffect)(()=>{(async()=>{if("segments"===e.recipients&&o){const e=await(t={organizationId:n},i=await H(),ss("query CampaignOrganizationSegmentsRecipients($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        segmentsFolders(level: Organization, segmentType: Volunteers) {\n            id\n            name\n\n            segments {\n                id\n                name\n            }\n        }\n    }\n}\n",{variables:t,token:i||void 0,fragments:[]}));d(e.organization.segmentsFolders),s(!1),a(!1)}var t,i})()},[e.recipients,o]),"segments"===e.recipients?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{css:{marginLeft:"$6"},children:r?(0,i.jsx)(qd,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!0,name:"campaign.segmentsIds",placeholder:t("ajouter_des_vue_58990"),children:l.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})})]}):null},_b=e=>{const t=Ln(),{form:n,handleSubmit:o,values:s}=e.formProps;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sr.Yr,{name:"recipients",children:e=>{if("everyone"===e)n.change("campaign.sendToEveryone",!0),n.change("campaign.usersInfosIds",[]),n.change("campaign.segmentsIds",[]);else if("users"===e)n.change("campaign.sendToEveryone",!1),n.change("campaign.segmentsIds",[]);else{if("segments"!==e)throw new Error(`Recipients ${e} is not possible`);n.change("campaign.sendToEveryone",!1),n.change("campaign.usersInfosIds",[])}}}),(0,i.jsx)(Sr.Yr,{name:"campaign.sendToEveryone",children:e=>{e&&(n.change("campaign.segmentsIds",[]),n.change("campaign.usersInfosIds",[]))}}),(0,i.jsx)(Sr.Yr,{name:"campaign.usersInfosIds",children:()=>{s.campaign.sendToEveryone&&s.campaign.usersInfosIds.length>0&&n.change("campaign.usersInfosIds",[])}}),(0,i.jsx)(Sr.Yr,{name:"campaign.segmentsIds",children:()=>{s.campaign.sendToEveryone&&s.campaign.segmentsIds.length>0&&n.change("campaign.segmentsIds",[])}}),(0,i.jsx)(vv,{name:"recipients",value:"everyone",children:t("_tous_vos_memb_83616")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"recipients",value:"users",children:t("_certains_memb_91094")}),(0,i.jsx)(pb,{campaignType:e.formProps.values.campaign.campaignType,recipients:s.recipients,usersInfosIds:e.formProps.values.campaign.usersInfosIds}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"recipients",value:"segments",children:t("_certaines_vue_55512")}),(0,i.jsx)(xb,{recipients:s.recipients}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{onClick:o,children:t("suivant_livra_97068")})})]})},Ib=e=>{const t=Ln(),{organizationId:n,eventId:o}=Wn(),[s,r]=(0,F.useState)(null),{mutate:a}=function(e={}){return Un("mutation CampaignEstimate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $campaign: CampaignInput!\n) {\n    campaignEstimate(organizationId: $organizationId, eventId: $eventId, campaign: $campaign) {\n        numberOfRecipients\n        price\n    }\n}\n",e)}(),{form:l,handleSubmit:d,submitting:c,values:u}=e.formProps,h=(0,F.useMemo)(()=>{if(e.formProps.values.campaign.campaignType===ue.Email){const t=e.emailsSenders.find(t=>t.id===e.formProps.values.campaign.emailSenderId);return t&&!t.isValidToSendEmail}return!1},[e.emailsSenders,e.formProps.values.campaign.emailSenderId]);return(0,F.useEffect)(()=>{a({organizationId:n,eventId:o,campaign:e.formProps.values.campaign}).then(e=>{r(e.campaignEstimate)})},[]),s?(0,i.jsxs)(i.Fragment,{children:[h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ha,{color:"error",leftIcon:"circle-exclamation",children:t("vous_ne_pouvez_33410")}),(0,i.jsx)(Pa,{height:"4"})]}),(0,i.jsxs)(Ea,{gap:"1",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:t("nombre_de_desti_22505")}),(0,i.jsx)(fr,{color:"gray800",children:t("_1_membre_49737",s.numberOfRecipients)})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsxs)(Ea,{gap:"1",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:t("prix_total_03054")}),(0,i.jsx)(fr,{color:"gray800",children:0===s.price?t("gratuit_13712"):`${s.price}€`})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(pl,{disabled:h,isLoading:c,onClick:()=>{u.campaign.state!==ce.Scheduled&&l.change("campaign.state",ce.InProgress),d()},children:u.campaign.state===ce.Scheduled?t("programmer_la_c_01938"):e.isEdit?t("mettre_jour_l_63945"):t("cr_er_et_envoye_81501")}),(0,i.jsx)(pl,{color:"white",isLoading:c,onClick:()=>{l.change("campaign.state",ce.Draft),d()},children:t("enregistrer_en_81222")})]})]}):(0,i.jsx)(ul,{})},vb=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=il(),{showNotification:r}=Yv(),a=Nn(Ev),l=e.initialValues.campaign.state===ce.Template,d=(0,F.useMemo)(()=>e.isEdit?s("mise_jour_de_17055",e.initialValues.campaign.name):s(l?"cr_ation_d_un_m_50096":"cr_ation_d_une_80936"),[e.isEdit,e.initialValues]);Cd(d);const c=[ce.Done,ce.InProgress].includes(e.initialValues.campaign.state),u=rI.CAMPAIGNS({organizationId:n,eventId:o});return(0,i.jsx)(bm,{category:d,fallbackClosePath:u,title:e.isEdit?e.initialValues.campaign.name:s(l?"nouveau_mod_le_74336":"nouvelle_campag_28814"),children:(0,i.jsx)(Im,{children:(0,i.jsxs)(kv,{initialValues:e.initialValues,isEdit:e.isEdit,onSubmit:async n=>{await e.mutate(n.campaign),r(e.isEdit?s("la_campagne_a_50262"):s("la_campagne_a_02968")),t.goBack(u)},children:[(0,i.jsx)(yv,{render:t=>(0,i.jsx)(rb,{formProps:t,isAdmin:e.isAdmin,isSent:c,isTemplate:l}),schema:a.campaignStep1Schema(),title:s(l?"initialisation_84842":"initialisation_48904")}),(0,i.jsx)(yv,{render:t=>(0,i.jsx)(jv,{campaignType:e.campaignType,customDocuments:e.customDocuments,emailSenderId:e.emailSenderId,emailsSenders:e.emailsSenders,formProps:t,isEdit:e.isEdit,isSent:c,isTemplate:l}),schema:a.campaignStep2Schema(),title:s("contenu_29668")}),!l&&!c&&(0,i.jsx)(yv,{render:t=>"event"===e.campaignType?(0,i.jsx)(fb,{formProps:t}):(0,i.jsx)(_b,{formProps:t}),schema:a.campaignStep3Schema(),title:s("destinataires_19592")}),!l&&!c&&(0,i.jsx)(yv,{render:t=>(0,i.jsx)(ab,{formProps:t,timeZone:e.timeZone}),schema:a.campaignStep4Schema(),title:s("livraison_86944")}),!l&&!c&&(0,i.jsx)(yv,{render:t=>(0,i.jsx)(Ib,{emailsSenders:e.emailsSenders,formProps:t,isEdit:e.isEdit}),schema:a.createUpdateCampaignSchema(),title:s("r_capitulatif_a_79107")})]})})})},bb=e=>{const{organizationId:t,eventId:n,options:o}=Wn(),s=Nn(Ev),{data:r,loader:a}=_s({organizationId:t,eventId:n}),{mutate:l}=fs();return a||(0,i.jsx)(vb,{campaignType:n?"event":"organization",customDocuments:r.organization?.event?.customDocuments??[],emailSenderId:r.organization?.event?.emailSender?.id??r.organization.emailSenderId,emailsSenders:r.organization.emailsSenders,initialValues:s.createUpdateCampaignValuesDefault(e.isAdmin,e.isTemplate,r.organization.emailSenderId,null,o),isAdmin:!0,isEdit:!1,mutate:async e=>{const{campaignCreate:{id:i}}=await l({organizationId:t,eventId:n,campaign:e});return i},timeZone:r.organization?.event?.timeZone??r.organization.timeZone})},jb=()=>{const{organizationId:e,eventId:t,campaignId:n}=Wn(),{data:o,loader:s}=Vn("query CampaignToEdit(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $campaignId: CampaignId!\n) {\n    organization(id: $organizationId) {\n        emailsSenders {\n            ...CreateCampaignEmailSender\n        }\n    }\n\n    event(id: $eventId) {\n        timeZone\n\n        campaign(id: $campaignId) {\n            ...CampaignEdit\n        }\n\n        customDocuments {\n            slug\n            name\n        }\n\n        emailSender {\n            ... on EmailsSender {\n                id\n            }\n        }\n    }\n}\n",{organizationId:e,eventId:t,campaignId:n},[Ro.CreateCampaignEmailSenderFragment,Ro.CampaignEditFragment]),r=Nn(Ev),{mutate:a}=xs(),{isEventAdmin:l}=Uv();return s||(0,i.jsx)(vb,{campaignType:"event",customDocuments:o.event.customDocuments,emailSenderId:o.event.emailSender?.id,emailsSenders:o.organization.emailsSenders,initialValues:r.createUpdateCampaignValuesDefault(l,!1,o.event.emailSender?.id,o.event.campaign,null),isAdmin:l,isEdit:!0,mutate:async i=>{const{campaignUpdate:{id:o}}=await a({organizationId:e,eventId:t,campaignId:n,campaign:i});return o},timeZone:o.event.timeZone})},Cb=()=>{const{organizationId:e,campaignId:t}=Wn(),{data:n,loader:o}=Vn("query CampaignOrganizationToEdit($organizationId: OrganizationId!, $campaignId: CampaignId!) {\n    organization(id: $organizationId) {\n        adminEmail\n        emailSenderId\n        timeZone\n\n        campaign(id: $campaignId) {\n            ...CampaignEdit\n        }\n\n        emailsSenders {\n            ...CreateCampaignEmailSender\n        }\n    }\n}\n",{organizationId:e,campaignId:t},[Ro.CampaignEditFragment,Ro.CreateCampaignEmailSenderFragment]),s=Nn(Ev),{mutate:r}=xs();return o||(0,i.jsx)(vb,{campaignType:"organization",customDocuments:[],emailSenderId:n.organization.emailSenderId,emailsSenders:n.organization.emailsSenders,initialValues:s.createUpdateCampaignValuesDefault(!0,!1,n.organization.emailSenderId,n.organization.campaign,null),isAdmin:!0,isEdit:!0,mutate:async n=>{const{campaignUpdate:{id:i}}=await r({organizationId:e,campaignId:t,campaign:n});return i},timeZone:n.organization.timeZone})},yb=({children:e,color:t,fontWeight:n,returnPathFallback:o})=>{const s=Gn();return(0,i.jsxs)(Ea,{align:"center",css:{color:"primary"===t?"$primary700":"$gray900",cursor:"pointer",fontSize:"textXl",fontWeight:n??"normal",padding:0},gap:"2",onClick:()=>s.goBack(o),children:[(0,i.jsx)(Va,{icon:"arrow-left"}),e]})},kb=F.createContext({}),Ab=e=>(0,i.jsx)(kb.Provider,{value:{...e},children:e.children}),wb=e=>(0,i.jsxs)(fr,{css:{bd:!0,padding:"$6",width:"100%"},children:[(0,i.jsx)(fr,{color:"gray500",fontWeight:"medium",children:e.title}),(0,i.jsx)(fr,{color:"gray900",fontSize:"displayMd",fontWeight:"semiBold",children:e.content})]}),Sb=ar(Ea,{gap:"$3",variants:{avatarOnTop:{true:{flexDirection:"column",gap:"$2"},false:{alignItems:"center",flexDirection:"row"}}}}),Eb=e=>{const{params:{organizationId:t,eventId:n}}=il(),o=F.useMemo(()=>h(e.userInfo.name)?e.userInfo.name:"-",[e.userInfo.name]),s=()=>(0,i.jsx)(fr,{color:e.disabled?"gray300":"gray800",css:{ellipsis:""},disabled:e.disabled,fontWeight:"medium",title:o,children:o});return(0,i.jsxs)(Sb,{avatarOnTop:{"@initial":!!e.badge,"@tablet":!1},width:1,children:[(0,i.jsx)(Fg,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:e.size||40}),(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"hidden"},direction:"column",justify:"center",children:[(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[e.isClickDisabled?s():(0,i.jsx)(j_,{to:kI.MEMBER_INFORMATION({organizationId:t,eventId:n,userInfoId:e.userInfo.id}),children:s()}),(0,i.jsx)(fr,{css:{flexShrink:0},children:e.badge})]}),(0,i.jsx)(fr,{color:e.disabled?"gray300":"gray500",css:{ellipsis:""},fontSize:"textSm",title:e.userInfo.email,children:e.areContactLinksEnabled?(0,i.jsx)(j_,{css:{fontWeight:"normal"},to:`mailto:${e.userInfo.email}`,children:e.userInfo.email}):(0,i.jsx)(i.Fragment,{children:e.userInfo.email})}),e.showPhoneNumber&&(0,i.jsx)(fr,{color:e.disabled?"gray300":"gray500",css:{ellipsis:""},fontSize:"textSm",title:e.userInfo.phone?.internationalFormat,children:e.areContactLinksEnabled?(0,i.jsx)(j_,{css:{fontWeight:"normal"},to:`tel:${e.userInfo.phone?.internationalFormat}`,children:e.userInfo.phone?.internationalFormat}):(0,i.jsx)(i.Fragment,{children:e.userInfo.phone?.internationalFormat})})]})]})};function Tb(e){switch(e){case Ee.Waiting:case Ee.Queued:return{color:"warning",leftIcon:"hourglass-empty"};case Ee.Bounced:return{color:"error",leftIcon:"circle-exclamation"};default:return{color:"success",leftIcon:"check"}}}const zb=e=>{const{translate:t,params:{organizationId:n,eventId:o,campaignId:s}}=il(),r=Nn($c),{mutate:a}=Js(),{mutate:l}=Ns();return(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(Eb,{userInfo:e.email.userInfo})}),(0,i.jsx)(xc,{children:e.email.sentAt?r.toLocaleString(e.email.sentAt.toLocal(),Ho.DateTime):""}),(0,i.jsxs)(xc,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(Gd,{...Tb(e.email.state),children:t(e.email.state)}),e.email.state===Ee.Bounced&&h(e.email.infos?.bounceDiagnosticCode)&&(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.email.infos.bounceDiagnosticCode,width:1,children:e.email.infos.bounceDiagnosticCode})]}),(0,i.jsx)(im,{justify:"end",children:(0,i.jsx)(pm,{children:(0,i.jsx)(Od,{icon:"paper-plane",onClick:async()=>{e.emailType?await l({organizationId:n,eventId:o,userInfoId:e.email.userInfo.id,emailType:e.emailType}):await a({organizationId:n,eventId:o,campaignId:s,selecteds:{ids:[e.email.userInfo.id]}}),e.reload()},children:t("r_envoyer_90741")})})})]})},$b=e=>{const{params:{organizationId:t,campaignId:n},translate:o}=il(),[s,r,a]=Ec(""),[l,d]=(0,F.useState)(""),[c,u]=(0,F.useState)(0),{data:m,isLoading:g,reload:p}=Vn("query CampaignEmails(\n    $organizationId: OrganizationId!\n    $campaignId: CampaignId!\n    $name: String\n    $state: EmailState\n    $offset: Int\n) {\n    organization(id: $organizationId) {\n        campaign(id: $campaignId) {\n            emails(name: $name, state: $state, limit: 25, offset: $offset) {\n                nodes {\n                    ...EmailRecipient\n                }\n\n                numberOfPages\n                totalCount\n            }\n        }\n    }\n}\n",{organizationId:t,campaignId:n,name:h(r)?r:void 0,state:""!==l?l:void 0,offset:c},[Ro.EmailRecipientFragment]);const f=Ac();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{gap:"6",children:[(0,i.jsx)(wb,{content:e.campaign.numberOfRecipients,title:o("nombre_de_desti_21374")}),(0,i.jsx)(wb,{content:e.campaign.numberOfOpen??0,title:o("nombre_d_ouvert_84187")}),(0,i.jsx)(wb,{content:e.campaign.numberOfClick??0,title:o("nombre_de_clics_64232")})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(kc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{width:200,children:(0,i.jsxs)(gu,{value:l,onChange:e=>{d(e),u(0)},children:[(0,i.jsx)("option",{value:"",children:o("tous_les_status_67644")}),f(en.filter(e=>e!==Ee.Queued))]})}),(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:o("rechercher_un_d_02329"),value:s,onChange:e=>{a(e),u(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:o("nom_du_membre_69353")}),(0,i.jsx)(Tc,{children:o("date_d_envoi_74668")}),(0,i.jsx)(Tc,{children:o("status_06428")}),(0,i.jsx)(Tc,{width:100})]}),numberOfPages:m.organization?.campaign.emails.numberOfPages??0,offset:c,rows:g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:m.organization.campaign.emails.nodes.map((e,t)=>(0,i.jsx)(zb,{email:e,emailType:null,reload:p},t))}),setOffset:u,title:o("liste_des_desti_16448"),totalCount:m.organization?.campaign.emails.totalCount??0})]})},Ob=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,userInfoId:r}}=il(),[a,l,d]=Ec(""),{usersInfosOptions:c,isLoading:u}=gb({organizationId:o,eventId:s,hasSelected:!0,nameDebounced:l,userInfoIds:[r],populationsIds:e.populationsIds});return(0,i.jsxs)(Ea,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(fr,{font:"gray900 textMd semiBold",children:n("aper_u_pour_le_81451")}),(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(dc,{isSearchLoading:u,isSearchVisible:!0,searchElement:(0,i.jsx)(wl,{icon:"magnifying-glass",name:a,placeholder:n("rechercher_un_m_05904"),state:"search",onChange:d}),values:[r],onChange:n=>{Zo(n)&&t.replace(e.getPath(n[0]))},children:c})}),h(e.downloadPath)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{css:{flex:"1"}}),(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",to:e.downloadPath,children:n("t_l_charger_03283")})})]})]})};function Rb(e){switch(e){case Et.Assigned:return{color:"success",leftIcon:"check"};case Et.Refused:return{color:"error",leftIcon:"xmark"};case Et.PreAssigned:return{color:"pink",leftIcon:"wand-magic-sparkles"};case Et.WaitingAssignment:return{color:"warning",leftIcon:"hourglass-empty"};case Et.NotApplicable:return{color:"gray",leftIcon:"infinity"};default:return Za()}}function Pb(e){switch(e){case ae.Accredited:return{color:"success",leftIcon:"check"};case ae.AutoAccredited:return{color:"success",leftIcon:"bolt-auto"};case ae.Refused:return{color:"error",leftIcon:"xmark"};case ae.WaitingAccreditation:return{color:"warning",leftIcon:"hourglass-empty"};case ae.NotApplicable:return{color:"gray",leftIcon:"infinity"};default:return Za()}}const Db=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=il(),{getVolunteersSegmentPath:r}=F.useContext(kb),a=(0,F.useMemo)(()=>e.campaign.positionsCategories.map(e=>({id:`pc-${e.id}`,name:e.name,link:ao.POSITION_CATEGORY({organizationId:o,eventId:s,positionCategoryId:e.id})})).concat(e.campaign.positions.map(e=>({id:`p-${e.id}`,name:e.name,link:ao.POSITION({organizationId:o,eventId:s,positionId:e.id})}))).concat(e.campaign.positionsSlots.map(e=>({id:`ps-${e.id}`,name:`${e.position.name} - ${e.nameOrRange}`,link:ao.POSITION({organizationId:o,eventId:s,positionId:e.position.id})}))).concat(e.campaign.tags.map(e=>({id:`t-${e.id}`,name:e.name,link:""}))),[e.campaign]),l=(0,F.useMemo)(()=>e.campaign.accreditationsCategories.map(e=>({id:`ac-${e.id}`,name:e.name,link:""})).concat(e.campaign.accreditations.map(e=>({id:`a-${e.id}`,name:e.name,link:Hi.ACCREDITATION({organizationId:o,eventId:s,accreditationId:e.id})}))).concat(e.campaign.accreditationsSlots.map(e=>({id:`as-${e.id}`,name:`${e.accreditation.name} - ${e.name}}`,link:Hi.ACCREDITATION({organizationId:o,eventId:s,accreditationId:e.accreditation.id})}))),[e.campaign]),d=(0,F.useMemo)(()=>l.length+a.length,[l,a]);return(0,i.jsxs)(Ea,{gap:"1",children:[(0,i.jsx)(fr,{color:"gray500",children:n("_96502")}),e.campaign.sendToEveryone?(0,i.jsx)(fr,{color:"gray800",children:n("tous_vos_membre_30731")}):Zo(e.campaign.states)?(0,i.jsx)(Ea,{css:{flex:"1"},gap:"2",wrap:"wrap",children:e.campaign.states.map(e=>(0,i.jsx)(Gd,{...Rb(e),children:n(e)},e))}):Zo(e.campaign.usersInfos)?(0,i.jsx)(Ea,{css:{flex:"1"},gap:"1",wrap:"wrap",children:e.campaign.usersInfos.map((n,r)=>(0,i.jsxs)(fr,{color:"primary700",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{t.push(kI.MEMBER_INFORMATION({organizationId:o,eventId:s,userInfoId:n.id}))},children:[n.nameOrEmail,r!==e.campaign.usersInfos.length-1&&", "]},n.id))}):Zo(e.campaign.segments)?(0,i.jsx)(Ea,{css:{flex:"1"},gap:"1",wrap:"wrap",children:e.campaign.segments.map((n,o)=>(0,i.jsxs)(fr,{color:"primary700",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{t.push(r(n.id))},children:[n.name,o!==e.campaign.segments.length-1&&", "]},n.id))}):(0,i.jsx)(Ea,{css:{flex:"1"},gap:"1",wrap:"wrap",children:a.concat(l).map((e,n)=>(0,i.jsxs)(fr,{color:h(e.link)?"primary700":"gray800",css:{cursor:h(e.link)?"pointer":"initial",textDecoration:"underline"},onClick:()=>{h(e.link)&&t.push(e.link)},children:[e.name,n!==d-1?", ":""]},e.id))})]})},Fb=e=>{const t=Ln(),n=(0,F.useCallback)(e=>{e&&(e.onload=()=>{const t=e.contentDocument.body.scrollHeight;e.style.height=`${t}px`,e.contentDocument.body.style.margin="0",e.contentDocument.body.style.overflow="hidden",e.parentElement.style.height=`${t+64}px`})},[]);return(0,i.jsx)(Ea,{css:{background:"$gray200",minHeight:"100%",py:"$6"},justify:"center",width:1,children:(0,i.jsxs)(Ea,{css:{background:"white",borderRadius:"$2",boxShadow:"$md",minHeight:"100%",paddingTop:"$6"},direction:"column",gap:"3",width:664,children:[e.createdBy&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(fr,{color:"gray500",children:t("cr_e_par_16667")}),(0,i.jsx)(fr,{color:"gray800",children:e.createdBy})]}),(0,i.jsx)(fr,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.from&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(fr,{color:"gray500",children:t("de_70487")}),(0,i.jsx)(fr,{color:"gray800",children:e.from})]}),(0,i.jsx)(fr,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.to&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{css:{margin:"0 $6"},width:1,children:(0,i.jsx)(Db,{campaign:e.to})}),(0,i.jsx)(fr,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.subject&&(0,i.jsxs)(Ea,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(fr,{color:"gray500",children:t("objet_86482")}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:e.subject})]}),e.content&&(0,i.jsxs)(Ea,{css:{background:"$gray100",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",flexGrow:"1",padding:"$7"},direction:"column",gap:"6",children:[(0,i.jsx)(fr,{css:{minHeight:"300px",marginTop:"$3","& iframe":{background:"white",border:"none",borderRadius:"$2",overflow:"hidden",width:"100%"}},width:1,children:(0,i.jsx)("iframe",{ref:n,srcDoc:e.content})}),(Zo(e.attachments)||Zo(e.documents))&&(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(fr,{font:"gray900 textXl semiBold",children:t("pi_ces_jointes_36761")}),(0,i.jsx)(Ea,{gap:"2",children:(e.attachments||[]).map(e=>(0,i.jsx)(Gd,{color:"white",size:"md",children:TI.includes(e)?t(e):Yt.includes(e)?b_(e):e},e))}),(0,i.jsx)(Ea,{direction:"column",gap:"3",children:(e.documents||[]).map(e=>(0,i.jsx)(WI,{acl:"public-read",document:e},e.id))})]})]})]})})},Mb=()=>{const{params:{organizationId:e,eventId:t,campaignId:n,userInfoId:o}}=il(),{data:s,loader:r}=Nr({organizationId:e,campaignId:n,userInfoId:o}),a=(0,F.useMemo)(()=>s.organization?.campaign.createdBy?`${s.organization.campaign.createdBy.name} (${s.organization.campaign.createdBy.email})`:null,[s.organization]),l=(0,F.useMemo)(()=>s.organization?.campaign.emailSender?`${s.organization.campaign.emailSender.fromName} (${s.organization.campaign.emailSender.fromEmail})`:R.EMAIL_FROM,[s.organization]);return r||(0,i.jsxs)(Ea,{direction:"column",height:1,width:1,children:[(0,i.jsx)(Ob,{getPath:i=>rI.CAMPAIGN_PREVIEW({organizationId:e,eventId:t,campaignId:n,userInfoId:i})}),(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(Fb,{attachments:s.organization.campaign.attachments,content:s.organization.campaign.preview,createdBy:a,documents:s.organization.campaign.documents,from:l,subject:s.organization.campaign.subject,to:s.organization.campaign})})]})};function Nb(e){switch(e){case jt.Waiting:return{color:"warning",leftIcon:"hourglass-empty"};case jt.Sent:case jt.Delivered:return{color:"success",leftIcon:"check"};default:return{color:"error",leftIcon:"circle-exclamation"}}}const Lb=e=>(0,i.jsx)(fr,{color:"gray800",css:{borderBottom:"1px solid $gray200",padding:"$6"},fontSize:"textXl",fontWeight:"medium",children:e.children}),Bb=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{gap:"3",width:1,children:[(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[e.message.createdBy&&(0,i.jsx)(fr,{color:"gray800",textAlign:"end",children:e.message.createdBy.name}),(0,i.jsx)(fr,{css:{background:"$primary600",borderRadius:"$2",borderTopRightRadius:"0",boxShadow:"$sm",color:"white",padding:"$3"},width:1,children:e.message.text})]}),e.message.createdBy&&(0,i.jsx)(fr,{children:(0,i.jsx)(Fg,{email:e.message.createdBy.email,image:e.message.createdBy.picture?.url,name:e.message.createdBy.name,size:40})})]}),e.message.replies.map((t,n)=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{gap:"3",width:1,children:[(0,i.jsx)(fr,{children:(0,i.jsx)(Fg,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:40})}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{color:"gray800",children:e.userInfo.name}),(0,i.jsx)(fr,{color:"gray800",css:{background:"$gray100",borderRadius:"$2",borderTopLeftRadius:"0",boxShadow:"$sm",padding:"$3"},width:1,children:unescape(t)})]})]})]},n))]}),Vb=e=>{const t=Ln(),{mutate:n}=function(e={}){return Un("mutation TextMessageSend(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $parentId: TextMessageId!\n    $content: String!\n) {\n    textMessageSend(\n        organizationId: $organizationId\n        eventId: $eventId\n        parentId: $parentId\n        content: $content\n    ) {\n        id\n    }\n}\n",e)}(),[o,s]=(0,F.useState)(""),{numberOfCharacters:r,numberOfSms:a}=Iv(o,!1),l=h(o);return(0,i.jsxs)(Ea,{direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Em,{label:(0,i.jsxs)(Ea,{justify:"between",children:[(0,i.jsx)(fr,{children:t("contenu_de_la_r_08075")}),(0,i.jsx)(fr,{color:"gray500",children:t("_1_caract_re_04414",r,a)})]}),value:o,onChange:s}),(0,i.jsx)(Ea,{justify:"end",children:(0,i.jsx)(pl,{disabled:!l,onClick:async()=>{await n({organizationId:e.organizationId,eventId:e.eventId,parentId:e.parentId,content:o}),e.reload()},children:t("envoyer_le_mess_41092")})})]})},Ub=e=>{const t=Ln(),{data:n,loader:o,reload:s}=Vn("query TextMessageReplies($organizationId: OrganizationId!, $textMessageId: TextMessageId!) {\n    organization(id: $organizationId) {\n        textMessage(id: $textMessageId) {\n            replies\n\n            children {\n                text: content\n                replies\n                sentAt: insertedAt\n\n                createdBy {\n                    ...CreatedBy\n                }\n            }\n        }\n    }\n}\n",{organizationId:e.organizationId,textMessageId:e.textMessage.id},[Ro.CreatedByFragment]);const r=(0,F.useMemo)(()=>(0,Zd.A)([{text:e.text,replies:n.organization?.textMessage.replies??[],sentAt:e.textMessage.sentAt,createdBy:e.createdBy}].concat(n.organization?.textMessage.children??[]),e=>e.sentAt.toMillis()),[n.organization]);return(0,i.jsxs)(eu,{size:"sm",onClose:e.onClose,children:[(0,i.jsx)(Lb,{children:t("r_ponse_de_1_77675",e.userInfo.name)}),o||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(tu,{children:[r.map((t,n)=>(0,i.jsx)(Bb,{message:t,userInfo:e.userInfo},n)),(0,i.jsx)(Pa,{height:"6"})]}),(0,i.jsx)(nu,{children:(0,i.jsx)(Vb,{eventId:e.eventId,organizationId:e.organizationId,parentId:e.textMessage.id,reload:s})})]})]})},Wb=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),s=Nn($c),{mutate:r}=function(e={}){return Un("mutation TextMessageRepliesRead(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $textMessageId: TextMessageId!\n) {\n    textMessageRepliesRead(\n        organizationId: $organizationId\n        eventId: $eventId\n        textMessageId: $textMessageId\n    ) {\n        id\n    }\n}\n",e)}(),[a,l]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Cc,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},children:[(0,i.jsx)(xc,{children:(0,i.jsx)(Eb,{userInfo:e.textMessage.userInfo})}),(0,i.jsx)(xc,{children:e.textMessage.userInfo.phone?.internationalFormat??""}),(0,i.jsx)(xc,{children:e.textMessage.sentAt?s.toLocaleString(e.textMessage.sentAt,Ho.DateTime):""}),(0,i.jsx)(xc,{children:(0,i.jsx)(Gd,{...Nb(e.textMessage.state),children:t(e.textMessage.state)})}),(0,i.jsx)(xc,{children:e.textMessage.numberOfReplies>0?(0,i.jsx)(pl,{color:"white",size:"sm",onClick:async t=>{Il(t),await r({organizationId:n,eventId:o,textMessageId:e.textMessage.id}),l(!0)},children:t("voir_la_reponse",e.textMessage.numberOfReplies)}):""})]}),a&&(0,i.jsx)(Ub,{createdBy:e.createdBy,eventId:o,organizationId:n,text:e.text,textMessage:e.textMessage,userInfo:e.textMessage.userInfo,onClose:()=>{l(!1)}})]})},Gb=e=>{const{params:{organizationId:t,campaignId:n},translate:o}=il(),[s,r,a]=Ec(""),[l,d]=(0,F.useState)(""),[c,u]=(0,F.useState)(""),[m,g]=(0,F.useState)(0),{data:p,isLoading:f}=Vn("query CampaignTextMessages(\n    $organizationId: OrganizationId!\n    $campaignId: CampaignId!\n    $name: String\n    $state: TextMessageState\n    $replies: TextMessageReplies\n    $offset: Int\n) {\n    organization(id: $organizationId) {\n        campaign(id: $campaignId) {\n            createdBy {\n                ...CreatedBy\n            }\n\n            textMessages(\n                name: $name\n                state: $state\n                replies: $replies\n                limit: 25\n                offset: $offset\n            ) {\n                nodes {\n                    id\n                    state\n                    sentAt: insertedAt\n                    numberOfReplies\n\n                    userInfo {\n                        ...CampaignUserInfo\n                    }\n                }\n\n                numberOfPages\n                totalCount\n            }\n        }\n    }\n}\n",{organizationId:t,campaignId:n,name:h(r)?r:void 0,state:""!==l?l:void 0,replies:""!==c?c:void 0,offset:m},[Ro.CreatedByFragment,Ro.CampaignUserInfoFragment]);const x=Ac(),{numberOfPages:_,totalCount:I}=lu(p.organization?.campaign.textMessages);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{gap:"6",children:[(0,i.jsx)(wb,{content:e.campaign.numberOfRecipients,title:o("nombre_de_desti_21374")}),(0,i.jsx)(wb,{content:e.campaign.numberOfDelivery??0,title:o("nombre_de_messa_93859")}),(0,i.jsx)(wb,{content:e.campaign.cost,title:o("co_t_de_la_camp_54312")})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(kc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{width:200,children:(0,i.jsxs)(gu,{value:l,onChange:e=>{d(e),g(0)},children:[(0,i.jsx)("option",{value:"",children:o("tous_les_status_67644")}),x(yn)]})}),(0,i.jsx)(fr,{width:240,children:(0,i.jsxs)(gu,{value:c,onChange:e=>{u(e),g(0)},children:[(0,i.jsx)("option",{value:"",children:o("avec_et_sans_r_23765")}),x(Cn)]})}),(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:o("rechercher_un_d_02329"),value:s,onChange:e=>{a(e),g(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:o("nom_du_membre_69353")}),(0,i.jsx)(Tc,{children:o("Phone")}),(0,i.jsx)(Tc,{children:o("date_d_envoi_74668")}),(0,i.jsx)(Tc,{children:o("status_06428")}),(0,i.jsx)(Tc,{children:o("r_ponses_97000")})]}),numberOfPages:_,offset:m,rows:f?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:p.organization.campaign.textMessages.nodes.map((t,n)=>(0,i.jsx)(Wb,{createdBy:p.organization.campaign.createdBy,text:e.campaign.text,textMessage:t},n))}),setOffset:g,title:o("liste_des_desti_16448"),totalCount:I})]})},Hb=()=>{const{params:{organizationId:e,eventId:t,campaignId:n,userInfoId:o}}=il(),s=Nn($c),{data:r,loader:a}=Nr({organizationId:e,campaignId:n,userInfoId:o}),l=r.organization?.campaign.sentAt?.setZone(Fo.c9.local().zone);return a||(0,i.jsxs)(Ea,{direction:"column",height:1,width:1,children:[(0,i.jsx)(Ob,{getPath:i=>rI.CAMPAIGN_PREVIEW({organizationId:e,eventId:t,campaignId:n,userInfoId:i})}),(0,i.jsx)(Ea,{css:{background:"$gray200",py:"$6"},justify:"center",width:1,children:(0,i.jsxs)(Ea,{css:{background:"white",borderRadius:"$2",boxShadow:"$md",padding:"$6"},direction:"column",gap:"3",width:640,children:[(0,i.jsx)(Db,{campaign:r.organization.campaign}),(0,i.jsx)(fr,{css:{borderTop:"1px solid $gray200",height:"1px"}}),(0,i.jsxs)(Ea,{gap:"3",width:1,children:[r.organization.campaign.createdBy&&(0,i.jsx)(fr,{children:(0,i.jsx)(Fg,{email:r.organization.campaign.createdBy.email,image:r.organization.campaign.createdBy.picture?.url,name:r.organization.campaign.createdBy.name,size:40})}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(r.organization.campaign.createdBy||l)&&(0,i.jsxs)(Ea,{gap:"3",width:1,children:[r.organization.campaign.createdBy&&(0,i.jsx)(fr,{color:"gray800",css:{flex:"1"},fontWeight:"medium",children:r.organization.campaign.createdBy.name}),l&&(0,i.jsx)(fr,{color:"gray500",children:s.toLocaleString(l,Ho.DateTime)})]}),(0,i.jsx)(fr,{color:"gray800",css:{background:"$gray100",borderRadius:"$2",borderTopLeftRadius:"0",boxShadow:"$sm",padding:"$3"},dangerouslySetInnerHTML:{__html:r.organization.campaign.preview}})]})]})]})})]})},qb=()=>{const{history:e,params:{organizationId:t,eventId:n,campaignId:o},translate:s}=il(),r=(0,_r.zy)(),{data:a,loader:l}=Vn("query Campaign($organizationId: OrganizationId!, $eventId: EventId, $campaignId: CampaignId!) {\n    organization(id: $organizationId) {\n        campaign(id: $campaignId) {\n            name\n            state\n            campaignType\n            text\n            numberOfRecipients\n            numberOfDelivery\n            numberOfOpen\n            numberOfClick\n            cost\n            states\n        }\n\n        usersInfos(limit: 1) {\n            nodes {\n                id\n            }\n        }\n\n        event: eventMaybe(id: $eventId) {\n            volunteersRegistrations(limit: 1) {\n                nodes {\n                    userInfoId\n                }\n            }\n        }\n    }\n}\n",{organizationId:t,eventId:n,campaignId:o},[]),d=(0,F.useMemo)(()=>a.organization?n?a.organization.event?.volunteersRegistrations.nodes[0]?.userInfoId:a.organization.usersInfos.nodes[0].id:-1,[n,a.organization]);return Cd(`${a.organization?.campaign.name??"…"} ${s("campagne_97871")}`),l||(0,i.jsxs)(Ea,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(yb,{returnPathFallback:rI.CAMPAIGNS({organizationId:t,eventId:n})}),(0,i.jsx)(fr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"medium",children:a.organization?.campaign.name??""}),(0,i.jsx)(fr,{width:320,children:(0,i.jsxs)(rv,{selectedItem:r.pathname.endsWith("dashboard")?"dashboard":"preview",onChange:i=>{"dashboard"===i?e.replace(rI.CAMPAIGN_DASHBOARD({organizationId:t,eventId:n,campaignId:o})):"preview"===i&&d&&e.replace(rI.CAMPAIGN_PREVIEW({organizationId:t,eventId:n,campaignId:o,userInfoId:d}))},children:[(0,i.jsx)(av,{item:"dashboard",children:s("tableau_de_bord_24627")}),(0,i.jsx)(av,{item:"preview",children:d?s("aper_u_25595"):(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:s("aper_u_25595")})}),(0,i.jsx)(am,{placement:"bottom",children:s("vous_devez_avoir_2345")})]})})]})})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:rI.CAMPAIGN_DASHBOARD({organizationId:":organizationId",eventId:n?":eventId":void 0,campaignId:":campaignId"}),children:a.organization?.campaign.campaignType===ue.Email?(0,i.jsx)($b,{campaign:a.organization?.campaign}):(0,i.jsx)(Gb,{campaign:a.organization?.campaign})}),(0,i.jsx)(_r.qh,{path:rI.CAMPAIGN_PREVIEW({organizationId:":organizationId",eventId:n?":eventId":void 0,campaignId:":campaignId",userInfoId:":userInfoId"}),children:a.organization?.campaign.campaignType===ue.Email?(0,i.jsx)(Mb,{}):(0,i.jsx)(Hb,{})}),(0,i.jsx)(_r.qh,{path:rI.CAMPAIGN({organizationId:":organizationId",eventId:n?":eventId":void 0,campaignId:":campaignId"}),children:(0,i.jsx)(Yn,{path:rI.CAMPAIGN_DASHBOARD({organizationId:t,eventId:n,campaignId:o}),replace:!0})})]})]})},Yb=()=>{const{organizationId:e,eventId:t}=Wn();return(0,i.jsx)(Ab,{getVolunteersSegmentPath:n=>So.VOLUNTEERS_SEGMENT(e,t,n),isOrganizationCampaign:!1,children:(0,i.jsx)(qb,{})})},Kb=()=>{const{organizationId:e}=Wn();return(0,i.jsx)(Ab,{getVolunteersSegmentPath:t=>So.COMMUNITY_USERS_SEGMENT(e,t),isOrganizationCampaign:!0,children:(0,i.jsx)(qb,{})})};function Zb(e){switch(e){case ye.Expired:return{color:"error",leftIcon:"clock"};case ye.Full:return{color:"error",leftIcon:"hundred-points"};case ye.Locked:return{color:"error",leftIcon:"lock-keyhole"};case ye.Ongoing:return{color:"success",leftIcon:"check"};default:return Za()}}let Xb=class extends zl{constructor(e){super(e)}createUpdateDelegationValuesDefault(e,t){return{delegation:this.delegationInputDefault(e,t),selectedAccreditationsSlotsIds:[]}}delegationInputDefault(e,t){const n=t?.forms&&t?.parentDelegation?t.forms.find(e=>e.name===t.parentDelegation?.form.name):null,i=e?.formId??n?.id??-1,o=Zo(t?.delegationsCategories)&&t?.parentDelegation?t.delegationsCategories.find(e=>e.name===t.parentDelegation?.delegationCategory.name):null;let s=e?.delegationCategoryId??o?.id??t?.delegationCategoryId;return Number.isInteger(s)||(s=null),{...this.getDefaultAccreditations(e),delegationCategoryId:s,parentId:e?.parentId??t?.parentId??null,name:e?.name??"",description:e?.description??"",leadersIds:e?.leadersIds??t?.parentDelegation?.leadersIds??[],formId:i,deadlineDate:e?.deadlineDate??null,maxResources:e?.maxResources??null,showInDelegationSpace:e?.showInDelegationSpace??!0,showFormLinkInDelegationSpace:e?.showFormLinkInDelegationSpace??!0,columns:e?.columns??t?.parentDelegation?.columns??["name","accreditations","accreditation_state"],canLeadersAddMembers:e?.canLeadersAddMembers??!0,canLeadersDeleteMembers:e?.canLeadersDeleteMembers??!0,canLeadersEditColumns:e?.canLeadersEditColumns??!0,canLeadersEditCustomFields:e?.canLeadersEditCustomFields??!0,canLeadersEditMembers:e?.canLeadersEditMembers??!0,canLeadersImportMembers:e?.canLeadersImportMembers??!1,canLeadersSeeHiddenAccreditationsSlots:e?.canLeadersSeeHiddenAccreditationsSlots??!1,privateNote:e?.privateNote??t?.parentDelegation?.privateNote??"",addDefaultAccreditationsByAvailability:e?.addDefaultAccreditationsByAvailability??!1,tagsIds:e?.tagsIds??t?.parentDelegation?.tagsIds??[],customFields:e?.customFields||[],fields:e?.fields??{},campaignsIds:e?.campaignsIds??[],customDocumentsSlugs:e?.customDocumentsSlugs??[],usedCustomFieldsIds:e?.usedCustomFieldsIds??[]}}delegationInputSchema(){return l.Ik().shape({parentId:l.ai().nullable(),name:l.Yj().when("parentId",{is:null,then:e=>e.required(this.t("le_nom_de_la_d_10042"))}),description:l.Yj(),delegationCategoryId:l.ai().required(this.t("la_cat_gorie_es_14008")).positive(this.t("la_cat_gorie_es_14008")).typeError(this.t("la_cat_gorie_es_14008")),leadersIds:l.YO().of(l.ai()),formId:l.ai().required(this.t("le_formulaire_e_77404")).typeError(this.t("le_formulaire_e_77404")).test("form-id-valid",this.t("le_formulaire_e_77404"),e=>"number"==typeof e&&e>0),deadlineDate:$m.typeError(this.t("la_date_limite_91708")).nullable(),maxResources:l.ai().min(0).nullable(),showInDelegationSpace:l.zM().required(),showFormLinkInDelegationSpace:l.zM().required(),columns:l.YO().of(l.Yj()).required(this.t("vous_devez_choi_82605")).min(1,this.t("vous_devez_choi_82605")),canLeadersAddMembers:l.zM().required(),canLeadersDeleteMembers:l.zM().required(),canLeadersEditColumns:l.zM().required(),canLeadersEditMembers:l.zM().required(),canLeadersEditCustomFields:l.zM().required(),canLeadersImportMembers:l.zM().required(),canLeadersSeeHiddenAccreditationsSlots:l.zM().required(),privateNote:l.Yj(),accreditations:l.YO().of(l.Ik().shape({accreditationCategoryId:l.ai().required(),accreditationId:l.ai().required(),maxResources:l.gl().nullable(),willAutoAccredit:l.zM().required()})),accreditationsSlots:l.YO().of(l.Ik().shape({accreditationCategoryId:l.ai().required(),accreditationId:l.ai().required(),accreditationSlotId:l.ai().required(),isDefault:l.zM().required(),maxResources:l.gl().nullable()})),campaignsIds:l.YO().of(l.ai()),customDocumentsSlugs:l.YO().of(l.gl()),usedCustomFieldsIds:l.YO().of(l.ai())})}createUpdateDelegationSchema(){return l.Ik().shape({delegation:this.delegationInputSchema()})}adminAddSchema(){return l.Ik().shape({usersInfosIds:l.YO().of(l.ai())})}getDefaultAccreditations(e){let t=e?.accreditations||[];const n=e?.accreditationsSlots||[];return Xo(t)&&Zo(n)&&(t=(0,Ju.A)(n,e=>e.accreditationId).map(e=>({accreditationCategoryId:e.accreditationCategoryId,accreditationId:e.accreditationId,maxResources:null,willAutoAccredit:!1}))),{accreditations:t,accreditationsSlots:n}}};Xb=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],Xb);var Jb=n(2662);const Qb=["key","name","acl"];let ej=class extends zl{constructor(e){super(e)}documentInputDefault(){return{key:"",name:"",acl:""}}documentInputSchema(e){const t=h(e)?this.t("_1_est_requis_99856",e):this.t("le_document_est_86403");return l.Ik().shape({key:l.Yj().required(t),name:l.Yj().required(t),acl:l.Yj().required(t)})}documentInputSchemaNotRequired(){return l.Ik().shape({key:l.Yj(),name:l.Yj(),acl:l.Yj()})}};ej=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],ej);const tj=({onChange:e,css:t,label:n,description:o,value:s,hint:r,state:a,initialValue:l,icon:d,...c})=>{const u=Ln(),h=(0,F.useRef)(null),m=(0,wc.A)(t=>{e(t)},500),{inputId:g,descId:p,errorId:f}=bl();return(0,i.jsxs)(Ea,{css:t,direction:"column",width:1,children:[(0,i.jsx)(yl,{htmlFor:g,isClickable:!1,children:n}),(0,i.jsx)(jl,{id:p,children:o}),(n||o)&&(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Al,{cursor:"default",icon:d,state:a,onClick:()=>{h.current?.click()},children:[(0,i.jsxs)(Ea,{align:"center",css:{flex:"1"},height:1,children:[(0,i.jsx)(fr,{css:{background:s,borderRadius:"2px",height:"24px",width:"24px","& input":{background:"transparent",border:"none",borderRadius:"2px",cursor:"pointer",height:"24px",width:"24px","&::-webkit-color-swatch-wrapper":{padding:0},"&::-webkit-color-swatch":{borderRadius:"2px",border:"none"},"&::-moz-color-swatch":{border:"none"}}},children:(0,i.jsx)("input",{ref:h,"aria-describedby":o?p:void 0,id:g,type:"color",value:s,onChange:e=>{m(e.target.value)},...c})}),(0,i.jsx)(Pa,{width:"3"}),(0,i.jsx)(fr,{color:"gray800",css:{flex:"1","& input[type=text]":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"}},height:1,onClick:Il,children:(0,i.jsx)("input",{"aria-describedby":o?p:void 0,"aria-errormessage":"error"===a?f:void 0,"aria-invalid":"error"===a,disabled:"disabled"===a,id:g,type:"text",value:s,onChange:t=>{e(t.target.value)},...c})})]}),l&&(0,i.jsx)(fr,{color:"primary700",css:{cursor:"pointer",userSelect:"none"},fontWeight:"medium",onClick:t=>{Il(t),e(l)},children:u("remettre_sa_v_90478")})]}),(0,i.jsx)(Cl,{id:f,state:a,children:r})]})},nj=({name:e,hint:t,state:n,...o})=>(0,i.jsx)(Oa.D0,{name:e,render:s=>{const r=_l(s.meta);return(0,i.jsx)(tj,{hint:r?s.meta.error:t,name:e,state:r?"error":n,value:s.input.value,onChange:e=>{s.input.onChange(e)},...o})}}),ij=({name:e,hint:t,state:n,...o})=>(0,i.jsx)(Oa.D0,{name:e,render:s=>{const r=s.meta.data?.forceDisplayError&&s.meta.invalid||s.meta.touched&&s.meta.invalid;return(0,i.jsx)(ju,{hint:r?s.meta.error:t,name:e,state:r?"error":n,value:s.input.value,onBlur:s.input.onBlur,onChange:s.input.onChange,onFocus:s.input.onFocus,...o})}}),oj=({onChange:e,prefix:t,state:n,withFileField:o,...s})=>{const r=`${t}key`,a=`${t}name`,l=`${t}acl`,d=[r,a,l];let c;return o&&(c=`${t}file`,d.push(c)),(0,i.jsx)(N_,{names:d,render:t=>{let d=null;h(t[r].input.value)&&h(t[a].input.value)&&h(t[l].input.value)&&(d={key:t[r].input.value,name:t[a].input.value,acl:t[l].input.value});const{invalid:u,hint:m}=Object.values(t).reduce((e,t)=>e.invalid?e:_l(t.meta)?{invalid:!0,hint:t.meta.error||t.meta.submitError}:e,{invalid:!1,hint:void 0});return(0,i.jsx)(tv,{hint:m,state:u?"error":n,value:d,onChange:n=>{t[r].input.onChange(n?.key??""),t[r].input.onBlur(),t[a].input.onChange(n?.name??""),t[a].input.onBlur(),t[l].input.onChange(n?.acl??""),t[l].input.onBlur(),o&&(t[c].input.onChange(n?.file),t[c].input.onBlur(),n?.file&&e?.(n.file))},...s})}})},sj=ar("div",{alignItems:"center",borderRadius:"$1",color:"$gray600",cursor:"pointer",display:"flex",height:"40px",justifyContent:"center",width:"40px",variants:{active:{true:{background:"$primary200",color:"$primary700"},false:{"&:hover":{background:"$gray200",color:"$gray800"}}}}}),rj=({css:e,label:t,description:n,value:o,height:s,renderOnPortal:r,onChange:a,...l})=>{const d=Ln(),[c,u]=(0,F.useState)(!1),h=(0,F.useMemo)(()=>(0,Zd.A)(ln.map(e=>({value:e,name:d(e)})),e=>e.name),[]);return(0,i.jsxs)(Ea,{css:e,direction:"column",width:1,children:[(0,i.jsx)(yl,{children:t}),(0,i.jsx)(jl,{children:n}),(t||n)&&(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ed,{isOpen:c,onStateChange:u,children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(Al,{cursor:"pointer",icon:Ba(o),rightIcon:c?"chevron-up":"chevron-down",...l,children:(0,i.jsx)(fr,{css:{flex:"1"},children:d(o)})})}),(0,i.jsx)(Pd,{maxHeight:300,placement:"bottom",renderOnPortal:r,width:"match",children:(0,i.jsx)(Ea,{css:{px:"$2"},gap:"2",width:1,wrap:"wrap",children:h.map(e=>(0,i.jsx)(sj,{active:o===e.value,onClick:()=>{u(!1),a(e.value)},children:(0,i.jsx)(Va,{icon:Ba(e.value)})},e.value))})})]})]})},aj=({name:e,hint:t,state:n,...o})=>(0,i.jsx)(Oa.D0,{name:e,render:s=>{const r=_l(s.meta);return(0,i.jsx)(rj,{hint:r?s.meta.error:t,name:e,state:r?"error":n,value:s.input.value,onBlur:s.input.onBlur,onChange:e=>{s.input.onChange(e)},onFocus:s.input.onFocus,...o})}}),lj=({name:e,hint:t,state:n,...o})=>(0,i.jsx)(Oa.D0,{name:e,render:s=>{const r=_l(s.meta);return(0,i.jsx)(gu,{hint:r?s.meta.error:t,name:e,state:r?"error":n,value:s.input.value,onBlur:s.input.onBlur,onChange:e=>{s.input.onChange(e)},onFocus:s.input.onFocus,...o})}}),dj=e=>{const{translate:t,params:{organizationId:n}}=il(),o=Nn(ej),s=Nn(D_),r=Nn(Hc),a=Ac();if((0,F.useEffect)(()=>{e.slug===ie.Acronym||e.slug===ie.Address||e.slug===ie.Color||e.slug===ie.Description||e.slug===ie.Icon||e.slug===ie.Name||e.slug===it.Acronym||e.slug===it.Address||e.slug===it.Color||e.slug===it.Description||e.slug===it.Icon||e.slug===it.Name||e.slug===ve.Description||e.slug===ve.Name||e.customField?.fieldType===Ne.Address||e.customField?.fieldType===Ne.Country||e.customField?.fieldType===Ne.Language||e.customField?.fieldType===Ne.Nationality||e.customField?.fieldType===Ne.Sex||e.customField?.fieldType===Ne.Text||e.customField?.fieldType===Ne.Textarea||e.customField?.fieldType===Ne.Time?"string"!=typeof e.value&&e.change(e.name,""):e.slug===ie.AutoAccredit||e.slug===ie.WeezeventIsSynchronized||e.slug===xe.Privacy||e.slug===ve.IsLocked||e.slug===ve.ShowInDelegationSpace||e.slug===ve.CanLeadersAddMembers||e.slug===ve.CanLeadersEditCustomFields||e.slug===ve.CanLeadersEditMembers||e.slug===ve.CanLeadersDeleteMembers||e.slug===ve.CanLeadersEditColumns||e.slug===ve.CanLeadersImportMembers||e.slug===ve.CanLeadersSeeHiddenAccreditationsSlots||e.slug===ve.ShowFormLinkInDelegationSpace||e.customField?.fieldType===Ne.Checkbox||e.customField?.fieldType===Ne.Validation?"boolean"!=typeof e.value&&e.change(e.name,!1):e.slug===ie.Category||e.slug===ve.Category||e.slug===it.Category?"number"!=typeof e.value&&e.change(e.name,e.categories[0]?.id):e.slug===ie.Index||e.slug===ie.Latitude||e.slug===ie.Longitude||e.slug===it.Latitude||e.slug===it.Longitude||e.slug===ve.MaxResources||e.customField?.fieldType===Ne.Number?"number"!=typeof e.value&&e.change(e.name,0):e.slug===ie.Tag||e.slug===it.Tag||e.slug===ve.Campaigns||e.slug===ve.Documents||e.slug===ve.Tag||e.slug===it.Traces?Array.isArray(e.value)||e.change(e.name,[]):e.slug===ve.DeadlineDate||e.customField?.fieldType===Ne.Date||e.customField?.fieldType===Ne.Datetime?Fo.c9.isDateTime(e.value)||h(e.value)||e.change(e.name,Fo.c9.invalid("Invalid")):e.customField?.fieldType===Ne.File?null!==e.value&&"object"==typeof e.value||e.change(e.name,o.documentInputDefault()):e.customField?.fieldType===Ne.Phone?null!==e.value&&"object"==typeof e.value||e.change(e.name,s.basePhoneInputDefault()):e.customField?.fieldType===Ne.Select?e.customField.canSelectMultiple&&!Array.isArray(e.value)?e.change(e.name,[]):e.customField.canSelectMultiple||"number"==typeof e.value||e.change(e.name,""):e.slug===ve.Form&&"number"!=typeof e.value&&e.change("massEdit.value",e.forms[0].id)},[e.customField,e.slug]),e.slug===ie.Acronym||e.slug===it.Acronym||e.slug===ie.Address||e.slug===it.Address||e.customField?.fieldType===Ne.Address||e.customField?.fieldType===Ne.Text)return(0,i.jsx)(Sl,{name:e.name});if(e.slug===ie.AutoAccredit||e.slug===ie.WeezeventIsSynchronized||e.slug===ve.IsLocked||e.slug===ve.ShowFormLinkInDelegationSpace||e.slug===ve.ShowInDelegationSpace||e.slug===ve.CanLeadersAddMembers||e.slug===ve.CanLeadersEditCustomFields||e.slug===ve.CanLeadersEditMembers||e.slug===ve.CanLeadersDeleteMembers||e.slug===ve.CanLeadersEditColumns||e.slug===ve.CanLeadersImportMembers||e.slug===ve.CanLeadersSeeHiddenAccreditationsSlots||e.customField?.fieldType===Ne.Checkbox||e.customField?.fieldType===Ne.Validation)return(0,i.jsxs)(lj,{name:e.name,shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:t("oui_54361")}),(0,i.jsx)("option",{value:"false",children:t("non_33516")})]});if(e.slug===xe.Privacy)return(0,i.jsxs)(lj,{name:e.name,shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:t("Private")}),(0,i.jsx)("option",{value:"false",children:t("Public")})]});if(e.slug===ie.Category||e.slug===ve.Category||e.slug===it.Category)return(0,i.jsx)(Sm,{isSearchVisible:!0,name:e.name,children:e.categories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});if(e.slug===ie.Color||e.slug===it.Color)return(0,i.jsx)(nj,{name:e.name});if(e.slug===ie.Description||e.slug===ve.Description||e.slug===it.Description)return(0,i.jsx)(fr,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(gv,{name:e.name})});if(e.slug===ie.Icon||e.slug===it.Icon)return(0,i.jsx)(aj,{name:e.name});if(e.slug===ie.Latitude||e.slug===it.Latitude)return(0,i.jsx)(wm,{name:e.name});if(e.slug===ie.Longitude||e.slug===it.Longitude)return(0,i.jsx)(wm,{name:e.name});if(e.slug===ie.Name||e.slug===it.Name)throw new Error("Should not happen");if(e.slug===ve.Campaigns)return(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.campaigns.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});if(e.slug===ve.Documents)return(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))});if(e.slug===ie.Tag||e.slug===it.Tag||e.slug===ve.Tag)return(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.tags.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});if(e.slug===it.Traces)return(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.traces.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});if(e.slug===ie.Index||e.slug===ve.MaxResources||e.customField?.fieldType===Ne.Number)return(0,i.jsx)(Sl,{name:e.name,shouldParseAsInt:!0});if(e.customField?.fieldType===Ne.Country)return(0,i.jsx)(Sm,{isSearchVisible:!0,name:e.name,children:r.getCountriesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))});if(e.slug===ve.DeadlineDate||e.customField?.fieldType===Ne.Date)return(0,i.jsx)(km,{name:e.name});if(e.customField?.fieldType===Ne.Datetime)return(0,i.jsx)(ij,{name:e.name});if(e.customField?.fieldType===Ne.File){const t=e.customField.fieldProperty===Me.Picture?[HI.Images]:[HI.Images,HI.Pdf],o=e.customField.fieldProperty===Me.Picture?"public-read":"private";return(0,i.jsx)(oj,{accept:t,acl:o,organizationId:n,prefix:`${e.name}.`})}return e.customField?.fieldType===Ne.Language?e.customField.fieldProperty===Me.Language?(0,i.jsxs)(lj,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:t("s_lectionnez_un_31086")}),a(ad)]}):(0,i.jsxs)(lj,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:t("s_lectionnez_un_31086")}),a(un)]}):e.customField?.fieldType===Ne.Nationality?(0,i.jsx)(Sm,{isSearchVisible:!0,name:e.name,children:r.getNationalitiesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}):e.customField?.fieldType===Ne.Phone?(0,i.jsx)(B_,{prefix:`${e.name}.`}):e.customField?.fieldType===Ne.Select?e.customField.canSelectMultiple?(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.customField.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))}):(0,i.jsx)(Sm,{isSearchVisible:!0,name:e.name,placeholder:t("s_lectionnez_un_44130"),children:e.customField.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))}):e.customField?.fieldType===Ne.Sex?(0,i.jsxs)(lj,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:t("s_lectionnez_un_43620")}),a(jn)]}):e.customField?.fieldType===Ne.Textarea?(0,i.jsx)(Tm,{name:e.name}):e.customField?.fieldType===Ne.Time?(0,i.jsx)(dv,{name:e.name}):e.slug===ve.Form?(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!1,name:"massEdit.value",children:e.forms.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):null},cj=e=>(0,i.jsxs)(Ea,{css:{background:"$gray50",borderRadius:"$1",padding:"$6"},direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Ea,{align:"center",gap:"4",children:[(0,i.jsx)(fr,{css:{flex:"1",textTransform:"uppercase"},font:"gray800 textXs semiBold",children:e.title}),e.buttons]}),e.children]}),uj=e=>{const{translate:t}=il(),n=e.customFields.find(t=>t.id===e.customFieldValues.customFieldId);return(0,i.jsxs)(cj,{buttons:(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})})}),(0,i.jsx)(am,{placement:"top",children:t("supprimer_43083")})]}),title:t("champ_de_formul_73221",e.index+1),children:[(0,i.jsxs)(Sm,{isSearchVisible:!0,label:t("CustomField"),name:`${e.field}.customFieldId`,children:[(0,i.jsx)("option",{value:"-1",children:t("s_lectionner_un_48159")}),e.customFields.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),n&&(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray700 textSm medium",children:t("nouvelle_valeur_39039",n.name)}),(0,i.jsx)(dj,{campaigns:[],categories:[],change:e.change,customDocuments:[],customField:n,forms:[],name:`${e.field}.value`,slug:n.slug,tags:[],traces:[],value:e.customFieldValues.value}),n.fieldType===Ne.Select&&n.canSelectMultiple&&(0,i.jsx)(ym,{name:`${e.field}.addValues`,children:t("ajouter_les_val_22996")})]})]})},hj=e=>{const t=Ln();return(0,i.jsxs)(i.Fragment,{children:[e.values.map((t,n)=>{const o=`${e.name}[${n}]`;return(0,i.jsxs)(F.Fragment,{children:[0!==n&&(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(uj,{change:e.change,customFieldValues:e.values[n],customFields:e.customFields,field:o,index:n,remove:()=>{e.change(e.name,ts(e.values,n))}})]},n)}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsxs)(fr,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{e.change(e.name,e.values.concat([{customFieldId:-1,addValues:!1}]))},children:["+ ",t("ajouter_un_nouv_22370")]})]})},mj=e=>(0,i.jsx)(Ea,{align:"center",css:{background:`$${e.color}50`,borderRadius:"48px",color:`$${e.color}700`,...e.css||{}},height:48,justify:"center",width:48,children:(0,i.jsx)(Ea,{align:"center",css:{background:`$${e.color}100`,borderRadius:"32px"},height:32,justify:"center",width:32,children:(0,i.jsx)(Va,{icon:e.icon})})}),gj=e=>{const t=Ln(),n=Nn(za);return(0,i.jsx)(Bc,{size:e.size||"sm",onClose:e.onClose,children:(0,i.jsx)(dl,{css:{overflow:"hidden"},direction:"column",height:1,hideDefaultErrors:!0,initialValues:e.initialValues,render:n=>{const{handleSubmit:o,submitting:s}=n;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ea,{justify:"center",children:(0,i.jsx)(mj,{color:"primary",icon:e.icon})}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:e.title}),e.subtitle&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:e.subtitle})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(sl,{}),(0,i.jsx)(Ea,{direction:"column",css:{overflowY:"auto"},children:"function"==typeof e.children?e.children(n):e.children}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{isLoading:s,onClick:o,children:e.buttonText}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},validate:t=>e.schema?n.validateForForm(e.schema)(t):{},onSubmit:e.onSubmit})})},pj=e=>{const t=Ln(),{mutate:n}=function(e={}){return Un("mutation TagCreate($organizationId: OrganizationId!, $eventId: EventId, $tag: String!) {\n    tagCreate(organizationId: $organizationId, eventId: $eventId, tag: $tag) {\n        id\n        name\n    }\n}\n",e)}();return(0,i.jsx)(gj,{buttonText:t("cr_er_82895"),icon:"tag",initialValues:{name:""},title:t("cr_er_un_tag_59505"),onClose:e.onClose,onSubmit:async t=>{const{tagCreate:i}=await n({organizationId:e.organizationId,tag:t.name});e.onSuccess(i),e.onClose()},children:(0,i.jsx)(Sl,{label:t("nom_du_tag_95054"),name:"name"})})},fj=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.tags),[s,r]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sm,{isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(nv,{children:t("tags_79499")}),multiple:!0,name:`${e.name}tagsIds`,onCreateClick:()=>{r(!0)},children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),s&&(0,i.jsx)(pj,{organizationId:e.organizationId,onClose:()=>{r(!1)},onSuccess:t=>{o([...n,t]),e.change(`${e.name}tagsIds`,[...e.tagsIds,t.id])}})]})},xj=/^[0-9]{11}$/i,_j=Fo.c9.now().year-2e3;function Ij(e){if(h(e)&&xj.test(e)){const t=(0,Jb.A)(e.substring(0,2),10);let n=(0,Jb.A)(e.substring(0,9),10);const i=(0,Jb.A)(e.substring(9),10);return t<=_j&&(n=2e9+n),i===97-n%97}return!1}let vj=class{countriesService;dateTimeService;translationService;constructor(e,t,n){this.countriesService=e,this.dateTimeService=t,this.translationService=n}getValueString(e,t,n={}){switch(e.fieldType){case Ne.Text:case Ne.Textarea:case Ne.Time:case Ne.Address:return t[e.slug]||"";case Ne.Sex:return this.getSexValue(e,t);case Ne.Language:return this.getLanguageValue(e,t);case Ne.Nationality:return this.getNationalityValue(e,t);case Ne.Country:return this.getCountryValue(e,t);case Ne.Select:return this.getSelectValue(e,t);case Ne.Checkbox:case Ne.Validation:return this.getBooleanValue(e,t);case Ne.Date:return this.getDateValue(e,t,n.dateFormat);case Ne.Datetime:return this.getDatetimeValue(e,t,n.datetimeFormat);case Ne.File:return"name"===n.fileReturnValue?t[e.slug]?.name||"":t[e.slug]?.url||"";case Ne.Phone:return this.getPhoneValue(e,t);case Ne.Number:return this.getIntValue(e,t);default:return Za(e.fieldType)}}getValue(e,t){return t[e.slug]}getSelectValues(e,t){const n=Ko(this.getValue(e,t)??[]);return(0,Da.A)(n.map(t=>e.values.find(e=>e.id===t)?.value))}getSexValue(e,t){return this.translationService.translate(this.getValue(e,t)??"")}getLanguageValue(e,t){return this.translationService.translate(this.getValue(e,t)??"")}getNationalityValue(e,t){return this.countriesService.getNationality(this.getValue(e,t)??"")??""}getCountryValue(e,t){return this.countriesService.getName(this.getValue(e,t)??"")??""}getBooleanValue(e,t){const n=this.getValue(e,t);return!0===n?this.translationService.translate("oui_54361"):!1===n?this.translationService.translate("non_33516"):""}getDateValue(e,t,n){let i=this.getValue(e,t);return h(i)&&(i=Fo.c9.fromISO(i,{zone:"utc"})),Fo.c9.isDateTime(i)&&i.isValid?h(n)?i.toFormat(n):this.dateTimeService.toLocaleString(i,Ho.DateOnly.MonthLong):""}getDatetimeValue(e,t,n){let i=this.getValue(e,t);return h(i)&&(i=Fo.c9.fromISO(i,{zone:"utc"})),Fo.c9.isDateTime(i)&&i.isValid?h(n)?i.toFormat(n):this.dateTimeService.toLocaleString(i,Ho.DateTime):""}getPhoneValue(e,t){return this.getValue(e,t)?.internationalFormat??""}getIntValue(e,t){return this.getValue(e,t)?.toString()??""}getSelectValue(e,t){const n=Ko(this.getValue(e,t)??[]);return(0,Da.A)(n.map(t=>e.values.find(e=>e.id===t)?.value)).join(", ")}};vj=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hc,$c,Dn])],vj);const bj=[Ne.Country,Ne.Language,Ne.Nationality,Ne.Select];function jj(e,t,n){if(e.hasCondition&&e.conditionCustomField){const i=n.find(t=>t.id===e.conditionCustomField.id);if(i){if(jj(i,t,n)){const n=t[e.conditionCustomField.slug];return"boolean"==typeof n&&e.conditionCustomField.fieldType===Ne.Checkbox?n===e.conditionValue:!(!bj.includes(e.conditionCustomField.fieldType)||!Zo(e.conditionValue))&&(0,Zu.A)(Ko(n),e.conditionValue).length>0}return!1}return!1}return!0}const Cj=ad.concat(un);let yj=class extends zl{countriesService;documentInputService;phoneInputService;translationService;constructor(e,t,n,i){super(i),this.countriesService=e,this.documentInputService=t,this.phoneInputService=n,this.translationService=i}fieldsUpdateInputDefault(e,t,n,i){return Object.fromEntries(t.map(t=>{const o=this.getFieldValue(e,t);return[t.slug,o??this.fieldUpdateInputDefault(t,n,i)]}))}fieldSchema(e,t){const n=(n,i)=>{if(e.conditionCustomField)return l.Ik().when(e.conditionCustomField.slug,([o])=>t&&(e.conditionCustomField.fieldType===Ne.Checkbox&&o===e.conditionValue||bj.includes(e.conditionCustomField.fieldType)&&Zo(e.conditionValue)&&(0,Zu.A)(Ko(o),e.conditionValue).length>0)?n():i());{let e;return e=t?n():i(),e}};switch(e.fieldType){case Ne.File:return n(()=>this.documentInputService.documentInputSchema(e.name),()=>this.documentInputService.documentInputSchemaNotRequired());case Ne.Phone:return n(()=>this.phoneInputService.phoneInputSchema(),()=>this.phoneInputService.phoneInputSchemaNotRequired());case Ne.Text:case Ne.Textarea:case Ne.Time:case Ne.Address:return e.fieldProperty===Me.Eid?n(()=>l.Yj().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)).test("valid-eid",this.t("le_num_ro_de_re_71488"),Ij),()=>l.Yj()):n(()=>l.Yj().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>l.Yj());case Ne.Number:return n(()=>l.ai().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>l.ai().nullable());case Ne.Checkbox:return n(()=>l.zM().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>l.zM());case Ne.Validation:return n(()=>l.zM().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)).oneOf([!0],this.t("_1_doit_obliga_82862",e.name)),()=>l.zM());case Ne.Select:return e.canSelectMultiple?n(()=>l.YO().of(l.ai().required()).required(this.t("_1_est_requis_99856",e.name)).min(1,this.t("vous_devez_s_le_55757",e.name)),()=>l.YO().of(l.ai())):n(()=>l.ai().oneOf(e.values.map(({id:e})=>e),this.oneOfMessage(e.name,e.values.map(({value:e})=>e))).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>l.ai().oneOf(e.values.map(({id:e})=>e),this.oneOfMessage(e.name,e.values.map(({value:e})=>e))));case Ne.Date:case Ne.Datetime:return n(()=>$m.required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("la_date_est_inv_22002",e.name)),()=>l.gl().nullable());case Ne.Sex:return n(()=>l.Yj().oneOf(jn,this.oneOfMessage(e.name,jn)).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>l.Yj().oneOf(jn,this.oneOfMessage(e.name,jn)));case Ne.Language:return n(()=>l.Yj().oneOf(Cj,this.oneOfMessage(e.name,Cj)).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>l.Yj().oneOf(Cj,this.oneOfMessage(e.name,Cj)));case Ne.Nationality:case Ne.Country:return n(()=>l.Yj().oneOf(this.countriesService.countriesCodes,this.oneOfMessage(e.name,this.countriesService.countriesCodes)).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>l.Yj().oneOf(this.countriesService.countriesCodes,this.oneOfMessage(e.name,this.countriesService.countriesCodes)));default:return Za(e.fieldType)}}fieldUpdateInputDefault(e,t,n){switch(e.fieldType){case Ne.Checkbox:case Ne.Validation:return!!n&&void 0;case Ne.File:return this.documentInputService.documentInputDefault();case Ne.Phone:return this.phoneInputService.phoneInputDefault(t);case Ne.Select:return e.canSelectMultiple?[]:void 0;case Ne.Address:case Ne.Date:case Ne.Datetime:case Ne.Language:case Ne.Number:case Ne.Sex:case Ne.Text:case Ne.Textarea:case Ne.Time:return;case Ne.Country:return t.user.country;case Ne.Nationality:return t.user.nationality;default:return Za(e.fieldType)}}getFieldValue(e,t){const n=e[t.slug];return t.fieldType===Ne.Phone&&n?(0,Ir.A)(n,P_):t.fieldType===Ne.File?(0,Ir.A)(n,Qb):t.fieldType===Ne.Date&&n?Fo.c9.fromISO(n,{zone:"UTC"}):n}};yj=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hc,ej,D_,Dn])],yj);const kj=({formattedAddressProps:e,latitudeProps:t,longitudeProps:n,placeProps:o,...s})=>{const r=(0,F.useRef)(null);return(0,F.useEffect)(()=>{const i=new google.maps.places.Autocomplete(r.current,{types:["geocode"]});i.addListener("place_changed",async()=>{const s=i.getPlace(),r=s.geometry.location.lat(),a=s.geometry.location.lng();e.input.onChange(s.formatted_address),t?.input.onChange(r),n?.input.onChange(a),o?.input.onChange(s)})},[]),(0,i.jsx)(wl,{ref:r,value:e.input.value,onBlur:e.input.onBlur,onChange:e.input.onChange,onFocus:e.input.onFocus,...s})},Aj=({addressName:e,latitudeName:t,longitudeName:n,placeName:o,...s})=>{const r=[e];return t&&r.push(t),n&&r.push(n),o&&r.push(o),(0,i.jsx)(N_,{names:r,render:r=>(0,i.jsx)(kj,{formattedAddressProps:r[e],latitudeProps:t?r[t]:void 0,longitudeProps:n?r[n]:void 0,placeProps:o?r[o]:void 0,...s})})},wj=e=>{const t=Ln();return(0,i.jsxs)(Ea,{gap:"4",width:1,children:[(0,i.jsx)(fr,{css:{border:"1px solid $gray200",borderRadius:"$1",overflow:"hidden"},height:126,width:126,children:(0,i.jsx)("img",{height:"126px",src:e.url,width:"126px"})}),(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",children:e.label}),e.hint&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray400",children:e.hint})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(fr,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",onClick:e.onDelete,children:t("supprimer_43083")})]})]})},Sj=e=>(0,i.jsxs)(Ea,{gap:"4",width:1,children:[(0,i.jsx)(Ea,{align:"center",css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",cursor:"pointer"},height:126,justify:"center",width:126,children:(0,i.jsx)(Ea,{height:64,width:64,children:(0,i.jsx)(cl,{color:lr.colors.gray900.value,height:"64px",strokeWidth:"4",width:"64px"})})}),(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",children:e.label}),e.hint&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray400",children:e.hint})]})]})]}),Ej=({value:e,onChange:t,label:n,hint:o,organizationId:s,...r})=>{const[a,l]=(0,F.useState)(e?ev.File:ev.Uploader);return a===ev.File&&e?(0,i.jsx)(wj,{hint:o,label:n,url:FI(e,R.HEAVENT_AWS_UPLOADS_BUCKET),onDelete:()=>{t(null),l(ev.Uploader)}}):a===ev.Uploading?(0,i.jsx)(Sj,{hint:o,label:n}):(0,i.jsx)(XI,{hint:o,label:n,onChange:async e=>{l(ev.Uploading);try{const n=await DI(s,e,"public-read");t(n),l(ev.File)}catch{l(ev.Uploader)}},...r})},Tj=({prefix:e,...t})=>{const n=`${e}key`,o=`${e}name`,s=`${e}acl`;return(0,i.jsx)(N_,{names:[n,o,s],render:e=>{let r=null;return h(e[n].input.value)&&h(e[o].input.value)&&h(e[s].input.value)&&(r={key:e[n].input.value,name:e[o].input.value,acl:e[s].input.value}),(0,i.jsx)(Ej,{value:r,onChange:t=>{e[n].input.onChange(t?.key??""),e[o].input.onChange(t?.name??""),e[s].input.onChange(t?.acl??"")},...t})}})},zj=e=>{const t=Ln(),n=Ac(),o=Nn(Hc),s=Nn(yj),r=e.isMandatory?e.field.name:(0,i.jsx)(nv,{children:e.field.name}),a=`${e.prefix}${e.field.slug}`,l=e.field.description,d=(0,F.useMemo)(()=>a.startsWith("formRegister.userInfo.fields."),[a]);if((0,F.useEffect)(()=>{e.display||e.change(a,s.fieldUpdateInputDefault(e.field,o.getDefaultCountryValues()))},[e.display,e.field,e.change]),!e.display)return null;switch(e.field.fieldType){case Ne.Text:return(0,i.jsx)(Sl,{description:l,label:r,name:a});case Ne.Textarea:return(0,i.jsx)(Tm,{description:l,label:r,name:a});case Ne.Checkbox:return(0,i.jsx)(ym,{name:a,subtext:l,children:r});case Ne.Validation:return(0,i.jsx)(ym,{name:a,subtext:(0,i.jsxs)(i.Fragment,{children:[h(l)&&(0,i.jsx)("span",{children:l}),h(l)&&e.field.document&&(0,i.jsx)("br",{}),e.field.document&&(0,i.jsx)(j_,{css:{color:"$primary700"},download:e.field.document.name,to:e.field.document.url,onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},children:t("consulter_le_do_69928")})]}),children:r});case Ne.Select:return e.field.canSelectMultiple?(0,i.jsx)(Sm,{description:l,isSearchVisible:!0,isSelectAllVisible:!0,label:r,multiple:!0,name:a,children:e.field.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))}):(0,i.jsx)(Sm,{description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:e.field.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))});case Ne.Date:return"dateOfBirth"===e.field.slug?(0,i.jsx)(km,{autoComplete:d?"bday":void 0,description:l,label:r,max:Fo.c9.now(),name:a}):(0,i.jsx)(km,{description:l,label:r,name:a});case Ne.Datetime:return(0,i.jsx)(ij,{description:l,label:r,name:a});case Ne.Time:return(0,i.jsx)(dv,{description:l,label:r,name:a});case Ne.Phone:return(0,i.jsx)(B_,{description:l,label:r,prefix:`${a}.`});case Ne.Number:return(0,i.jsx)(Sl,{description:l,label:r,name:a,shouldParseAsInt:!0});case Ne.Sex:return(0,i.jsxs)(lj,{autoComplete:d?"sex":void 0,description:l,label:r,name:a,children:[(0,i.jsx)("option",{disabled:!0,value:"",children:t("choisir_une_val_00277")}),n(jn)]});case Ne.Language:return e.field.fieldProperty===Me.Language?(0,i.jsx)(Sm,{autoComplete:d?"language":void 0,description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:n(ad)}):(0,i.jsx)(Sm,{description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:n(un)});case Ne.Nationality:return(0,i.jsx)(Sm,{description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:o.getNationalitiesIdName(e.countryCode).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});case Ne.Address:return(0,i.jsx)(Aj,{addressName:a,autoComplete:d?"street-address":void 0,description:l,label:r,placeName:e.field.fieldProperty===Me.Street?"place":void 0});case Ne.Country:return(0,i.jsx)(Sm,{autoComplete:d?"country":void 0,description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:o.getCountriesIdName(e.countryCode).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});case Ne.File:return e.field.fieldProperty===Me.Picture?(0,i.jsx)(Tj,{allowCrop:!0,hint:l,label:r,organizationId:e.organizationId,prefix:`${a}.`}):(0,i.jsx)(oj,{accept:[HI.Images,HI.Pdf],acl:e.fileAcl??"private",description:l,label:r,organizationId:e.organizationId,prefix:`${a}.`});default:return Za(e.field.fieldType)}},$j=e=>{const t=Ln(),[n,o]=(0,F.useState)(""),s=(0,F.useMemo)(()=>{if(h(n)){const t=n.trim().toLowerCase();return e.customFields.filter(e=>e.name.trim().toLowerCase().includes(t)||h(e.label)&&e.label.trim().toLowerCase().includes(t))}return e.customFields},[e.customFields,n]),r=(0,F.useMemo)(()=>(0,Zd.A)(Object.entries((0,Kd.A)(s,e=>e.category.name)),([e])=>e).map(([e,t])=>[e,(0,Zd.A)(t,e=>e.name)]),[s]);return(0,i.jsxs)(Ea,{css:{padding:"$3"},direction:"column",width:1,children:[(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_un_c_86475"),state:"search",value:n,onChange:o}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(fr,{css:{maxHeight:"300px",overflowY:"auto"},children:r.map(([n,o],s)=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(Qd,{index:s,children:n}),o.map(n=>n.conditionCustomField&&!e.selectedCustomFieldsIds.has(n.conditionCustomField.id)?(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsxs)(Ea,{align:"center",css:{px:"$3"},gap:"3",height:40,width:1,children:[(0,i.jsx)(tc,{disabled:!0,shouldPreventDefault:!1,state:"unchecked",onClick:Bl.A}),(0,i.jsx)(fr,{color:"gray400",css:{ellipsis:!0,flex:"1"},title:n.name,children:n.name})]},n.id)}),(0,i.jsx)(am,{placement:"top-start",children:t("ce_champ_d_pend_31209",n.conditionCustomField?.name)})]},n.id):(0,i.jsx)(rc,{isCheckbox:!0,isRadio:!1,isSelected:e.selectedCustomFieldsIds.has(n.id),subtext:n.label,value:n.id,onClick:()=>{e.toggle(n)},children:n.name},n.id))]},s))})]})},Oj=e=>{const{translate:t}=il();return(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"invisible",leftIcon:"plus",children:t("ajouter_97327")})}),(0,i.jsx)(Pd,{placement:"top-start",width:400,children:(0,i.jsx)($j,{customFields:e.customFields,selectedCustomFieldsIds:e.usedCustomFieldsIds,toggle:e.toggle})})]})},Rj=e=>{const{translate:t}=il();return(0,i.jsxs)(Ea,{align:"center",css:{background:"$gray50",bd:"gray200 2",padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("aucun_champ_per_21094")}),(0,i.jsx)(Oj,{customFields:e.customFields,toggle:e.toggle,usedCustomFieldsIds:e.usedCustomFieldsIds})]})},Pj=e=>{const{params:{organizationId:t}}=il(),n=(0,F.useMemo)(()=>e.customFields.filter(t=>e.usedCustomFieldsIds.includes(t.id)),[e.customFields,e.usedCustomFieldsIds]),o=(0,F.useMemo)(()=>new Set(e.usedCustomFieldsIds),[e.usedCustomFieldsIds]),s=(0,F.useCallback)(t=>{o.has(t.id)?e.change(`${e.prefix}usedCustomFieldsIds`,e.usedCustomFieldsIds.filter(e=>e!==t.id)):e.change(`${e.prefix}usedCustomFieldsIds`,[...e.usedCustomFieldsIds,t.id])},[e.prefix,e.usedCustomFieldsIds,o]);return(0,i.jsx)(Ea,{children:Zo(e.usedCustomFieldsIds)?(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"4",children:[n.map(n=>(0,i.jsxs)(Ea,{align:"end",gap:"3",children:[(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(zj,{change:e.change,display:!0,field:n,fileAcl:"public-read",isMandatory:!1,organizationId:t,prefix:`${e.prefix}fields.`})}),(0,i.jsx)(pl,{color:"white",leftIcon:"trash-can",onClick:()=>s(n)})]},n.id)),(0,i.jsx)(Oj,{customFields:e.customFields,toggle:s,usedCustomFieldsIds:o})]}):(0,i.jsx)(Rj,{customFields:e.customFields,toggle:s,usedCustomFieldsIds:o})})},Dj=e=>{const t=Ln();return(0,i.jsxs)(Ed,{doNotCloseOnOtherOpen:!0,isOpen:e.isOpen,onStateChange:e.onStateChange,children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(fr,{children:(0,i.jsxs)(pl,{color:e.color,leftIcon:"bars-filter",children:[t("filtres_64574")," ",(e.numberOfAppliedFilters||0)>0?`(${e.numberOfAppliedFilters})`:""]})})}),(0,i.jsx)(Pd,{placement:"bottom-end",width:385,children:(0,i.jsxs)(Ea,{direction:"column",onChange:Il,children:[(0,i.jsxs)(Ea,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(fr,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),e.children]}),e.showButtons&&(0,i.jsxs)(Ea,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(fr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:e.reinit,children:t("r_initialiser_77538")}),(0,i.jsx)(pl,{size:"sm",onClick:e.apply,children:t("appliquer_05753")})]})]})})]})};function Fj(e){return`${e.name}${h(e.acronym)?` (${e.acronym})`:""}`}function Mj(e,t,n,i,o){return i.accreditationDisplay!==ct.None&&!i.hiddenAccreditationsIds.includes(e.id)&&(0===i.displayedAccreditationsIds.length||i.displayedAccreditationsIds.includes(e.id))&&dh(e,n)&&(!e.hasSlots||e.slots.some(e=>fh(e,t,i,o)))||o.some(n=>n.accreditationId===e.id&&(!e.hasSlots||e.slots.some(e=>fh(e,t,i,o))))}function Nj(e){return Lj(e.map(({accreditationSlot:e})=>e))}function Lj(e){return(0,Zd.A)(Object.values((0,Kd.A)(e,e=>e.accreditation.id)).map(e=>{const t=e[0].accreditationCategory,n=e[0].accreditation,i=e.map(e=>e.date?.toMillis()??1);return{id:n.id,category:t.name,index:n.index,text:h(n.acronym)?n.acronym:n.name,minDate:(0,Xu.A)(i),color:n.color,count:e.length,icon:n.icon}}),({category:e,index:t,text:n,minDate:i})=>[e.toLowerCase(),Bj(t),n.toLowerCase(),i])}function Bj(e){return"number"!=typeof e||isNaN(e)?"9999":e.toString(10).padStart(4,"0")}function Vj(e){return(0,Zd.A)(e,e=>[e.accreditationCategoryName||"",Bj(e.index),e.name.toLowerCase()])}function Uj(e,t,n,i,o){let s;const r=t.map(e=>e.accreditationId);if(n){const t={accreditationCategoryId:i.accreditationCategoryId,accreditationId:i.accreditationId,maxResources:null,willAutoAccredit:!0};s=(0,Ju.A)([...e,t],e=>e.accreditationId)}else s=e.filter(e=>r.includes(e.accreditationId));o("delegation.accreditations",s)}const Wj=({accreditationCategoryId:e,accreditationId:t,accreditationName:n,accreditationSlotsIdsValues:o,change:s,slot:r,values:a})=>{const l=Nn($c),d=(0,F.useMemo)(()=>o.includes(r.id),[o]);return(0,i.jsx)(nc,{state:d?"checked":"unchecked",onClick:()=>{const n={accreditationCategoryId:e,accreditationId:t,accreditationSlotId:r.id,isDefault:!1,isVisible:!0},i=d?a.accreditationsSlots.filter(e=>e.accreditationSlotId!==r.id):[...a.accreditationsSlots,n];s("delegation.accreditationsSlots",i),Uj(a.accreditations,i,!d,n,s)},children:ph(l,r,n)})},Gj=({accreditationCategoryId:e,accreditation:t,accreditationSlotsIdsValues:n,change:o,fullAccreditation:s,values:r})=>{const a=Ln(),[l,d]=(0,F.useState)(!0),c=(0,F.useMemo)(()=>!s.slots.some(e=>!n.includes(e.id)),[t.slots,n]),u=Zo((0,F.useMemo)(()=>r.accreditationsSlots.filter(e=>e.accreditationId==t.id),[r])),h=(e,t,n)=>{const i=e?[...r.accreditationsSlots,...n]:r.accreditationsSlots.filter(e=>e.accreditationId!==t);o("delegation.accreditationsSlots",i),Uj(r.accreditations,i,e,n[0],o)};return s.hasSlots?(0,i.jsxs)(Ea,{css:{padding:"$4 0",borderRadius:"5px",border:"1px solid $gray200",boxShadow:"$xs",background:"$white"},direction:"column",gap:"4",children:[(0,i.jsxs)(Ea,{css:{padding:"0 $5"},children:[(0,i.jsxs)(Ea,{align:"center",css:{cursor:"pointer"},gap:"2",onClick:()=>{d(!l)},children:[(0,i.jsx)(Va,{icon:l?"chevron-down":"chevron-up"}),t.name]}),(0,i.jsx)(fr,{css:{flex:"1"}}),(0,i.jsx)(pl,{color:"invisible",onClick:()=>{const n=t.slots.map(n=>({accreditationCategoryId:e,accreditationId:t.id,accreditationSlotId:n.id,isDefault:!1,isVisible:!0}));h(!c,t.id,n)},children:a(c?"tout_des_lectio_13935":"tout_s_lectionn_48027")})]}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(Ea,{css:{padding:"0 $5"},direction:"column",gap:"4",children:t.slots.toSorted((e,t)=>{if(e.date&&t.date){const n=e.date.toJSDate(),i=t.date.toJSDate();return ni?1:0}return e.namet.name?1:0}).map(s=>(0,i.jsx)(Wj,{accreditationCategoryId:e,accreditationId:t.id,accreditationName:t.name,accreditationSlotsIdsValues:n,change:o,slot:s,values:r},s.id))})]})]}):(0,i.jsx)(nc,{css:{padding:"$4 $5",borderRadius:"5px",border:"1px solid $gray200",boxShadow:"$xs",background:"$white"},state:u?"checked":"unchecked",onClick:()=>{const n=[{accreditationCategoryId:e,accreditationId:t.id,accreditationSlotId:t.hiddenSlotId,isDefault:!1,isVisible:!0}];h(!u,t.id,n)},children:t.name})},Hj=({accreditationCategory:e,accreditationSlotsIdsValues:t,change:n,fullAccreditationCategory:o,values:s})=>{const r=(0,F.useMemo)(()=>Vj(e.accreditations),[e.accreditations]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray500",fontSize:"textSm",children:e.name}),r.map(r=>(0,i.jsx)(Gj,{accreditation:r,accreditationCategoryId:e.id,accreditationSlotsIdsValues:t,change:n,fullAccreditation:o.accreditations.find(e=>e.id===r.id),values:s},r.id))]})},qj=({allAccreditationCategories:e,change:t,eventStartAt:n,eventEndAt:o,setIsAddAccreditationOpen:s,values:r})=>{const{params:{organizationId:a,eventId:l,delegationId:d},translate:c}=il(),[u,h]=(0,F.useState)(""),[g,p]=(0,F.useState)([]),[f,x]=(0,F.useState)([]),[_,I]=(0,F.useState)(Fo.c9.invalid("Invalid")),v=(0,F.useMemo)(()=>r.accreditationsSlots.flatMap(e=>e.accreditationSlotId),[r]),b=(0,F.useMemo)(()=>e.flatMap(e=>e.accreditations),[e]),j=(0,F.useMemo)(()=>(0,Zd.A)(e.flatMap(e=>{const t=Xo(g)||g.includes(e.id),n=e.accreditations.flatMap(e=>{const t=(m(u)||(n=e.name,i=u,n.toUpperCase().includes(i.toUpperCase())))&&(Xo(f)||f.includes(e.id));var n,i;const o=e.slots.filter(e=>!_?.isValid||!e.date?.isValid||e.date.equals(_));return t&&(Xo(e.slots)||Zo(o))?[{...e,slots:o}]:[]});return t&&Zo(n)?[{...e,accreditations:n}]:[]}),e=>e.name.toLowerCase()),[u,g,f,_]);return(0,i.jsxs)(eu,{returnToFallback:to.DELEGATION_ACCREDITATIONS({organizationId:a,eventId:l,delegationId:d}),size:"md",onClose:()=>{s(!1)},children:[(0,i.jsxs)(tu,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{font:"gray900 textXl medium",children:c("add_an_accreditation")}),(0,i.jsx)(fr,{color:"gray500",children:c("add_default_accreditations_to_delegation")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsxs)(Ea,{gap:"3",justify:"evenly",children:[(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:c("rechercher_une_65646"),value:u,onChange:e=>{h(e)}}),(0,i.jsxs)(Dj,{color:"gray",showButtons:!1,children:[(0,i.jsx)(dc,{isSearchVisible:!0,isSelectAllVisible:!0,label:c("cat_gories_24533"),multiple:!0,renderOnPortal:!0,values:g,onChange:p,children:e.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(dc,{isSearchVisible:!0,isSelectAllVisible:!0,label:c("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:f,onChange:x,children:b.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(_u,{label:"Date",max:o,min:n,value:_,onChange:I})]})]}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Ea,{direction:"column",gap:"4",children:j.map(n=>(0,i.jsx)(Hj,{accreditationCategory:n,accreditationSlotsIdsValues:v,change:t,fullAccreditationCategory:e.find(e=>e.id===n.id),values:r},n.id))}),(0,i.jsx)(Pa,{height:"6"})]}),(0,i.jsx)(nu,{children:(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{onClick:()=>s(!1),children:c("ajouter_97327")}),(0,i.jsx)(pl,{color:"white",onClick:()=>{t("delegation.accreditations",[]),t("delegation.accreditationsSlots",[])},children:c("r_initialiser_77538")})]})})]})},Yj=e=>(0,i.jsx)(Ea,{css:{background:"$gray50",overflowX:"auto",padding:"$6",...e.css},direction:"column",gap:"4",height:1,width:1,children:e.children}),Kj=e=>(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(fr,{font:"gray800 textMd medium",children:e.category.name}),(0,i.jsx)(Ea,{direction:"column",gap:"3",children:e.children})]},e.category.id),Zj=ar(Ea,{borderRadius:"$2",fontSize:"$textSm",height:"32px",width:"32px","@tablet":{borderRadius:"$3",fontSize:"$textMd",height:"40px",width:"40px"}}),Xj=e=>{const t=(0,F.useMemo)(()=>Vd(e.color),[e.color]),n=(0,F.useMemo)(()=>ln.includes(e.icon)?Ba(e.icon):e.icon,[e.icon]);return(0,i.jsx)(Zj,{role:"presentation",align:"center",css:{background:t[100],color:t[700]},justify:"center",children:(0,i.jsx)(Va,{icon:n})})},Jj=e=>{const{translate:t}=il(),n=F.useMemo(()=>Fj(e.accreditation),[e.accreditation]),[o,s]=F.useState(!0),r=e.displaySlots||"function"==typeof e.renderCheckbox;return(0,i.jsxs)(Ea,{css:{background:"white",bd:!0,overflow:"hidden",userSelect:"none"},direction:"column",children:[(0,i.jsxs)(Ea,{align:"center",css:{cursor:r?"pointer":"default",padding:"$3 $4"},gap:"2",onClick:()=>{s(!o),e.onClick?.()},children:[e.displaySlots&&(0,i.jsx)(Ea,{align:"center",css:{fontSize:"$textXs"},height:20,justify:"center",width:20,children:(0,i.jsx)(Va,{icon:o?"chevron-down":"chevron-right"})}),e.renderCheckbox?.(),(0,i.jsx)(Xj,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray800 textSm semiBold",children:n}),e.displayNumberOfSlots&&(0,i.jsx)(fr,{color:"gray500",children:t("creneau",e.numberOfSlots)})]}),e.renderActions?.()]}),(e.displayFormCustomFields||e.displaySlots&&o)&&(0,i.jsx)(Ea,{css:{borderTop:"1px solid $gray200"},direction:"column",children:e.children})]})},Qj=e=>{const{translate:t}=il(),[n,o]=(0,F.useState)(void 0),s=(0,F.useCallback)(t=>{e.change("delegation.accreditationsSlots",(0,Jc.jM)(e.values.delegation.accreditationsSlots,n=>{n.forEach(n=>{e.slotsIds.includes(n.accreditationSlotId)&&(n.maxResources=t)})})),o(t)},[e.selectedSlotsIds,e.slotsIds,e.values,e.change,o]),r=(0,F.useMemo)(()=>e.values.delegation.accreditationsSlots.find(t=>t.accreditationSlotId===e.selectedSlotsIds[0]),[e.selectedSlotsIds,e.values]),a=r?.isDefault??!1,l=r?.isVisible??!0,d=(0,F.useCallback)(()=>{e.change("delegation.accreditationsSlots",(0,Jc.jM)(e.values.delegation.accreditationsSlots,t=>{t.forEach(t=>{e.selectedSlotsIds.includes(t.accreditationSlotId)&&(a?(t.isDefault=!1,t.isVisible=!0):t.isDefault=!0)})})),e.change("selectedAccreditationsSlotsIds",[])},[e.selectedSlotsIds,e.values,e.change,a]),c=(0,F.useCallback)(()=>{e.change("delegation.accreditationsSlots",(0,Jc.jM)(e.values.delegation.accreditationsSlots,t=>{t.forEach(t=>{e.selectedSlotsIds.includes(t.accreditationSlotId)&&(l?(t.isDefault=!0,t.isVisible=!1):t.isVisible=!0)})})),e.change("selectedAccreditationsSlotsIds",[])},[e.selectedSlotsIds,e.values,e.change,l]),u=(0,F.useCallback)(()=>{e.change("selectedAccreditationsSlotsIds",(0,Jd.A)(e.values.selectedAccreditationsSlotsIds,e.selectedSlotsIds)),e.change("delegation.accreditationsSlots",e.values.delegation.accreditationsSlots.filter(t=>!e.selectedSlotsIds.includes(t.accreditationSlotId)))},[e.selectedSlotsIds,e.values,e.change]);return Zo(e.selectedSlotsIds)?(0,i.jsxs)(Ea,{gap:"3",onClick:Il,children:[(0,i.jsxs)(Ea,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:d,children:[(0,i.jsx)(fr,{fontSize:"textXs",children:(0,i.jsx)(Va,{icon:"badge"})}),(0,i.jsx)(fr,{fontWeight:"medium",children:t(a?"ne_pas_accr_dit_59893":"accr_diter_par_72403")})]}),(0,i.jsxs)(Ea,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:c,children:[(0,i.jsx)(fr,{fontSize:"textXs",children:(0,i.jsx)(Va,{icon:l?"eye-slash":"eye"})}),(0,i.jsx)(fr,{fontWeight:"medium",children:t(l?"masquer_34645":"rendre_visible_37057")})]}),(0,i.jsxs)(Ea,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",children:[(0,i.jsx)(fr,{fontWeight:"medium",children:t("total_07173")}),(0,i.jsx)(fr,{width:100,children:(0,i.jsx)(wl,{min:0,rightIcon:"xmark",shouldParseAsInt:!0,value:n??"",onChange:s,onRightIconClick:()=>s(void 0)})})]}),(0,i.jsxs)(Ea,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:u,children:[(0,i.jsx)(fr,{fontSize:"textXs",children:(0,i.jsx)(Va,{icon:"trash-can"})}),(0,i.jsx)(fr,{fontWeight:"medium",children:t("supprimer_43083")})]})]}):(0,i.jsxs)(Ea,{align:"center",gap:"6",onClick:Il,children:[e.hasSlots&&(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{children:t("limite_totale_35352")}),(0,i.jsx)(fr,{width:60,children:(0,i.jsx)(Sl,{name:`${e.prefix}maxResources`})})]}),(0,i.jsx)(zm,{name:`${e.prefix}willAutoAccredit`,children:t("attribuer_autom_13895")})]})},eC=e=>{const{translate:t}=il(),n=Nn($c),o=(0,F.useMemo)(()=>e.values.delegation.accreditationsSlots.findIndex(t=>t.accreditationSlotId===e.slot.id),[e.values,e.slot]),s=e.values.delegation.accreditationsSlots[o],r=`delegation.accreditationsSlots[${o}].`,a=s?.isDefault?"checked":"unchecked",l=(0,F.useMemo)(()=>e.values.selectedAccreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked",[e.slot,e.values.selectedAccreditationsSlotsIds]),d=(0,F.useCallback)(t=>{e.change(`${r}isDefault`,"checked"===t),"checked"===t&&e.values.delegation.accreditationsSlots.forEach((t,n)=>{t.accreditationSlotId!==s.accreditationSlotId&&t.accreditationId===s.accreditationId&&e.change(`delegation.accreditationsSlots[${n}].isDefault`,!1)}),"unchecked"===t&&e.change(`${r}isVisible`,!0)},[r,s,e.values,e.change]),c=(0,F.useCallback)(t=>{e.change(`${r}isDefault`,"checked"===t),"unchecked"===t&&e.change(`${r}isVisible`,!0)},[r,e.change]),u=(0,F.useCallback)(t=>{e.change("selectedAccreditationsSlotsIds",Jo(e.values.selectedAccreditationsSlotsIds,e.slot.id,"checked"===t))},[e.slot,e.values.selectedAccreditationsSlotsIds,e.change]);return(0,i.jsxs)(Cc,{children:[e.displaySelectedCheckbox&&(0,i.jsx)(xc,{width:48,children:(0,i.jsx)(tc,{state:l,onClick:u})}),(0,i.jsx)(xc,{css:{textTransform:"capitalize"},children:e.slot.date?n.toLocaleString(e.slot.date,Ho.DateOnly.WeekdayShortMonthShort):"-"}),(0,i.jsx)(xc,{children:h(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(xc,{children:e.accreditationDisplay===ne.Radio?(0,i.jsx)(sc,{state:a,onClick:d,children:t("accr_ditation_p_28030")}):(0,i.jsx)(nc,{state:a,onClick:c,children:t("accr_ditation_p_28030")})}),(0,i.jsx)(xc,{width:100,children:(0,i.jsx)(pl,{color:"white",disabled:!s.isDefault,leftIcon:s.isVisible?"eye":"eye-slash",onClick:()=>{e.change(`${r}isVisible`,!s.isVisible)}})}),(0,i.jsx)(xc,{width:130,children:(0,i.jsx)(Sl,{min:0,name:`${r}maxResources`,shouldParseAsInt:!0})})]})},tC=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>e.values.delegation.accreditations.findIndex(t=>t.accreditationId===e.accreditation.id),[e.values,e.accreditation]),o=(0,F.useMemo)(()=>Ih(e.slots.filter(t=>t.accreditationId===e.accreditation.id)),[e.slots,e.accreditation]),s=(0,F.useMemo)(()=>o.map(e=>e.id),[o]),r=`delegation.accreditations[${n}].`,a=(0,F.useMemo)(()=>{if(e.accreditation.hasSlots){const t=(0,Oo.A)(o.map(t=>e.values.selectedAccreditationsSlotsIds.includes(t.id)));return 2===t.length?"indeterminate":t[0]?"checked":"unchecked"}return"unchecked"},[e.accreditation,e.values.selectedAccreditationsSlotsIds,o]),l=(0,F.useMemo)(()=>s.filter(t=>e.values.selectedAccreditationsSlotsIds.includes(t)),[e.values.selectedAccreditationsSlotsIds,s]),d=(0,F.useCallback)(t=>{"checked"===t?e.change("selectedAccreditationsSlotsIds",(0,Oo.A)(e.values.selectedAccreditationsSlotsIds.concat(s))):e.change("selectedAccreditationsSlotsIds",(0,Jd.A)(e.values.selectedAccreditationsSlotsIds,s))},[e.values.selectedAccreditationsSlotsIds,e.change,s]);return(0,i.jsx)(Jj,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:o.length,renderActions:()=>(0,i.jsx)(Qj,{change:e.change,hasSlots:e.accreditation.hasSlots,prefix:r,selectedSlotsIds:l,slotsIds:s,values:e.values}),children:(0,i.jsxs)(mc,{hideBorder:!0,children:[(0,i.jsxs)(cc,{children:[e.accreditation.hasSlots&&(0,i.jsx)(Tc,{width:48,children:(0,i.jsx)(tc,{state:a,onClick:d})}),(0,i.jsx)(Tc,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(Tc,{children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(Tc,{children:t("accr_ditation_p_28030")}),(0,i.jsx)(Tc,{width:100,children:t("Privacy")}),(0,i.jsx)(Tc,{width:130,children:t("total_07173")})]}),o.map((t,n)=>(0,i.jsx)(eC,{accreditationDisplay:e.accreditation.accreditationDisplay,change:e.change,displaySelectedCheckbox:e.accreditation.hasSlots,slot:t,values:e.values},`${t.id}-${n}`))]})})},nC=e=>{const t=(0,F.useMemo)(()=>Vj(e.accreditations.filter(t=>t.accreditationCategoryId===e.category.id)),[e.accreditations,e.category]);return(0,i.jsx)(Kj,{category:e.category,children:t.map((t,n)=>(0,i.jsx)(tC,{accreditation:t,change:e.change,slots:e.slots,values:e.values},`${t.id}-${n}`))})},iC=e=>{const t=(0,F.useMemo)(()=>e.values.delegation.accreditationsSlots.map(e=>e.accreditationCategoryId),[e.values]),n=(0,F.useMemo)(()=>e.values.delegation.accreditationsSlots.map(e=>e.accreditationId),[e.values]),o=(0,F.useMemo)(()=>e.values.delegation.accreditationsSlots.map(e=>e.accreditationSlotId),[e.values]),s=(0,F.useMemo)(()=>(0,Zd.A)(e.accreditationCategories.filter(e=>t.includes(e.id)),e=>e.name.toLowerCase()),[e.accreditationCategories,t]),r=(0,F.useMemo)(()=>e.accreditationCategories.flatMap(e=>e.accreditations).filter(e=>n.includes(e.id)),[e.accreditationCategories,n]),a=(0,F.useMemo)(()=>r.flatMap(e=>e.slots).filter(e=>o.includes(e.id)),[r,o]);return(0,i.jsx)(Yj,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:s.map(t=>(0,i.jsx)(nC,{accreditations:r,category:t,change:e.change,slots:a,values:e.values},t.id))})},oC=({allAccreditationCategories:e,setIsAddAccreditationOpen:t,change:n,values:o})=>{const{translate:s}=il(),r=(0,F.useMemo)(()=>o.delegation.accreditationsSlots.some(({isDefault:e})=>e),[o]);return(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{font:"gray900 textMd medium",children:s("liste_des_accr_46997")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(iC,{accreditationCategories:e,change:n,values:o}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(pl,{color:"invisible",leftIcon:"plus",onClick:()=>{t(!0)},children:s("add_accreditation")}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{font:"gray900 textMd medium",children:s("attribution_des_59896")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(zm,{name:"delegation.addDefaultAccreditationsByAvailability",children:s("attribuer_les_a_56919")})]})]})},sC=e=>(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsx)(fr,{font:"gray800 textSm medium",width:280,children:e.title}),(0,i.jsx)(Ea,{css:{flex:"1"},direction:"column",children:e.children})]}),rC=e=>{const{translate:t}=il(),n=Nn(Eh),[o,s]=(0,F.useState)(!1),r=(0,F.useMemo)(()=>n.getDelegationMembersPossibleColumns(e.customFields,{isWeezeventConnected:!0,positionDisplay:ht.Position,slotDisplay:gt.Custom}),[n,e.customFields]),a=(0,F.useMemo)(()=>(0,Da.A)(e.values.delegation.columns.map(e=>r.find(t=>t.slug===e))),[r,e.values.delegation]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{bd:!0,overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(Ea,{css:{background:"$gray50",borderBottom:"1px solid $gray200",color:"$gray500",padding:"$3 $6"},children:t("liste_des_colon_20101")}),(0,i.jsxs)(Ea,{css:{padding:"$4"},direction:"column",gap:"4",children:[(0,i.jsx)(Ea,{direction:"column",gap:"2",children:a.map(t=>(0,i.jsxs)(Ea,{align:"center",css:{border:"1px solid $gray200",borderRadius:"$1",overflow:"hidden",padding:"$3"},gap:"3",children:[(0,i.jsx)(fr,{color:"gray700",css:{flex:"1"},children:t.name}),(0,i.jsx)(pl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.change("delegation.columns",(0,Xd.A)(e.values.delegation.columns,t.slug))}})]},t.slug))}),(0,i.jsx)(pl,{color:"invisible",leftIcon:"gear",onClick:()=>{s(!0)},children:t("_diter_les_colo_39630")})]})]}),o&&(0,i.jsx)(ru,{columns:r,initialSelectedColumns:e.values.delegation.columns,saveButtonText:t("_diter_62574"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_96096"),title:t("_dition_des_col_70300"),onClose:()=>{s(!1)},onSave:t=>{e.change("delegation.columns",t)}})]})},aC=e=>{const{translate:t}=il();return(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(sC,{title:t("liste_des_colon_20101"),children:(0,i.jsx)(rC,{change:e.change,customFields:e.customFields,values:e.values})}),(0,i.jsx)($u,{height:"5"}),(0,i.jsx)(sC,{title:t("droits_des_resp_01552"),children:(0,i.jsxs)(Ea,{direction:"column",gap:"3",width:1,children:[(0,i.jsx)(zm,{name:"delegation.showFormLinkInDelegationSpace",children:t("afficher_le_lie_05841")}),(0,i.jsx)(zm,{name:"delegation.canLeadersAddMembers",children:t("CanLeadersAddMembers")}),(0,i.jsx)(zm,{name:"delegation.canLeadersImportMembers",children:t("CanLeadersImportMembers")}),(0,i.jsx)(zm,{name:"delegation.canLeadersEditMembers",children:t("CanLeadersEditMembers")}),(0,i.jsx)(zm,{name:"delegation.canLeadersDeleteMembers",children:t("CanLeadersDeleteMembers")}),(0,i.jsx)(zm,{name:"delegation.canLeadersEditColumns",children:t("CanLeadersEditColumns")}),(0,i.jsx)(zm,{name:"delegation.canLeadersEditCustomFields",children:t("CanLeadersEditCustomFields")}),(0,i.jsx)(zm,{name:"delegation.canLeadersSeeHiddenAccreditationsSlots",children:t("CanLeadersSeeHiddenAccreditationsSlots")})]})}),(0,i.jsx)($u,{height:"5"}),(0,i.jsx)(sC,{title:t("communication_05277"),children:(0,i.jsxs)(Ea,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("liste_des_campa_21201"),multiple:!0,name:"delegation.campaignsIds",children:e.campaigns.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("liste_des_docum_18767"),multiple:!0,name:"delegation.customDocumentsSlugs",children:e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))})]})})]})};function lC(e){return(0,Zd.A)(e,e=>e.name.toLowerCase())}const dC=e=>{const t=Ln(),n=(0,F.useMemo)(()=>l.Ik().shape({name:l.Yj().required(t("le_nom_est_requ_61536"))}),[]);return(0,i.jsx)(gj,{buttonText:e.isEdit?t("renommer_42135"):t("cr_er_82895"),icon:"pen",initialValues:{name:e.initialName},schema:n,title:e.isEdit?t("renommer_1_40542",e.initialName):t("cr_er_une_nouve_72722"),onClose:e.onClose,onSubmit:async t=>{const n=await e.mutate(t.name);e.onClose(),e.onSuccess(n)},children:(0,i.jsx)(Sl,{label:t("nom_de_la_cat_g_03860"),name:"name"})})},cC=e=>{const{mutate:t}=function(e={}){return Un("mutation DelegationCategoryCreate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $delegationCategory: DelegationsCategoryInput!\n) {\n    delegationCategoryCreate(\n        organizationId: $organizationId\n        eventId: $eventId\n        delegationCategory: $delegationCategory\n    ) {\n        id\n        name\n    }\n}\n",e)}();return(0,i.jsx)(dC,{initialName:"",isEdit:!1,mutate:async n=>(await t({organizationId:e.organizationId,eventId:e.eventId,delegationCategory:{name:n}})).delegationCategoryCreate,onClose:e.onClose,onSuccess:e.onSuccess})},uC=e=>{const{mutate:t}=function(e={}){return Un("mutation DelegationCategoryUpdate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $delegationCategoryId: DelegationsCategoryId!\n    $delegationCategory: DelegationsCategoryInput!\n) {\n    delegationCategoryUpdate(\n        organizationId: $organizationId\n        eventId: $eventId\n        delegationCategoryId: $delegationCategoryId\n        delegationCategory: $delegationCategory\n    ) {\n        id\n        name\n    }\n}\n",e)}();return(0,i.jsx)(dC,{initialName:e.delegationCategory.name,isEdit:!0,mutate:async n=>(await t({organizationId:e.organizationId,eventId:e.eventId,delegationCategoryId:e.delegationCategory.id,delegationCategory:{name:n}})).delegationCategoryUpdate,onClose:e.onClose,onSuccess:e.onSuccess})},hC=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),[s,r]=(0,F.useState)(0),[a,l,d]=Ec(""),{usersInfosOptions:c,isLoading:u}=gb({organizationId:n,eventId:null,hasSelected:Zo(e.leadersIds),nameDebounced:l,reloadKey:s,userInfoIds:e.leadersIds}),[h,m]=(0,F.useState)(!1),[g,p]=(0,F.useState)(lC(e.categories)),[f,x]=(0,F.useState)(!!e.initialParentId),_=(0,F.useCallback)(t=>{t||e.change("delegation.parentId",null),x(t)},[e.change,x]),I=(0,F.useCallback)(t=>{const n=e.organizationDelegations.find(e=>e.id===t);n&&(e.change("delegation.leadersIds",n.leadersIds),r(e=>e+1))},[e.organizationDelegations,e.leadersIds]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sr.Yr,{name:"delegation.parentId",children:I}),"event"===e.delegationType&&Zo(e.organizationDelegations)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(su,{value:f,onChange:_,children:t("lier_cette_d_l_78975")}),(0,i.jsx)(Pa,{height:"6"})]}),f?(0,i.jsx)(Sm,{isSearchVisible:!0,label:t("_quelle_d_l_ga_70215"),name:"delegation.parentId",children:e.organizationDelegations.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):(0,i.jsx)(Sl,{label:t("nom_de_votre_d_69290"),name:"delegation.name"}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Sm,{isCreateVisible:!0,isSearchVisible:!0,label:t("cat_gorie_00291"),name:"delegation.delegationCategoryId",onCreateClick:()=>{m(!0)},children:g.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Sm,{isSearchLoading:u,isSearchVisible:!0,label:t("reponsable_82458_plural"),multiple:!0,name:"delegation.leadersIds",searchElement:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),state:"search",value:a,onChange:d}),children:c}),h&&(0,i.jsx)(cC,{eventId:o,organizationId:n,onClose:()=>{m(!1)},onSuccess:t=>{p(lC([...g,t])),e.change("delegation.delegationCategoryId",t.id)}})]})},mC=e=>(0,i.jsx)(hC,{categories:e.categories,change:e.change,delegationType:"event",initialParentId:e.initialParentId,leadersIds:e.leadersIds,organizationDelegations:e.organizationDelegations}),gC=e=>(0,i.jsx)(hC,{categories:e.categories,change:e.change,delegationType:"organization",initialParentId:null,leadersIds:e.leadersIds,organizationDelegations:[]}),pC=e=>{const t=Ln(),n=(0,F.useMemo)(()=>(0,Zd.A)(e.forms,e=>e.name),[e.forms]),[o,s]=(0,F.useState)(!!e.initialValues.delegation.deadlineDate),[r,a]=(0,F.useState)(Number.isInteger(e.initialValues.delegation.maxResources));return(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(sC,{title:t("Form"),children:(0,i.jsx)(Sm,{isSearchVisible:!0,label:t("avec_quel_formu_60160"),name:"delegation.formId",placeholder:t("s_lectionnez_un_77066"),children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(sC,{title:t("inscription_dan_16147"),children:[(0,i.jsx)(fr,{font:"gray800 textSm semiBold",children:t("les_inscription_64653")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(sc,{state:o?"checked":"unchecked",onClick:()=>{s(!0)},children:t("oui_il_y_a_une_68479")}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(km,{name:"delegation.deadlineDate"}),(0,i.jsx)(Pa,{height:"3"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:o?"unchecked":"checked",onClick:()=>{s(!1),e.change("delegation.deadlineDate",null)},children:t("non_les_inscri_87979")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{font:"gray800 textSm semiBold",children:t("les_inscription_76218")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(sc,{state:r?"checked":"unchecked",onClick:()=>{a(!0)},children:t("oui_il_y_a_une_02976")}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sl,{name:"delegation.maxResources",shouldParseAsInt:!0}),(0,i.jsx)(Pa,{height:"3"})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:r?"unchecked":"checked",onClick:()=>{a(!1),e.change("delegation.maxResources",null)},children:t("non_les_inscri_07566")})]})]})},fC=e=>{const{translate:t}=il();return(0,i.jsx)(nb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"triangle-exclamation",children:t("accr_ditations_34551")}),(0,i.jsx)(Qv,{children:(0,i.jsxs)(Ea,{align:"center",direction:"column",gap:"1",width:1,children:[(0,i.jsx)(fr,{font:"gray900 textLg medium",children:t("voulez_vous_met_24993")}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:t("les_accr_ditati_76418",e.deletedAccreditationsSlots.join(", "))})]})}),(0,i.jsx)(Jv,{children:(0,i.jsx)(pl,{isLoading:e.submitting,onClick:e.handleSubmit,children:t("mettre_jour_l_69948")})})]})})},xC=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),s=F.useMemo(()=>h(e.initialValues.delegation.description)||h(e.initialValues.delegation.privateNote),[e.initialValues]),r=F.useMemo(()=>e.isEdit&&Zo(e.initialValues.delegation.accreditationsSlots),[e.initialValues,e.isEdit]),a=F.useMemo(()=>e.isEdit&&Zo(e.initialValues.delegation.usedCustomFieldsIds),[e.initialValues,e.isEdit]),l=F.useMemo(()=>e.isEdit&&Zo(e.initialValues.delegation.customFields),[e.initialValues,e.isEdit]),d=F.useMemo(()=>Zo(e.initialValues.delegation.tagsIds),[e.initialValues]),c=function(e,t,n){const i=Nn($c),o=(0,F.useMemo)(()=>{const e=t.delegation.accreditationsSlots.map(e=>e.accreditationSlotId),i=n.delegation.accreditationsSlots.map(e=>e.accreditationSlotId);return(0,Jd.A)(e,i)},[t,n]);return(0,F.useMemo)(()=>e.flatMap(e=>e.accreditations.flatMap(e=>e.slots.flatMap(t=>o.includes(t.id)?[ph(i,t,e.name,{accreditation:{includeName:!0}})]:[]))),[o,e])}("event"===e.delegationType?e.accreditationsCategories:[],e.initialValues,e.values),[u,m]=F.useState(!1),[g,p]=F.useState(!1),f=F.useCallback(()=>{Zo(c)?p(!0):e.handleSubmit()},[c,p,e.handleSubmit]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(bm,{button:e.isEdit?(0,i.jsx)(pl,{isLoading:e.submitting,onClick:f,children:t("mettre_jour_l_69948")}):null,category:e.isEdit?t("mise_jour_de_17055",e.initialValues.delegation.name):t("cr_ation_d_une_07120"),color:"dark",fallbackClosePath:to.DELEGATIONS({organizationId:n,eventId:o}),title:e.isEdit?e.initialValues.delegation.name:t("nouvelle_d_l_ga_42871"),children:(0,i.jsxs)(Im,{ref:e.centeredContainerRef,children:[(0,i.jsx)(sl,{}),(0,i.jsx)(Cm,{hideToggle:!0,initialIsOpen:!0,title:t("informations_su_34607"),children:"event"===e.delegationType?(0,i.jsx)(mC,{categories:e.categories,change:e.form.change,initialParentId:e.initialValues.delegation.parentId,leadersIds:e.values.delegation.leadersIds,organizationDelegations:e.organizationDelegations}):(0,i.jsx)(gC,{categories:e.categories,change:e.form.change,leadersIds:e.values.delegation.leadersIds})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Cm,{hideToggle:!0,initialIsOpen:!0,title:t("param_tres_de_l_81810"),children:(0,i.jsx)(pC,{change:e.form.change,forms:e.forms,initialValues:e.initialValues})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Cm,{initialIsOpen:e.values.delegation.showInDelegationSpace,subtitle:t("param_trer_les_35157"),title:t("espace_d_l_gati_59251"),onToggle:t=>{t||(e.form.change("delegation.campaignsIds",[]),e.form.change("delegation.customDocumentsSlugs",[])),e.form.change("delegation.showInDelegationSpace",t)},children:(0,i.jsx)(aC,{campaigns:e.campaigns,change:e.form.change,customDocuments:"event"===e.delegationType?e.customDocuments:[],customFields:e.customFields,values:e.values})}),(0,i.jsx)(Pa,{height:"5"}),"event"===e.delegationType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Cm,{initialIsOpen:r,subtitle:t("delegation_accreditations_desc"),title:t("accr_ditations_39450"),onToggle:t=>{t||e.form.change("delegation.accreditationsSlots",[])},children:(0,i.jsx)(oC,{allAccreditationCategories:e.accreditationsCategories,change:e.form.change,setIsAddAccreditationOpen:m,values:e.values})}),(0,i.jsx)(Pa,{height:"5"})]}),(0,i.jsx)(Cm,{initialIsOpen:a,subtitle:t("ajouter_des_inf_57824"),title:t("champs_de_formu_64126"),onToggle:t=>{t||(e.form.change("delegation.usedCustomFieldsIds",[]),e.form.change("delegation.fields",(0,tr.A)(e.values.delegation.fields,e.delegationCustomFields.map(e=>e.slug))))},children:(0,i.jsx)(Pj,{change:e.form.change,customFields:e.delegationCustomFields,prefix:"delegation.",usedCustomFieldsIds:e.values.delegation.usedCustomFieldsIds})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Cm,{initialIsOpen:l,subtitle:t("choisissez_une_24029"),title:t("d_finir_la_vale_27863"),onToggle:t=>{t||e.form.change("delegation.customFields",[])},children:(0,i.jsx)(hj,{change:e.form.change,customFields:e.customFields,name:"delegation.customFields",values:e.values.delegation.customFields})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsxs)(Cm,{initialIsOpen:s,subtitle:t("ajoutez_une_des_54307"),title:t("description_et_59312"),onToggle:t=>{t||(e.form.change("delegation.description",""),e.form.change("delegation.privateNote",""))},children:[(0,i.jsx)(gv,{label:(0,i.jsx)(nv,{children:t("description_58935")}),name:"delegation.description"}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(gv,{label:(0,i.jsx)(nv,{children:t("note_priv_e_06303")}),name:"delegation.privateNote"})]}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Cm,{initialIsOpen:d,subtitle:t("ajouter_des_tag_35833"),title:t("tags_79499"),onToggle:t=>{t||e.form.change("delegation.tagsIds",[])},children:(0,i.jsx)(fj,{change:e.form.change,name:"delegation.",organizationId:n,tags:e.tags,tagsIds:e.values.delegation.tagsIds})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(jm,{children:(0,i.jsx)(pl,{isLoading:e.submitting,textAlign:"center",onClick:f,children:e.isEdit?t("mettre_jour_l_69948"):t("cr_er_la_d_l_ga_53268")})})]})}),"event"===e.delegationType&&u&&(0,i.jsx)(qj,{allAccreditationCategories:e.accreditationsCategories,change:e.form.change,eventEndAt:e.eventEndAt,eventStartAt:e.eventStartAt,setIsAddAccreditationOpen:m,values:e.values.delegation}),(0,i.jsx)(fC,{deletedAccreditationsSlots:c,handleSubmit:e.handleSubmit,isOpen:g,submitting:e.submitting,onClose:()=>{p(!1)}})]})},_C=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=il(),{showNotification:r}=Yv(),a=Nn(Xb),l=Nn(za),d=(0,F.useRef)(null);return Cd((0,F.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.delegation.name):n("cr_ation_d_une_07120"),[e.isEdit,e.initialValues])),(0,i.jsx)(dl,{customErrorRef:d,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:n,submitting:o,values:s})=>(0,i.jsx)(xC,{...e,centeredContainerRef:d,form:t,handleSubmit:n,submitting:o,values:s}),validate:l.validateForForm(a.createUpdateDelegationSchema()),width:1,onSubmit:async i=>{await e.mutate({organizationId:o,eventId:s,delegation:i.delegation}),r(e.isEdit?n("la_d_l_gation_a_86694"):n("la_d_l_gation_a_01157")),t.goBack(to.DELEGATIONS({organizationId:o,eventId:s}))}})},IC=(e,t)=>{try{if(h(e)&&!isNaN((0,Jb.A)(e,10)))return{delegationCategoryId:(0,Jb.A)(e,10)};if(h(e)){const n=JSON.parse(r(e)),i=n.parentId,o=n.applyParentSettings?t.find(e=>e.id===i):null;return{parentId:i,parentDelegation:o}}return{}}catch{return{}}},vC=()=>{const{params:{organizationId:e,eventId:t,options:n}}=il(),o=Nn(Xb),{data:s,loader:r}=Vn("query DelegationEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n    organization(id: $organizationId) {\n        ...CreatePositionTags\n        ...OrganizationCustomFields\n\n        delegationsCategories(level: Event, eventId: $eventId) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n            nodes {\n                ...AttachCustomField\n            }\n        }\n\n        delegations(level: Organization) {\n            nodes {\n                id\n                name\n                privateNote\n                leadersIds\n                tagsIds\n                columns\n\n                delegationCategory {\n                    name\n                }\n\n                form {\n                    name\n                }\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        ...CreateDelegationEvent\n    }\n}\n",{organizationId:e,eventId:t},[Ro.CreatePositionTagsFragment,Ro.OrganizationCustomFieldsFragment,Ro.AttachCustomFieldFragment,Ro.CreateDelegationEventFragment]),{mutate:a}=Vr(),l=(0,F.useMemo)(()=>{if(s.organization){const{delegationCategoryId:e,parentId:t,parentDelegation:i}=IC(n,s.organization.delegations.nodes);return o.createUpdateDelegationValuesDefault(null,{delegationCategoryId:e,delegationsCategories:s.organization.delegationsCategories.nodes,forms:s.event.forms.nodes,parentId:t,parentDelegation:i})}return{}},[n,s]);return r||(0,i.jsx)(_C,{accreditationsCategories:s.event.accreditationsCategories,campaigns:s.event.campaigns.nodes,categories:s.organization.delegationsCategories.nodes,closePath:to.DELEGATIONS({organizationId:e,eventId:t}),customDocuments:s.event.customDocuments,customFields:s.organization.customFields.nodes,delegationCustomFields:s.organization.delegationCustomFields.nodes,delegationType:"event",eventEndAt:s.event.endAt,eventStartAt:s.event.startAt,forms:s.event.forms.nodes,initialValues:l,isEdit:!1,mutate:async e=>(await a(e)).delegationCreate.id,organizationDelegations:s.organization.delegations.nodes,tags:s.organization.tags.nodes})},bC=()=>{const{params:{organizationId:e,options:t}}=il(),n=Nn(Xb),{data:o,loader:s}=Vn("query DelegationOrganizationInfos($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        ...CreatePositionTags\n        ...OrganizationCustomFields\n\n        campaigns(level: Organization, states: [Template]) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        delegationsCategories(level: Organization) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n            nodes {\n                ...AttachCustomField\n            }\n        }\n\n        forms(level: Organization) {\n            nodes {\n                ...CreateDelegationForm\n            }\n        }\n    }\n}\n",{organizationId:e},[Ro.CreatePositionTagsFragment,Ro.OrganizationCustomFieldsFragment,Ro.AttachCustomFieldFragment,Ro.CreateDelegationFormFragment]),{mutate:r}=Vr(),a=(0,F.useMemo)(()=>{const{delegationCategoryId:e}=IC(t,[]);return n.createUpdateDelegationValuesDefault(null,{delegationCategoryId:e})},[]);return s||(0,i.jsx)(_C,{campaigns:o.organization.campaigns.nodes,categories:o.organization.delegationsCategories.nodes,closePath:So.COMMUNITY_DELEGATIONS(e),customFields:o.organization.customFields.nodes,delegationCustomFields:o.organization.delegationCustomFields.nodes,delegationType:"organization",forms:o.organization.forms.nodes,initialValues:a,isEdit:!1,mutate:async e=>(await r(e)).delegationCreate.id,tags:o.organization.tags.nodes})},jC=()=>{const{params:{organizationId:e,eventId:t,delegationId:n}}=il(),o=Nn(Xb),{data:s,loader:r}=Vn("query DelegationEventToEdit(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $delegationId: DelegationId!\n) {\n    organization(id: $organizationId) {\n        ...CreatePositionTags\n        ...OrganizationCustomFields\n\n        delegationsCategories(level: Event, eventId: $eventId) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n            nodes {\n                ...AttachCustomField\n            }\n        }\n\n        delegations(level: Organization) {\n            nodes {\n                id\n                name\n                leadersIds\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        ...CreateDelegationEvent\n\n        delegation(id: $delegationId) {\n            name\n            description\n            delegationCategoryId\n            parentId\n            leadersIds\n            formId\n            deadlineDate\n            maxResources\n            columns\n            privateNote\n            tagsIds\n            addDefaultAccreditationsByAvailability\n            showInDelegationSpace\n            showFormLinkInDelegationSpace\n            fields\n            canLeadersAddMembers\n            canLeadersDeleteMembers\n            canLeadersEditColumns\n            canLeadersEditCustomFields\n            canLeadersEditMembers\n            canLeadersImportMembers\n            canLeadersSeeHiddenAccreditationsSlots\n            campaignsIds\n            customDocumentsSlugs\n            usedCustomFieldsIds\n\n            customFields {\n                addValues\n                customFieldId\n                value\n            }\n\n            accreditations {\n                accreditationCategoryId\n                accreditationId\n                maxResources\n                willAutoAccredit\n            }\n\n            accreditationsSlots {\n                accreditationCategoryId\n                accreditationId\n                accreditationSlotId\n                isDefault\n                maxResources\n                isVisible\n            }\n        }\n    }\n}\n",{organizationId:e,eventId:t,delegationId:n},[Ro.CreatePositionTagsFragment,Ro.OrganizationCustomFieldsFragment,Ro.AttachCustomFieldFragment,Ro.CreateDelegationEventFragment]),{mutate:a}=Ur(),l=(0,F.useMemo)(()=>o.createUpdateDelegationValuesDefault(s.event?.delegation,null),[s.event]);return r||(0,i.jsx)(_C,{accreditationsCategories:s.event.accreditationsCategories,campaigns:s.event.campaigns.nodes,categories:s.organization.delegationsCategories.nodes,closePath:to.DELEGATION({organizationId:e,eventId:t,delegationId:n}),customDocuments:s.event.customDocuments,customFields:s.organization.customFields.nodes,delegationCustomFields:s.organization.delegationCustomFields.nodes,delegationType:"event",eventEndAt:s.event.endAt,eventStartAt:s.event.startAt,forms:s.event.forms.nodes,initialValues:l,isEdit:!0,mutate:async e=>(await a({...e,delegationId:n})).delegationUpdate.id,organizationDelegations:s.organization.delegations.nodes,tags:s.organization.tags.nodes})},CC=()=>{const{params:{organizationId:e,delegationId:t}}=il(),n=Nn(Xb),{data:o,loader:s}=Vn("query DelegationOrganizationToEdit($organizationId: OrganizationId!, $delegationId: DelegationId!) {\n    organization(id: $organizationId) {\n        ...CreatePositionTags\n        ...OrganizationCustomFields\n\n        campaigns(level: Organization, states: [Template]) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        delegationsCategories(level: Organization) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n            nodes {\n                ...AttachCustomField\n            }\n        }\n\n        forms(level: Organization) {\n            nodes {\n                ...CreateDelegationForm\n            }\n        }\n\n        delegation(id: $delegationId) {\n            name\n            description\n            delegationCategoryId\n            leadersIds\n            formId\n            deadlineDate\n            maxResources\n            columns\n            privateNote\n            tagsIds\n            addDefaultAccreditationsByAvailability\n            showInDelegationSpace\n            showFormLinkInDelegationSpace\n            fields\n            canLeadersAddMembers\n            canLeadersDeleteMembers\n            canLeadersEditColumns\n            canLeadersEditCustomFields\n            canLeadersEditMembers\n            canLeadersImportMembers\n            canLeadersSeeHiddenAccreditationsSlots\n            campaignsIds\n            customDocumentsSlugs\n            usedCustomFieldsIds\n\n            customFields {\n                addValues\n                customFieldId\n                value\n            }\n        }\n    }\n}\n",{organizationId:e,delegationId:t},[Ro.CreatePositionTagsFragment,Ro.OrganizationCustomFieldsFragment,Ro.AttachCustomFieldFragment,Ro.CreateDelegationFormFragment]),{mutate:r}=Ur(),a=(0,F.useMemo)(()=>n.createUpdateDelegationValuesDefault(o.organization?{...o.organization.delegation,accreditations:[],accreditationsSlots:[]}:null,null),[o.organization]);return s||(0,i.jsx)(_C,{campaigns:o.organization.campaigns.nodes,categories:o.organization.delegationsCategories.nodes,closePath:So.COMMUNITY_DELEGATION(e,t),customFields:o.organization.customFields.nodes,delegationCustomFields:o.organization.delegationCustomFields.nodes,delegationType:"organization",forms:o.organization.forms.nodes,initialValues:a,isEdit:!0,mutate:async e=>(await r({...e,delegationId:t})).delegationUpdate.id,tags:o.organization.tags.nodes})},yC=e=>(0,i.jsx)(Ea,{...wa(e),css:{background:"$gray50",flex:"1",padding:"$7",...e.css},direction:"column",children:e.children}),kC=e=>(0,i.jsx)(Ea,{css:{background:"white",borderBottom:e.hideBorder?"":"1px solid $gray200",padding:"$6 $7"},...wa(e),children:e.children}),AC=e=>(0,i.jsx)(Ea,{css:e.css,direction:"column",height:1,width:1,children:e.children});function wC(e,t,n){const{getLocalOrganization:i,updateLocalOrganization:o}=function(e){const t=F.useCallback(async()=>{let t=await X_.organizations.get(e);return t||(t={id:e},await X_.organizations.put(t)),t},[e]),n=F.useCallback(async n=>{const i=await t(),o=(0,Lv.A)(i,{id:e},n);return await X_.organizations.put(o),o},[e,t]);return{getLocalOrganization:t,updateLocalOrganization:n}}(e),[s,r]=F.useState(n),[a,l]=F.useState(!0),d=F.useCallback(async e=>{r(e),await o({[t]:e})},[t,r,o]);return F.useEffect(()=>{(async()=>{const e=await i();e[t]&&r(e[t]),l(!1)})()},[e,i,r,l]),[s,d,a]}function SC(e){return(0,F.useMemo)(()=>new Map(e.map(e=>[e.slug,e])),[e])}function EC(e,t,n){if(t.startsWith("form_inserted_at")){const i=parseInt(t.substring(17),10);if(isNaN(i))return"";{const t=n.find(({form:e})=>e?.id===i);return t?e.toLocaleString(t.insertedAt.toLocal(),Ho.DateTime):""}}return""}const TC=(0,F.createContext)({});function zC(){return(0,F.useContext)(TC)}const $C=e=>{const t=Nn(vj),{isEditMode:n}=zC(),{isEditMode:o}=Uh(),s=n||o,r=t.getValue(e.customField,e.fields),a=t.getValueString(e.customField,e.fields),l=!0===r?"checked":!1===r?"unchecked":"indeterminate";return s&&e.updatable?(0,i.jsxs)(xc,{css:{border:"2px solid transparent","& > .h-checkbox-cell-hover":{display:"none"},"&:hover":{border:"2px solid $primary700"},"&:hover > .h-checkbox-cell-default":{display:"none"},"&:hover > .h-checkbox-cell-hover":{display:"block"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Il,children:[(0,i.jsx)(fr,{className:"h-checkbox-cell-default",children:a}),(0,i.jsx)(fr,{className:"h-checkbox-cell-hover",children:(0,i.jsx)(tc,{state:l,onClick:async t=>{await e.mutate("checked"===t,e.customField.slug),e.reload()}})})]}):(0,i.jsx)(xc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:a})},OC="h-update-cell-open",RC=e=>{const t=Ln(),n=F.useRef(N()),[o,s]=F.useState(!1),[r,a]=F.useState(e.initialValue),l=F.useCallback(t=>{s(t),document.body.dispatchEvent(new CustomEvent(OC,{bubbles:!0,detail:{uuid:n.current}})),e.onStateChange?.(t)},[s,e.onStateChange]),d=F.useCallback(e=>{e.detail.uuid!==n.current&&s(!1)},[s]),c=F.useCallback(()=>{l(!1),a(e.initialValue)},[e.initialValue,l,a]);return F.useEffect(()=>(document.addEventListener(OC,d),()=>{document.removeEventListener(OC,d)}),[d]),(0,i.jsxs)(Ed,{doNotCloseOnOtherOpen:!0,isOpen:o,onStateChange:l,children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(xc,{css:{...e.css,border:"2px solid transparent",cursor:"text","&:hover":{border:"2px solid $primary700"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Il,children:"string"==typeof e.renderValue?e.renderValue:e.renderValue()})}),(0,i.jsxs)(Pd,{css:{padding:"0"},placement:"bottom-start",width:380,children:[(0,i.jsx)(Ea,{css:{padding:"$4 $6"},onKeyDown:t=>{"Enter"===t.key&&e.onSave(r)},children:e.renderInput(r,a)}),(0,i.jsxs)(Ea,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(fr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:c,children:t("annuler_48254")}),(0,i.jsx)(pl,{size:"sm",onClick:()=>{e.onSave(r)},children:t("appliquer_05753")})]})]})]})},PC=e=>{const{isEditMode:t}=zC(),{isEditMode:n}=Uh();return(t||n)&&e.updatable?(0,i.jsx)(RC,{column:e.column,initialValue:e.initialValue,renderInput:e.renderInput,renderValue:e.renderValue,onSave:async t=>{await e.mutate(t),e.reload()}}):(0,i.jsx)(xc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:"string"==typeof e.renderValue?e.renderValue:e.renderValue()})};function DC(e,t){return(0,F.useCallback)(n=>t(n,e.slug),[e,t])}const FC=e=>{const t=Nn(vj),n=t.getValueString(e.customField,e.fields),o=(0,F.useMemo)(()=>{const n=t.getValue(e.customField,e.fields);return h(n)?Fo.c9.fromISO(n,{zone:"utc"}):n},[]),s=DC(e.customField,e.mutate);return(0,i.jsx)(PC,{column:e.column,initialValue:o,mutate:s,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(_u,{label:e.customField.name,value:t,onChange:n}),renderValue:n,updatable:e.updatable})},MC=e=>{const t=Nn(vj),n=t.getValueString(e.customField,e.fields),o=(0,F.useMemo)(()=>{const n=t.getValue(e.customField,e.fields);return h(n)?Fo.c9.fromISO(n,{zone:"utc"}):n},[]),s=DC(e.customField,e.mutate);return(0,i.jsx)(PC,{column:e.column,initialValue:o,mutate:s,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(ju,{label:e.customField.name,value:t,onChange:n}),renderValue:n,updatable:e.updatable})},NC=e=>{const{params:{organizationId:t}}=il(),n=Nn(vj),o=n.getValueString(e.customField,e.fields,{fileReturnValue:"name"}),s=n.getValueString(e.customField,e.fields,{fileReturnValue:"url"}),r=(0,F.useMemo)(()=>n.getValue(e.customField,e.fields),[e.customField,e.fields]),a=DC(e.customField,e.mutate);return(0,i.jsx)(PC,{column:e.column,initialValue:r,mutate:a,reload:e.reload,renderInput:(n,o)=>(0,i.jsx)(tv,{accept:[HI.Images,HI.Pdf],acl:"private",label:e.customField.name,organizationId:t,value:n,onChange:o}),renderValue:()=>(0,i.jsx)(j_,{css:{fontWeight:"$regular"},to:s,children:o}),updatable:e.updatable})},LC=e=>{const t=Nn(vj),n=t.getValueString(e.customField,e.fields),o=(0,F.useMemo)(()=>t.getValue(e.customField,e.fields)||0,[e.customField,e.fields]),s=DC(e.customField,e.mutate);return(0,i.jsx)(PC,{column:e.column,initialValue:o,mutate:s,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(wl,{label:e.customField.name,shouldParseAsInt:!0,value:t,onChange:n}),renderValue:n,updatable:e.updatable})},BC=e=>{const t=Nn(vj),n=Nn(D_),o=t.getValueString(e.customField,e.fields),s=(0,F.useMemo)(()=>{const i=t.getValue(e.customField,e.fields),o=n.basePhoneInputDefault();return{country:i?.country||o.country,code:i?.code||o.code,number:i?.number||o.number}},[e.fields]),r=DC(e.customField,e.mutate);return(0,i.jsx)(PC,{column:e.column,initialValue:s,mutate:r,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(L_,{label:e.customField.name,value:t,onChange:n}),renderValue:o,updatable:e.updatable})};function VC(e){const t=Nn(Hc),n=Ac();return(0,F.useMemo)(()=>e?e.fieldType===Ne.Country?t.getCountriesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e)):e.fieldType===Ne.Language?e.fieldProperty===Me.Language?n(ad):n(un):e.fieldType===Ne.Nationality?t.getNationalitiesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e)):e.fieldType===Ne.Sex?n(jn):e.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e)):(0,i.jsx)(i.Fragment,{}),[e])}let UC=null;function WC(e,{fontSize:t,fontWeight:n}={}){UC||=document.createElement("canvas");const i=UC.getContext("2d");return i.font=`${n||"400"} ${t||"14px"} 'Open Sans`,i.measureText(e).width}const GC=({badge:e})=>(0,i.jsx)(Gd,{color:e.color,count:e.count,css:{cursor:e.onClick?"pointer":"inherit"},leftIcon:e.icon?ln.includes(e.icon)?Ba(e.icon):e.icon:void 0,size:"md",onClick:e.onClick,children:e.text}),HC=({badges:e})=>(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(Gd,{cursor:"pointer",size:"md",children:`+${e.length}`})}),(0,i.jsx)(Pd,{css:{flexWrap:"wrap",gap:"$2",overflow:"auto",padding:"$4",zIndex:100},maxHeight:300,placement:"top-end",width:400,children:e.map(e=>(0,i.jsx)(Ea,{children:(0,i.jsx)(GC,{badge:e})},e.id))})]}),qC=({badges:e,doNotSort:t,onClick:n})=>{const[o,s]=(0,F.useState)(0),r=(0,F.useCallback)(e=>{e&&s(e.getBoundingClientRect().width)},[]),a=(0,F.useMemo)(()=>{const n=e.map(e=>({...e,textWidth:Math.floor(WC(e.text,{fontSize:"12px"}))+60}));return!0===t?n:(0,Zd.A)(n,({textWidth:e})=>e)},[e,t]),[l,d]=(0,F.useMemo)(()=>{let e=37;const t=[],n=[];for(const i of a)e+=i.textWidth+8,eZo(d),[d]);return(0,i.jsxs)(Ea,{ref:r,align:"center",css:{cursor:n?"pointer":"inherit","&:hover":{color:"black"}},gap:"2",height:1,width:1,onClick:e=>{n&&Zo(a)&&(Il(e),n())},children:[l.map(e=>(0,i.jsx)(GC,{badge:e},e.id)),c&&(n?(0,i.jsx)(Gd,{css:{cursor:"pointer"},size:"md",children:"+"+(a.length-l.length)}):(0,i.jsx)(HC,{badges:d}))]})},YC=e=>{const t=Ln(),n=Nn(vj),o=(0,F.useMemo)(()=>{if(e.customField.canSelectMultiple){const t=n.getSelectValues(e.customField,e.fields).map(e=>({id:e,color:"gray",icon:null,text:e}));return()=>(0,i.jsx)(qC,{badges:t})}return n.getValueString(e.customField,e.fields)},[n,e.customField,e.fields]),s=(0,F.useMemo)(()=>{const t=n.getValue(e.customField,e.fields);return e.customField.canSelectMultiple?Zo(t)?t:[]:t||""},[]),r=VC(e.customField),a=DC(e.customField,e.mutate);return(0,i.jsx)(PC,{column:e.column,initialValue:s,mutate:a,reload:e.reload,renderInput:(n,o)=>e.customField.canSelectMultiple?(0,i.jsx)(dc,{isSearchVisible:!0,isSelectAllVisible:!0,label:e.customField.name,multiple:!0,renderOnPortal:!0,values:n,onChange:o,children:r}):(0,i.jsx)(dc,{isSearchVisible:!0,label:e.customField.name,multiple:!1,placeholder:t("choisir_une_val_00277"),renderOnPortal:!0,values:[n],onChange:e=>{Zo(e)?o(e[0]):o(null)},children:r}),renderValue:o,updatable:e.updatable})},KC=e=>{const t=Nn(vj).getValueString(e.customField,e.fields),n=DC(e.customField,e.mutate);return(0,i.jsx)(PC,{column:e.column,initialValue:t,mutate:n,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(Em,{label:e.customField.name,value:t,onChange:n}),renderValue:t,updatable:e.updatable})},ZC=e=>{const t=Nn(vj).getValueString(e.customField,e.fields),n=DC(e.customField,e.mutate);return(0,i.jsx)(PC,{column:e.column,initialValue:t,mutate:n,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(wl,{autoFocus:!0,label:e.customField.name,value:t,onChange:n}),renderValue:t,updatable:e.updatable})},XC=e=>{const t=Nn(vj),n=t.getValueString(e.customField,e.fields),o=(0,F.useMemo)(()=>t.getValueString(e.customField,e.fields),[]),s=DC(e.customField,e.mutate);return(0,i.jsx)(PC,{column:e.column,initialValue:o,mutate:s,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(lv,{label:e.customField.name,value:t,onChange:n}),renderValue:n,updatable:e.updatable})},JC=e=>{const t=Nn(vj);return e.customField?.fieldType===Ne.Checkbox?(0,i.jsx)($C,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ne.Date?(0,i.jsx)(FC,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ne.Phone?(0,i.jsx)(BC,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ne.Select||e.customField?.fieldType===Ne.Country||e.customField?.fieldType===Ne.Language||e.customField?.fieldType===Ne.Sex||e.customField?.fieldType===Ne.Nationality?(0,i.jsx)(YC,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ne.Text?(0,i.jsx)(ZC,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ne.Textarea?(0,i.jsx)(KC,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ne.Number?(0,i.jsx)(LC,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ne.File?(0,i.jsx)(NC,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ne.Datetime?(0,i.jsx)(MC,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ne.Time?(0,i.jsx)(XC,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):(0,i.jsx)(xc,{children:e.customField?t.getValueString(e.customField,e.fields,{fileReturnValue:"name"}):""})},QC=e=>{const{translate:t}=il(),{isEditMode:n}=zC(),{isEditMode:o}=Uh(),s=n||o,r=(0,F.useMemo)(()=>({firstName:e.userInfo.fields.firstName||"",lastName:e.userInfo.fields.lastName||""}),[e.userInfo]),a=(0,F.useCallback)(async t=>{await e.mutate(t.firstName,"firstName"),await e.mutate(t.lastName,"lastName"),e.reload()},[e.mutate,e.reload]);return s&&e.updatable?(0,i.jsx)(RC,{column:e.column,initialValue:r,renderInput:(e,n)=>(0,i.jsxs)(Ea,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(wl,{label:t("pr_nom_66988"),value:e.firstName,onChange:t=>{n({...e,firstName:t})}}),(0,i.jsx)(wl,{label:t("last_name"),value:e.lastName,onChange:t=>{n({...e,lastName:t})}})]}),renderValue:()=>(0,i.jsx)(Eb,{isClickDisabled:!0,size:32,userInfo:e.userInfo}),onSave:a}):(0,i.jsx)(xc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Eb,{isClickDisabled:!e.canClickMemberName,size:32,userInfo:e.userInfo})})};function ey(e,t){return e?e.usersOrganizations.map(e=>({id:e.role.id,color:"gray",icon:e.role.type===pt.OrganizationAdmin?"gem":"glasses-round",text:`${e.role.name}`})).concat(e.usersEvents.map(e=>({id:e.role.id,color:"gray",icon:e.role.type===pt.EventAdmin?"gem":"glasses-round",text:`${e.event.name} - ${e.role.name}`}))).concat(e.usersDelegations.map((e,n)=>({id:`ud-${n}`,color:"gray",icon:"user-group",text:`${e.delegation.name} - ${t("responsable_de_70462")}`}))).concat(e.usersDelegationsCategories.map(e=>({id:e.role.id,color:"gray",icon:"user-group",text:`${e.delegationCategory.name} - ${e.role.name}`}))).concat(e.usersPositions.map(e=>({id:e.role.id,color:"gray",icon:"sitemap",text:`${e.position.name} - ${e.role.name}`}))).concat(e.usersPositionsCategories.map(e=>({id:e.role.id,color:"gray",icon:"sitemap",text:`${e.positionCategory.name} - ${e.role.name}`}))):[]}const ty=e=>{const t=Ln(),n=(0,F.useMemo)(()=>e.userPermissions?ey(e.userPermissions,t):[],[e.userPermissions]);return(0,i.jsx)(xc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(qC,{badges:n,doNotSort:!0})})},ny=({column:e,eventId:t,onClick:n,reload:o,updatable:s,volunteerRegistration:r})=>{const a=Ln(),{mutate:l}=ps(),{mutate:d}=Vs(),c=Nn($c),{isEditMode:u}=zC(),{isEditMode:h}=Uh(),m=u||h,[g,p]=(0,F.useState)(!0),[f,x]=(0,F.useState)(null),_=(0,F.useMemo)(()=>r?.accreditationsUsersInfos||[],[r]),I=(0,F.useMemo)(()=>Nj(_),[_]),v=(0,F.useMemo)(()=>_.map(e=>e.accreditationSlot.id),[_]),b=(0,F.useCallback)(async e=>{if(e&&g){const{event:e}=await(n={eventId:t},o=await H(),ss("query UpdateCellAccreditationsSlots($eventId: EventId!) {\n    event(id: $eventId) {\n        accreditationsCategories {\n            name\n\n            accreditations {\n                id\n                name\n                accreditationDisplay\n                hasSlots\n                index\n\n                slots(includeHidden: true) {\n                    id\n                    name\n                    date\n                    isBlocked\n                }\n            }\n        }\n    }\n}\n",{variables:n,token:o||void 0,fragments:[]})),s=(0,Zd.A)(e.accreditationsCategories,e=>e.name.toLowerCase()).flatMap(e=>Vj(e.accreditations).map(t=>{const n=t.accreditationDisplay===ne.Radio?t.name:void 0,o=Ih(t.slots);return(0,i.jsx)("optgroup",{label:`${e.name} - ${t.name}`,children:o.map(e=>{const o=ph(c,e,t.name,{accreditation:{includeNameAtEnd:!0}});return(0,i.jsx)("option",{"data-radio":n,disabled:e.isBlocked,value:e.id,children:o},e.id)})},t.id)}));x(s),p(!1)}var n,o},[g]),j=(0,F.useCallback)(async e=>{Zo(e)?await l({eventId:t,massAccredit:{accreditationsSlotsIds:e,selecteds:{ids:[r.userInfo.id]},strategy:Je.Replace}}):await d({eventId:t,massStateUpdate:{selecteds:{ids:[r.userInfo.id]},state:ae.WaitingAccreditation}}),o()},[t,r,l,o]);return m&&s?(0,i.jsx)(RC,{column:e,css:{gap:"$2"},initialValue:v,renderInput:(e,t)=>g?(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(qd,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(dc,{isSearchVisible:!0,label:a("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:e,onChange:t,children:f}),renderValue:()=>(0,i.jsx)(qC,{badges:I,doNotSort:!0}),onSave:j,onStateChange:b}):(0,i.jsx)(xc,{css:{border:"2px solid transparent"},minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(qC,{badges:I,doNotSort:!0,onClick:n})})},iy=e=>{const t=(0,F.useMemo)(()=>(0,Ju.A)(e.volunteerRegistration?.accreditationsUsersInfos??[],e=>e.accreditationSlot.accreditationCategory.id).map(e=>({id:e.accreditationSlot.accreditationCategory.id,color:"gray",icon:null,text:e.accreditationSlot.accreditationCategory.name})),[e.volunteerRegistration]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:t})})},oy=e=>{const t=Ln(),{mutate:n}=Ys();return(0,i.jsx)(Ea,{css:{cursor:"pointer",padding:"$3","&:hover":{background:"$gray100"}},onClick:async()=>{await n({eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistrationId,slug:"accreditation_state",value:e.state}),e.reload(),e.close()},children:(0,i.jsx)(Gd,{...Pb(e.state),children:t(e.state)})})},sy=e=>{const t=Ln(),{isEditMode:n}=zC(),{isEditMode:o}=Uh(),s=n||o,[r,a]=(0,F.useState)(!1),l=(0,F.useCallback)(e=>{s&&a(e)},[s,a]),d=(0,F.useCallback)(()=>{l(!1)},[l]);return s&&e.updatable?(0,i.jsx)(xc,{css:{border:"2px solid transparent","&:hover":{border:"2px solid $primary700"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Il,children:(0,i.jsxs)(Ed,{isOpen:r,onStateChange:l,children:[(0,i.jsx)(Dd,{children:(0,i.jsxs)(Ea,{align:"center",gap:"3",height:1,justify:"between",width:1,children:[(0,i.jsx)(Gd,{...Pb(e.state),cursor:"text",children:t(e.state)}),r&&(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"chevron-down"})})]})}),(0,i.jsxs)(Pd,{offset:2,placement:"bottom",width:240,children:[e.state!==ae.WaitingAccreditation&&(0,i.jsx)(oy,{close:d,eventId:e.eventId,reload:e.reload,state:ae.WaitingAccreditation,volunteerRegistrationId:e.volunteerRegistrationId}),e.state!==ae.NotApplicable&&(0,i.jsx)(oy,{close:d,eventId:e.eventId,reload:e.reload,state:ae.NotApplicable,volunteerRegistrationId:e.volunteerRegistrationId})]})]})}):(0,i.jsx)(xc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Gd,{...Pb(e.state),children:t(e.state)})})},ry=e=>{const t=Nn($c),n=Nn(Ku),o=(0,F.useMemo)(()=>{const i=e.volunteerRegistration.userInfo.formsUsersInfos||[];return(0,Zd.A)(i.flatMap(e=>(e.slots||[]).map(t=>({range:t.range,display:e.form.slotDisplay}))),({range:e})=>e.start.toMillis()).map((e,i)=>({id:i,color:"gray",icon:null,text:e.display===gt.Calendar||e.display===gt.DisplayDays?t.toLocaleString(e.range.start,Ho.DateOnly.Numeric):n.toDisplayString(e.range,{formats:{localeFormat:Ho.DateOnly.Numeric}})}))},[e.volunteerRegistration.userInfo.formsUsersInfos]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:o,doNotSort:!0,onClick:e.onClick})})},ay=e=>{const{translate:t}=il();return(0,i.jsxs)(nb,{children:[(0,i.jsx)(ib,{children:(0,i.jsx)(fr,{css:{cursor:"pointer"},height:e.size,width:e.size,children:(0,i.jsx)("img",{height:"100%",src:Ym(e.ticketId,{height:e.size,width:e.size}),width:"100%"})})}),(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"qrcode",children:t("code_barres_1_82428",e.nameOrEmail)}),(0,i.jsxs)(Qv,{align:"center",css:{padding:"$4"},gap:"3",justify:"center",children:[(0,i.jsx)(fr,{height:100,width:100,children:(0,i.jsx)("img",{height:"100%",src:Ym(e.ticketId,{height:100,width:100}),width:"100%"})}),(0,i.jsx)(fr,{children:e.ticketId})]}),(0,i.jsx)(Jv,{})]})]})},ly=e=>{const t=e.volunteerRegistration.ticketId;return(0,i.jsxs)(xc,{align:"center",gap:"2",minWidth:e.column.minWidth,width:e.column.width,children:[(0,i.jsx)(ay,{nameOrEmail:e.volunteerRegistration.userInfo.nameOrEmail,size:30,ticketId:e.volunteerRegistration.ticketId}),h(e.volunteerRegistration.weezeventTicketUrl)?(0,i.jsx)(j_,{css:{fontWeight:"normal"},to:e.volunteerRegistration.weezeventTicketUrl,children:t}):t]})},dy=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>(e.volunteerRegistration.userInfo.emails??[]).map(e=>{const{color:n,leftIcon:i}=Tb(e.state);return{id:e.id,color:n,icon:i,text:`${e.campaign?.name??""} - ${t(e.state)}`}}),[e.volunteerRegistration]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:n})})},cy=e=>{const t=(0,F.useMemo)(()=>(e.volunteerRegistration.positionsSlotsUsersInfos||[]).filter(e=>e.state!==he.Waiting),[e.volunteerRegistration]),n=(0,F.useMemo)(()=>gh(t),[t]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:n,doNotSort:!0,onClick:e.onClick})})},uy=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{mutate:s}=Ws(),{mutate:r}=Es(),{isEditMode:a}=zC(),{isEditMode:l}=Uh(),d=a||l,c=(0,F.useMemo)(()=>e.volunteerRegistration.delegation,[e.volunteerRegistration.delegation]),u=(0,F.useMemo)(()=>c?[c.id]:[],[c]),[h,m]=(0,F.useState)(!0),[g,p]=(0,F.useState)([]),f=(0,F.useCallback)(async e=>{if(e&&h){const{event:{delegations:e}}=await qs({eventId:o},await H());p(e.nodes),m(!1)}},[h]),x=(0,F.useCallback)(async t=>{Zo(t)?await s({eventId:o,delegationId:t[0],selecteds:{ids:[e.volunteerRegistration.userInfo.id]}}):c&&await r({organizationId:n,eventId:o,delegationId:c.id,selecteds:{ids:[e.volunteerRegistration.userInfo.id]},deleteFromEvent:!1}),e.reload()},[o,e.volunteerRegistration]);return d&&e.updatable?(0,i.jsx)(RC,{column:e.column,css:{gap:"$2"},initialValue:u,renderInput:(e,n)=>h?(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(qd,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(dc,{isSearchVisible:!0,label:t("Delegation"),renderOnPortal:!0,values:e,onChange:n,children:g.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),renderValue:()=>c?(0,i.jsx)(Gd,{cursor:"pointer",ellipsis:!0,children:c.name}):null,onSave:x,onStateChange:f}):(0,i.jsx)(xc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:c&&(0,i.jsx)(Gd,{cursor:"pointer",ellipsis:!0,title:c.name,children:(0,i.jsx)(La,{to:to.DELEGATION({organizationId:n,eventId:o,delegationId:c.id}),children:c.name})})})},hy=e=>{const{params:{organizationId:t,eventId:n}}=il(),o=e.volunteerRegistration.delegation?.delegationCategory;return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:o&&(0,i.jsx)(Gd,{cursor:"pointer",ellipsis:!0,title:o.name,children:(0,i.jsx)(La,{to:to.DELEGATION_CATEGORY({organizationId:t,eventId:n,delegationCategoryId:o.id}),children:o.name})})})},my=e=>{const t=(0,F.useMemo)(()=>(e.volunteerRegistration.userInfo?.formsUsersInfos??[]).flatMap(e=>e.form?[{id:e.form.id,color:"gray",icon:null,text:e.form.name}]:[]),[e.volunteerRegistration.userInfo]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:t})})},gy=e=>{const t=Ln(),{mutate:n}=Us(),{mutate:o}=Gs(),s=Nn(Ku),{isEditMode:r}=zC(),{isEditMode:a}=Uh(),l=r||a,d=(0,F.useMemo)(()=>e.volunteerRegistration?.positionsSlotsUsersInfos||[],[e.volunteerRegistration]),c=(0,F.useMemo)(()=>gh(d),[d]),u=(0,F.useMemo)(()=>d.map(e=>e.positionSlot.id),[d]),[h,m]=(0,F.useState)(!0),[g,p]=(0,F.useState)([]),f=(0,F.useCallback)(async t=>{if(t&&h){const{event:{positionsSlots:t}}=await(n={eventId:e.eventId},i=await H(),ss("query UpdateCellPositionsSlots($eventId: EventId!) {\n    event(id: $eventId) {\n        positionsSlots {\n            nodes {\n                id\n                name\n                range\n\n                position {\n                    name\n                }\n            }\n        }\n    }\n}\n",{variables:n,token:i||void 0,fragments:[]})),o=(0,Zd.A)(t.nodes,e=>[e.range.start.toMillis(),e.name]).map(e=>({id:e.id,positionName:e.position.name,name:ih(s,e,e.position.name,{position:{includeNameAtEnd:!0}})}));p((0,Zd.A)(Object.entries((0,Kd.A)(o,e=>e.positionName)),([e])=>e)),m(!1)}var n,i},[h]),x=(0,F.useCallback)(async t=>{Zo(t)?await n({eventId:e.eventId,massAssign:{positionsSlotsIds:t,selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:Je.Replace}}):await o({eventId:e.eventId,massStateUpdate:{selecteds:{ids:[e.volunteerRegistration.userInfo.id]},state:Et.WaitingAssignment}}),e.reload()},[e.eventId,e.volunteerRegistration,n,e.reload]);return l&&e.updatable?(0,i.jsx)(RC,{column:e.column,css:{gap:"$2"},initialValue:u,renderInput:(e,n)=>h?(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(qd,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(dc,{isSearchVisible:!0,label:t("missions_63972"),multiple:!0,renderOnPortal:!0,values:e,onChange:n,children:g.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))}),renderValue:()=>(0,i.jsx)(qC,{badges:c,doNotSort:!0}),onSave:x,onStateChange:f}):(0,i.jsx)(xc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:c,doNotSort:!0,onClick:e.onClick})})},py=e=>{const t=(0,F.useMemo)(()=>(0,Ju.A)(e.volunteerRegistration?.positionsSlotsUsersInfos??[],e=>e.positionCategory.id).map(e=>({id:e.positionCategory.id,color:"gray",icon:null,text:e.positionCategory.name})),[e.volunteerRegistration]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:t})})},fy=e=>{const t=(0,F.useMemo)(()=>(e.volunteerRegistration?.preassignPositions||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:t})})},xy=e=>{const t=(0,F.useMemo)(()=>(e.volunteerRegistration?.preassignPositionsCategories||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:t})})},_y=e=>{const t=(0,F.useMemo)(()=>(e.volunteerRegistration.accreditationsUsersInfos||[]).filter(e=>e.checkInAt?.isValid),[e.volunteerRegistration]),n=(0,F.useMemo)(()=>Nj(t),[t]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:n,doNotSort:!0,onClick:e.onClick})})},Iy=e=>(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:h(e.volunteerRegistration.shortTag)&&h(e.volunteerRegistration.weezeventPayUrl)?(0,i.jsx)(j_,{css:{fontWeight:"normal"},to:e.volunteerRegistration.weezeventPayUrl,children:e.volunteerRegistration.shortTag}):e.volunteerRegistration.shortTag||""}),vy=(...e)=>({name:"canCommentFn",args:e}),by=(...e)=>({name:"canRegistrationStateUpdateFn",args:e}),jy=(...e)=>({name:"canUserInfoSlotsUpdateFn",args:e});async function Cy(e){try{const t=await H(),n=await function(e,t){return ss("query UserPermission($checks: [PermissionCheck!]!) {\n    user {\n        permission(checks: $checks)\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}(e,t);return n.user.permission}catch{return e.checks.map(e=>!1)}}const yy=new Map;function ky({checks:e}){const t=e.map(e=>[e,JSON.stringify(e)]),n=t.filter(([e,t])=>!yy.has(t));if(n.length>0){const e=Cy({checks:n.map(([e,t])=>e)});n.forEach(([t,n],i)=>{yy.set(n,e.then(e=>e[i]))})}return Promise.all(t.map(([e,t])=>yy.get(t)))}function Ay({withCaching:e,checks:t}){const[{isLoading:n,permissions:i},o]=(0,F.useState)({isLoading:!0,permissions:new Array(t.length).fill(!1)}),s=e?ky:Cy;return(0,F.useEffect)(()=>{s({checks:t}).then(e=>{o({isLoading:!1,permissions:e})},()=>{o({isLoading:!1,permissions:i})})},[]),{isLoading:n,permissions:i}}function wy(...e){return Ay({withCaching:!0,checks:e})}const Sy=e=>{const t=Ln(),{mutate:n}=Ys();return(0,i.jsx)(Ea,{css:{cursor:"pointer",padding:"$3","&:hover":{background:"$gray100"}},onClick:async()=>{await n({eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistrationId,slug:"volunteer_registration_state",value:e.state}),e.reload(),e.close()},children:(0,i.jsx)(Gd,{cursor:"pointer",...Rb(e.state),children:t(e.state)})})},Ey=e=>{const{permissions:[t,n],isLoading:o}=function(...e){return Ay({withCaching:!1,checks:e})}(by(e.eventId,Et.PreAssigned,e.volunteerRegistrationId),by(e.eventId,Et.Assigned,e.volunteerRegistrationId));return o?null:(0,i.jsxs)(i.Fragment,{children:[n&&e.state!==Et.WaitingAssignment&&(0,i.jsx)(Sy,{close:e.close,eventId:e.eventId,reload:e.reload,state:Et.WaitingAssignment,volunteerRegistrationId:e.volunteerRegistrationId}),t&&(0,i.jsx)(Sy,{close:e.close,eventId:e.eventId,reload:e.reload,state:Et.PreAssigned,volunteerRegistrationId:e.volunteerRegistrationId}),n&&e.state!==Et.Refused&&(0,i.jsx)(Sy,{close:e.close,eventId:e.eventId,reload:e.reload,state:Et.Refused,volunteerRegistrationId:e.volunteerRegistrationId}),n&&e.state!==Et.NotApplicable&&(0,i.jsx)(Sy,{close:e.close,eventId:e.eventId,reload:e.reload,state:Et.NotApplicable,volunteerRegistrationId:e.volunteerRegistrationId})]})},Ty=e=>{const t=Ln(),{isEditMode:n}=zC(),{isEditMode:o}=Uh(),s=n||o,[r,a]=(0,F.useState)(!1),l=(0,F.useCallback)(e=>{s&&a(e)},[s,a]),d=(0,F.useCallback)(()=>{l(!1)},[l]);return s&&e.updatable?(0,i.jsx)(xc,{css:{border:"2px solid transparent","&:hover":{border:"2px solid $primary700"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Il,children:(0,i.jsxs)(Ed,{isOpen:r,onStateChange:l,children:[(0,i.jsx)(Dd,{children:(0,i.jsxs)(Ea,{align:"center",gap:"3",height:1,justify:"between",width:1,children:[(0,i.jsx)(Gd,{...Rb(e.state),cursor:"text",ellipsis:!0,children:t(e.state)}),r&&(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"chevron-down"})})]})}),(0,i.jsx)(Pd,{offset:2,placement:"bottom",width:230,children:(0,i.jsx)(Ey,{close:d,...e})})]})}):(0,i.jsx)(xc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Gd,{...Rb(e.state),children:t(e.state)})})},zy=e=>{const t=(0,F.useMemo)(()=>e.volunteerRegistration.userInfo.tags||[],[e.volunteerRegistration]),n=(0,F.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:n})})},$y=e=>{const{history:t,params:{organizationId:n,eventId:o,segmentId:s}}=il(),r=(0,F.useMemo)(()=>(e.volunteerRegistration.teams||[]).map(({teamCode:i})=>({id:i,color:"gray",icon:null,text:i,onClick(){t.push(So.VOLUNTEERS_LIST_USER_PANEL_TEAM(n,o,s,e.volunteerRegistration.userInfo.id,i))}})),[e.volunteerRegistration]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:r})})},Oy=e=>{const{params:{organizationId:t,eventId:n}}=il(),o=(0,F.useMemo)(()=>(0,Zd.A)(e.teamMembers,e=>c(e.name)),[e.teamMembers]);return(0,i.jsx)(Ea,{children:o.map((e,o)=>(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{css:{cursor:"pointer",position:"relative",left:-4*o+"px"},children:(0,i.jsx)(La,{to:kI.MEMBER_INFORMATION({organizationId:t,eventId:n,userInfoId:e.id}),children:(0,i.jsx)(Fg,{email:e.email,image:e.picture?.url,name:e.name,size:24})})})}),(0,i.jsx)(am,{placement:"top",children:e.name})]},e.id))})},Ry=e=>{const t=(0,F.useMemo)(()=>(e.volunteerRegistration.userInfo.formsUsersInfos||[]).flatMap(e=>e.teamMembers||[]),[e.volunteerRegistration]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Oy,{teamMembers:t})})},Py=e=>{const t=(0,F.useMemo)(()=>(e.volunteerRegistration.weezaccessChecklists||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:t})})},Dy=e=>{const t=(0,F.useMemo)(()=>Lj(e.volunteerRegistration?.accreditationsSlots||[]),[e.volunteerRegistration]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:t,doNotSort:!0,onClick:e.onClick})})},Fy=e=>{const t=Nn(Ku),n=(0,F.useMemo)(()=>function(e,t,n,i){return(0,Ju.A)(t,e=>e.id).map(e=>({id:`c-${e.id}`,color:"gray",icon:null,text:e.name})).concat((0,Ju.A)(n,e=>e.id).map(e=>({id:`p-${e.id}`,color:e.color,icon:e.icon,text:h(e.acronym)?e.acronym:e.name}))).concat((0,Ju.A)(i,e=>e.id).map(t=>{const n=h(t.position.acronym)?t.position.acronym:t.position.name,i=ih(e,t,n,{interval:{options:{formats:{localeFormat:Ho.DateOnly.Numeric}}}});return{id:`s-${t.id}`,color:t.position.color,icon:t.position.icon,text:`${n} | ${i}`}}))}(t,e.volunteerRegistration?.positionsCategories||[],e.volunteerRegistration?.positions||[],e.volunteerRegistration?.positionsSlots||[]),[e.volunteerRegistration]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:n,onClick:e.onClick})})},My=e=>{const{history:t}=il(),n=Nn($c),o=Nn(Ng),s=(0,F.useMemo)(()=>function(e,t){return t.flatMap(t=>t.form?[`${t.form.name} : ${e.toLocaleString(t.insertedAt.toLocal(),Ho.DateTime)}`]:[]).join(", ")}(n,e.row.userInfo.formsUsersInfos||[]),[e.row]),{mutate:r}=Ys(),a=(0,F.useCallback)((t,n)=>r({eventId:e.eventId,volunteerRegistrationId:e.row.id,slug:n,value:t}),[e.eventId,e.row,r]),l=e.row.userInfo;switch(e.column.slug){case wh.Accreditations:return(0,i.jsx)(ny,{column:e.column,eventId:e.eventId,reload:e.reloadRow,updatable:e.canAccredit,volunteerRegistration:e.row,onClick:h(e.accreditationsPanelPath)?()=>{t.push(`${e.accreditationsPanelPath}/assigned`)}:void 0});case wh.AccreditationsCategories:return(0,i.jsx)(iy,{column:e.column,volunteerRegistration:e.row});case wh.AccreditationState:return(0,i.jsx)(sy,{column:e.column,eventId:e.eventId,field:e.column,reload:e.reloadRow,state:e.row.accreditationState,updatable:e.canAccredit,volunteerRegistrationId:e.row.id});case wh.ScannedAccreditations:return(0,i.jsx)(_y,{column:e.column,volunteerRegistration:e.row,onClick:h(e.accreditationsPanelPath)?()=>{t.push(`${e.accreditationsPanelPath}/scanned`)}:void 0});case wh.Availability:return(0,i.jsx)(ry,{column:e.column,volunteerRegistration:e.row,onClick:h(e.availabilitiesPanelPath)?()=>{t.push(e.availabilitiesPanelPath)}:void 0});case wh.Comments:return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:Zo(l.comments)?l.comments.flatMap(e=>e.content).join("; "):""});case wh.CampaignsStates:return(0,i.jsx)(dy,{column:e.column,volunteerRegistration:e.row});case wh.CheckedInPositions:return(0,i.jsx)(cy,{column:e.column,volunteerRegistration:e.row,onClick:h(e.positionsPanelPath)?()=>{t.push(`${e.positionsPanelPath}/assigned`)}:void 0});case wh.CompletedForms:return(0,i.jsx)(my,{column:e.column,volunteerRegistration:e.row});case wh.FormsInsertedAt:return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:s,children:s})});case wh.Delegations:return(0,i.jsx)(uy,{column:e.column,reload:e.reloadRow,updatable:e.canChangeDelegation,volunteerRegistration:e.row});case wh.DelegationCategory:return(0,i.jsx)(hy,{column:e.column,volunteerRegistration:e.row});case wh.Email:return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:l.email});case wh.Id:return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:l.id});case wh.LocalId:return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.localId});case wh.InsertedAt:return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:n.toLocaleString(e.row.insertedAt.toLocal(),Ho.DateTime)});case wh.Name:return(0,i.jsx)(QC,{canClickMemberName:e.canClickMemberName,column:e.column,mutate:a,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0,userInfo:e.row.userInfo});case wh.NumberOfAccreditations:return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAccreditations});case wh.NumberOfAssignments:return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAssignments});case wh.NumberOfAssignmentsDays:return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAssignmentsDays});case wh.NumberOfAvailableDays:return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAvailableDays});case"picture":return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Fg,{email:l.email,image:l.picture?.url,name:l.name,size:32})});case wh.Positions:return(0,i.jsx)(gy,{column:e.column,eventId:e.eventId,reload:e.reloadRow,updatable:e.canAssign,volunteerRegistration:e.row,onClick:h(e.positionsPanelPath)?()=>{t.push(`${e.positionsPanelPath}/assigned`)}:void 0});case wh.PositionsCategories:return(0,i.jsx)(py,{column:e.column,volunteerRegistration:e.row});case wh.PreassignedPositions:return(0,i.jsx)(fy,{column:e.column,volunteerRegistration:e.row});case wh.PreassignedPositionsCategories:return(0,i.jsx)(xy,{column:e.column,volunteerRegistration:e.row});case wh.Roles:return(0,i.jsx)(ty,{minWidth:e.column.minWidth,userPermissions:e.row.userInfo,width:e.column.width});case wh.Tags:return(0,i.jsx)(zy,{column:e.column,volunteerRegistration:e.row});case wh.TeamCode:return(0,i.jsx)($y,{column:e.column,volunteerRegistration:e.row});case wh.TeamMembers:return(0,i.jsx)(Ry,{column:e.column,volunteerRegistration:e.row});case wh.VolunteerMinutes:return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:o.minutesToHoursMinutesString(e.row.volunteerMinutes)});case wh.VolunteerRegistrationState:return(0,i.jsx)(Ty,{column:e.column,eventId:e.eventId,field:e.column,reload:e.reloadRow,state:e.row.state,updatable:e.row.canRegistrationStateUpdate??!0,volunteerRegistrationId:e.row.id});case wh.WishedAccreditationSlots:return(0,i.jsx)(Dy,{column:e.column,volunteerRegistration:e.row,onClick:h(e.accreditationsPanelPath)?()=>{t.push(`${e.accreditationsPanelPath}/wished`)}:void 0});case wh.WishedPositions:return(0,i.jsx)(Fy,{column:e.column,volunteerRegistration:e.row,onClick:h(e.positionsPanelPath)?()=>{t.push(`${e.positionsPanelPath}/wished`)}:void 0});case wh.WeezaccessChecklists:return(0,i.jsx)(Py,{column:e.column,volunteerRegistration:e.row});case wh.WeezeventBarcodeId:return(0,i.jsx)(ly,{column:e.column,volunteerRegistration:e.row});case wh.WeezeventPairedAt:return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.weezeventPairedAt?.isValid?n.toLocaleString(e.row.weezeventPairedAt.toLocal(),Ho.DateTime):""});case wh.WeezeventShortTag:return(0,i.jsx)(Iy,{column:e.column,volunteerRegistration:e.row});default:return Object.values(wh).includes(e.column.slug)?(console.error(`003: Unhandled default column ${e.column.slug}`),(0,i.jsx)(xc,{children:"ERR"})):e.column.slug.startsWith("form_inserted_at")?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:EC(n,e.column.slug,e.row.userInfo.formsUsersInfos||[])}):(0,i.jsx)(JC,{column:e.column,customField:e.customField,fields:e.row.userInfo.fields,mutate:a,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0})}},Ny=e=>{const t=Hn().pathname.includes(e.basePath||e.path);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(La,{replace:!0,to:e.path,children:(0,i.jsx)(fr,{color:t?"primary700":"gray500",css:{borderBottom:t?"2px solid $primary700":"unset",cursor:t?"inherit":"pointer",paddingBlock:"$3","&:hover":{color:t?"$primary800":"$gray800"}},children:e.children})}),(0,i.jsx)(fr,{width:24})]})},Ly=e=>(0,i.jsxs)(Ea,{"aria-orientation":"horizontal",as:Aa.Nav,css:{borderBottom:"1px solid $gray200",...e.css},role:"tablist",width:1,children:[e.center&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fr,{css:{flex:"1"}})}),e.children,(0,i.jsx)(fr,{css:{flex:"1"}})]}),By=e=>(0,i.jsx)(i.Fragment,{children:e.children});By.displayName="TabPanel";const Vy=e=>{const[t,n]=(0,Nu.A)(F.Children.toArray(e.children),e=>F.isValidElement(e)&&e.type===By);return(0,i.jsxs)(Ea,{direction:"column",width:1,...wa(e),children:[n,(0,i.jsx)(_r.dO,{children:t.map((e,t)=>(0,i.jsx)(_r.qh,{path:e.props.path,children:e},t))})]})},Uy=({title:e,subtitle:t})=>(0,i.jsx)(Cc,{css:{height:"fit-content"},children:(0,i.jsx)(xc,{children:(0,i.jsxs)(Ea,{align:"center",css:{padding:"$8 0"},direction:"column",justify:"center",width:1,children:[(0,i.jsx)(mj,{color:"primary",icon:"magnifying-glass"}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:e}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t})]})})}),Wy=F.createContext({}),Gy=e=>{const{mutate:t}=ps(),{mutate:n}=Qs(),[o,s]=F.useState(e.volunteerRegistration.accreditationsUsersInfos.map(e=>e.accreditationSlot)),r=F.useMemo(()=>o.map(({id:e})=>e),[o]),[a,l]=F.useState(e.volunteerRegistration.accreditationsUsersInfos.flatMap(e=>e.checkInAt?.isValid?[e.accreditationSlot]:[])),[d,c]=F.useState(e.volunteerRegistration.accreditationsSlots),u=F.useMemo(()=>(0,Zd.A)((0,Ju.A)(o.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[o]),h=F.useMemo(()=>(0,Zd.A)((0,Ju.A)(a.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[a]),m=F.useMemo(()=>(0,Zd.A)((0,Ju.A)(d.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[d]),g=F.useMemo(()=>(0,Ju.A)(o.map(e=>e.accreditation),e=>e.id),[o]),p=F.useMemo(()=>(0,Ju.A)(a.map(e=>e.accreditation),e=>e.id),[a]),f=F.useMemo(()=>(0,Ju.A)(d.map(e=>e.accreditation),e=>e.id),[d]),x=F.useCallback(async n=>{await t({eventId:e.eventId,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e.userInfoId]},strategy:Je.Delete}}),s(e=>e.filter(e=>e.id!==n)),l(e=>e.filter(e=>e.id!==n))},[e.eventId,e.userInfoId,s,l]),_=F.useCallback(async t=>{await n({eventId:e.eventId,delegationId:e.delegationId,massAccredit:{accreditationsSlotsIds:[t],selecteds:{ids:[e.userInfoId]},strategy:Je.Delete}}),c(e=>e.filter(e=>e.id!==t))},[e.eventId,e.delegationId,e.userInfoId]),I=F.useCallback(async n=>{await t({eventId:e.eventId,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e.userInfoId]},strategy:Je.Add}});const i=d.find(e=>e.id===n);s(e=>[...e,i])},[e.eventId,e.volunteerRegistration,d,s]),v=F.useCallback(t=>e.volunteerRegistration.accreditationsUsersInfos.find(e=>e.accreditationSlot.id===t).checkInAt,[e.volunteerRegistration]);return(0,i.jsx)(Wy.Provider,{value:{assignedAccreditations:g,assignedCategories:u,assignedSlots:o,assignedSlotsIds:r,canAccredit:e.canAccredit,canEditWished:e.canEditWished,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,scannedCategories:h,scannedAccreditations:p,scannedSlots:a,wishedAccreditations:f,wishedCategories:m,wishedSlots:d,assignSlot:I,deleteAssignedSlot:x,deleteWishedSlot:_,getScannedAt:v},children:e.children})};function Hy(){return F.useContext(Wy)}const qy=e=>{const{translate:t}=il(),n=Nn($c),{assignedSlotsIds:o,assignSlot:s,canAccredit:r,canEditWished:a,defaultHiddenAccreditationsSlotsIds:l,deleteAssignedSlot:d,deleteWishedSlot:c,getScannedAt:u}=Hy(),[h,m]=(0,F.useState)(!1);return"assigned"===e.state&&!e.isBlocked&&r?(0,i.jsx)(Ea,{css:{flex:"1",px:"$4"},justify:"end",children:h?(0,i.jsx)(qd,{borderRadius:"$1",height:20,children:t("retirer_05155")}):(0,i.jsx)(fr,{css:{cursor:"pointer"},font:"error700 textSm medium",onClick:async()=>{m(!0),await d(e.accreditationSlotId)},children:t("retirer_05155")})}):"wished"===e.state&&r?(0,i.jsx)(Ea,{css:{flex:"1",px:"$4"},justify:"end",children:o.includes(e.accreditationSlotId)?(0,i.jsxs)(Ea,{align:"center",gap:"1",children:[(0,i.jsx)(fr,{color:"success500",children:(0,i.jsx)(Va,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(fr,{font:"gray800 textXs medium",children:t("d_j_attribu_e_06450")})]}):e.isBlocked?null:(0,i.jsx)(pl,{isLoading:h,size:"sm",onClick:async()=>{m(!0),await s(e.accreditationSlotId),m(!1)},children:t("ajouter_97327")})}):"wished"!==e.state||!a||e.isBlocked||l.includes(e.accreditationSlotId)?"scanned"===e.state?(0,i.jsx)(Ea,{css:{flex:"1",px:"$4"},children:(0,i.jsx)(fr,{css:{ellipsis:!0},children:n.toLocaleString(u(e.accreditationSlotId),Ho.DateTime)})}):(0,i.jsx)(Ea,{css:{flex:"1",px:"$4"}}):(0,i.jsx)(Ea,{css:{flex:"1",px:"$4"},justify:"end",children:h?(0,i.jsx)(qd,{borderRadius:"$1",height:20,children:t("retirer_05155")}):(0,i.jsx)(fr,{css:{cursor:"pointer"},font:"error700 textSm medium",onClick:async()=>{m(!0),await c(e.accreditationSlotId)},children:t("retirer_05155")})})},Yy=e=>{const t=Nn($c),{canAccredit:n,canEditWished:o}=Hy(),s="assigned"===e.state&&n||"scanned"===e.state||"wished"===e.state&&(n||o),r=h(e.slot.name)?e.slot.name:"-";return(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{css:{textTransform:"capitalize"},children:e.slot.date?t.toLocaleString(e.slot.date,Ho.DateOnly.WeekdayShortMonthShort):"-"}),(0,i.jsx)(xc,{children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:r,width:1,children:r})}),s&&(0,i.jsx)(qy,{accreditationSlotId:e.slot.id,isBlocked:e.slot.isBlocked,state:e.state})]})},Ky=e=>{const{translate:t}=il(),{assignedSlots:n,canAccredit:o,canEditWished:s,scannedSlots:r,wishedSlots:a}=Hy(),l=(0,F.useMemo)(()=>(0,Zd.A)(("assigned"===e.state?n:"scanned"===e.state?r:a).filter(t=>t.accreditationId===e.accreditation.id),e=>[e.date?.toMillis()??1,e.name?.toLowerCase()||""]),[n,r,a,e.accreditation,e.state]),d="assigned"===e.state&&o||"scanned"===e.state||"wished"===e.state&&(o||s);return(0,i.jsx)(Jj,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:e.accreditation.hasSlots,numberOfSlots:l.length,renderActions:!e.accreditation.hasSlots&&d?()=>(0,i.jsx)(qy,{accreditationSlotId:e.accreditation.hiddenSlotId,isBlocked:!1,state:e.state}):void 0,children:(0,i.jsxs)(mc,{hideBorder:!0,children:[(0,i.jsxs)(cc,{children:[(0,i.jsx)(Tc,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(Tc,{children:t("nom_du_cr_neau_54351")}),d&&(0,i.jsx)(Tc,{children:"scanned"===e.state&&t("scann_e_le_27812")})]}),l.map(t=>(0,i.jsx)(Yy,{slot:t,state:e.state},t.id))]})})},Zy=e=>{const{assignedAccreditations:t,scannedAccreditations:n,wishedAccreditations:o}=Hy(),s=(0,F.useMemo)(()=>Vj(("assigned"===e.state?t:"scanned"===e.state?n:o).filter(t=>t.accreditationCategoryId===e.category.id)),[t,o,e.category,e.state]);return(0,i.jsx)(Kj,{category:e.category,children:s.map(t=>(0,i.jsx)(Ky,{accreditation:t,state:e.state},t.id))})},Xy=e=>{const t=Ln(),{assignedCategories:n,scannedCategories:o,wishedCategories:s}=Hy(),r="assigned"===e.state?n:"scanned"===e.state?o:s;return(0,i.jsx)(Yj,{children:Zo(r)?r.map(t=>(0,i.jsx)(Zy,{category:t,state:e.state},t.id)):(0,i.jsx)(Uy,{title:t("no_accreditations")})})},Jy=e=>{const{translate:t}=il();return(0,i.jsx)(Gy,{canAccredit:e.canAccredit,canEditWished:e.canEditWished,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,delegationId:e.delegationId,eventId:e.eventId,userInfoId:e.userInfoId,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsxs)(eu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Lb,{children:t("accr_ditations_39450")}),(0,i.jsx)(tu,{css:{padding:"0"},children:(0,i.jsxs)(Vy,{height:1,children:[(0,i.jsxs)(Ly,{center:!0,children:[(0,i.jsx)(Ny,{path:`${e.basePath}/assigned`,children:t("attribu_es_48167")}),(0,i.jsx)(Ny,{path:`${e.basePath}/wished`,children:t("souhait_es_78101")}),(0,i.jsx)(Ny,{path:`${e.basePath}/scanned`,children:t("scann_es_13169")})]}),(0,i.jsx)(By,{path:`${e.basePath}/assigned`,children:(0,i.jsx)(Xy,{state:"assigned"})}),(0,i.jsx)(By,{path:`${e.basePath}/wished`,children:(0,i.jsx)(Xy,{state:"wished"})}),(0,i.jsx)(By,{path:`${e.basePath}/scanned`,children:(0,i.jsx)(Xy,{state:"scanned"})})]})})]})})},Qy=e=>{const{translate:t,params:{organizationId:n}}=il(),{mutate:o}=zs(),[s,r]=(0,F.useState)(me.CheckInOut),[a,l]=(0,F.useState)(e.positionSlotUserInfo.checkInAt?.toLocal()),[d,c]=(0,F.useState)(e.positionSlotUserInfo.checkOutAt?.toLocal()),[u,h]=(0,F.useState)(e.positionSlotUserInfo.breakTime),m=(0,F.useMemo)(()=>qo(),[]),g=s===me.Reset||a?.isValid&&d?.isValid&&d>a||a?.isValid&&!d?.isValid;return(0,i.jsx)(nb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"sliders",children:t("mise_jour_du_76261")}),(0,i.jsxs)(Qv,{gap:"2",children:[(0,i.jsx)(fr,{font:"gray700 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(sc,{state:s===me.CheckInOut?"checked":"unchecked",onClick:()=>{r(me.CheckInOut)},children:t("mettre_jour_l_00128")}),s===me.CheckInOut&&(0,i.jsxs)(Ea,{css:{paddingBottom:"$3",paddingLeft:"$6"},gap:"6",children:[(0,i.jsx)(ju,{hint:t("date_et_heure_d_93417"),rightIcon:"xmark",value:a,zone:m,onChange:l,onRightIconClick:()=>l(null)}),(0,i.jsx)(ju,{hint:t("date_et_heure_d_65738"),rightIcon:"xmark",value:d,zone:m,onChange:c,onRightIconClick:()=>c(null)}),(0,i.jsx)(wl,{css:{visibility:2723===n?"hidden":"visible"},hint:t("temps_de_pause_00051"),shouldParseAsInt:!0,value:u,onChange:h})]}),(0,i.jsx)(sc,{state:s===me.Reset?"checked":"unchecked",onClick:()=>{r(me.Reset)},children:t("remettre_z_ro_11572")})]}),(0,i.jsx)(Jv,{children:n=>(0,i.jsx)(pl,{disabled:!g,onClick:async()=>{await o({eventId:e.positionSlotUserInfo.eventId,checkIn:{breakTime:u,checkInAt:a?.toUTC(),checkOutAt:d?.toUTC(),strategy:s,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),n()},children:t("mettre_jour_85141")})})]})})},ek=e=>{const{translate:t}=il(),{mutate:n}=zs(),{mutate:o}=Us(),[s,r]=F.useState(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(pm,{triggerElem:e.triggerElem,children:[e.canCheckIn&&(0,i.jsx)(Od,{icon:"circle-check",onClick:()=>{r(!0)},children:t("mettre_jour_l_00128")}),e.canCheckIn&&e.psui.state!==he.Waiting&&(0,i.jsx)(Od,{icon:"arrows-rotate",onClick:async()=>{await n({eventId:e.psui.eventId,checkIn:{strategy:me.Reset,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reloadCheckIn(e.psui.id)},children:t("remettre_z_ro_11572")}),e.canDelete&&(0,i.jsx)(Od,{color:"red",icon:"user-xmark",onClick:async()=>{await o({eventId:e.psui.eventId,massAssign:{positionsSlotsIds:[e.psui.positionSlot.id],selecteds:{ids:[e.psui.userInfoId]},strategy:Je.Delete}}),e.onDelete(e.psui.id)},children:t("d_saffecter_du_47122")})]}),(0,i.jsx)(Qy,{isOpen:s,positionSlotUserInfo:e.psui,onClose:()=>{e.reloadCheckIn(e.psui.id),r(!1)}})]})},tk=e=>{const{translate:t}=il(),n=Nn($c),o=Nn(Ng),s=Nn(Ku),{mutate:r}=zs(),a=pc(),l=(0,F.useMemo)(()=>{const t=e.positionSlotUserInfo.positionSlot;return h(t.name)?`${t.name} - ${s.toDisplayString(t.range)}`:s.toDisplayString(t.range)},[e.positionSlotUserInfo.positionSlot]),d=()=>(0,i.jsxs)(Ea,{align:"center",css:{padding:"$3","@tablet":{padding:"$3 $4"}},gap:"3",width:1,wrap:"wrap",children:[(0,i.jsx)(Xj,{color:e.positionSlotUserInfo.position.color,icon:e.positionSlotUserInfo.position.icon}),(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{color:"gray800",css:{fontWeight:"$medium",overflow:"hidden",textOverflow:"ellipsis","@tablet":{fontWeight:"$semiBold"}},children:e.positionSlotUserInfo.position.name}),(0,i.jsx)(fr,{color:"gray500",fontSize:"textSm",children:l})]})]});return(0,i.jsxs)(Ea,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs","@tablet":{borderRadius:"$2"}},direction:"column",width:1,children:[e.canCheckIn?(0,i.jsx)(La,{to:ao.POSITION({organizationId:e.positionSlotUserInfo.organizationId,eventId:e.positionSlotUserInfo.eventId,positionId:e.positionSlotUserInfo.position.id}),children:d()}):d(),(e.canCheckIn||e.canDelete)&&(0,i.jsxs)(Ea,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$3","@tablet":{padding:"$3 $4"}},justify:"between",width:1,children:[e.positionSlotUserInfo.state===he.CheckedOut?(0,i.jsx)(Gd,{leftIcon:"clock",children:t("temps_total_79448",o.minutesToHoursMinutesString(e.positionSlotUserInfo.timeDifferenceMinutes))}):e.positionSlotUserInfo.state===he.CheckedIn?(0,i.jsx)(Gd,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:t("point_le_1_63576",n.toLocaleString(e.positionSlotUserInfo.checkInAt.toLocal(),a?Ho.ShortDateTime:Ho.DateTime))}):(0,i.jsx)(Gd,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:t("non_point_42145")}),(0,i.jsxs)(Ea,{gap:"3",children:[e.canCheckIn&&e.positionSlotUserInfo.state===he.Waiting&&(0,i.jsx)(pl,{size:"sm",onClick:async()=>{await r({eventId:e.positionSlotUserInfo.eventId,checkIn:{strategy:me.CheckIn,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),e.reloadCheckIn(e.positionSlotUserInfo.id)},children:t("pointer_80927")}),e.canCheckIn&&e.positionSlotUserInfo.state===he.CheckedIn&&(0,i.jsx)(pl,{color:"white",size:"sm",onClick:async()=>{await r({eventId:e.positionSlotUserInfo.eventId,checkIn:{strategy:me.CheckOut,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),e.reloadCheckIn(e.positionSlotUserInfo.id)},children:t("d_pointer_25328")}),(0,i.jsx)(ek,{canCheckIn:e.canCheckIn,canDelete:e.canDelete,psui:e.positionSlotUserInfo,reloadCheckIn:e.reloadCheckIn,triggerElem:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",rightIcon:"ellipsis-vertical",size:"sm"})}),onDelete:e.onDelete})]})]})]})},nk=F.createContext({}),ik=e=>{const{data:t}=$s({organizationId:e.organizationId,eventId:e.eventId,userInfoId:e.volunteerRegistration.userInfo.id}),[n,o]=F.useState(e.volunteerRegistration.positionsSlotsUsersInfos),s=F.useMemo(()=>(0,Zd.A)((0,Ju.A)(n.map(e=>e.positionCategory),e=>e.id),e=>e.name.toLowerCase()),[n]),r=F.useCallback(e=>{o(t=>t.filter(t=>t.id!==e))},[o]),a=F.useCallback(async t=>{const i=n.find(e=>e.id===t),{event:{volunteerRegistration:{positionSlotUserInfo:s}}}=await(r={eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistration.id,positionSlotId:i.positionSlot.id},a=await H(),ss("query PositionSlotUserInfo(\n    $eventId: EventId!\n    $volunteerRegistrationId: VolunteersRegistrationId!\n    $positionSlotId: PositionsSlotId!\n) {\n    event(id: $eventId) {\n        volunteerRegistration(id: $volunteerRegistrationId) {\n            positionSlotUserInfo(positionSlotId: $positionSlotId) {\n                ...UserPositionSlotUserInfo\n            }\n        }\n    }\n}\n",{variables:r,token:a||void 0,fragments:[Ro.UserPositionSlotUserInfoFragment]}));var r,a;o(e=>e.map(e=>e.id===t?s:e))},[e.eventId,e.volunteerRegistration,n,o]);return(0,i.jsx)(nk.Provider,{value:{assignedCategories:s,assignedPsuis:n,canCheckIn:e.canCheckIn,canDelete:e.canDelete,formsUsersInfos:t.organization?.userInfo.formsUsersInfos??[],onAssignedPsuiDelete:r,reloadCheckIn:a},children:e.children})};function ok(){return F.useContext(nk)}const sk=()=>{const{assignedCategories:e,assignedPsuis:t,canCheckIn:n,canDelete:o,onAssignedPsuiDelete:s,reloadCheckIn:r}=ok(),a=(0,F.useMemo)(()=>(0,Kd.A)(t,e=>e.positionCategory.id),[t]);return(0,i.jsx)(Yj,{children:e.map(e=>{const t=a[e.id];return(0,i.jsx)(Kj,{category:e,children:t.map(e=>(0,i.jsx)(tk,{canCheckIn:"function"==typeof n?n(e.positionCategoryId,e.position.id):n,canDelete:o(e.positionCategoryId,e.position.id),positionSlotUserInfo:e,reloadCheckIn:r,onDelete:s},e.id))},e.id)})})},rk=e=>(0,i.jsxs)(Ea,{align:"center",css:e.css,direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(fr,{css:{inlineSize:"70%","@tablet":{inlineSize:"50%",blockSize:"auto",maxInlineSize:"100px"}},children:(0,i.jsx)("img",{alt:"Blank image",className:"blank-image",height:"100%",src:e.imageSrc??sd.WeezeventBlankPerson,width:"100%"})}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{css:{color:"$gray800",fontSize:"$textMd",fontWeight:"$semiBold","@tablet":{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}},textAlign:"center",children:e.title}),h(e.subtitle)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{color:"gray500",fontSize:"textSm",textAlign:"center",children:e.subtitle})]}),e.button&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Ea,{justify:"center",children:e.button})]})]});function ak(e,t,n,i){return(0,Zd.A)(e.map(e=>{const o=e.positions.map((o,s)=>({name:o.name,range:o.range?t.toDisplayString(o.range):"-",path:ao.POSITION({organizationId:n,eventId:i,positionId:o.id}),form:e.form,rank:s+1})),s=e.positionsCategories.map((o,s)=>({name:o.name,range:o.range?t.toDisplayString(o.range):"-",path:ao.POSITION_CATEGORY({organizationId:n,eventId:i,positionCategoryId:o.id}),form:e.form,rank:s+1})),r=e.positionsSlots.map(t=>({name:t.position.name,range:t.nameOrRange,path:ao.POSITION({organizationId:n,eventId:i,positionId:t.position.id}),form:e.form,rank:-1}));return o.concat(s).concat(r)}).flat(),[e=>e.form.name,(e,t)=>t])}const lk=({message:e,title:t})=>(0,i.jsxs)(Ha,{color:"warning",leftIcon:"triangle-exclamation",children:[(0,i.jsx)(Ea,{css:{fontWeight:"$medium"},direction:"column",children:t}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(Ea,{css:{fontWeight:"normal"},children:e})]}),dk=({editDisabled:e,editPath:t,eventId:n,form:o,organizationId:s,userInfoId:r})=>{const a=Gn();return(0,i.jsx)(Gd,{color:"primary",cursor:e?"default":"pointer",onContentClick:()=>{e||a.push(t?n?t(s,r,n,o.id):t(s,r,o.id):zi.FORM({organizationId:s,eventId:n??void 0,formId:o.id}))},children:o.name})},ck=({editFormPath:e,editPath:t,formsUsersInfos:n,isEditDisabled:o=!1})=>{const{history:s,params:{organizationId:r,eventId:a,userInfoId:l},translate:d}=il(),c=Nn(Ku),u=(0,F.useMemo)(()=>ak(n,c,r,a),[n]),m=pc();return(0,i.jsxs)(Ea,{direction:"column",gap:"6",width:1,children:[o&&(0,i.jsx)(lk,{message:d("you_are_already_assigned_to_missions"),title:d("wished_positions_can_no_longer_be_changed")}),(0,i.jsx)(kc,{filters:h(t)&&(0,i.jsx)(pl,{color:"white",disabled:o,size:"sm",to:t,children:d("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:d("nom_de_la_missi_64605")}),!m&&(0,i.jsx)(Tc,{children:d("Date")}),!m&&(0,i.jsx)(Tc,{children:d("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:Zo(u)?u.map((t,n)=>(0,i.jsxs)(Cc,{children:[(0,i.jsxs)(xc,{align:"start",css:{color:"$gray800",fontWeight:"$medium",fontSize:"$textSm"},direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(fr,{color:"gray900",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{s.push(t.path)},children:t.name}),t.form.positionRanking===Ue.Ranked&&(0,i.jsx)(fr,{color:"gray500",children:d("choix_n_1_00613",t.rank)}),m&&(0,i.jsx)(fr,{color:"gray500",css:{fontWeight:400,lineHeight:"20px"},fontSize:"textSm",children:t.range})]}),!m&&(0,i.jsx)(xc,{children:t.range}),!m&&(0,i.jsx)(xc,{children:(0,i.jsx)(dk,{editDisabled:o,editPath:e,eventId:a,form:t.form,organizationId:r,userInfoId:l})})]},n)):(0,i.jsx)(Cc,{css:{height:"200px"},children:(0,i.jsx)(xc,{children:(0,i.jsx)(rk,{title:d("aucune_mission_61179")})})})}),setOffset:Bl.A,title:d("missions_souhai_23225"),totalCount:0})]})},uk=()=>{const{formsUsersInfos:e}=ok();return(0,i.jsx)(Ea,{css:{background:"$gray50",padding:"$6"},height:1,width:1,children:(0,i.jsx)(ck,{formsUsersInfos:e})})},hk=e=>{const{translate:t}=il();return(0,i.jsx)(ik,{canCheckIn:e.canCheckIn,canDelete:e.canDelete,eventId:e.eventId,organizationId:e.organizationId,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsxs)(eu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Lb,{children:t("missions_63972")}),(0,i.jsx)(tu,{css:{padding:"0"},children:(0,i.jsxs)(Vy,{height:1,children:[(0,i.jsxs)(Ly,{center:!0,children:[(0,i.jsx)(Ny,{path:`${e.basePath}/assigned`,children:t("attribu_es_48167")}),(0,i.jsx)(Ny,{path:`${e.basePath}/wished`,children:t("souhait_es_78101")})]}),(0,i.jsx)(By,{path:`${e.basePath}/assigned`,children:(0,i.jsx)(sk,{})}),(0,i.jsx)(By,{path:`${e.basePath}/wished`,children:(0,i.jsx)(uk,{})})]})})]})})},mk=F.createContext({}),gk=e=>{const{data:t,loader:n}=Vn("query TeamRightPanel($eventId: EventId!, $teamCode: TeamCode!) {\n    event(id: $eventId) {\n        team(teamCode: $teamCode) {\n            form {\n                name\n            }\n\n            members {\n                ...UserInfoTeamRightPanel\n            }\n        }\n    }\n}\n",{eventId:e.eventId,teamCode:e.teamCode},[Ro.UserInfoTeamRightPanelFragment]);const{mutate:o}=Us(),[s,r]=F.useState([]),a=F.useMemo(()=>{const e=s.flatMap(e=>e.positionsCategories.flatMap(e=>e.positions.flatMap(e=>e.slots.map(t=>({...t,position:(0,Ir.A)(e,["id","name","icon","color"])}))))),t=s.flatMap(e=>e.positions.flatMap(e=>e.slots.map(t=>({...t,position:(0,Ir.A)(e,["id","name","icon","color"])})))),n=s.flatMap(e=>e.positionsSlots);return(0,Ju.A)(e.concat(t).concat(n),e=>e.id)},[s]),l=F.useMemo(()=>(0,Ju.A)(s.flatMap(e=>e.positionsSlotsUsersInfos.map(e=>({...e.positionSlot,position:e.position}))),e=>e.id),[s]),d=F.useMemo(()=>(0,Zd.A)((0,Ju.A)(a.concat(l),e=>e.id),e=>[e.position.name.toLowerCase(),e.range.start.toMillis()]),[a,l]),c=F.useMemo(()=>Object.fromEntries(s.map(e=>{const t=(0,Oo.A)(e.positionsCategories.flatMap(e=>e.positions.flatMap(e=>e.slots.map(e=>e.id))).concat(e.positions.flatMap(e=>e.slots.map(e=>e.id))).concat(e.positionsSlots.map(e=>e.id)));return[e.userInfo.id,t]})),[s]),u=F.useMemo(()=>Object.fromEntries(s.map(e=>{const t=e.positionsSlotsUsersInfos.map(e=>e.positionSlot.id);return[e.userInfo.id,t]})),[s]),h=F.useCallback(async(t,n)=>{await o({eventId:e.eventId,massAssign:{positionsSlotsIds:[n],selecteds:{ids:[t]},strategy:Je.Add}});const{event:i}=await function(e,t){return ss("query TeamRightPanelMember($eventId: EventId!, $userInfoId: UsersInfoId!) {\n    event(id: $eventId) {\n        volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n            ...UserInfoTeamRightPanel\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.UserInfoTeamRightPanelFragment]})}({eventId:e.eventId,userInfoId:t},await H());r(e=>e.map(e=>e.userInfo.id===t?i.volunteerRegistration:e))},[e.eventId,r]);return F.useEffect(()=>{r(t.event?.team?.members??[])},[t.event,r]),(0,i.jsx)(mk.Provider,{value:{allSlots:d,form:t.event?.team?.form,loader:n,memberIdToAssignedSlotsIds:u,memberIdToWishedSlotsIds:c,members:s,assign:h},children:e.children})};function pk(){return F.useContext(mk)}const fk=e=>{const{translate:t}=il(),{assign:n,memberIdToAssignedSlotsIds:o,memberIdToWishedSlotsIds:s}=pk(),[r,a]=(0,F.useState)(!1),l=o[e.member.userInfo.id].includes(e.slot.id),d=s[e.member.userInfo.id].includes(e.slot.id);return(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(Eb,{size:32,userInfo:e.member.userInfo})}),(0,i.jsx)(xc,{justify:"end",children:l?(0,i.jsxs)(Ea,{align:"center",gap:"1",children:[(0,i.jsx)(fr,{color:"success500",children:(0,i.jsx)(Va,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(fr,{font:"gray800 textXs medium",children:t("d_j_affect_71706")})]}):d?(0,i.jsx)(pl,{isLoading:r,size:"sm",onClick:()=>{a(!0),n(e.member.userInfo.id,e.slot.id)},children:t("affecter_94255")}):(0,i.jsxs)(Ea,{align:"center",gap:"1",children:[(0,i.jsx)(fr,{color:"error500",children:(0,i.jsx)(Va,{icon:"circle-xmark",iconStyle:"solid"})}),(0,i.jsx)(fr,{font:"gray800 textXs medium",children:t("non_souhait_46147")})]})})]})},xk=e=>{const{translate:t}=il(),{members:n}=pk(),o=Nn(Ku),s=(0,F.useMemo)(()=>ih(o,e.slot,e.slot.position.name,{slot:{includeRange:!0}}),[e.slot]);return(0,i.jsxs)(Ea,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Ea,{css:{padding:"$3 $4"},gap:"3",children:[(0,i.jsx)(Xj,{color:e.slot.position.color,icon:e.slot.position.icon}),(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{font:"gray800 textSm semiBold",children:e.slot.position.name}),(0,i.jsx)(fr,{color:"gray500",children:s})]})]}),(0,i.jsxs)(mc,{hideBorder:!0,children:[(0,i.jsxs)(cc,{children:[(0,i.jsx)(Tc,{children:t("full_name")}),(0,i.jsx)(Tc,{})]}),n.map(t=>(0,i.jsx)(fk,{member:t,slot:e.slot},t.userInfo.id))]})]})},_k=()=>{const{allSlots:e}=pk();return(0,i.jsx)(Ea,{direction:"column",gap:"3",width:1,children:e.map(e=>(0,i.jsx)(xk,{slot:e},e.id))})},Ik=e=>{const{translate:t}=il(),{form:n,loader:o}=pk();return(0,i.jsxs)(eu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Lb,{children:(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{children:t("_quipe_1_19590",e.teamCode)}),(0,i.jsx)(fr,{color:"gray500",fontSize:"textSm",children:t("formulaire_1_39637",n?.name)})]})}),(0,i.jsx)(tu,{css:{background:"$gray50",py:"$6"},children:o||(0,i.jsx)(_k,{})})]})},vk=e=>(0,i.jsx)(gk,{eventId:e.eventId,teamCode:e.teamCode,children:(0,i.jsx)(Ik,{...e})}),bk=({editFormPath:e,editPath:t,eventId:n,organizationId:o,formsUsersInfos:s,showEditButton:r,userInfoId:a,isEditDisabled:l=!1})=>{const{translate:d}=il(),c=Nn($c),u=Nn(Ku),h=(0,F.useMemo)(()=>(0,Zd.A)(s.flatMap(e=>e.slots.map(t=>({range:t.range,display:e.form.slotDisplay,form:e.form}))),({range:e})=>e.start.toMillis()),[s]),m=pc(),g=(0,F.useCallback)((e,t)=>{switch(t){case gt.Calendar:case gt.DisplayDays:return(0,i.jsx)(fr,{children:c.toLocaleString(e.start,Ho.DateOnly.MonthLong)});case gt.Display:case gt.Custom:return(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{css:{lineHeight:"20px"},children:u.toDisplayString(e,{hideTime:!0})}),(0,i.jsx)(fr,{color:"gray500",css:{fontWeight:400,lineHeight:"20px"},fontSize:"textSm",children:u.toDisplayString(e,{hideDate:!0})})]});case gt.Hide:return null;default:return Za()}},[]);return(0,i.jsxs)(Ea,{direction:"column",gap:"6",children:[l&&(0,i.jsx)(lk,{message:d("you_are_already_assigned_to_missions"),title:d("availabilities_can_no_longer_be_changed")}),(0,i.jsx)(kc,{filters:r&&(0,i.jsx)(pl,{color:"white",disabled:l,size:"sm",to:t,children:d("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:d("Date")}),!m&&(0,i.jsx)(Tc,{children:d("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:Zo(h)?h.map((t,s)=>(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{children:g(t.range,t.display)}),!m&&(0,i.jsx)(xc,{children:(0,i.jsx)(dk,{editDisabled:l,editPath:e,eventId:n,form:t.form,organizationId:o,userInfoId:a})})]},s)):(0,i.jsx)(Cc,{css:{height:"200px"},children:(0,i.jsx)(xc,{children:(0,i.jsx)(rk,{title:d("aucune_disponib_15602")})})})}),setOffset:Bl.A,title:d("disponibilit_s_49923"),totalCount:0})]})},jk=e=>{const t=Ln(),{data:n,loader:o}=Ls({organizationId:e.organizationId,eventId:e.eventId,userInfoId:e.userInfoId}),{permissions:[s],isLoading:r}=wy(jy({eventId:e.eventId,userInfoId:e.userInfoId}));return(0,i.jsxs)(eu,{returnToFallback:e.returnPathFallback,size:"md",children:[(0,i.jsx)(Lb,{children:t("disponibilit_s_49923")}),(0,i.jsx)(tu,{children:o||r?o:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(bk,{editFormPath:(t,n,i,o)=>location.host.startsWith("app.")?So.EDIT_USER_SLOTS_FORM(t,i,n,o):e.delegationId?to.MEMBER_EDIT({organizationId:t,userInfoId:n,delegationId:e.delegationId,eventId:i,formId:o}):kI.MEMBER_FORM_EDIT({organizationId:t,userInfoId:n,eventId:i,formId:o}),editPath:So.EDIT_USER_SLOTS(e.organizationId,e.eventId,e.userInfoId),eventId:e.eventId,formsUsersInfos:n.organization.userInfo.formsUsersInfos,organizationId:e.organizationId,showEditButton:s,userInfoId:e.userInfoId}),(0,i.jsx)(Pa,{height:"6"})]})})]})},Ck=e=>{const{history:t}=il();return(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:e.accreditationsPanelPath,children:(0,i.jsx)(Jy,{basePath:e.accreditationsPanelPath,canAccredit:e.canAccredit,canEditWished:e.canEditWishedAccreditations,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,delegationId:e.delegationId,eventId:e.eventId,userInfoId:e.volunteerRegistration.userInfo.id,volunteerRegistration:e.volunteerRegistration,onClose:()=>{e.reloadRow(),t.goBack(e.returnPathFallback)}})}),(0,i.jsx)(_r.qh,{path:e.availabilitiesPanelPath,children:(0,i.jsx)(jk,{delegationId:e.delegationId,eventId:e.eventId,organizationId:e.organizationId,returnPathFallback:e.availabilitiesPanelPath,userInfoId:e.volunteerRegistration.userInfo.id})}),(0,i.jsx)(_r.qh,{path:e.positionsPanelPath,children:(0,i.jsx)(hk,{basePath:e.positionsPanelPath,canCheckIn:e.canCheckIn,canDelete:e.canDeletePosition,eventId:e.eventId,organizationId:e.organizationId,volunteerRegistration:e.volunteerRegistration,onClose:()=>{e.reloadRow(),t.goBack(e.returnPathFallback)}})}),(e.teamsPanelsPath||[]).map((n,o)=>(0,i.jsx)(_r.qh,{path:n,children:(0,i.jsx)(vk,{eventId:e.eventId,teamCode:(e.volunteerRegistration.teams||[])[o].teamCode,onClose:()=>{e.reloadRow(),t.goBack(e.returnPathFallback)}})},o))]})};function yk(e,t){return 0===e.length||e.includes(t)}const kk=e=>{const t=Ln(),[n,o]=F.useState(!1),s=F.useCallback(async()=>{let t=!0;return o(!0),await e.onDelete(),t&&o(!1),()=>{t=!1}},[e.onDelete,n,o]);return(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ea,{justify:"center",children:(0,i.jsx)(Ea,{align:"center",css:{background:"$error100",borderRadius:"48px",color:"$error600",height:"48px",fontSize:"20px",width:"48px"},justify:"center",children:(0,i.jsx)(Va,{icon:"circle-exclamation",iconStyle:"light"})})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(fr,{css:{ellipsis:!0},font:"gray900 textLg regular",textAlign:"center",title:e.text,children:e.text}),"subtext"in e&&Ko(e.subtext).map((e,t)=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:e})]},t)),"children"in e&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{color:"gray500",css:{alignSelf:"center"},children:e.children})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{color:"error",isLoading:n,onClick:s,children:e.buttonText}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},Ak=e=>{const{translate:t,params:{organizationId:n,eventId:o,delegationId:s}}=il(),{mutate:r}=Bs(),{mutate:a}=Es(),{mutate:l}=Rs(),[d,c]=(0,F.useState)(!1),[u,h]=(0,F.useState)(!1),m=(0,F.useMemo)(()=>e.customDocuments.filter(t=>yk(t.populationsIds,e.member.fields.population)),[e.customDocuments,e.member]),g=o&&e.canAccredit&&e.accreditationState===ae.WaitingAccreditation,p=o&&e.showDocumentsDownload&&void 0!==e.member.links&&Zo(e.allowedCustomDocuments);return g||p||e.canDelete||e.showDeleteFromEvent?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(pm,{children:[g&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Od,{icon:"check",onClick:async()=>{await r({eventId:o,delegationId:s,usersInfosIds:[e.member.id]}),e.reload()},children:t("valider_les_acc_80801")}),(0,i.jsx)(Od,{icon:"badge-check",to:So.ACCREDIT(n,o,e.member.id),children:t("accr_diter_70543")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"})]}),p&&(0,i.jsx)(i.Fragment,{children:Zo(e.allowedCustomDocuments)&&(0,i.jsx)(i.Fragment,{children:e.allowedCustomDocuments.map((n,o)=>{const s=m.find(e=>e.slug===n);return s?(0,i.jsx)(Od,{download:`${e.member.nameOrEmail}-${s.name}`,icon:"arrow-down-to-bracket",target:"_blank",to:Zm(e.member.links?.userCustomDocumentLinks[n],"pdf"),children:t("t_l_charger_1_80752",s.name)},o):Yt.includes(n)?(0,i.jsx)(Od,{download:`${e.member.nameOrEmail}-custom-badge`,icon:"arrow-down-to-bracket",target:"_blank",to:Zm(e.member.links?.userCustomBadgeLinks[n],"pdf"),children:t("t_l_charger_1_80752",b_(n))},o):null})})}),p&&e.canDelete&&(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),e.canDelete&&(0,i.jsx)(Od,{color:"red",icon:"user-xmark",onClick:()=>c(!0),children:t("retirer_de_la_d_64963")}),e.showDeleteFromEvent&&(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>h(!0),children:t("delete_from_eve_69290")})]}),d&&(0,i.jsx)(kk,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_sur_d_88752")],text:t("suppression_de_73669",e.member.nameOrEmail),onClose:()=>c(!1),onDelete:async()=>{await a({organizationId:n,eventId:o,delegationId:s,selecteds:{ids:[e.member.id]},deleteFromEvent:e.deleteFromEvent}),e.reload()}}),u&&e.volunteerRegistrationId&&(0,i.jsx)(kk,{buttonText:t("supprimer_43083"),subtext:[t("are_you_sure_yo_46668")],text:t("suppression_de_73669",e.member.nameOrEmail),onClose:()=>h(!1),onDelete:async()=>{await l({eventId:o,selecteds:{ids:[e.member.id]}}),e.reload()}})]}):null};function wk(e,t){switch(t){case Ie.Accreditation:return e("accr_ditations_39450");case Ie.Delegation:return e("d_l_gations_78318");case Ie.Event:return e("Event");case Ie.Position:return e("missions_63972");case Ie.UserInfo:return e("membres_11310");default:return Za()}}function Sk(e){return h(e.label)?`${e.name} (${e.label})`:e.name}const Ek=({displayName:e,isAddDeleteVisible:t,isResetVisible:n,massEditFieldInput:o,reset:s,strategy:r,change:a})=>{const{translate:l}=il();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{font:"gray700 textSm medium",children:l("que_souhaitez_v_87607")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(sc,{state:s||r!==Je.Replace?"unchecked":"checked",onClick:()=>{a("massEdit.reset",!1),a("massEdit.strategy",Je.Replace)},children:l("remplacer_les_v_78885")}),!s&&r===Je.Replace&&o,(0,i.jsx)(Pa,{height:"3"}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sc,{state:s||r!==Je.Add?"unchecked":"checked",onClick:()=>{a("massEdit.reset",!1),a("massEdit.strategy",Je.Add)},children:l("ajouter_des_val_80159")}),!s&&r===Je.Add&&o,(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:s||r!==Je.Delete?"unchecked":"checked",onClick:()=>{a("massEdit.reset",!1),a("massEdit.strategy",Je.Delete)},children:l("supprimer_des_v_96120")}),!s&&r===Je.Delete&&o,(0,i.jsx)(Pa,{height:"3"})]}),n&&(0,i.jsx)(sc,{state:s?"checked":"unchecked",onClick:()=>a("massEdit.reset",!0),children:l("r_initialiser_42983",e)})]})},Tk=e=>{const t=Ln(),n=(0,F.useMemo)(()=>(0,Zd.A)(e.customFields??[],e=>e.name.toLowerCase()),[e.customFields]),o=(0,F.useMemo)(()=>(0,Zd.A)(n.map(e=>({slug:e.slug,name:e.name,label:e.label})).concat(e.properties.map(e=>({slug:e,name:t(e),label:null}))),e=>e.name.toLowerCase()),[n,e.properties]);return(0,i.jsx)(Bc,{size:"md",onClose:e.onClose,children:(0,i.jsx)(Oa.lV,{initialValues:{massEdit:{reset:!1,selecteds:e.selecteds,slug:"",value:"",strategy:Je.Replace}},initialValuesEqual:wr.A,render:({form:s,handleSubmit:r,submitting:a,values:l})=>{const{reset:d,slug:c,strategy:u}=l.massEdit,m=o.find(e=>e.slug===c),g=n.find(e=>e.slug===c),p=h(c)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(dj,{campaigns:e.campaigns,categories:e.categories,change:s.change,customDocuments:e.customDocuments,customField:g,forms:e.forms,name:"massEdit.value",slug:c,tags:e.tags,traces:e.traces,value:l.massEdit.value})})]}):null,f=c===ie.Tag||c===ve.Campaigns||c===ve.Documents||!0===g?.canSelectMultiple,x=c!==ie.Category&&c!==xe.Category&&c!==ve.Category&&c!==it.Category&&c!==ie.WeezeventIsSynchronized&&c!==xe.Privacy&&c!==ve.Form&&c!==ve.IsLocked&&c!==ve.ShowFormLinkInDelegationSpace&&c!==ve.ShowInDelegationSpace&&c!==ve.CanLeadersAddMembers&&c!==ve.CanLeadersEditCustomFields&&c!==ve.CanLeadersEditMembers&&c!==ve.CanLeadersDeleteMembers&&c!==ve.CanLeadersEditColumns&&c!==ve.CanLeadersImportMembers&&c!==ve.CanLeadersSeeHiddenAccreditationsSlots;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ea,{justify:"center",children:(0,i.jsx)(mj,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("_dition_de_la_v_67585")}),(0,i.jsx)(Pa,{height:"7"}),e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(qd,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(Sm,{isSearchVisible:!0,label:t("quel_est_le_cha_81138"),name:"massEdit.slug",placeholder:t("s_lectionnez_un_82446"),children:o.map(e=>(0,i.jsx)("option",{value:e.slug,children:Sk(e)},e.slug))}),m&&(0,i.jsx)(Ek,{change:s.change,displayName:m.name,isAddDeleteVisible:f,isResetVisible:x,massEditFieldInput:p,reset:d,strategy:u}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{disabled:(_=l.massEdit,I=g,!(_.reset||!I||I.fieldType!==Ne.Select||I.canSelectMultiple||"number"==typeof _.value&&!isNaN(_.value))),isLoading:a,onClick:r,children:t("modifier_la_val_07602")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]});var _,I},onSubmit:async t=>{const n=(await e.mutate(t.massEdit)).numberOfEdited;e.onSuccess(n),e.onClose()}})})},zk=e=>{const{data:t,isLoading:n}=Vn("query PositionsMassEditInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n    organization(id: $organizationId) {\n        customFields(variety: Position, sort: { attribute: Name, direction: Asc }) {\n            nodes {\n                ...MassEditCustomField\n            }\n        }\n\n        tags {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        positionsCategories {\n            id\n            name\n        }\n\n        traces {\n            id\n            name\n        }\n    }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[Ro.MassEditCustomFieldFragment]);const o=(0,F.useMemo)(()=>pn.filter(e=>e!==it.Name),[]);return(0,i.jsx)(Tk,{campaigns:[],categories:t.event?.positionsCategories??[],customDocuments:[],customFields:t.organization?.customFields.nodes??[],forms:[],isLoading:n,mutate:e.mutate,properties:o,selecteds:e.selecteds,tags:t.organization?.tags.nodes??[],traces:t.event?.traces??[],onClose:e.onClose,onSuccess:e.onSuccess})},$k=e=>{const{data:t,isLoading:n}=Vn("query AccreditationsMassEditInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n    organization(id: $organizationId) {\n        customFields(variety: Accreditation, sort: { attribute: Name, direction: Asc }) {\n            nodes {\n                ...MassEditCustomField\n            }\n        }\n\n        tags {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        accreditationsCategories {\n            id\n            name\n        }\n    }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[Ro.MassEditCustomFieldFragment]);const o=(0,F.useMemo)(()=>Ut.filter(e=>e!==ie.Name),[]);return(0,i.jsx)(Tk,{campaigns:[],categories:t.event?.accreditationsCategories??[],customDocuments:[],customFields:t.organization?.customFields.nodes??[],forms:[],isLoading:n,mutate:e.mutate,properties:o,selecteds:e.selecteds,tags:t.organization?.tags.nodes??[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},Ok=e=>{const{data:t,isLoading:n}=(o={organizationId:e.organizationId},Vn(as,o,[]));var o;const s=(0,F.useMemo)(()=>Kt.filter(e=>e!==xe.Label&&e!==xe.Name),[]);return(0,i.jsx)(Tk,{campaigns:[],categories:t.organization?.customFieldsCategories.nodes??[],customDocuments:[],customFields:[],forms:[],isLoading:n,mutate:e.mutate,properties:s,selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},Rk=e=>{const{data:t,isLoading:n}=(o={organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?et.Event:et.Organization},Vn(ls,o,[Ro.MassEditCustomFieldFragment]));var o;const s=(0,F.useMemo)(()=>Xt.filter(e=>e!==ve.Name&&e!==ve.Columns),[]);return(0,i.jsx)(Tk,{campaigns:t.organization?.campaigns.nodes??[],categories:t.organization?.delegationsCategories.nodes??[],customDocuments:t.organization?.event?.customDocuments??[],customFields:t.organization?.customFields.nodes??[],forms:t.organization?.forms.nodes??[],isLoading:n,mutate:e.mutate,properties:s,selecteds:e.selecteds,tags:t.organization?.tags.nodes??[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},Pk=e=>{const{data:t,isLoading:n}=Vn("query UsersInfosMassEditInfos($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        customFields(variety: UserInfo, sort: { attribute: Name, direction: Asc }) {\n            nodes {\n                ...MassEditCustomField\n            }\n        }\n    }\n}\n",{organizationId:e.organizationId},[Ro.MassEditCustomFieldFragment]);return(0,i.jsx)(Tk,{campaigns:[],categories:[],customDocuments:[],customFields:t.organization?.customFields.nodes??[],forms:[],isLoading:n,mutate:e.mutate,properties:[],selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},Dk=e=>(0,i.jsx)(Tk,{campaigns:[],categories:[],customDocuments:[],customFields:e.customFields,forms:[],isLoading:!1,mutate:e.mutate,properties:[],selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess});let Fk=class extends zl{translationService;constructor(e){super(e),this.translationService=e}massAccreditStep1Schema(){return l.Ik().shape({massAccredit:l.Ik().shape({...this.massAccreditStep1Fields()})})}massAccreditStep2Schema(){return l.Ik().shape({massAccredit:l.Ik().shape({...this.massAccreditStep2Fields()})})}massAccreditSchema(){return l.Ik().shape({...this.massAccreditStep1Fields(),...this.massAccreditStep2Fields()})}massAccreditStep1Fields(){return{strategy:l.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(mn,this.t("la_strat_gie_es_82287"))}}massAccreditStep2Fields(){return{accreditationsSlotsIds:l.YO().of(l.ai()).required(this.t("vous_devez_s_le_72138")).min(1,this.t("vous_devez_s_le_72138"))}}};Fk=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],Fk);const Mk=e=>(0,ee.createPortal)((0,i.jsx)(fr,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"50",...e.css},height:1,width:1,children:e.children}),document.body),Nk=e=>{const t=Ln();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{font:"gray900 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"massAccredit.strategy",value:Je.Add,children:t("ajouter_des_acc_17744")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"massAccredit.strategy",value:Je.Replace,children:t("remplacer_les_a_92733")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"massAccredit.strategy",value:Je.Delete,children:t("supprimer_des_a_04246")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{onClick:e.handleSubmit,children:t("suivant_accr_25709")})})]})};var Lk=n(9120);const Bk=e=>(0,Zd.A)(e,e=>e.toMillis()),Vk=ar("div",{alignItems:"center",borderRadius:"$2",color:"$gray400",display:"flex",fontWeight:"$medium",height:"32px",justifyContent:"center",userSelect:"none",width:"32px",variants:{isSelectable:{true:{color:"$gray800",cursor:"pointer","&:hover":{background:"$primary700",color:"white"}}},isSelected:{true:{background:"$primary700",color:"white",cursor:"pointer"}}},compoundVariants:[{isSelectable:!0,isSelected:!0,css:{background:"$primary700",color:"white",cursor:"pointer"}}]}),Uk=({disabledDates:e,firstDayOfMonth:t,max:n,min:o,onChange:s,values:r})=>{const a=Ln(),l=Nn($c),d=(0,F.useMemo)(()=>t.minus({day:t.weekday-1}),[t]),c=(0,F.useMemo)(()=>t.endOf("month"),[t]),u=(0,F.useMemo)(()=>{const e=c.plus({day:7-c.weekday});return Math.ceil(e.diff(d,"days").days)},[c]),h=(0,F.useMemo)(()=>(0,vc.A)(0,u).map(i=>{const s=d.plus({day:i}),a=s.toMillis(),l=r.some(e=>e.toMillis()===a),c=!!Zo(e)&&e.some(e=>e.toMillis()===a);return{day:s,isSelected:l,isDisabled:c,isSelectable:!c&&s.month===t.month&&s>=o&&s<=n}}),[d,u,r,e]),m=(0,F.useMemo)(()=>!h.some(({isSelectable:e,isSelected:t})=>e&&!t),[h]),g=(0,F.useCallback)(()=>{s(m?[]:h.flatMap(({day:e,isSelectable:t,isSelected:n})=>t||n?[e]:[]))},[h,m,s]);return(0,i.jsxs)(Ea,{css:{background:"white",bd:!0,padding:"$5 $4"},direction:"column",children:[(0,i.jsx)(fr,{css:{textTransform:"capitalize"},font:"gray800 textXl semiBold",textAlign:"center",width:1,children:l.toLocaleString(t,{month:"long",year:"numeric"})}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Jl,{gap:"2",gridtemplatecolumns:"repeat(7, 32px)",gridtemplaterows:"auto",children:(0,vc.A)(0,7).map(e=>{const t=d.plus({day:e});return(0,i.jsx)(fr,{css:{textTransform:"capitalize"},font:"gray500 textXs medium",width:32,children:l.toLocaleString(t,{weekday:"short"})},e)})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Jl,{gap:"2",gridtemplatecolumns:"repeat(7, 32px)",gridtemplaterows:"auto",children:h.map(({day:e,isSelected:t,isSelectable:n},o)=>(0,i.jsx)(Vk,{isSelectable:n,isSelected:t,onClick:i=>{if(n&&t)s(Bk((0,Lk.A)(r,[e],e=>e.toMillis())));else if(n&&!t){const t=r.findLast(t=>tt.plus({day:e+1}));s(Bk([...r,...i]))}else s(Bk([...r,e]))}},children:e.day},o))}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(pl,{color:"white",textAlign:"center",onClick:g,children:a(m?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")})]})},Wk=e=>{const{minDate:t,maxDate:n,numberOfMonths:o,totalDaysDiff:s}=(0,F.useMemo)(()=>xh(e.slots),[e.slots]),r=(0,F.useMemo)(()=>e.slots.flatMap(t=>t.date?.isValid&&e.accreditationsSlotsIds.includes(t.id)?[t.date]:[]),[e.slots,e.accreditationsSlotsIds]),a=(0,F.useMemo)(()=>(0,vc.A)(0,s).flatMap(n=>{const i=t.plus({day:n});return e.slots.some(e=>e.date?.isValid&&e.date.toMillis()===i.toMillis())?[]:[i]}),[t,s,e.slots]);return(0,i.jsx)(Ea,{gap:"4",wrap:"wrap",children:(0,vc.A)(0,o).map(s=>{const l=t.plus({month:s}).startOf("month"),d=0===s?t:l,c=s===o-1?n:l.endOf("month"),u=r.filter(e=>e.startOf("month").equals(l));return(0,i.jsx)(Uk,{disabledDates:a,firstDayOfMonth:l,max:c,min:d,values:u,onChange:t=>{e.change(`${e.prefix}accreditationsSlotsIds`,_h(e.accreditationsSlotsIds,e.slots,l,t))}},s)})})},Gk=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>e.slots.filter(e=>e.date?.isValid),[e.slots]);return Zo(n)?(0,i.jsx)(Wk,{...e,slots:n}):(0,i.jsx)(rk,{imageSrc:sd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})};let Hk=class{translationService;constructor(e){this.translationService=e}getFormatter(e={}){return Intl.NumberFormat(this.translationService.language.toString().toLowerCase(),{notation:e.notation||"compact",style:e.style||"unit",unit:e.unit||"byte",unitDisplay:e.unitDisplay||"narrow"})}toNumberOrInfinity(e){return"number"==typeof e&&e!==1/0?e.toLocaleString():"∞"}static bytesToMegabytes(e){return`${parseFloat((e/1e6).toPrecision(1))} MB`}static bytesToGigabytes(e){return`${parseFloat((e/1e9).toPrecision(1))} GB`}};Hk=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],Hk);const qk=e=>{const{translate:t}=il(),n=Nn(Hk),o=(0,F.useMemo)(()=>Fj(e.accreditation),[e.accreditation]),s=e.accreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(Ea,{align:"center",css:{background:"white",bd:!0,cursor:"pointer",px:"$4",userSelect:"none"},gap:"2",height:64,onClick:()=>{e.onClick(e.slot.id,"unchecked"===s)},children:[(0,i.jsx)(tc,{shouldPreventDefault:!1,state:s,onClick:Bl.A}),(0,i.jsx)(Xj,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsx)(fr,{css:{flex:"1"},font:"gray800 textSm semiBold",children:o}),(0,i.jsx)(Ea,{css:{px:"$3"},width:310,children:(0,i.jsx)(Gd,{color:e.slot.assignedResources>=(e.slot.maxResources||1/0)?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.slot.assignedResources,n.toNumberOrInfinity(e.slot.maxResources))})})]})},Yk=e=>{const t=Ln(),n=Nn($c),o=Nn(Hk),s=e.accreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(Cc,{css:{cursor:"pointer"},onClick:()=>{e.onClick(e.slot.id,"unchecked"===s)},children:[(0,i.jsx)(xc,{justify:"center",width:48,children:e.shouldDisplayList?(0,i.jsx)(tc,{shouldPreventDefault:!1,state:s,onClick:Bl.A}):(0,i.jsx)(oc,{shouldPreventDefault:!1,state:s,onClick:Bl.A})}),(0,i.jsx)(xc,{children:h(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(xc,{children:e.slot.date?.isValid?n.toLocaleString(e.slot.date,Ho.DateOnly.WeekdayLongMonthLong):"-"}),(0,i.jsx)(xc,{children:(0,i.jsx)(Gd,{color:e.slot.assignedResources>=(e.slot.maxResources||1/0)?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.slot.assignedResources,o.toNumberOrInfinity(e.slot.maxResources))})})]})},Kk=e=>{const t=Ln(),n=(0,F.useMemo)(()=>(0,Zd.A)(e.slots.filter(t=>t.accreditation.id===e.accreditation.id),e=>(0,Da.A)([e.date?.toMillis(),e.name.toLowerCase()])),[e.slots,e.accreditation]),o=(0,F.useMemo)(()=>n.map(e=>e.id),[n]),s=(0,F.useMemo)(()=>{const t=(0,Zu.A)(e.accreditationsSlotsIds,o);return t.length===o.length?"checked":0===t.length?"unchecked":"indeterminate"},[o,e.accreditationsSlotsIds]),r=(0,F.useCallback)((t,n)=>{if(e.accreditation.accreditationDisplay===ne.Radio){const i=(0,Jd.A)(e.accreditationsSlotsIds,o).concat(n?[t]:[]);e.change("massAccredit.accreditationsSlotsIds",i)}else e.change("massAccredit.accreditationsSlotsIds",Jo(e.accreditationsSlotsIds,t,n))},[e.accreditation,e.accreditationsSlotsIds,e.change,o]),a=e.accreditation.accreditationDisplay===ne.List||e.strategy===Je.Delete;return e.accreditation.hasSlots?(0,i.jsx)(Jj,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:n.length,children:e.accreditation.accreditationDisplay===ne.Calendar?(0,i.jsx)(Ea,{css:{background:"$gray50",padding:"$4"},children:(0,i.jsx)(Gk,{accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,prefix:"massAccredit.",slots:n})}):(0,i.jsxs)(mc,{hideBorder:!0,children:[(0,i.jsxs)(cc,{children:[(0,i.jsx)(Tc,{justify:"center",width:48,children:a&&(0,i.jsx)(tc,{state:s,onClick:t=>{"checked"===t?e.change("massAccredit.accreditationsSlotsIds",(0,Oo.A)(e.accreditationsSlotsIds.concat(o))):e.change("massAccredit.accreditationsSlotsIds",(0,Jd.A)(e.accreditationsSlotsIds,o))}})}),(0,i.jsx)(Tc,{children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(Tc,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(Tc,{})]}),n.map(t=>(0,i.jsx)(Yk,{accreditationsSlotsIds:e.accreditationsSlotsIds,shouldDisplayList:a,slot:t,onClick:r},t.id))]})}):(0,i.jsx)(qk,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,slot:n[0],onClick:r})},Zk=e=>{const t=(0,F.useMemo)(()=>(0,Zd.A)(e.accreditations.filter(t=>t.accreditationCategoryId===e.category.id),e=>e.name.toLowerCase()),[]);return(0,i.jsx)(Kj,{category:e.category,children:t.map(t=>(0,i.jsx)(Kk,{accreditation:t,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,slots:e.slots,strategy:e.strategy},t.id))})},Xk=e=>{const t=Ln(),[n,o]=(0,F.useState)(!1),[s,r]=(0,F.useState)(e.excludeEmpty?"checked":"unchecked"),[a,l]=(0,F.useState)(e.excludeFull?"checked":"unchecked"),[d,c]=(0,F.useState)(e.excludePast?"checked":"unchecked"),u=(e.excludeEmpty?1:0)+(e.excludeFull?1:0)+(e.excludePast?1:0);return(0,i.jsxs)(Ea,{css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"3",children:[(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_une_65646"),value:e.name,onChange:t=>{e.setName(t)}})}),(0,i.jsxs)(Dj,{apply:()=>{e.setExcludeEmpty("checked"===s),e.setExcludeFull("checked"===a),e.setExcludePast("checked"===d),o(!1)},color:"white",isOpen:n,numberOfAppliedFilters:u,reinit:()=>{e.setExcludeEmpty(!1),r("unchecked"),e.setExcludeFull(!1),l("unchecked"),e.setExcludePast(!1),c("unchecked"),e.setName(""),o(!1)},showButtons:!0,onStateChange:o,children:[(0,i.jsx)(nc,{state:s,onClick:r,children:t("cacher_les_cr_n_76382")}),(0,i.jsx)(nc,{state:a,onClick:l,children:t("cacher_les_cr_n_31908")}),(0,i.jsx)(nc,{state:d,onClick:c,children:t("masquer_les_cr_05336")})]})]})},Jk=e=>{const t=Ln(),[n,o,s]=Ec(""),[r,a]=(0,F.useState)(!1),[l,d]=(0,F.useState)(!1),[c,u]=(0,F.useState)(!1),{data:m,loader:g}=Vn("query MassAccreditSlots(\n    $eventId: EventId!\n    $delegationId: DelegationId\n    $accreditationName: String\n    $excludeFull: Boolean\n    $excludeEmpty: Boolean\n    $excludePast: Boolean\n) {\n    event(id: $eventId) {\n        accreditationsSlots(\n            delegationId: $delegationId\n            accreditationName: $accreditationName\n            includeHidden: true\n            excludeFull: $excludeFull\n            excludeEmpty: $excludeEmpty\n            excludePast: $excludePast\n        ) {\n            nodes {\n                id\n                name\n                assignedResources\n                maxResources\n                date\n                isBlocked\n                isFull\n\n                accreditation {\n                    id\n                    accreditationCategoryId\n                    name\n                    accreditationDisplay\n                    hasSlots\n                    color\n                    icon\n                }\n\n                accreditationCategory {\n                    id\n                    name\n                }\n            }\n        }\n    }\n}\n",{eventId:e.eventId,delegationId:e.delegationId,accreditationName:h(o)?o:void 0,excludeEmpty:r,excludeFull:l,excludePast:c},[]);const p=(0,F.useMemo)(()=>(m.event?.accreditationsSlots.nodes??[]).filter(e=>!e.isBlocked),[m.event]),f=(0,F.useMemo)(()=>(0,Zd.A)((0,Ju.A)(p.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[p]),x=(0,F.useMemo)(()=>(0,Ju.A)(p.map(e=>e.accreditation),e=>e.id),[p]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Xk,{excludeEmpty:r,excludeFull:l,excludePast:c,name:n,setExcludeEmpty:a,setExcludeFull:d,setExcludePast:u,setName:s}),(0,i.jsx)(Pa,{height:"6"}),g||(0,i.jsx)(Yj,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:f.map(t=>(0,i.jsx)(Zk,{accreditations:x,accreditationsSlotsIds:e.values.massAccredit.accreditationsSlotsIds,category:t,change:e.change,slots:p,strategy:e.values.massAccredit.strategy},t.id))}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{isLoading:e.submitting,onClick:e.handleSubmit,children:h(e.buttonText)?e.buttonText:t(e.values.massAccredit.strategy===Je.Add?"accr_diter_les_78545":e.values.massAccredit.strategy===Je.Replace?"r_accr_diter_le_34059":"d_saccr_diter_l_28590",e.numberOfSelected)})})]})},Qk=({eventId:e,numberOfSelected:t,onClose:n,onSuccess:o,selecteds:s})=>{const r=Ln(),a=Nn(Fk),{mutate:l}=ps();return(0,i.jsx)(Mk,{children:(0,i.jsx)(bm,{category:r("Accreditation"),title:r("accr_diter_les_48281"),onClose:n,children:(0,i.jsx)(Im,{children:(0,i.jsxs)(kv,{initialValues:{massAccredit:{selecteds:s,strategy:Je.Add,accreditationsSlotsIds:[]}},isEdit:!1,onSubmit:async t=>{const i=(await l({eventId:e,massAccredit:t.massAccredit})).numberOfMembers;o(r("_1_membres_ont_05068",i)),n()},children:[(0,i.jsx)(yv,{render:({handleSubmit:e})=>(0,i.jsx)(Nk,{handleSubmit:e}),schema:a.massAccreditStep1Schema(),title:r("initialisation_38640")}),(0,i.jsx)(yv,{render:({form:n,handleSubmit:o,submitting:s,values:r})=>(0,i.jsx)(Jk,{change:n.change,delegationId:null,eventId:e,handleSubmit:o,numberOfSelected:t,submitting:s,values:r}),schema:a.massAccreditStep2Schema(),title:r("accr_ditations_39450")})]})})})})},eA=e=>{const{history:t,translate:n}=il(),{mutate:o,isLoading:r}=Js(),[a,l]=(0,F.useState)([]),d=Zo(a);return(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ea,{justify:"center",children:(0,i.jsx)(mj,{color:"primary",icon:"people-group"})}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{font:"gray900 textLg medium",textAlign:"center",children:n("SendCampaign")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(dc,{isSearchVisible:!0,label:n("campagne_97871"),values:a,onChange:l,children:e.campaigns.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),e.canCreate&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(pl,{color:"invisible",leftIcon:"plus",onClick:()=>{const n=s(JSON.stringify({usersInfosIds:e.selecteds.ids}));t.push(rI.CREATE({organizationId:e.organizationId,eventId:e.eventId||void 0,options:n}))},children:n("cr_er_une_nouve_86635")})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{disabled:!d,isLoading:r,onClick:async()=>{if(Zo(a)){const t=e.campaigns.find(e=>e.id===a[0]),i=(await o({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegationId,selecteds:e.selecteds,campaignId:a[0]})).numberOfMembers;e.onSuccess(n("la_campagne_1_62015",t.name,i)),e.onClose()}},children:n("envoyer_26609")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},tA=e=>{const{data:t}=Vn("query MassCampaignSendCampaigns(\n    $organizationId: OrganizationId!\n    $level: OrganizationEventLevel!\n    $eventId: EventId\n) {\n    organization(id: $organizationId) {\n        campaigns(level: $level, eventId: $eventId) {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n}\n",{organizationId:e.organizationId,level:e.eventId?et.Event:et.Organization,eventId:e.eventId},[]);return(0,i.jsx)(eA,{campaigns:t.organization?.campaigns.nodes??[],canCreate:!0,delegationId:null,eventId:e.eventId,organizationId:e.organizationId,selecteds:e.selecteds,onClose:e.onClose,onSuccess:e.onSuccess})},nA=e=>{const{translate:t}=il(),n=Nn(Fk),{mutate:o}=Qs();return(0,i.jsx)(Mk,{children:(0,i.jsx)(bm,{category:t("Accreditation"),title:t("update_desired_accreditations"),onClose:e.onClose,children:(0,i.jsx)(Im,{css:{py:"$7"},children:(0,i.jsxs)(kv,{initialValues:{massAccredit:{selecteds:e.selecteds,strategy:Je.Add,accreditationsSlotsIds:[]}},isEdit:!1,onSubmit:async t=>{await o({eventId:e.eventId,delegationId:e.delegationId,massAccredit:t.massAccredit}),e.onSuccess(),e.onClose()},children:[(0,i.jsx)(yv,{render:({handleSubmit:e})=>(0,i.jsx)(Nk,{handleSubmit:e}),schema:n.massAccreditStep1Schema(),title:t("initialisation_38640")}),(0,i.jsx)(yv,{render:({form:n,handleSubmit:o,values:s,submitting:r})=>(0,i.jsx)(Jk,{buttonText:s.massAccredit.strategy===Je.Delete?t("supprimer_les_a_93519"):t("update_desired_accreditations"),change:n.change,delegationId:e.delegationId,eventId:e.eventId,handleSubmit:o,numberOfSelected:e.numberOfSelected,submitting:r,values:s}),schema:n.massAccreditStep2Schema(),title:t("accr_ditations_39450")})]})})})})},iA=e=>{const{translate:t,params:{organizationId:n,eventId:o,delegationId:s}}=il(),{mutate:r}=As(),{mutate:a}=Bs(),{mutate:l}=Es(),[d,c]=(0,F.useState)(!1),[u,h]=(0,F.useState)(!1),[m,g]=(0,F.useState)(!1),[p,f]=(0,F.useState)(!1),[x,_]=(0,F.useState)(!1),I=e.massActions.getSelectedsInput(null,null),v=e.showAccreditationsValidate||Zo(e.campaigns)||e.showDelete;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pl,{color:"invisible-gray",leftIcon:"pen",onClick:()=>{c(!0)},children:t("_diter_un_champ_64621")}),e.showWishedAccreditationsEdit&&(0,i.jsx)(pl,{color:"invisible-gray",leftIcon:"wand-magic-sparkles",onClick:()=>{h(!0)},children:t("_diter_les_accr_41957")}),e.showAccreditationsEdit&&(0,i.jsx)(pl,{color:"invisible-gray",leftIcon:"wand-magic-sparkles",onClick:()=>{g(!0)},children:t("_diter_les_accr_86042")}),v&&(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"invisible-gray",rightIcon:"chevron-down",children:t("plus_77692")})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[e.showAccreditationsValidate&&(0,i.jsx)(Od,{icon:"check",onClick:async()=>{await a({eventId:o,delegationId:s,usersInfosIds:I.ids}),e.onMassEditSuccess()},children:t("valider_les_acc_80801")}),Zo(e.campaigns)&&(0,i.jsx)(Od,{icon:"paper-plane",onClick:()=>{f(!0)},children:t("SendCampaign")}),e.showDelete&&(0,i.jsx)(Od,{color:"red",icon:"user-xmark",onClick:()=>_(!0),children:t("retirer_de_la_d_64963")})]})]}),d&&(0,i.jsx)(Dk,{customFields:e.customFields,mutate:e=>r({organizationId:n,eventId:o,delegationId:s,massEdit:e}),selecteds:I,onClose:()=>{c(!1)},onSuccess:e.onMassEditSuccess}),u&&(0,i.jsx)(nA,{delegationId:s,eventId:o,numberOfSelected:e.massActions.numberOfSelected,selecteds:I,onClose:()=>{h(!1)},onSuccess:e.onMassEditSuccess}),m&&(0,i.jsx)(Qk,{eventId:o,numberOfSelected:e.massActions.numberOfSelected,selecteds:I,onClose:()=>{g(!1)},onSuccess:e.onMassEditSuccess}),p&&(0,i.jsx)(eA,{campaigns:e.campaigns,canCreate:!1,delegationId:s,eventId:o,organizationId:n,selecteds:I,onClose:()=>{f(!1)},onSuccess:e.onMassEditSuccess}),x&&(0,i.jsx)(kk,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_sur_d_29974"),text:t("suppression_de_57689",I.ids?.length??0),onClose:()=>_(!1),onDelete:async()=>{await l({organizationId:n,eventId:o,delegationId:s,selecteds:I,deleteFromEvent:e.deleteFromEvent}),e.onMassEditSuccess()}})]})};function oA(e){return(0,Zd.A)((0,Ju.A)(e,e=>e.accreditation.id).map(t=>({...t.accreditation,accreditationCategory:t.accreditationCategory,slots:Ih(e.filter(e=>e.accreditation.id===t.accreditation.id))})),e=>[e.accreditationCategory.name.toLowerCase(),Bj(e.index),e.name.toLowerCase()])}function sA(e,t){return e.flatMap(e=>{const n=e.slots.map(e=>e.id),i=Xo(t)?e.slots.length:(0,Zu.A)(n,t).length;return 0===i?[]:[{...e,numberOfSlots:i}]})}function rA(e,t){return e.flatMap(e=>e.slots.filter(e=>Xo(t)||t.includes(e.id)))}const aA=e=>{const{translate:t}=il(),n=F.useRef(null),o=Nn($c);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{ref:n,css:{background:"white",border:"1px solid $gray200"},children:[(0,i.jsxs)(Ea,{css:{width:"calc(2 * $cellWidth)"},direction:"column",children:[(0,i.jsx)(Ea,{align:"center",css:{borderBottom:"1px solid $gray200",borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},width:1,children:(0,i.jsx)(dc,{isSearchVisible:!0,isSelectAllVisible:!0,menuWidth:300,multiple:!0,triggerElem:(0,i.jsxs)(pl,{color:"white",leftIcon:"bars-filter",size:"sm",children:[t("accr_ditations_39450"),Zo(e.selectedSlotsIds)&&` (${e.selectedSlotsIds.length})`]}),values:e.selectedSlotsIds,onChange:e.setSelectedSlotsIds,children:e.allAccreditations.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.slots.map(t=>(0,i.jsx)("option",{value:t.id,children:ph(o,t,e.name,{accreditation:{includeNameAtEnd:!0}})},t.id))},e.id))})}),(0,i.jsx)(Ea,{css:{borderRight:"1px solid $gray200",height:"$cellHeightSm"},width:1,onClick:()=>{n.current?.requestFullscreen()}}),e.data.map(t=>e.renderLeftColumn(t))]}),(0,i.jsx)(Ea,{css:{flex:"1",overflowX:"auto"},children:(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(Ea,{css:{borderBottom:"1px solid $gray200",height:"$cellHeightSm"},children:e.filteredAccreditations.map(t=>{const n=h(t.acronym)?t.acronym:t.name;return(0,i.jsxs)(Ea,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`calc(${t.numberOfSlots} * ${e.cellWidth}px)`},direction:"column",height:1,justify:"center",children:[(0,i.jsx)(fr,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:n,width:1,children:n}),(0,i.jsx)(fr,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:t.accreditationCategory.name,width:1,children:t.accreditationCategory.name})]},t.id)})}),(0,i.jsx)(Ea,{css:{height:"$cellHeightSm"},children:e.slots.map(t=>{const n=t.date?.isValid?o.toLocaleString(t.date,Ho.DateOnly.Numeric):"-";return(0,i.jsxs)(Ea,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`${e.cellWidth}px`},direction:"column",height:1,justify:"center",children:[(0,i.jsx)(fr,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:t.name||"-",width:1,children:t.name||"-"}),(0,i.jsx)(fr,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:n,width:1,children:n})]},t.id)})}),e.data.map(t=>e.renderRow(t))]})})]}),(0,i.jsx)(yc,{children:(0,i.jsx)(jc,{limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,setLimit:e.setLimit,setOffset:e.setOffset,showLimits:!0,totalCount:e.totalCount})})]})},lA=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.isAutoAccredit?[e.accreditationSlotId]:[]),[e.vr]),o=(0,F.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.isAutoAccredit?[]:[e.accreditationSlotId]),[e.vr]),s=(0,F.useMemo)(()=>(e.vr.matrixWishedSlots||[]).map(e=>e.id),[e.vr]);return(0,i.jsx)(Ea,{css:{borderTop:"1px solid $gray200",height:"$cellHeightSm"},children:e.slotsIds.map(r=>{const a=n.includes(r),l=o.includes(r),d=s.includes(r),c=e.isEditMode&&("assigned"===e.editMode&&(a||l)||"wished"===e.editMode&&d),u=e.isEditMode&&("assigned"===e.editMode&&!(a||l)||"wished"===e.editMode&&!d);return(0,i.jsxs)(Ea,{align:"center",css:{borderRight:"1px solid $gray200",padding:"$3 $4",width:"$cellWidth","& > .h-accreditations-matrix-cell":{display:"flex"},"&:hover > .h-accreditations-matrix-cell":{display:"none"},"& > .h-accreditations-matrix-edit-cell":{display:"none"},"&:hover > .h-accreditations-matrix-edit-cell":{display:"flex"}},height:1,children:[c&&(0,i.jsx)(Ea,{align:"center",className:"h-accreditations-matrix-edit-cell",css:{background:"$error200",bd:"error500 1",color:"$error700",cursor:"pointer"},height:1,justify:"center",width:1,onClick:async()=>{await e.deleteAccreditationSlot(e.vr.userInfo.id,r),e.reloadRow(e.vr.id)},children:(0,i.jsx)(Va,{icon:"trash-can"})}),u&&(0,i.jsx)(Ea,{align:"center",className:"h-accreditations-matrix-edit-cell",css:{background:"$primary200",bd:"primary500 1",color:"$primary700",cursor:"pointer"},height:1,justify:"center",width:1,onClick:async()=>{await e.addAccreditationSlot(e.vr.userInfo.id,r),e.reloadRow(e.vr.id)},children:(0,i.jsx)(Va,{icon:"plus"})}),a||l?(0,i.jsx)(Ea,{align:"center",className:e.isEditMode?"h-accreditations-matrix-cell":"",css:{background:"$success200",bd:"success500 1",color:"$success700",fontSize:"$textMd"},height:1,justify:"center",width:1,children:(0,i.jsx)(Va,{icon:n.includes(r)?"bolt-auto":"check"})}):d?(0,i.jsx)(Ea,{align:"center",className:e.isEditMode?"h-accreditations-matrix-cell":"",css:{background:"white",bd:"gray300 1",borderStyle:"dashed"},height:1,justify:"center",width:1,children:(0,i.jsx)(fr,{font:"gray800 textXs medium",children:t("souhait_e_52100")})}):null]},r)})})},dA=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>oA(e.allAccreditationsSlots),[e.allAccreditationsSlots]),o=(0,F.useMemo)(()=>sA(n,e.selectedSlotsIds),[n,e.selectedSlotsIds]),s=(0,F.useMemo)(()=>rA(o,e.selectedSlotsIds),[o,e.selectedSlotsIds]),r=(0,F.useMemo)(()=>s.map(e=>e.id),[s]),a=(0,F.useCallback)(e=>(0,i.jsx)(Ea,{css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},width:1,children:(0,i.jsx)(Eb,{size:32,userInfo:e.userInfo})},e.userInfo.id),[]),l=(0,F.useCallback)(t=>e.isRowLoading(t.id)?(0,i.jsx)(zc,{css:{border:"none",borderTop:"1px solid $gray200",height:"$cellHeightSm"}},t.userInfo.id):(0,i.jsx)(lA,{addAccreditationSlot:e.addAccreditationSlot,deleteAccreditationSlot:e.deleteAccreditationSlot,editMode:e.editMode,isEditMode:e.isEditMode,reloadRow:e.reloadRow,slotsIds:r,vr:t},t.userInfo.id),[e.addAccreditationSlot,e.deleteAccreditationSlot,e.editMode,e.isEditMode,e.isRowLoading,e.reloadRow,r]);return(0,i.jsx)(Ea,{direction:"column",width:1,children:e.isLoading?(0,i.jsx)(ul,{}):Xo(e.members)||Xo(o)?(0,i.jsx)(Ea,{css:{background:"white",border:"1px solid $gray200"},height:400,children:Xo(e.members)?(0,i.jsx)(rk,{imageSrc:od.Blanks.Member,title:t("aucun_membre_ne_07054")}):(0,i.jsx)(rk,{imageSrc:od.Blanks.Accreditation,title:t("aucune_accr_dit_97505")})}):(0,i.jsx)(aA,{allAccreditations:n,cellWidth:120,data:e.members,filteredAccreditations:o,limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,renderLeftColumn:a,renderRow:l,selectedSlotsIds:e.selectedSlotsIds,setLimit:e.setLimit,setOffset:e.setOffset,setSelectedSlotsIds:e.setSelectedSlotsIds,slots:s,totalCount:e.totalCount})})},cA=e=>{const{params:{eventId:t,delegationId:n}}=il(),{data:o,idToLoading:s,isEditMode:r,isLoading:a,limit:l,numberOfPages:d,offset:c,reloadRow:u,setLimit:h,setOffset:m,totalCount:g}=Uh(),{mutate:p}=Qs(),{data:f,isLoading:x}=Vn("query DelegationMembersAccreditationsMatrix($eventId: EventId!, $delegationId: DelegationId!) {\n    event(id: $eventId) {\n        delegation(id: $delegationId) {\n            accreditationsSlots(onlyVisible: true) {\n                accreditationSlot {\n                    ...AccreditationSlotMatrix\n                }\n            }\n        }\n    }\n}\n",{eventId:t,delegationId:n},[Ro.AccreditationSlotMatrixFragment]),_=(0,F.useMemo)(()=>(f.event?.delegation.accreditationsSlots??[]).map(e=>e.accreditationSlot),[f]),I=(0,F.useCallback)(e=>s[e]??!1,[s]),v=(0,F.useCallback)((e,i)=>p({eventId:t,delegationId:n,massAccredit:{accreditationsSlotsIds:[i],selecteds:{ids:[e]},strategy:Je.Add}}),[t,n,p]),b=(0,F.useCallback)((e,i)=>(console.log("delete accreditation slot",{eventId:t,delegationId:n,userInfoId:e,accreditationSlotId:i}),p({eventId:t,delegationId:n,massAccredit:{accreditationsSlotsIds:[i],selecteds:{ids:[e]},strategy:Je.Delete}})),[t,n,p]);return(0,i.jsx)(dA,{addAccreditationSlot:v,allAccreditationsSlots:_,deleteAccreditationSlot:b,editMode:"wished",isEditMode:r,isLoading:a||x,isRowLoading:I,limit:l,members:o,numberOfPages:d,offset:c,reloadRow:u,selectedSlotsIds:e.selectedSlotsIds,setLimit:h,setOffset:m,setSelectedSlotsIds:e.setSelectedSlotsIds,totalCount:g})},uA=e=>{const{params:{organizationId:t,eventId:n,delegationId:o}}=il(),s=Nn(Eh),r=qn(),[a,l,d]=wC(t,"eventDelegationMembers.columns",e.columns),[c,u,h]=wC(t,"eventDelegationMembers.limit",_c),[m,g,p]=wC(t,"eventDelegationMembers.predicates",[]),[f,x,_]=wC(t,"eventDelegationMembers.rendering",yh.List),[I,v,b]=wC(t,"eventDelegationMembers.selectedSlotsIds",[]),[j,C,y]=wC(t,"eventDelegationMembers.sort",null),{data:k,isLoading:A}=Vn("query EventDelegationMembersInfos(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $delegationId: DelegationId!\n    $privacy: CustomFieldPrivacy!\n) {\n    organization(id: $organizationId) {\n        weezeventOrganizationId\n\n        customFields(variety: UserInfo, privacy: $privacy) {\n            nodes {\n                ...SegmentCustomField\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        startAt\n        endAt\n        isWeezeventConnected\n\n        customDocuments {\n            ...CustomDocumentPopulation\n        }\n\n        delegation(id: $delegationId) {\n            numberOfDelegationsAccreditationsSlots\n\n            accreditationsSlots(onlyDefault: true, onlyHidden: true) {\n                accreditationSlotId\n            }\n\n            columnsCustomFields {\n                ...SegmentCustomField\n            }\n\n            form {\n                positionDisplay\n                slotDisplay\n\n                elements {\n                    customField {\n                        ...SegmentCustomField\n                    }\n                }\n            }\n        }\n    }\n}\n",{organizationId:t,eventId:n,delegationId:o,privacy:e.customFieldsPrivacy},[Ro.SegmentCustomFieldFragment,Ro.CustomDocumentPopulationFragment]);const w=d||h||p||_||b||y||A,S=(0,F.useMemo)(()=>e.customFieldsPrivacy===fe.All?k.organization?.customFields.nodes??[]:(0,Da.A)((k.event?.delegation.form.elements.map(e=>e.customField)||[]).concat(k.event?.delegation.columnsCustomFields||[])),[e.customFieldsPrivacy,k.organization,k.event]),E=SC(S),T=(0,F.useMemo)(()=>k.event?s.getDelegationMembersFilters(t,n,S,k.event,k.event.delegation.form,k.event.isWeezeventConnected):[],[n,S,k.event]),z=(0,F.useMemo)(()=>k.event?s.getDelegationMembersPossibleColumns(S,{isWeezeventConnected:k.event.isWeezeventConnected,positionDisplay:k.event.delegation.form.positionDisplay,slotDisplay:k.event.delegation.form.slotDisplay}):[],[S,k.event]),$=(0,F.useMemo)(()=>(k.event?.delegation.accreditationsSlots??[]).map(e=>e.accreditationSlotId),[k.event]),O=(0,F.useMemo)(()=>"function"==typeof e.showEditMode?e.showEditMode(f):e.showEditMode,[e.showEditMode,f]),R=(k.event?.delegation.numberOfDelegationsAccreditationsSlots??0)>0;return(0,F.useEffect)(()=>{r.setItem(El.DELEGATIONS_SPACE_TAB,"members")},[]),w?(0,i.jsx)(ul,{}):(0,i.jsx)(Zh,{columns:e.canEditColumns?a:e.columns,columnsSearch:[],columnsToIncludes:Sh,eventId:n,filters:T,getMassActionId:e=>e.userInfo.id,limit:c,loadDataList:Xs,loadDataListParams:{delegationId:o,onlyVisibleAccreditationsSlots:e.onlyVisibleAccreditationsSlots,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:Ks,loadRowParams:{delegationId:o,onlyVisibleAccreditationsSlots:e.onlyVisibleAccreditationsSlots,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:t,possibleColumns:z,possibleRenderings:[yh.List,yh.AccreditationsMatrix],predicates:m,renderActions:(t,n,o)=>(0,i.jsx)(iA,{campaigns:e.campaigns,customFields:S,deleteFromEvent:e.deleteFromEvent,massActions:t,showAccreditationsEdit:e.showAccreditationsEdit,showAccreditationsValidate:e.showAccreditationsValidate,showDelete:e.canDeleteMembers,showWishedAccreditationsEdit:R,onMassEditSuccess:o}),rendering:f,setColumns:l,setLimit:u,setPredicates:g,setRendering:x,setSort:C,showEditColumns:f===yh.List&&e.canEditColumns,showEditMode:O,showFilters:!0,showMassActions:e.canEditMembers,showRowDropdown:!0,showRowEdit:e.canEditMembers,showSearchColumns:!1,sort:j,children:f===yh.AccreditationsMatrix?(0,i.jsx)(cA,{selectedSlotsIds:I,setSelectedSlotsIds:v}):(0,i.jsx)(cm,{getEditPath:e.getEditPath,renderCell:(s,r,a)=>(0,i.jsx)(My,{accreditationsPanelPath:to.DELEGATION_MEMBER_ACCREDITATIONS({organizationId:t,eventId:n,delegationId:o,userInfoId:r.userInfo.id}),availabilitiesPanelPath:to.DELEGATION_MEMBER_AVAILABILITIES({organizationId:t,eventId:n,delegationId:o,userInfoId:r.userInfo.id}),canAccredit:e.canAccredit,canAssign:!1,canChangeDelegation:!1,canClickMemberName:e.canClickMemberName,column:s,customField:E.get(s.slug),eventId:n,positionsPanelPath:to.DELEGATION_MEMBER_POSITIONS({organizationId:t,eventId:n,delegationId:o,userInfoId:r.userInfo.id}),reloadRow:a,row:r}),renderRowDropdown:(t,n)=>(0,i.jsx)(Ak,{accreditationState:t.accreditationState,allowedCustomDocuments:e.customBadges,canAccredit:e.canAccredit,canDelete:e.canDeleteMembers&&t.canDelete,customDocuments:k.event?.customDocuments??[],deleteFromEvent:e.deleteFromEvent,member:t.userInfo,reload:n,showDeleteFromEvent:e.showDeleteFromEvent,showDocumentsDownload:e.showDocumentsDownload,volunteerRegistrationId:t.id}),renderRowPanels:(s,r)=>(0,i.jsx)(Ck,{accreditationsPanelPath:to.DELEGATION_MEMBER_ACCREDITATIONS({organizationId:t,eventId:n,delegationId:o,userInfoId:s.userInfo.id}),availabilitiesPanelPath:to.DELEGATION_MEMBER_AVAILABILITIES({organizationId:t,eventId:n,delegationId:o,userInfoId:s.userInfo.id}),canAccredit:e.canAccredit,canCheckIn:!1,canDeletePosition:()=>!1,canEditWishedAccreditations:!0,defaultHiddenAccreditationsSlotsIds:$,delegationId:o,eventId:n,organizationId:t,positionsPanelPath:to.DELEGATION_MEMBER_POSITIONS({organizationId:t,eventId:n,delegationId:o,userInfoId:s.userInfo.id}),reloadRow:r,returnPathFallback:to.DELEGATION_MEMBERS({organizationId:t,eventId:n,delegationId:o}),volunteerRegistration:s})})})};function hA(e){return{includeDelegations:e.includes("delegations")||e.includes("delegations_categories"),includeEvents:e.includes("events")||e.includes("number_of_events"),includeForms:e.includes("forms")||e.includes("forms_inserted_at"),includeTags:e.includes("tags"),includeRoles:e.includes("roles")}}let mA=class extends Xc{constructor(e,t,n){super(e,t,n)}getOrganizationUsersFilters(e,t,n){return[...this.getBaseFilters(n.customFields.nodes),...this.getEventsFilters(e),...this.getFormsFilters(e),...this.getPositionsFilters(),...this.getDelegationsFilters(e),...this.getEmailsFilters(e),...this.getCommentsFilters(),{slug:"tag",name:this.t("Tag"),category:this.t("autres_99130"),fieldType:Be.Select,needLoading:!0,organizationId:e,tagContext:vt.UsersInfos},{slug:"sameEmail",name:this.t("nombre_de_profi_42316"),category:this.t("autres_99130"),fieldType:Be.Number,hideEmpty:!0},{slug:"segments",name:this.t("fait_partie_de_44650"),category:this.t("autres_99130"),fieldType:Be.Select,values:n.segmentsFolders.flatMap(e=>e.segments).filter(e=>e.id!==t),hideEmpty:!0},{slug:"isAdmin",name:this.t("est_administrat_15766"),category:this.t("autres_99130"),fieldType:Be.Checkbox},{slug:"isLeader",name:this.t("est_responsable_27270"),category:this.t("autres_99130"),fieldType:Be.Checkbox}]}getDelegationMembersFilters(e){return this.getBaseFilters(e)}getOrganizationUsersPossibleColumns(e){return[...this.getBaseColumns(),{slug:"events",name:this.t("_v_nements_53672"),minWidth:320},{slug:"number_of_events",name:this.t("nombre_d_v_nem_14214"),width:230},{slug:"forms",name:this.t("formulaires_rem_62495"),minWidth:320},{slug:"forms_inserted_at",name:this.t("dates_de_rempli_65075"),minWidth:320},{slug:"delegations",name:this.t("d_l_gations_78318"),isSearchable:!0,minWidth:320},{slug:"delegations_categories",name:this.t("cat_gories_de_d_45259"),minWidth:320},{slug:"inserted_at",name:this.t("date_d_inscript_31369"),isSortable:!0,sortAttribute:St.InsertedAt,width:230},{slug:"tags",name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:"roles",name:this.t("r_les_61679"),minWidth:320},...this.customFieldsToPossibleColumns(e)]}getDelegationMembersPossibleColumns(e){return[...this.getBaseColumns(),...this.customFieldsToPossibleColumns(e)]}getBaseColumns(){return[{slug:"name",name:this.t("full_name"),isSearchable:!0,isSortable:!0,sortAttribute:St.Name,minWidth:240},{slug:"email",name:this.t("e_mail_du_membr_69509"),isSearchable:!0,minWidth:180},{slug:"id",name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:St.Id,width:100}]}getBaseFilters(e){return[{slug:"email",name:this.t("Email"),category:this.t("champs_de_formu_64126"),fieldType:Be.Text},{slug:"registrationDate",name:this.t("date_d_inscript_31369"),category:this.t("champs_de_formu_64126"),fieldType:Be.Date,hideEmpty:!0},...this.customFieldsToFilters(e)]}getEventsFilters(e){return[{slug:"event",name:this.t("_v_nement_22345"),category:this.t("Event"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"numberOfEvents",name:this.t("nombre_d_v_nem_14214"),category:this.t("Event"),fieldType:Be.Number,hideEmpty:!0}]}getFormsFilters(e){return[{slug:"forms",name:this.t("formulaires_rem_62495"),category:this.t("Form_plural"),fieldType:Be.Select,needLoading:!0,organizationId:e},{slug:"formsInsertedAt",name:this.t("dates_de_rempli_65075"),category:this.t("Form_plural"),fieldType:Be.Date,hideEmpty:!0,needLoading:!0,organizationId:e}]}getPositionsFilters(){return[{slug:"positionName",name:this.t("nom_de_la_missi_80169"),category:this.t("missions_63972"),fieldType:Be.Text,hideEmpty:!0},{slug:"positionCategoryName",name:this.t("nom_de_la_cat_g_57279"),category:this.t("missions_63972"),fieldType:Be.Text,hideEmpty:!0},{slug:"numberOfAssignments",name:this.t("nombre_d_affect_31455"),category:this.t("missions_63972"),fieldType:Be.Number,hideEmpty:!0}]}getDelegationsFilters(e){return[{slug:"delegation",name:this.t("fait_partie_de_32196"),category:this.t("d_l_gations_78318"),fieldType:Be.Select,needLoading:!0,organizationId:e},{slug:"delegationCategory",name:this.t("inscrit_via_la_12241"),category:this.t("d_l_gations_78318"),fieldType:Be.Select,needLoading:!0,organizationId:e},{slug:"isDelegationLeader",name:this.t("est_responsable_87662"),category:this.t("d_l_gations_78318"),fieldType:Be.Checkbox}]}getEmailsFilters(e){return[{slug:"campaign",name:this.t("campagne_97871"),category:this.t("e_mails_09850"),fieldType:Be.Campaign,needLoading:!0,organizationId:e},{slug:"emailBlacklist",name:this.t("ne_souhaite_plu_08853"),category:this.t("e_mails_09850"),fieldType:Be.Checkbox,hideEmpty:!0}]}getCommentsFilters(){return[{slug:"comments",name:this.t("commentaires_96492"),category:this.t("commentaires_96492"),fieldType:Be.Text},{slug:"lastCommentAt",name:this.t("date_du_dernier_73554"),category:this.t("commentaires_96492"),fieldType:Be.Date,hideEmpty:!0}]}};mA=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hc,$c,Dn])],mA);const gA=e=>{const t=(0,F.useMemo)(()=>(e.user.events||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.user]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:t})})},pA=e=>{const{params:{organizationId:t}}=il(),n=Nn($c),{mutate:o}=function(e={}){return Un("mutation UserInfoUpdateField(\n    $organizationId: OrganizationId!\n    $userInfoId: UsersInfoId!\n    $slug: String!\n    $value: JSON!\n) {\n    userInfoUpdateField(\n        organizationId: $organizationId\n        userInfoId: $userInfoId\n        slug: $slug\n        value: $value\n    ) {\n        id\n    }\n}\n",e)}(),s=(0,F.useCallback)((n,i)=>o({organizationId:t,userInfoId:e.row.id,slug:i,value:n}),[e.row,o]),r=(0,F.useMemo)(()=>(e.row.formsUsersInfos||[]).flatMap(e=>e.form?[{id:e.form.id,color:"gray",icon:null,text:e.form.name}]:[]),[e.row.formsUsersInfos]),a=(0,F.useMemo)(()=>(e.row.formsUsersInfos||[]).flatMap(e=>e.form?[`${e.form.name} : ${n.toLocaleString(e.insertedAt.toLocal(),Ho.DateTime)}`]:[]).join(", "),[e.row.formsUsersInfos]),l=(0,F.useMemo)(()=>(e.row.delegations||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.row.delegations]),d=(0,F.useMemo)(()=>(0,Ju.A)(e.row.delegations||[],e=>e.delegationCategory.id).map(e=>({id:e.delegationCategory.id,color:"gray",icon:null,text:e.delegationCategory.name})),[e.row.delegations]),c=(0,F.useMemo)(()=>(e.row.tags||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.row.tags]);return"name"===e.column.slug?(0,i.jsx)(QC,{canClickMemberName:e.canClickMemberName,column:e.column,mutate:s,reload:e.reloadRow,updatable:e.updatable,userInfo:e.row}):"id"===e.column.slug?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):"picture"===e.column.slug?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Fg,{email:e.row.email,image:e.row.picture?.url,name:e.row.name,size:32})}):"email"===e.column.slug?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.email}):"events"===e.column.slug?(0,i.jsx)(gA,{column:e.column,user:e.row}):"number_of_events"===e.column.slug?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.events?.length??0}):"forms"===e.column.slug?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:r})}):"forms_inserted_at"===e.column.slug?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:a,children:a})}):"delegations"===e.column.slug?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:l})}):"delegations_categories"===e.column.slug?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:d})}):"inserted_at"===e.column.slug?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:n.toLocaleString(e.row.insertedAt.toLocal(),Ho.DateTime)}):"tags"===e.column.slug?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:c})}):"roles"===e.column.slug?(0,i.jsx)(ty,{minWidth:e.column.minWidth,userPermissions:e.row,width:e.column.width}):(0,i.jsx)(JC,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:s,reload:e.reloadRow,updatable:e.updatable})},fA=e=>{const{params:{organizationId:t,delegationId:n}}=il(),o=Nn(mA),s=qn(),[r,a,l]=wC(t,"organizationDelegationMembers.columns",e.columns),[d,c,u]=wC(t,"organizationDelegationMembers.limit",_c),[h,m,g]=wC(t,"organizationDelegationMembers.predicates",[]),[p,f,x]=wC(t,"organizationDelegationMembers.sort",null),{data:_,isLoading:I}=Vn("query OrganizationDelegationMembersInfos(\n    $organizationId: OrganizationId!\n    $delegationId: DelegationId!\n    $privacy: CustomFieldPrivacy!\n) {\n    organization(id: $organizationId) {\n        customFields(variety: UserInfo, privacy: $privacy) {\n            nodes {\n                ...SegmentCustomField\n            }\n        }\n\n        delegation(id: $delegationId) {\n            columnsCustomFields {\n                ...SegmentCustomField\n            }\n\n            form {\n                elements {\n                    customField {\n                        ...SegmentCustomField\n                    }\n                }\n            }\n        }\n    }\n}\n",{organizationId:t,privacy:e.isOrganizationAdmin?fe.All:fe.Public,delegationId:n},[Ro.SegmentCustomFieldFragment]);const v=l||u||g||x||I,b=(0,F.useMemo)(()=>e.isOrganizationAdmin?_.organization?.customFields.nodes??[]:(0,Da.A)((_.organization?.delegation.form.elements.map(e=>e.customField)||[]).concat(_.organization?.delegation.columnsCustomFields??[])),[_.organization]),j=SC(b),C=(0,F.useMemo)(()=>o.getDelegationMembersFilters(b),[b]),y=(0,F.useMemo)(()=>o.getDelegationMembersPossibleColumns(b),[b]);return(0,F.useEffect)(()=>{s.setItem(El.DELEGATIONS_SPACE_TAB,"members")},[]),v?(0,i.jsx)(ul,{}):(0,i.jsx)(Zh,{columns:e.canEditColumns?r:e.columns,columnsSearch:[],columnsToIncludes:hA,eventId:null,filters:C,limit:d,loadDataList:Ds,loadDataListParams:{delegationId:n},loadRow:Ps,organizationId:t,possibleColumns:y,predicates:h,renderActions:(t,n,o)=>(0,i.jsx)(iA,{campaigns:e.campaigns,customFields:b,deleteFromEvent:!1,massActions:t,showAccreditationsEdit:!1,showAccreditationsValidate:!1,showDelete:e.canDeleteMembers,showWishedAccreditationsEdit:!1,onMassEditSuccess:o}),rendering:yh.List,setColumns:a,setLimit:c,setPredicates:m,setSort:f,showEditColumns:e.canEditColumns,showEditMode:e.isOrganizationAdmin,showFilters:!0,showMassActions:!0,showRowDropdown:!0,showRowEdit:e.canEditMembers,showSearchColumns:!1,sort:p,children:(0,i.jsx)(cm,{getEditPath:e.getEditPath,renderCell:(t,n,o)=>(0,i.jsx)(pA,{canClickMemberName:e.canClickMemberName,column:t,customField:j.get(t.slug),reloadRow:o,row:n,updatable:e.canEditMembers}),renderRowDropdown:(t,n)=>(0,i.jsx)(Ak,{accreditationState:null,allowedCustomDocuments:e.customBadges,canAccredit:!1,canDelete:e.canDeleteMembers,customDocuments:[],deleteFromEvent:!1,member:t,reload:n,showDeleteFromEvent:!1,showDocumentsDownload:e.showDocumentsDownload,volunteerRegistrationId:null})})})};function xA(){return gc(sr.desktop)}const _A=e=>{const t=xA(),n=(0,F.useMemo)(()=>e.min.startOf("week").equals(e.value.startOf("week")),[e.min,e.value]),o=(0,F.useMemo)(()=>e.max.endOf("week").equals(e.value.endOf("week")),[e.max,e.value]);return(0,i.jsxs)(Ea,{gap:"2",children:[(0,i.jsx)(pl,{color:"white",disabled:n,leftIcon:"chevron-left",onClick:()=>{e.onChange(e.value.minus(t?{week:1}:{day:1}))}}),(0,i.jsx)(fr,{width:160,children:(0,i.jsx)(_u,{...e})}),(0,i.jsx)(pl,{color:"white",disabled:o,leftIcon:"chevron-right",onClick:()=>{e.onChange(e.value.plus(t?{week:1}:{day:1}))}})]})},IA=F.createContext({}),vA=e=>{const{days:t,interval:n}=F.useContext(IA),o=t[0],s=t[6]??t[0],r=F.useMemo(()=>(e.startAt??Fo.c9.max(o,n.start)).startOf("day"),[e.startAt,o,n]),a=F.useMemo(()=>(e.endAt??Fo.c9.min(s,n.end)).endOf("day"),[e.endAt,s,n]),l=F.useMemo(()=>"number"==typeof e.startHour&&e.startHour>0&&e.startAt?.isValid&&e.startAt.hour{const e=Math.max(r.diff(o,"days").days+1,1);return l?e-1:e},[l,r,o]),c=F.useMemo(()=>{const e=Math.min(Math.ceil(a.diff(o,"days").days)+1,8);return l?e-1:e},[l,a,o]);return r>s||a{const t=F.useMemo(()=>{if("week"===e.display){const t=e.date.startOf("week");return(0,vc.A)(0,7).map(e=>t.plus({day:e}))}return[e.date]},[e.date]),n=F.useMemo(()=>Fo.IX.fromDateTimes(e.minDate.startOf("day"),e.maxDate.endOf("day")),[e.minDate,e.maxDate]),[o,s]=F.useState(300),r=F.useCallback(e=>{if(e){const t=Math.max(Math.ceil(e.getBoundingClientRect().height),300);s(t)}},[e.date,s]),a=e.showBorder?{bd:!0,overflow:"hidden"}:{};return(0,i.jsx)(IA.Provider,{value:{days:t,interval:n},children:(0,i.jsxs)(Ea,{css:{...a,...e.css},direction:"column",children:[(0,i.jsx)(Ea,{css:{borderBottom:"1px solid $gray200"},height:60,width:1,children:t.map(e=>(0,i.jsxs)(Ea,{align:"center",css:{background:"$gray50"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(fr,{css:{textTransform:"capitalize"},font:"gray500 textXs medium",children:e.toLocaleString({weekday:"long"})}),(0,i.jsx)(fr,{font:"gray800 textXl semiBold",children:e.day})]},e.toISO()))}),(0,i.jsxs)(Ea,{className:"h-calendar-events-container",css:{position:"relative"},direction:"column",height:o,width:1,children:[(0,i.jsx)(Jl,{css:{flex:"1","& > div:last-child":{borderRight:"none"}},gridtemplatecolumns:"week"===e.display?"repeat(7, minmax(0, 1fr))":"1",gridtemplaterows:"1fr",width:1,children:t.map((e,t)=>(0,i.jsx)(Ea,{css:{background:n.contains(e)?"white":"$primary50",borderRight:"1px solid $gray200",gridColumn:`${t+1} / ${t+2}`,gridRow:"1 / 2"}},e.toISO()))}),(0,i.jsx)(Jl,{ref:r,css:{gridAutoFlow:"column",rowGap:"$2",position:"absolute",top:"0",py:"$2"},gridtemplatecolumns:"week"===e.display?"repeat(7, minmax(0, 1fr))":"1",width:1,children:e.children})]})]})})},jA=e=>{const{translate:t}=il(),n=e.member.accreditationsUsersInfos.some(t=>t.accreditationSlotId===e.accreditationSlotId);return(0,i.jsx)(Cc,{children:(0,i.jsxs)(xc,{children:[(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(Eb,{userInfo:e.member.userInfo})}),(0,i.jsx)(Ea,{align:"center",gap:"3",children:n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",gap:"1",children:[(0,i.jsx)(fr,{color:"success500",children:(0,i.jsx)(Va,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(fr,{font:"gray800 textXs medium",children:t("d_j_attribu_e_06450")})]}),(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsx)(Pd,{placement:"bottom-end",children:(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>e.deleteAccreditationSlot(e.member.userInfo.id,e.accreditationSlotId),children:t("retirer_l_accr_62187")})})]})]}):(0,i.jsx)(pl,{size:"sm",onClick:()=>e.addAccreditationSlot(e.member.userInfo.id,e.accreditationSlotId),children:t("ajouter_97327")})})]})})},CA=e=>{const t=Ln();return(0,i.jsx)(Ea,{css:{background:"white",bd:!0,padding:"$4 $6"},direction:"column",gap:"2",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1}),e.isWeezeventConnected&&(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"badge-check"})}),(0,i.jsx)(fr,{css:{flex:"1"},children:t("attribu_es_48167")}),(0,i.jsx)(fr,{children:e.stats.assignedResources})]}),(0,i.jsxs)(Ea,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"hand-holding-heart"})}),(0,i.jsx)(fr,{css:{flex:"1"},children:t("souhait_es_78101")}),(0,i.jsx)(fr,{children:e.stats.wishedResources})]}),e.isWeezeventConnected&&(0,i.jsxs)(Ea,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"scanner-gun"})}),(0,i.jsx)(fr,{css:{flex:"1"},children:t("scann_es_13169")}),(0,i.jsx)(fr,{children:e.stats.scannedResources})]})]})})},yA=e=>{const{params:{eventId:t,delegationId:n},translate:o}=il(),{mutate:s}=ps(),r=(0,F.useMemo)(()=>`${e.das.accreditation.name}${h(e.das.accreditationSlot.name)?` - ${e.das.accreditationSlot.name}`:""}`,[e.das]),[a,l]=(0,F.useState)(!1),[d,c]=(0,F.useState)(e.das),[u,m]=(0,F.useState)((0,Zd.A)(e.das.volunteersRegistrations,e=>e.userInfo.name)),[g,p]=(0,F.useState)({}),f=(0,F.useCallback)(async i=>{l(!0),p(e=>({...e,[i]:!0}));const{event:o}=await(s={eventId:t,delegationId:n,accreditationSlotId:e.accreditationSlotId,userInfoId:i},r=await H(),ss("query DelegationAccreditationSlotMember(\n    $eventId: EventId!\n    $delegationId: DelegationId!\n    $accreditationSlotId: AccreditationsSlotId!\n    $userInfoId: UsersInfoId!\n) {\n    event(id: $eventId) {\n        delegation(id: $delegationId) {\n            accreditationSlot(id: $accreditationSlotId) {\n                ...DelegationAccreditationSlotStats\n            }\n        }\n\n        member: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n            ...VolunteerRegistrationDelegationAccreditationSlot\n        }\n    }\n}\n",{variables:s,token:r||void 0,fragments:[Ro.DelegationAccreditationSlotStatsFragment,Ro.VolunteerRegistrationDelegationAccreditationSlotFragment]}));var s,r;m(t=>t.flatMap(t=>{if(t.userInfo.id===i){const t=o.member.accreditationsUsersInfos.some(t=>t.accreditationSlotId===e.accreditationSlotId),n=o.member.accreditationsSlots.some(t=>t.id===e.accreditationSlotId);return t||n?[o.member]:[]}return[t]})),c(o.delegation.accreditationSlot),p(e=>({...e,[i]:!1})),l(!1)},[e.accreditationSlotId,n,t,l,c,p,m]),x=(0,F.useCallback)(async(e,n)=>{p(t=>({...t,[e]:!0})),await s({eventId:t,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e]},strategy:Je.Add}}),await f(e)},[t,f,p]),_=(0,F.useCallback)(async(e,n)=>{p(t=>({...t,[e]:!0})),await s({eventId:t,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e]},strategy:Je.Delete}}),await f(e)},[t,f,p]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Lb,{children:r}),(0,i.jsxs)(tu,{css:{background:"$gray50",gap:"$6",padding:"$6"},children:[(0,i.jsx)(CA,{isLoading:a,isWeezeventConnected:e.isWeezeventConnected,stats:d}),(0,i.jsxs)(mc,{children:[(0,i.jsx)(cc,{children:(0,i.jsx)(Tc,{children:o("nom_du_membre_69353")})}),u.map(t=>g[t.userInfo.id]?(0,i.jsx)(zc,{bx:!0},t.id):(0,i.jsx)(jA,{accreditationSlotId:e.accreditationSlotId,addAccreditationSlot:x,deleteAccreditationSlot:_,member:t},t.id))]})]})]})},kA=e=>{const{data:t,loader:n,isLoading:o}=Vn("query DelegationAccreditationSlotMembers(\n    $eventId: EventId!\n    $delegationId: DelegationId!\n    $accreditationSlotId: AccreditationsSlotId!\n) {\n    event(id: $eventId) {\n        isWeezeventConnected\n\n        delegation(id: $delegationId) {\n            accreditationSlot(id: $accreditationSlotId) {\n                ...DelegationAccreditationSlotStats\n\n                accreditationSlot {\n                    date\n                    name\n                }\n\n                accreditation {\n                    name\n                }\n\n                volunteersRegistrations {\n                    ...VolunteerRegistrationDelegationAccreditationSlot\n                }\n            }\n        }\n    }\n}\n",{eventId:e.eventId,delegationId:e.delegationId,accreditationSlotId:e.accreditationSlotId},[Ro.DelegationAccreditationSlotStatsFragment,Ro.VolunteerRegistrationDelegationAccreditationSlotFragment]);return(0,i.jsx)(eu,{size:"md",onClose:e.onClose,children:o?n:(0,i.jsx)(yA,{accreditationSlotId:e.accreditationSlotId,das:t.event.delegation.accreditationSlot,isWeezeventConnected:t.event.isWeezeventConnected})})},AA=e=>{const t="horizontal"===e.display?{}:{flex:"1"};return(0,i.jsxs)(Ea,{align:"center",gap:"2",width:"horizontal"===e.display?void 0:1,children:[(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:e.icon})}),(0,i.jsx)(fr,{css:t,fontSize:"textXs",children:e.text}),(0,i.jsx)(Ea,{align:"center",css:{background:e.background,borderRadius:"$1",fontSize:"$textXs",fontWeight:"$medium",padding:"2px 8px",minWidth:"30px"},justify:"center",children:e.count})]})},wA=e=>{const{translate:t,params:{eventId:n,delegationId:o}}=il(),[s,r]=(0,F.useState)(e.das),a=(0,F.useMemo)(()=>Vd(e.das.accreditation.color),[e.das]),l=(0,F.useMemo)(()=>({background:a[50],border:`1px solid ${a[500]}`,color:a[700]}),[a]),d=(0,F.useMemo)(()=>`${e.das.accreditation.name}${h(e.das.accreditationSlot.name)?` - ${e.das.accreditationSlot.name}`:""}`,[e.das]),c=(0,F.useCallback)(async()=>{const{event:{delegation:t}}=await ws({eventId:n,delegationId:o,accreditationSlotId:e.das.accreditationSlot.id},await H());r(t.accreditationSlot)},[e.das,r]),[u,m]=(0,F.useState)(!1),g=s.maxResources?`/${s.maxResources}`:"",p=`${s.assignedResources}${g}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"horizontal"===e.display?"center":"start",css:{...l,borderRadius:"$1",cursor:e.isEventAdmin?"pointer":"default",minHeight:"32px",px:"$2",py:"horizontal"===e.display?"0":"$2"},direction:"horizontal"===e.display?"row":"column",gap:"horizontal"===e.display?"6":"2",width:1,onClick:()=>{e.isEventAdmin&&m(!0)},children:[(0,i.jsx)(fr,{css:{flex:"1"},fontSize:"textXs",fontWeight:"medium",children:d}),(0,i.jsx)(AA,{background:a[100],count:p,display:e.display,icon:"badge-check",text:t("attribu_es_48167")}),e.showWished&&(0,i.jsx)(AA,{background:a[100],count:s.wishedResources,display:e.display,icon:"hand-holding-heart",text:t("souhait_es_78101")}),(0,i.jsx)(AA,{background:a[100],count:s.scannedResources,display:e.display,icon:"scanner-gun",text:t("scann_es_13169")})]}),e.isEventAdmin&&u&&(0,i.jsx)(kA,{accreditationSlotId:e.das.accreditationSlot.id,delegationId:o,eventId:n,onClose:()=>(m(!1),c())})]})},SA=e=>{const t=xA(),n=(0,F.useMemo)(()=>e.event.startAt.startOf("day").equals(e.event.endAt.startOf("day")),[e.event]),o=(0,F.useMemo)(()=>(0,Zd.A)(e.accreditationsSlots.filter(e=>!e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name,Bj(e.accreditation.index),e.accreditation.name.toLowerCase()]),[e.accreditationsSlots]),s=(0,F.useMemo)(()=>(0,Zd.A)(e.accreditationsSlots.filter(e=>e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name,Bj(e.accreditation.index),e.accreditation.name.toLowerCase()]),[e.accreditationsSlots]),r=(0,F.useMemo)(()=>Object.fromEntries(e.accreditations.map(e=>[e.accreditationId,e.willAutoAccredit||e.accreditation.willAutoAccredit])),[e.accreditations]);return(0,i.jsxs)(bA,{css:{borderTop:"1px solid $gray200"},date:e.selectedDay,display:t?"week":"day",maxDate:e.event.endAt,minDate:e.event.startAt,children:[o.map(t=>(0,i.jsx)(vA,{children:(0,i.jsx)(wA,{das:t,display:n?"vertical":"horizontal",isEventAdmin:e.isEventAdmin,showWished:!r[t.accreditationId]})},t.accreditationSlot.id)),s.map(t=>(0,i.jsx)(vA,{endAt:t.accreditationSlot.date,startAt:t.accreditationSlot.date,children:(0,i.jsx)(wA,{das:t,display:"vertical",isEventAdmin:e.isEventAdmin,showWished:!r[t.accreditationId]})},t.accreditationSlot.id))]})},EA=e=>{const t=Nn(Hk),{delegationAccreditationsSlots:n,showWished:o}=RA(),s=n.find(t=>t.accreditationSlot.id===e.slot.id);return(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{css:{paddingLeft:"76px",textTransform:"capitalize"},children:e.slot.name}),o&&(0,i.jsx)(xc,{width:150,children:t.toNumberOrInfinity(s?.wishedResources??0)}),(0,i.jsx)(xc,{width:150,children:t.toNumberOrInfinity(s?.assignedResources??0)}),(0,i.jsx)(xc,{width:150,children:t.toNumberOrInfinity(s?.maxResources)}),(0,i.jsx)(xc,{width:150,children:t.toNumberOrInfinity(s?.scannedResources??0)})]})},TA=e=>{const t=Nn(Hk),{delegationAccreditations:n,delegationAccreditationsSlots:o,accreditationIdToSlots:s,accreditationIdToOpen:r,setAccreditationIdToOpen:a,showWished:l}=RA(),d=r[e.accreditation.id]??!0,c=s[e.accreditation.id],u=(0,F.useMemo)(()=>{const t=n.find(t=>t.accreditationId===e.accreditation.id);if("number"==typeof t?.maxResources)return t.maxResources;{const t=o.filter(t=>t.accreditationId===e.accreditation.id&&"number"==typeof t.maxResources);return Zo(t)?(0,Av.A)(t,e=>e.maxResources):null}},[e.accreditation,n,o]),h=(0,F.useMemo)(()=>(0,Av.A)(o.filter(t=>t.accreditationId===e.accreditation.id),e=>e.wishedResources),[e.accreditation,o]),m=(0,F.useMemo)(()=>(0,Av.A)(o.filter(t=>t.accreditationId===e.accreditation.id),e=>e.assignedResources),[e.accreditation,o]),g=(0,F.useMemo)(()=>(0,Av.A)(o.filter(t=>t.accreditationId===e.accreditation.id),e=>e.scannedResources),[e.accreditation,o]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Cc,{children:[(0,i.jsxs)(xc,{align:"center",css:{cursor:"pointer",paddingLeft:"44px",userSelect:"none"},gap:"2",onClick:()=>a({...r,[e.accreditation.id]:!d}),children:[e.accreditation.hasSlots&&(0,i.jsx)(Ea,{align:"center",css:{color:"$gray800"},height:32,justify:"center",width:32,children:(0,i.jsx)(Va,{icon:d?"chevron-up":"chevron-right"})}),(0,i.jsx)(Xj,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsx)(fr,{children:e.accreditation.name})]}),l&&(0,i.jsx)(xc,{width:150,children:t.toNumberOrInfinity(h)}),(0,i.jsx)(xc,{width:150,children:t.toNumberOrInfinity(m)}),(0,i.jsx)(xc,{width:150,children:t.toNumberOrInfinity(u)}),(0,i.jsx)(xc,{width:150,children:t.toNumberOrInfinity(g)})]}),e.accreditation.hasSlots&&d&&c.map(e=>(0,i.jsx)(EA,{slot:e},`s-${e.id}`))]})},zA=e=>{const t=Nn(Hk),{delegationAccreditations:n,delegationAccreditationsSlots:o,categoryIdToOpen:s,categoryIdToAccreditations:r,setCategoryIdToOpen:a,showWished:l}=RA(),d=s[e.category.id]??!0,c=(0,F.useMemo)(()=>Vj(r[e.category.id]),[r,e.category.id]),u=(0,F.useMemo)(()=>{const t=(0,Da.A)(n.filter(t=>t.accreditationCategoryId===e.category.id).map(e=>{if("number"==typeof e.maxResources)return e.maxResources;{const t=o.filter(t=>t.accreditationId===e.accreditationId&&"number"==typeof t.maxResources);return Zo(t)?(0,Av.A)(t,e=>e.maxResources):null}}));return Zo(t)?(0,Pg.A)(t):null},[e.category,n,o]),h=(0,F.useMemo)(()=>(0,Av.A)(o.filter(t=>t.accreditationCategory.id===e.category.id),e=>e.wishedResources),[e.category,o]),m=(0,F.useMemo)(()=>(0,Av.A)(o.filter(t=>t.accreditationCategory.id===e.category.id),e=>e.assignedResources),[e.category,o]),g=(0,F.useMemo)(()=>(0,Av.A)(o.filter(t=>t.accreditationCategory.id===e.category.id),e=>e.scannedResources),[e.category,o]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Cc,{css:{background:"$gray100"},children:[(0,i.jsxs)(xc,{align:"center",css:{cursor:"pointer",userSelect:"none"},gap:"2",onClick:()=>a({...s,[e.category.id]:!d}),children:[(0,i.jsx)(Ea,{align:"center",css:{color:"$gray800"},height:32,justify:"center",width:32,children:(0,i.jsx)(Va,{icon:d?"chevron-up":"chevron-right"})}),(0,i.jsx)(fr,{css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"medium",children:e.category.name})]}),l&&(0,i.jsx)(xc,{width:150,children:t.toNumberOrInfinity(h)}),(0,i.jsx)(xc,{width:150,children:t.toNumberOrInfinity(m)}),(0,i.jsx)(xc,{width:150,children:t.toNumberOrInfinity(u)}),(0,i.jsx)(xc,{width:150,children:t.toNumberOrInfinity(g)})]}),d&&c.map(e=>(0,i.jsx)(TA,{accreditation:e},`a-${e.id}`))]})},$A=(0,F.createContext)({}),OA=e=>{const{translate:t,params:{organizationId:n}}=il(),o=Nn($c),s=(0,F.useMemo)(()=>(0,Zd.A)((0,Ju.A)(e.accreditationsSlots.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[e.accreditationsSlots]),r=(0,F.useMemo)(()=>(0,Yd.A)((0,Kd.A)((0,Ju.A)(e.accreditations.map(e=>e.accreditation),e=>e.id),e=>e.accreditationCategoryId),e=>(0,Zd.A)(e,e=>e.name.toLowerCase())),[e.accreditations]),a=(0,F.useMemo)(()=>(0,Yd.A)((0,Kd.A)(e.accreditationsSlots.map(e=>({...e.accreditationSlot,name:ph(o,e.accreditationSlot,"",{date:{localeFormat:Ho.DateOnly.WeekdayLongMonthLong}})})),e=>e.accreditationId),e=>Ih(e)),[e.accreditationsSlots]),l=(0,F.useMemo)(()=>e.accreditations.some(e=>!(e.willAutoAccredit||e.accreditation.willAutoAccredit)),[e.accreditations]),[d,c]=wC(n,"eventDelegationAccreditations.categoryIdToOpen",{}),[u,h]=wC(n,"eventDelegationAccreditations.accreditationIdToOpen",{});return(0,i.jsx)($A.Provider,{value:{accreditationIdToOpen:u,accreditationIdToSlots:a,categories:s,categoryIdToAccreditations:r,categoryIdToOpen:d,delegationAccreditations:e.accreditations,delegationAccreditationsSlots:e.accreditationsSlots,setAccreditationIdToOpen:h,setCategoryIdToOpen:c,showWished:l},children:(0,i.jsxs)(mc,{hideBorder:!0,children:[(0,i.jsxs)(cc,{children:[(0,i.jsx)(Tc,{children:t("cat_gorie_accr_40335")}),l&&(0,i.jsx)(Tc,{width:150,children:t("souhait_es_78101")}),(0,i.jsx)(Tc,{width:150,children:t("affect_es_00048")}),(0,i.jsx)(Tc,{width:150,children:t("quota_00069")}),(0,i.jsx)(Tc,{width:150,children:t("scann_es_13169")})]}),s.map(e=>(0,i.jsx)(zA,{category:e},`c-${e.id}`))]})})};function RA(){return(0,F.useContext)($A)}const PA=e=>{const{translate:t,params:{organizationId:n}}=il(),[o,s]=(0,F.useState)(""),[r,a]=wC(n,"eventDelegationAccreditations.rendering","calendar"),[l,d]=(0,F.useState)(e.event.delegation.minAccreditationSlotDate),c=(0,F.useMemo)(()=>l?.isValid?l:e.event.startAt,[e.event,l]),[u,m]=(0,F.useState)(null),g=(0,F.useMemo)(()=>e.event.delegation.accreditationsSlots.filter(e=>{const t=!h(o)||e.accreditation.name.toLowerCase().includes(o.toLowerCase())||e.accreditationSlot.name.toLowerCase().includes(o.toLowerCase())||"table"!==r||e.accreditationCategory.name.toLowerCase().includes(o.toLowerCase()),n=!u?.isValid||!!e.accreditationSlot.date?.isValid&&u.toSQLDate()===e.accreditationSlot.date.toSQLDate();return t&&n}),[e.event,o,r,u]);return(0,i.jsxs)(Ea,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Ea,{css:{background:"white",padding:"$5 $5"},gap:"3",children:[(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_une_65646"),value:o,onChange:s})}),(0,i.jsx)(fr,{css:{flex:"1"}}),"calendar"===r&&(0,i.jsx)(_A,{max:e.event.endAt,min:e.event.startAt,value:c,onChange:d}),"table"===r&&(0,i.jsx)(fr,{width:160,children:(0,i.jsx)(_u,{max:e.event.endAt,min:e.event.startAt,value:u,onChange:m})}),(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"table"===r?"table":"calendar",children:t("table"===r?"vue_tableau_18026":"vue_calendrier_58086")})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsx)(Od,{icon:"calendar",onClick:()=>a("calendar"),children:t("vue_calendrier_58086")}),(0,i.jsx)(Od,{icon:"table",onClick:()=>a("table"),children:t("vue_tableau_18026")})]})]})]}),"table"===r?(0,i.jsx)(OA,{accreditations:e.event.delegation.accreditations,accreditationsSlots:g}):(0,i.jsx)(SA,{accreditations:e.event.delegation.accreditations,accreditationsSlots:g,event:e.event,isEventAdmin:e.isEventAdmin,selectedDay:c})]})},DA=()=>{const e=Ln();return(0,i.jsx)(Ea,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs"},height:1,justify:"center",width:1,children:(0,i.jsx)(fr,{height:250,width:1,children:(0,i.jsx)(rk,{title:e("aucune_accr_dit_27643")})})})},FA=e=>{const{params:{eventId:t,delegationId:n}}=il(),{data:o,loader:s}=Vn("query DelegationAccreditations(\n    $eventId: EventId!\n    $delegationId: DelegationId!\n    $onlyVisible: Boolean!\n) {\n    event(id: $eventId) {\n        startAt\n        endAt\n\n        delegation(id: $delegationId) {\n            minAccreditationSlotDate\n\n            accreditations {\n                accreditationId\n                accreditationCategoryId\n                willAutoAccredit\n                maxResources\n\n                accreditation {\n                    id\n                    accreditationCategoryId\n                    name\n                    color\n                    icon\n                    hasSlots\n                    index\n                    willAutoAccredit\n                }\n            }\n\n            accreditationsSlots(onlyVisible: $onlyVisible) {\n                ...DelegationAccreditationSlotStats\n\n                accreditationSlot {\n                    id\n                    accreditationId\n                    date\n                    name\n                }\n\n                accreditation {\n                    name\n                    color\n                    index\n                }\n\n                accreditationCategory {\n                    id\n                    name\n                }\n            }\n        }\n    }\n}\n",{eventId:t,delegationId:n,onlyVisible:e.onlyVisible},[Ro.DelegationAccreditationSlotStatsFragment]);return s||(Zo(o.event?.delegation.accreditationsSlots)?(0,i.jsx)(PA,{event:o.event,isEventAdmin:e.isEventAdmin}):(0,i.jsx)(DA,{}))},MA=e=>{const{translate:t,params:{eventId:n,delegationId:o}}=il(),{mutate:s,isLoading:r}=Ss(),a=(0,F.useMemo)(()=>e.customDocuments.filter(t=>t.slug===e.slug),[e.customDocuments,e.slug]),l=(0,F.useMemo)(()=>Zo(a)?a.map(e=>e.name).join(", "):Yt.includes(e.slug)?b_(e.slug):null,[a,e.slug]),d=Zo(a);return l?(0,i.jsxs)(Ea,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4 $6","&:last-child":{borderBottom:"none"}},gap:"3",children:[(0,i.jsx)(Ea,{align:"center",css:{background:"$blueGray100",borderRadius:"12px",color:"$blueGray700"},height:40,justify:"center",width:40,children:(0,i.jsx)(Va,{icon:"file-lines"})}),(0,i.jsx)(fr,{css:{flex:"1"},font:"gray900 textSm medium",children:l}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",isLoading:r,leftIcon:"download",onClick:()=>s({eventId:n,delegationId:o,documentsExport:{badgeType:d?null:e.slug,customDocumentSlug:d?e.slug:null,documentType:d?Se.UserCustomDocument:Se.CustomBadge,language:It.Fr,oneFile:!1,segmentsIds:[],strategy:Ae.OnePerPage}})})})}),(0,i.jsx)(am,{placement:"top",children:t("recevoir_les_do_31669")})]})]}):null},NA=e=>{const{translate:t}=il();return(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(fr,{font:"gray900 textMd medium",children:t("documents_dispo_46996")}),(0,i.jsx)(Ea,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",flex:"1",overflow:"hidden"},direction:"column",children:e.delegationsSpaceCustomBadges.map(t=>(0,i.jsx)(MA,{customDocuments:e.customDocuments,slug:t},t))})]})},LA=ar(fr,{overflow:"hidden",textOverflow:"ellipsis"}),BA=e=>{const t=Nn(vj);switch(e.field.fieldType){case Ne.File:{const n=t.getValue(e.field,e.fields);return n?(0,i.jsx)(WI,{acl:"public-read",document:n}):(0,i.jsx)(LA,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:"-"})}case Ne.Phone:{const n=t.getValueString(e.field,e.fields);return(0,i.jsx)(LA,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:h(n)?(0,i.jsx)(j_,{css:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},hideIcon:!0,to:`tel:${n}`,children:n}):"-"})}default:{const n=t.getValueString(e.field,e.fields);return(0,i.jsx)(LA,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:h(n)?URL.canParse(n)?(0,i.jsx)(j_,{css:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},hideIcon:!0,to:n,children:n}):n:"-"})}}},VA=e=>(0,i.jsx)(Ea,{css:{background:"white",bd:!0,...e.css},direction:"column",width:1,children:(0,i.jsxs)(Ea,{direction:"column",width:1,children:[(0,i.jsxs)(Ea,{css:{borderBottom:e.hideTitleBorder?void 0:"1px solid $gray200",paddingBottom:e.hideTitleBorder?"0":"$5",paddingTop:"$5",px:"$6"},gap:"3",width:1,children:[(0,i.jsx)(fr,{color:"gray900",css:{flex:"1",alignContent:"center"},fontSize:"textMd",fontWeight:"semiBold",children:e.title}),e.rightIcon&&(0,i.jsx)(fr,{color:"gray900",css:{cursor:"pointer"},fontSize:"textMd",fontWeight:"semiBold",textAlign:"center",width:20,onClick:t=>{e.rightIconClick?.(t)},children:(0,i.jsx)(Va,{icon:e.rightIcon})}),e.select]}),(0,i.jsx)(fr,{className:"h-detail-box-content",css:{flex:"1",padding:"$6"},width:1,children:e.children})]})}),UA=({css:e,title:t,children:n})=>(0,i.jsxs)(Ea,{direction:"column",gap:"3",children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:t}),(0,i.jsx)(Ea,{css:{bd:!0,padding:"$4",...e},direction:"column",children:n})]}),WA=({children:e,...t})=>pc()?(0,i.jsx)(UA,{...t,children:e}):(0,i.jsx)(VA,{...t,children:e});var GA=n(6502),HA=n(2716);function qA(e){return e<=.2?lr.colors.error500.value:e<.7?lr.colors.warning500.value:e<=1?lr.colors.success500.value:lr.colors.blueGray500.value}const YA=({percent:e,prospectivePercent:t})=>(0,i.jsxs)(fr,{css:{background:"$gray100",borderRadius:"$1",position:"relative"},height:8,width:1,children:[(0,i.jsx)(fr,{css:{background:qA(e),borderRadius:"$1",left:0,maxWidth:"100%",position:"absolute",top:0,width:100*e+"%"},height:1}),void 0!==t&&(0,i.jsx)(fr,{css:{background:qA(t),borderRadius:"$1",left:0,opacity:.4,maxWidth:"100%",position:"absolute",top:0,width:100*t+"%"},height:1})]}),KA=e=>{const t=(0,F.useMemo)(()=>(0,HA.A)().innerRadius(70).outerRadius(90).cornerRadius(20).startAngle(-Math.PI/2).endAngle(Math.PI/2),[]),n=(0,F.useMemo)(()=>e.total===1/0?1:0===e.total?1/0:e.count/e.total,[e.count,e.total]),o=(0,F.useMemo)(()=>{const e=(0,GA.A)().domain([0,1]).range([-Math.PI/2,Math.PI/2]);return(0,HA.A)().innerRadius(70).outerRadius(90).cornerRadius(20).startAngle(-Math.PI/2).endAngle(e(n<=1?n:1))},[n]);return(0,i.jsxs)(fr,{css:{position:"relative","& svg":{height:"100%",width:"100%"}},height:90,width:180,children:[(0,i.jsx)("svg",{children:(0,i.jsxs)("g",{transform:"translate(90, 90)",children:[(0,i.jsx)("path",{d:t(void 0),fill:lr.colors.gray100.value}),(0,i.jsx)("path",{d:o(void 0),fill:qA(n)})]})}),(0,i.jsxs)(Ea,{align:"baseline",css:{bottom:"0",left:"0",position:"absolute"},gap:"2",justify:"center",width:1,children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:e.count}),(0,i.jsxs)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:["/",e.total===1/0?"∞":e.total]})]})]})},ZA=(e,t=null,n={})=>(Object.entries(e).forEach(([e,i])=>{const o=t?`${t}.${e}`:e;"object"!=typeof i||null===i||Array.isArray(i)?n[o]=i:ZA(i,o,n)}),n);const XA=/(\{([\w\.]+)\})/g;let JA=class{fieldService;constructor(e){this.fieldService=e}renderText(e,t={}){const n={organization:t.organization||void 0,event:t.event||void 0,delegation:t.delegation||void 0,invitedBy:t?.invitedBy?this.getUser(t.invitedBy,t):void 0,recipient:t?.recipient?this.getUser(t.recipient,t):void 0,user:t.userInfo?this.getUser(t.userInfo,t):void 0,...t.extraInfos},i=ZA(n);return Object.entries(i).reduce((e,[t,n])=>e.replaceAll(`{${t}}`,n),e).replace(XA,(e,n,i)=>{const[o,s,r,a]=i.split("."),l=t?.userInfo?{lang:this.getLanguage(t.userInfo)}:{};if(8===a?.length?l.date=a:16===a?.length&&(l.date=a.substring(0,8),l.endDate=a.substring(8)),t.userInfo?.links){const e=t.userInfo.links;return i.includes("planningDays")?Zm(e.userPlanningDaysLink,"pdf",l):i.includes("planningList")?Zm(e.userPlanningListLink,"pdf",l):i.includes("planning")?Zm(e.userPlanningLink,"pdf",l):i.includes("assignments")?Zm(e.userAssignmentsLink,"pdf",l):i.includes("paris20kmassignment")&&e?.userCustomBadgeLinks[pe.Paris20kmassignment]?Zm(e.userCustomBadgeLinks[pe.Paris20kmassignment],"pdf",l):""}return""})}getUser(e,t){const n=t.customFields||[],i=this.getFields(e,n),o=this.getLanguage(e),s=o?{lang:o.toString()}:{},r=e.links?Zm(e.links.userAssignmentsLink,"pdf",s):"",a=e.links?Zm(e.links.userPlanningLink,"pdf",s):"",l=e.links?Zm(e.links.userPlanningListLink,"pdf",s):"",d=e.links?Zm(e.links.userPlanningDaysLink,"pdf",s):"",c=e.links?{assignments:r,badge:Zm(e.links.userBadgeLink,"pdf",s),certificate:Zm(e.links.userCertificateLink,"pdf",s),planning:a,planningList:l,planningDays:d,...Object.fromEntries(Object.entries(e.links.userCustomBadgeLinks).map(([e,t])=>[e.toLowerCase(),Zm(t,"pdf",s)])),...Object.fromEntries(Object.entries(e.links.userCustomDocumentLinks).map(([e,t])=>[e,Zm(t,"pdf",s)]))}:{},u=t.volunteerRegistration?.ticketId??"",h=(e.fields.isExpanded?e.fields?.firstName?.value:e.fields.firstName)||"",m=(e.fields.isExpanded?e.fields?.lastName?.value:e.fields.lastName)||"",g=`\n            
\n        
 `;return{id:e.id,localId:t.volunteerRegistration?.localId||"",email:e.email,...i,firstName:h,lastName:m,ticketId:u,qrcode:g,memberCode:t.volunteerRegistration?.weezevent?.memberCode||"",name:ug({firstName:h,lastName:m}),registrationDate:e.registrationDate?.toFormat(t.organization?.datetimeFormat??"yyyy-MM-dd HH:mm")??"",assignmentSheet:t.event?r:"",documents:c,delegation:{name:t.volunteerRegistration?.delegation?.name??"",leader:{firstName:t.volunteerRegistration?.delegation?.leaders?.[0]?.firstName??"",lastName:t.volunteerRegistration?.delegation?.leaders?.[0]?.lastName??"",phone:t.volunteerRegistration?.delegation?.leaders?.[0]?.phone?.internationalFormat??""}},weezevent:{barcode:u,qrcode:g,identificationNumber:""}}}getFields(e,t){return e.fields.isExpanded?Object.fromEntries(Object.entries(e.fields).map(([e,{value:t}])=>[e,Zo(t)?t.join(", "):h(t)?t:""])):Object.fromEntries(t.map(t=>[t.slug,this.fieldService.getValueString(t,e.fields)]))}getLanguage(e){return e.fields.isExpanded?e.fields?.language?.rawValue:e.fields?.language}};JA=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[vj])],JA);const QA=({description:e})=>{const t=Ln();return(0,i.jsx)(WA,{title:t("description_58935"),children:h(e)?(0,i.jsx)(ng,{text:e}):(0,i.jsx)(fr,{color:"gray500",textAlign:"center",width:1,children:t("aucune_descript_25737")})})},ew=({privateNote:e})=>{const t=Ln();return(0,i.jsx)(WA,{title:(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(Va,{icon:"lock"}),(0,i.jsx)(fr,{children:t("note_priv_e_06303")})]}),children:h(e)?(0,i.jsx)(ng,{text:e}):(0,i.jsx)(fr,{color:"gray500",textAlign:"center",width:1,children:t("aucune_note_pri_86832")})})};let tw=class extends zl{constructor(e){super(e)}associateTagsIdsSchema(){return l.Ik().shape({tagsIds:l.YO().of(l.ai())})}};tw=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],tw);const nw=e=>{const t=Ln(),n=Nn(tw),[o,s]=(0,F.useState)(e.tags),[r,a]=(0,F.useState)(!1);return(0,i.jsx)(gj,{buttonText:t("enregistrer_06519"),icon:"tag",initialValues:{tagsIds:e.tagsIds},schema:n.associateTagsIdsSchema(),size:"md",subtitle:e.subtitle,title:t("ajout_d_un_ou_p_17767"),onClose:e.onClose,onSubmit:async t=>{e.onSave(t.tagsIds)},children:({form:t,values:n})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sm,{isCreateVisible:!0,isSearchVisible:!0,multiple:!0,name:"tagsIds",onCreateClick:()=>{a(!0)},children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.name))}),r&&(0,i.jsx)(pj,{organizationId:e.organizationId,onClose:()=>{a(!1)},onSuccess:e=>{s([...o,e]),t.change("tagsIds",[...n.tagsIds,e.id])}})]})})},iw=e=>{const{data:t,loader:n}=(o={organizationId:e.organizationId},Vn(cs,o,[]));var o;return n?null:(0,i.jsx)(nw,{organizationId:e.organizationId,subtitle:e.subtitle,tags:t.organization.tags.nodes,tagsIds:e.tagsIds,onClose:e.onClose,onSave:e.onSave})},ow=e=>{const t=Ln(),{organizationId:n}=Wn(),[o,s]=(0,F.useState)(!1);return"associateTags"in e?(0,i.jsxs)(WA,{rightIcon:"pen",rightIconClick:()=>{s(!0)},title:t("tags_79499"),children:[Zo(e.tags)?(0,i.jsx)(Ea,{gap:"2",wrap:"wrap",children:e.tags.map(e=>(0,i.jsx)(Gd,{children:e.name},e.id))}):(0,i.jsx)(fr,{color:"gray500",textAlign:"center",width:1,children:t("aucun_tag_ajout_63348")}),o&&(0,i.jsx)(iw,{organizationId:n,subtitle:e.modalSubtitle,tagsIds:e.tags.map(({id:e})=>e),onClose:()=>{s(!1)},onSave:async t=>{await e.associateTags(t),e.reload(),s(!1)}})]}):(0,i.jsx)(WA,{title:t("tags_79499"),children:Zo(e.tags)?(0,i.jsx)(Ea,{gap:"2",wrap:"wrap",children:e.tags.map(e=>(0,i.jsx)(Gd,{children:e.name},e.id))}):(0,i.jsx)(fr,{color:"gray500",textAlign:"center",width:1,children:t("aucun_tag_ajout_63348")})})},sw=e=>{const{translate:t,params:{organizationId:n,eventId:o,delegationId:s}}=il(),{hasFeature:r}=nI(),a=Nn($c),l=Nn(JA),{isOrganizationAdmin:d}=nI(),{mutate:c}=js(),u=(0,F.useMemo)(()=>Hm({organizationId:n,eventId:o,delegationId:s,formId:e.delegation?.form.id}),[e.delegation]),m=(0,F.useMemo)(()=>Gm(n,to.DELEGATION({organizationId:n,eventId:o,delegationId:s})),[e.delegation]),g=(0,F.useMemo)(()=>h(e.delegation.description)?l.renderText(e.delegation.description,{delegation:{...e.delegation,formLink:u}}):"",[e.delegation]),p=(0,F.useMemo)(()=>e.delegation.usedCustomFields.concat(e.customFields),[e.customFields,e.delegation]),f=(e,t)=>(0,i.jsxs)(Ea,{children:[(0,i.jsx)(fr,{textAlign:"start",children:e}),(0,i.jsx)(fr,{css:{borderBlockEnd:"2px dotted $gray500",flex:"1",marginBlockEnd:"$1"}}),(0,i.jsx)(fr,{color:"gray900",css:{fontSize:"$textMd"},textAlign:"end",children:t})]});return(0,i.jsx)(yC,{children:(0,i.jsxs)(Ea,{direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Ea,{gap:"6",children:[(0,i.jsx)(Ea,{css:{flex:"3",height:"100%"},direction:"column",gap:"6",children:(0,i.jsx)(WA,{css:{flex:"1 1"},title:t("limite_de_membr_42978"),children:(0,i.jsxs)(Ea,{css:{justifyContent:"space-between"},direction:"column",height:"100%",children:[(0,i.jsx)(fr,{css:{margin:"auto"},children:(0,i.jsx)(KA,{count:e.delegation.numberOfResources,total:e.delegation.maxResources??1/0})}),(0,i.jsx)(Ea,{direction:"column",gap:"4",children:r(Fe.Accreditation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray700",css:{fontSize:"$textXs",fontWeight:600,fontFamily:"Open Sans",lineHeight:"18px",textTransform:"uppercase"},children:t("dont_76603")}),(0,i.jsxs)(Ea,{color:"gray500",css:{fontSize:"$textSm",fontWeight:"$medium",lineHeight:"20px",justifyContent:"space-between"},direction:"column",gap:"2",children:[f(t("membres_accr_di_73664"),e.delegation.numberOfMembersAccredited),f(t("membres_en_atte_57336"),e.delegation.numberOfMembersWaitingAccreditation),f(t("membres_refus_31757"),e.delegation.numberOfMembersRefusedAccreditation)]})]})})]})})}),(0,i.jsx)(Ea,{css:{flex:"6"},direction:"column",gap:"6",children:(0,i.jsx)(WA,{title:t("param_tres_78420"),children:(0,i.jsxs)(Ea,{direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Ea,{gap:"3",justify:"between",children:[(0,i.jsx)(fr,{color:"gray500",children:t("cat_gorie_00291")}),(0,i.jsx)(fr,{children:(0,i.jsx)(j_,{to:to.DELEGATION_CATEGORY({organizationId:n,eventId:o,delegationCategoryId:e.delegation.delegationCategory.id}),children:e.delegation.delegationCategory.name})})]}),(0,i.jsx)(zu,{direction:"horizontal"}),d&&e.delegation.parent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{gap:"3",justify:"between",children:[(0,i.jsx)(fr,{color:"gray500",children:t("d_l_gation_pare_68507")}),(0,i.jsx)(Ea,{align:"center",css:{color:"$primary700",fontWeight:"$medium","&:hover":{textDecoration:"underline"}},gap:"2",children:(0,i.jsx)(La,{to:to.DELEGATION({organizationId:n,delegationId:e.delegation.parent.id}),children:(0,i.jsx)(Gd,{color:"white",cursor:"pointer",size:"md",children:e.delegation.parent.name},e.delegation.parent.id)})})]}),(0,i.jsx)(zu,{direction:"horizontal"})]}),(0,i.jsxs)(Ea,{gap:"3",justify:"between",children:[(0,i.jsx)(fr,{color:"gray500",children:t("status_06428")}),(0,i.jsx)(fr,{color:"gray800",children:(0,i.jsx)(Gd,{color:"success",children:t(e.delegation.state)})})]}),(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsxs)(Ea,{gap:"3",justify:"between",children:[(0,i.jsx)(fr,{color:"gray500",children:t("date_limite_d_i_79779")}),(0,i.jsx)(fr,{color:"gray800",children:e.delegation.deadlineDate?a.toLocaleString(e.delegation.deadlineDate,Ho.DateOnly.MonthLong):"-"})]}),(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsxs)(Ea,{gap:"3",justify:"between",children:[(0,i.jsx)(fr,{color:"gray500",children:t("Form")}),(0,i.jsx)(j_,{css:{color:"$primary700"},to:u,children:e.delegation.form.name})]}),(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsxs)(Ea,{gap:"3",justify:"between",children:[(0,i.jsx)(fr,{color:"gray500",children:t("DelegationSpaceLink")}),(0,i.jsx)(j_,{css:{color:"$primary700"},to:m,children:t("portail_d_l_gat_06817")})]})]})})})]}),Zo(p)&&(0,i.jsx)(WA,{title:t("champs_de_formu_64126"),children:(0,i.jsx)(Ea,{direction:"column",gap:"4",width:1,children:p.map((t,n)=>(0,i.jsxs)(F.Fragment,{children:[0!==n&&(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsxs)(Ea,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(fr,{color:"gray500",css:{flex:"1"},children:t.name}),(0,i.jsx)(Ea,{justify:"end",width:300,children:(0,i.jsx)(BA,{field:t,fields:e.delegation.fields})})]})]},t.slug))})}),(0,i.jsxs)(Ea,{gap:"6",children:[(0,i.jsxs)(Ea,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(WA,{title:t("reponsable_82458_plural"),children:Zo(e.delegation.leaders)?e.delegation.leaders.map((e,t)=>(0,i.jsxs)(F.Fragment,{children:[0!==t&&(0,i.jsx)($u,{height:"4"}),(0,i.jsx)(Eb,{userInfo:e})]},e.id)):(0,i.jsx)(fr,{color:"gray500",textAlign:"center",width:1,children:t("aucun_reponsabl_38504")})}),(0,i.jsx)(ow,{associateTags:e=>c({organizationId:n,eventId:o,massEdit:{reset:!1,selecteds:{ids:[s]},slug:ve.Tag,strategy:Je.Replace,value:e}}),modalSubtitle:t("ajouter_des_tag_35833"),reload:e.reload,tags:e.delegation.tags})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(QA,{description:g}),(0,i.jsx)(ew,{privateNote:e.delegation.privateNote})]})]})]})})},rw=()=>{const{params:{organizationId:e,delegationId:t}}=il(),{data:n,loader:o,reload:s}=Vn("query DelegationDashboard($organizationId: OrganizationId!, $delegationId: DelegationId!) {\n    organization(id: $organizationId) {\n        customFields(variety: Delegation, privacy: Private) {\n            nodes {\n                ...CustomFieldWithCondition\n            }\n        }\n\n        delegation(id: $delegationId) {\n            id\n            name\n            description\n            deadlineDate\n            privateNote\n            state\n            numberOfResources\n            maxResources\n            numberOfMembersAccredited\n            numberOfMembersWaitingAccreditation\n            numberOfMembersRefusedAccreditation\n            fields\n\n            delegationCategory {\n                id\n                name\n            }\n\n            parent {\n                id\n                name\n            }\n\n            form {\n                id\n                name\n            }\n\n            leaders {\n                id\n                email\n                name\n\n                picture {\n                    url\n                }\n            }\n\n            tags {\n                id\n                name\n            }\n\n            usedCustomFields {\n                ...CustomFieldWithCondition\n            }\n        }\n    }\n}\n",{organizationId:e,delegationId:t},[Ro.CustomFieldWithConditionFragment]);return o||(0,i.jsx)(sw,{customFields:n.organization.customFields.nodes,delegation:n.organization.delegation,reload:s})},aw=e=>{switch(e){case lw.Event:return{color:"success",leftIcon:"calendar"};case lw.ParentDelegation:return{color:"pink",leftIcon:"people-group"};default:return Za()}};var lw;!function(e){e.Event="event",e.ParentDelegation="parent-delegation"}(lw||(lw={}));const dw=({state:e,userInfo:t,onClick:n})=>{const o=Ln(),s=h(t.name);return(0,i.jsxs)(Ea,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$3",userSelect:"none",width:"100%","&:last-child":{border:"none"}},onClick:n,children:[(0,i.jsx)(tc,{shouldPreventDefault:!1,state:e,onClick:Bl.A}),(0,i.jsx)(Pa,{width:"3"}),(0,i.jsx)(Fg,{email:t.email,image:t.picture?.url,name:t.name,size:40}),(0,i.jsx)(Pa,{width:"4"}),(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(fr,{ellipsis:!0,color:"gray700",children:s?t.name:t.email}),s&&(0,i.jsx)(fr,{ellipsis:!0,color:"gray500",children:t.email})]}),t.source&&(0,i.jsx)(fr,{children:(0,i.jsx)(Gd,{...aw(t.source),leftIconStyle:"solid",children:t.source===lw.Event?o("_v_nement_22345"):o("d_l_gation_pare_68507")})})]})},cw=({availableMembers:e,select:t,usersInfosIds:n})=>(0,i.jsx)(i.Fragment,{children:e.map(e=>{const o=n.includes(e.id)?"checked":"unchecked";return(0,i.jsx)(dw,{state:o,userInfo:e,onClick:()=>{t(e.id)}},e.id)})}),uw=({delegationId:e,nameOrEmail:t,organizationId:n,usersInfosIds:o,select:s})=>{const{data:r,loader:a}=xa({organizationId:n,excludedDelegationId:e,name:h(t)?t:null});return a||(0,i.jsx)(cw,{availableMembers:r.organization.usersInfos.nodes,select:s,usersInfosIds:o})},hw=({delegationId:e,eventId:t,nameOrEmail:n,usersInfosIds:o,select:s})=>{const{data:r,loader:a}=Vn("query EventUsersInfos($eventId: EventId!, $delegationId: DelegationId!, $name: String) {\n    event(id: $eventId) {\n        delegation(id: $delegationId) {\n            parentUsersInfos(name: $name) {\n                ...ExistingVolunteer\n            }\n        }\n\n        volunteersRegistrations(excludeDelegationMembers: true, name: $name, limit: 25) {\n            nodes {\n                userInfo {\n                    ...ExistingVolunteer\n                }\n            }\n        }\n    }\n}\n",{eventId:t,delegationId:e,name:h(n)?n:null},[Ro.ExistingVolunteerFragment]);const l=(0,F.useMemo)(()=>{if(r.event){const e=r.event.volunteersRegistrations.nodes.map(e=>({...e.userInfo,source:lw.Event})),t=e.map(({id:e})=>e),n=r.event.delegation.parentUsersInfos.flatMap(e=>t.includes(e.id)?[]:[{...e,source:lw.ParentDelegation}]);return e.concat(n)}return[]},[r.event]);return a||(0,i.jsx)(cw,{availableMembers:l,select:s,usersInfosIds:o})},mw=({delegationId:e,eventId:t,organizationId:n,onClose:o,reload:s})=>{const r=Ln(),a=Nn(Xb),[l,d,c]=Ec(""),{mutate:u}=Ws(),{mutate:h}=ba();return(0,i.jsx)(gj,{buttonText:r("ajouter_un_memb_33261"),icon:"sliders",initialValues:{usersInfosIds:[]},schema:a.adminAddSchema(),size:"md",subtitle:r(t?"ajouter_un_memb_95658":"ajouter_un_memb_89696"),title:r("add_member_to_delegation"),onClose:o,onSubmit:async i=>{t?await u({eventId:t,delegationId:e,selecteds:{ids:i.usersInfosIds}}):await h({organizationId:n,delegationId:e,selecteds:{ids:i.usersInfosIds}}),o(),s()},children:({form:o,values:s})=>{const a=e=>{o.change("usersInfosIds",Qo(s.usersInfosIds,e))};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:r("rechercher_un_m_05904"),value:l,onChange:c}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(sl,{}),(0,i.jsx)(Ea,{css:{flex:"1",overflowY:"auto"},direction:"column",children:t?(0,i.jsx)(hw,{delegationId:e,eventId:t,nameOrEmail:d,select:a,usersInfosIds:s.usersInfosIds}):(0,i.jsx)(uw,{delegationId:e,nameOrEmail:d,organizationId:n,select:a,usersInfosIds:s.usersInfosIds})})]})}})},gw=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{showNotification:s}=Yv(),{mutate:r}=Hr();return(0,i.jsx)(kk,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_66412"),text:t("suppression_de_73669",e.delegation.name),onClose:e.onClose,onDelete:async()=>{await r({organizationId:n,eventId:o,selecteds:{ids:[e.delegation.id]}}),s(t("la_d_l_gation_31201",e.delegation.name)),e.onSuccess()}})},pw=({delegation:e,reload:t})=>{const{history:n,translate:o,params:{organizationId:s,eventId:r,delegationId:a}}=il(),{isOrganizationAdmin:l}=nI(),{isEventAdmin:d}=Uv(),{mutate:c}=Wr(),{mutate:u}=Bs(),{mutate:h}=js(),[m,g]=(0,F.useState)(!1),[p,f]=(0,F.useState)(!1),x=l||d,_=e.lockedAt?.isValid;return(0,i.jsxs)(kC,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(yb,{returnPathFallback:to.DELEGATIONS({organizationId:s,eventId:r})}),(0,i.jsxs)(Ea,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(fr,{font:"gray900 displayXs medium",children:e.name}),_&&(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{color:"error600",fontSize:"textMd",children:(0,i.jsx)(Va,{icon:"lock-keyhole"})})}),(0,i.jsx)(am,{placement:"top",children:o("cette_d_l_gatio_29556")})]})]}),x&&(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",disabled:e.numberOfResources>=(e.maxResources??1/0),children:o("ajouter_un_memb_33261")})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsx)(Od,{icon:"user-plus",onClick:()=>{n.push(kI.CREATE({organizationId:s,eventId:r,delegationId:a}))},children:o("ajouter_un_nouv_29283")}),(0,i.jsx)(Od,{icon:"user-group",onClick:e=>{wd(e.target),f(!0)},children:o("ajouter_des_mem_06922")})]})]}),x&&(0,i.jsx)(pl,{to:ri(to.DELEGATION({organizationId:s,eventId:r,delegationId:e.id})),children:o("_diter_la_d_l_g_30300")}),x&&(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[r&&(0,i.jsx)(Od,{icon:"check",onClick:async()=>{await u({eventId:r,delegationId:e.id}),t()},children:o("valider_les_acc_80801")}),_?(0,i.jsx)(Od,{icon:"lock-keyhole-open",onClick:async()=>{await h({organizationId:s,eventId:r,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:ve.IsLocked,strategy:Je.Replace,value:!1}}),t()},children:o("d_verrouiller_67042")}):(0,i.jsx)(Od,{icon:"lock-keyhole",onClick:async()=>{await h({organizationId:s,eventId:r,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:ve.IsLocked,strategy:Je.Replace,value:!0}}),t()},children:o("verrouiller_24528")}),(0,i.jsx)(Od,{icon:"clone",onClick:async()=>{const{delegationDuplicate:t}=await c({organizationId:s,eventId:r,delegationId:e.id});n.push(ri(to.DELEGATION({organizationId:s,eventId:r,delegationId:t.id})))},children:o("dupliquer_28256")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{g(!0)},children:o("supprimer_43083")})]})]}),m&&(0,i.jsx)(gw,{delegation:e,onClose:()=>g(!1),onSuccess:()=>n.replace(r?to.DELEGATIONS({organizationId:s,eventId:r}):So.COMMUNITY_DELEGATIONS(s))}),p&&(0,i.jsx)(mw,{delegationId:e.id,eventId:r,organizationId:s,reload:t,onClose:()=>{f(!1)}})]})};var fw=n(6349);const xw=e=>({title:{display:!0,font:{weight:500},padding:{bottom:30},text:e}}),_w=()=>({border:{display:!1},grid:{color:lr.colors.gray100.value}}),Iw=({datasets:e,labels:t,options:n})=>{const o=(0,F.useMemo)(()=>(0,vl.A)("chart-"),[]),s=(0,F.useRef)(null),r={animation:!1,datasets:{bar:{borderRadius:8}},maintainAspectRatio:!1,plugins:{legend:{align:"end",labels:{useBorderRadius:!0,borderRadius:5,boxWidth:10,boxHeight:10}}},scales:{x:{grid:{display:!1}},y:_w()}};return(0,F.useEffect)(()=>{s.current&&s.current.destroy(),s.current=new fw.Ay(document.getElementById(o),{type:"bar",options:(0,Fa.A)(r,n),data:{labels:t,datasets:e}})},[e,t,n]),(0,i.jsx)(fr,{height:1,width:1,children:(0,i.jsx)("canvas",{id:o})})},vw=e=>{const t=Ln(),n=Nn($c),o=(0,F.useMemo)(()=>Ih(e.slots),[e.slots]),s=(0,F.useMemo)(()=>e.accreditation.hasSlots?o.map(e=>ph(n,e,"",{accreditation:{includeName:!1}})):[e.accreditation.name],[o,e.accreditation]),r=(0,F.useMemo)(()=>{const n=o.some(e=>"number"==typeof e.maxResources),i=o.some(e=>"number"==typeof e.delegationsTotalResources&&e.delegationsTotalResources>0);return(0,Da.A)([e.accreditation.willAutoAccredit?null:{label:t("souhait_es_78101"),data:o.map(e=>e.wishedResources),backgroundColor:n?o.map(e=>e.assignedResources+e.wishedResources<=(e.maxResources??1/0)?lr.colors.primary400.value:Nd(lr.colors.primary400.value,.5)):lr.colors.primary400.value},{label:t("affect_es_00048"),data:o.map(e=>e.assignedResources),backgroundColor:n?o.map(e=>e.assignedResources<=(e.maxResources??1/0)?lr.colors.primary700.value:Nd(lr.colors.error500.value,.7)):lr.colors.primary700.value},{label:t("scann_es_13169"),data:o.map(e=>e.scannedResources),backgroundColor:lr.colors.primary900.value},n?{label:t("maximum_56225"),data:o.map(e=>e.maxResources??1/0),backgroundColor:lr.colors.gray200.value}:null,i?{label:t("total_attribu_e_97130"),data:o.map(e=>e.delegationsTotalResources??0),backgroundColor:lr.colors.gray400.value}:null])},[o]);return(0,i.jsx)(Iw,{datasets:r,labels:s,options:{scales:{y:{..._w(),ticks:{precision:0},...xw(t("nb_d_accr_dita_23359"))},x:{grid:{display:!1},...xw(t(e.accreditation.hasSlots?"slots_05517":"Accreditation"))}}}})},bw=e=>{const t=(0,F.useMemo)(()=>e.event.delegation.accreditationsSlots.filter(t=>t.accreditationId===e.accreditation.id).map(e=>({maxResources:e.maxResources,assignedResources:e.assignedResources,scannedResources:e.scannedResources,wishedResources:e.wishedResources,name:e.accreditationSlot.name,date:e.accreditationSlot.date})),[e.accreditation,e.event]);return(0,i.jsx)(WA,{title:e.accreditation.name,children:(0,i.jsx)(fr,{height:380,width:1,children:(0,i.jsx)(vw,{accreditation:e.accreditation,slots:t})})})},jw=e=>{const t=(0,F.useMemo)(()=>Vj((0,Ju.A)(e.event.delegation.accreditations.map(e=>{const t=e.willAutoAccredit||e.accreditation.willAutoAccredit;return{...e.accreditation,willAutoAccredit:t}}),e=>e.id)),[e.event]);return(0,i.jsx)(Ea,{direction:"column",gap:"4",children:Zo(t)?t.map(t=>(0,i.jsx)(bw,{accreditation:t,event:e.event},t.id)):(0,i.jsx)(DA,{})})},Cw=()=>{const{params:{eventId:e,delegationId:t}}=il(),{data:n,loader:o}=Vn("query DelegationReporting($eventId: EventId!, $delegationId: DelegationId!) {\n    event(id: $eventId) {\n        delegation(id: $delegationId) {\n            accreditations {\n                accreditationId\n                willAutoAccredit\n\n                accreditation {\n                    id\n                    name\n                    accreditationCategoryName\n                    hasSlots\n                    index\n                    willAutoAccredit\n                }\n            }\n\n            accreditationsSlots {\n                accreditationId\n                maxResources\n                assignedResources\n                scannedResources\n                wishedResources\n\n                accreditationSlot {\n                    name\n                    date\n                }\n            }\n        }\n    }\n}\n",{eventId:e,delegationId:t},[]);return o||(0,i.jsx)(jw,{event:n.event})},yw=e=>{const{translate:t,params:{organizationId:n,eventId:o,delegationId:s}}=il(),{hasFeature:r,isOrganizationAdmin:a}=nI(),{isEventAdmin:l,isEventReader:d}=Uv(),c=a||l,u=(0,F.useMemo)(()=>e.organization.allowDelegationSpaceDownload||Zo(e.organization.delegation.customDocuments??[]),[e.organization]),h=(0,F.useMemo)(()=>(e.organization.delegationsSpaceCustomBadges??[]).concat(e.organization.delegation.customDocuments.map(e=>e.slug)??[]),[e.organization]),m=(0,F.useMemo)(()=>e.organization.delegation.event?.customDocuments??[],[e.organization]),g=e=>({organizationId:e?":organizationId":n,eventId:o?e?":eventId":o:void 0,delegationId:e?":delegationId":s});return Cd(e.organization.delegation.name),(0,i.jsxs)(AC,{children:[(0,i.jsx)(pw,{delegation:e.organization.delegation,reload:e.reload}),(0,i.jsxs)(Vy,{css:{flex:"1"},children:[(0,i.jsxs)(Ly,{css:{px:"$7"},children:[(0,i.jsx)(Ny,{path:to.DELEGATION_DASHBOARD(g(!1)),children:t("tableau_de_bord_24627")}),(0,i.jsx)(Ny,{path:to.DELEGATION_MEMBERS(g(!1)),children:t("membres_125561",e.organization.delegation.numberOfResources)}),o&&r(Fe.Accreditation)&&(0,i.jsx)(Ny,{path:to.DELEGATION_ACCREDITATIONS(g(!1)),children:t("accr_ditations_39450")}),o&&r(Fe.Accreditation)&&(0,i.jsx)(Ny,{path:to.DELEGATION_REPORTING(g(!1)),children:"Reporting"}),o&&u&&(0,i.jsx)(Ny,{path:to.DELEGATION_DOCUMENTS(g(!1)),children:t("Documents")})]}),(0,i.jsx)(By,{path:to.DELEGATION_DASHBOARD(g(!0)),children:(0,i.jsx)(rw,{})}),(0,i.jsx)(By,{path:to.DELEGATION_MEMBERS(g(!0)),children:o?(0,i.jsx)(yC,{children:(0,i.jsx)(uA,{campaigns:e.organization.delegation.campaigns,canAccredit:c,canClickMemberName:!0,canDeleteMembers:c,canEditColumns:!0,canEditMembers:c,columns:e.organization.delegation.columns,customBadges:e.organization.delegationsSpaceCustomBadges,customFieldsPrivacy:fe.All,deleteFromEvent:!1,getEditPath:t=>So.EDIT_USER_DELEGATION_FORM(n,o,s,t.userInfo.id,e.organization.delegation.formId),onlyVisibleAccreditationsSlots:!d,showAccreditationsEdit:c,showAccreditationsValidate:c,showDeleteFromEvent:c,showDocumentsDownload:!0,showEditMode:c})}):(0,i.jsx)(yC,{children:(0,i.jsx)(fA,{campaigns:e.organization.delegation.campaigns,canClickMemberName:!0,canDeleteMembers:c,canEditColumns:!0,canEditMembers:c,columns:e.organization.delegation.columns,customBadges:e.organization.delegationsSpaceCustomBadges,getEditPath:e=>So.COMMUNITY_EDIT_USER_DELEGATION(n,s,e.id),isOrganizationAdmin:c,showDocumentsDownload:!0})})}),(0,i.jsx)(By,{path:to.DELEGATION_ACCREDITATIONS(g(!0)),children:(0,i.jsx)(yC,{children:(0,i.jsx)(FA,{isEventAdmin:l,onlyVisible:!d})})}),(0,i.jsx)(By,{path:to.DELEGATION_REPORTING(g(!0)),children:(0,i.jsx)(yC,{children:(0,i.jsx)(Cw,{})})}),(0,i.jsx)(By,{path:to.DELEGATION_DOCUMENTS(g(!0)),children:(0,i.jsx)(yC,{children:(0,i.jsx)(NA,{customDocuments:m,delegationsSpaceCustomBadges:h})})})]})]})},kw=()=>{const{params:{organizationId:e,eventId:t,delegationId:n}}=il(),{data:o,loader:s,reload:r}=Vn("query Delegation($organizationId: OrganizationId!, $delegationId: DelegationId!) {\n    organization(id: $organizationId) {\n        ...OrganizationCustomFields\n\n        allowDelegationSpaceDownload\n        delegationsSpaceCustomBadges\n\n        delegation(id: $delegationId) {\n            id\n            name\n            formId\n            numberOfResources\n            maxResources\n            columns\n            parentId\n            lockedAt\n\n            campaigns {\n                id\n                name\n            }\n\n            customDocuments {\n                slug\n                name\n            }\n\n            event {\n                customDocuments {\n                    slug\n                    name\n                }\n            }\n        }\n    }\n}\n",{organizationId:e,delegationId:n},[Ro.OrganizationCustomFieldsFragment]);return s||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{exact:!0,path:to.DELEGATION({organizationId:":organizationId",eventId:t?":eventId":void 0,delegationId:":delegationId"}),children:(0,i.jsx)(Yn,{path:to.DELEGATION_DASHBOARD({organizationId:e,eventId:t,delegationId:n}),replace:!0})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(yw,{organization:o.organization,reload:r})})]})},Aw=({backgroundColor:e,button:t,iconColor:n,value:o,icon:s,text:r})=>(0,i.jsxs)(Ea,{css:{backgroundColor:e??"$white",bd:!0,flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Ea,{css:{borderBottom:t?"1px solid $gray200":"none",padding:"$6"},direction:"column",children:[s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(mj,{color:n??"primary",icon:s}),(0,i.jsx)(Pa,{height:"6"})]}),(0,i.jsx)(fr,{color:"gray500",children:r}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"displayMd",fontWeight:"semiBold",children:o})]}),t&&(0,i.jsx)(Ea,{css:{background:"$gray50",padding:"$4 $6"},gap:"4",justify:"end",children:t})]}),ww=e=>{const t=Ln(),[n,o,s]=Ec(""),{data:r,loader:a}=Vn("query CollaboratorsVolunteers($organizationId: OrganizationId!, $eventId: EventId!, $name: String) {\n    event(id: $eventId) {\n        collaborators(name: $name) {\n            userInfo(organizationId: $organizationId) {\n                ...LeaderUserInfo\n            }\n        }\n\n        volunteersRegistrations(name: $name, limit: 50) {\n            nodes {\n                userInfo {\n                    ...LeaderUserInfo\n                }\n            }\n        }\n    }\n}\n",{organizationId:e.organizationId,eventId:e.eventId,name:h(o)?o:void 0},[Ro.LeaderUserInfoFragment]);const[l,d]=(0,F.useState)(!1),[c,u]=(0,F.useState)(null),[m,g]=(0,F.useState)(null),{styles:p,attributes:f,update:x}=(0,Rd.E)(c,m,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,8]}}]}),_=(0,F.useMemo)(()=>c?.getBoundingClientRect().width??100,[c]),I=(0,F.useMemo)(()=>{const t=t=>void 0!==e.currentLeaders.find(e=>e.userInfo.id===t),n=(r.event?.collaborators??[]).map(({userInfo:e})=>e.id);return(r.event?.collaborators??[]).map(({userInfo:e})=>({...e,isAdmin:!0,isDisabled:t(e.id)})).concat((r.event?.volunteersRegistrations.nodes??[]).filter(({userInfo:e})=>!n.includes(e.id)).map(({userInfo:e})=>({...e,isAdmin:!1,isDisabled:t(e.id)})))},[r.event,e.currentLeaders]);return(0,F.useEffect)(()=>{x?.()},[x,l,c,I]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ea,{ref:u,onClick:e=>{Il(e),d(!l)},children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_17775"),value:n,onChange:s})}),(0,i.jsx)(Ea,{ref:g,css:{background:"white",border:"1px solid $gray100",borderRadius:"$2",boxShadow:"$md",display:l?"flex":"none",maxHeight:"360px",overflowY:"auto",py:"$2",zIndex:1e3,...p.popper},direction:"column",width:_,onClick:e=>{Il(e)},...f.poppeer,children:a||I.map(n=>(0,i.jsxs)(Ea,{align:"center",css:{cursor:n.isDisabled?"initial":"pointer",padding:"10px $4",userSelect:"none","&:hover":{background:n.isDisabled?"inherit":"$primary100"}},gap:"3",children:[(0,i.jsx)(Eb,{badge:n.isAdmin&&(0,i.jsx)(Gd,{color:"primary",children:t("administrateur_38490")}),disabled:n.isDisabled,userInfo:n}),!n.isDisabled&&(0,i.jsx)(pl,{color:"white",leftIcon:"plus",size:"sm",onClick:()=>{e.onAdd(n)}})]},n.id))})]})},Sw=e=>{const t=Ln();return(0,i.jsxs)(Ea,{align:"center",gap:"5",children:[(0,i.jsx)(fr,{css:{flex:1,maxWidth:"calc(50% - 32px)"},children:(0,i.jsx)(Eb,{userInfo:e.leader.userInfo})}),(0,i.jsx)(fr,{css:{flex:1,maxWidth:"calc(50% - 32px)"},children:(0,i.jsx)(gu,{shouldParseAsInt:!0,value:e.leader.role.id,onChange:t=>{e.onRoleChange(t)},children:e.roles.map((e,n)=>(0,i.jsx)("option",{value:e.id,children:t(e.name)},n))})}),(0,i.jsx)(fr,{color:"gray500",css:{cursor:"pointer",width:"$6",padding:"$1"},onClick:e.onDelete,children:(0,i.jsx)(Va,{icon:"trash-can"})})]})},Ew=e=>{const t=Ln(),{organization:n}=nI(),[o,s]=(0,F.useState)(e.currentLeaders),r=(0,F.useMemo)(()=>n.roles.filter(t=>e.rolesTypes.includes(t.type)),[n.roles,e.rolesTypes]),a=r.find(t=>t.type===e.defaultRoleType);return(0,i.jsxs)(Bc,{size:"lg",onClose:e.onClose,children:[(0,i.jsx)(Ea,{justify:"center",children:(0,i.jsx)(mj,{color:"primary",icon:"user-gear"})}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("modification_de_24714")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:t("les_responsable_92946")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(ww,{currentLeaders:o,eventId:e.eventId,organizationId:e.organizationId,onAdd:e=>{s(o.concat([{userInfo:e,role:a}]))}}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Ea,{css:{flex:"1",overflowY:"auto"},direction:"column",gap:"4",children:o.map((e,t)=>(0,i.jsx)(Sw,{leader:e,roles:r,onDelete:()=>{s((0,Xd.A)(o,e))},onRoleChange:e=>{s((0,Jc.jM)(n=>{n[t].role=r.find(t=>t.id===e)}))}},e.userInfo.id))}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{onClick:()=>{e.onSave(o.map(e=>({userInfoId:e.userInfo.id,roleId:e.role.id})))},children:t("enregistrer_06519")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},Tw=({leaders:e})=>{const t=Ln();return Zo(e)?(0,i.jsx)(i.Fragment,{children:e.map((e,n)=>(0,i.jsxs)(F.Fragment,{children:[0!==n&&(0,i.jsx)($u,{height:"4"}),(0,i.jsx)(Eb,{badge:(0,i.jsx)(Gd,{color:"gray",children:t(e.role.name)}),userInfo:e.userInfo})]},e.userInfo.id))}):(0,i.jsx)(fr,{color:"gray500",textAlign:"center",width:1,children:t("aucun_reponsabl_38504")})},zw=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{isEventAdmin:s}=Uv(),[r,a]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(WA,{rightIcon:s?"pen":void 0,rightIconClick:()=>{a(!0)},title:t("reponsable_82458_plural"),children:(0,i.jsx)(Tw,{leaders:e.leaders})}),s&&r&&(0,i.jsx)(Ew,{currentLeaders:e.leaders,defaultRoleType:e.defaultRoleType,eventId:o,organizationId:n,rolesTypes:e.rolesTypes,onClose:()=>{a(!1)},onSave:async t=>{await e.onSave(t),e.reload()}})]})},$w=e=>{const t=Ln();return"onSave"in e?(0,i.jsx)(zw,{...e}):(0,i.jsx)(WA,{title:t("reponsable_82458_plural"),children:(0,i.jsx)(Tw,{leaders:e.leaders})})},Ow=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,delegationCategoryId:s}}=il(),[r,a,l]=Ec(""),[d,c]=(0,F.useState)(0),{data:u,isLoading:m}=Vn("query DelegationCategoryDelegations(\n    $organizationId: OrganizationId!\n    $level: OrganizationEventLevel!\n    $eventId: EventId\n    $delegationCategoryId: DelegationsCategoryId!\n    $name: String\n    $offset: Int\n) {\n    organization(id: $organizationId) {\n        delegations(\n            level: $level\n            eventId: $eventId\n            name: $name\n            delegationsCategoriesIds: [$delegationCategoryId]\n            limit: 25\n            offset: $offset\n        ) {\n            nodes {\n                id\n                name\n                state\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{organizationId:n,eventId:o,level:o?et.Event:et.Organization,delegationCategoryId:s,name:h(a)?a:void 0,offset:d},[]);const{numberOfPages:g,totalCount:p}=lu(u.organization?.delegations);return(0,i.jsx)(kc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_une_31213"),value:r,onChange:l})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:t("nom_de_la_d_l_g_28087")}),(0,i.jsx)(Tc,{children:t("status_06428")})]}),numberOfPages:g,offset:d,rows:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):u.organization.delegations.nodes.map(s=>(0,i.jsxs)(Cc,{css:{cursor:"pointer"},onClick:()=>{e.push(to.DELEGATION({organizationId:n,eventId:o,delegationId:s.id}))},children:[(0,i.jsx)(xc,{children:(0,i.jsx)(fr,{font:"gray900 textSm medium",children:s.name})}),(0,i.jsx)(xc,{children:(0,i.jsx)(Gd,{...Zb(s.state),children:t(s.state)})})]},s.id)),setOffset:c,title:t("liste_des_d_l_g_86270"),totalCount:p})},Rw=e=>{const{translate:t,params:{organizationId:n,eventId:o,delegationCategoryId:s}}=il(),{mutate:r}=function(e={}){return Un("mutation DelegationsCategoriesMassLeadersEdit(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $massLeaders: MassLeadersInput!\n) {\n    delegationsCategoriesMassLeadersEdit(\n        organizationId: $organizationId\n        eventId: $eventId\n        massLeaders: $massLeaders\n    )\n}\n",e)}();return(0,i.jsx)(yC,{children:(0,i.jsxs)(Ea,{direction:"column",gap:"6",children:[(0,i.jsxs)(Ea,{gap:"6",width:1,children:[(0,i.jsx)(Aw,{text:t("nombre_de_d_l_g_45708"),value:e.delegationCategory.numberOfDelegations}),(0,i.jsx)(Aw,{text:t("number_of_membe_24698"),value:e.delegationCategory.numberOfResources})]}),(0,i.jsx)(Ea,{children:(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(Ow,{})})}),(0,i.jsx)(Ea,{children:(0,i.jsx)($w,{defaultRoleType:pt.DelegationCategoryLeader,leaders:e.delegationCategory.leaders,reload:e.reload,rolesTypes:[pt.Custom,pt.DelegationCategoryLeader],onSave:e=>r({organizationId:n,eventId:o,massLeaders:{leaders:e,selecteds:{ids:[s]},strategy:Je.Replace}})})})]})})},Pw=e=>{const t=Ln(),{mutate:n}=function(e={}){return Un("mutation DelegationCategoryDelete(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $delegationCategoryId: DelegationsCategoryId!\n) {\n    delegationCategoryDelete(\n        organizationId: $organizationId\n        eventId: $eventId\n        delegationCategoryId: $delegationCategoryId\n    ) {\n        id\n    }\n}\n",e)}();return(0,i.jsx)(kk,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_50954"),t("cela_supprimera_35330")],text:t("suppression_de_73669",e.delegationCategory.name),onClose:e.onClose,onDelete:async()=>{await n({organizationId:e.organizationId,eventId:e.eventId,delegationCategoryId:e.delegationCategory.id}),e.onSuccess()}})},Dw=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=il(),{isOrganizationAdmin:r}=nI(),{isEventAdmin:a}=Uv(),{mutate:l}=function(e={}){return Un("mutation DelegationCategoryDuplicate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $delegationCategoryId: DelegationsCategoryId!\n) {\n    delegationCategoryDuplicate(\n        organizationId: $organizationId\n        eventId: $eventId\n        delegationCategoryId: $delegationCategoryId\n    ) {\n        id\n    }\n}\n",e)}(),d=r||a,[c,u]=(0,F.useState)(!1),[h,m]=(0,F.useState)(!1);return(0,i.jsxs)(kC,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(yb,{returnPathFallback:to.DELEGATIONS({organizationId:o,eventId:s})}),(0,i.jsx)(fr,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.category.name}),d&&(0,i.jsx)(pl,{color:"white",onClick:()=>m(!0),children:n("_diter_62574")}),d&&(0,i.jsx)(pl,{onClick:()=>{t.push(s?So.CREATE_DELEGATION(o,s,e.category.id):So.COMMUNITY_CREATE_DELEGATION(o,e.category.id))},children:n("ajouter_une_d_l_79133")}),d&&(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsx)(Od,{icon:"copy",onClick:async()=>{const{delegationCategoryDuplicate:{id:n}}=await l({organizationId:o,eventId:s,delegationCategoryId:e.category.id});t.push(to.DELEGATION_CATEGORY({organizationId:o,eventId:s,delegationCategoryId:n}))},children:n("dupliquer_28256")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{u(!0)},children:n("supprimer_43083")})]})]}),h&&(0,i.jsx)(uC,{delegationCategory:e.category,eventId:s,organizationId:o,onClose:()=>{m(!1)},onSuccess:e.reload}),c&&(0,i.jsx)(Pw,{delegationCategory:e.category,eventId:s,organizationId:o,onClose:()=>{u(!1)},onSuccess:()=>{t.replace(to.DELEGATIONS({organizationId:o,eventId:s}))}})]})},Fw=()=>{const{params:{organizationId:e,eventId:t,delegationCategoryId:n}}=il(),o=Nn(Eh),s=Nn(mA),{isOrganizationAdmin:r}=nI(),{isEventAdmin:a}=Uv(),l=r||a,[d,c,u]=wC(e,"delegationCategoryMembers.columns",["name","delegations"]),[h,m,g]=wC(e,"delegationCategoryMembers.limit",_c),[p,f,x]=wC(e,"delegationCategoryMembers.predicates",[]),[_,I,v]=wC(e,"delegationCategoryMembers.sort",null),{data:b,isLoading:j}=Vn("query DelegationCategoryMembersInfos($organizationId: OrganizationId!, $eventId: EventId) {\n    organization(id: $organizationId) {\n        customFields(variety: UserInfo, privacy: All) {\n            nodes {\n                ...SegmentCustomField\n            }\n        }\n\n        event: eventMaybe(id: $eventId) {\n            startAt\n            endAt\n            isWeezeventConnected\n        }\n    }\n}\n",{organizationId:e,eventId:t},[Ro.SegmentCustomFieldFragment]),C=u||g||x||v||j,y=(0,F.useMemo)(()=>b.organization?.customFields.nodes??[],[b.organization]),k=SC(y),A=(0,F.useMemo)(()=>b.organization?t?o.getDelegationCategoryMembersFilters(e,t,y,b.organization.event,b.organization?.event?.isWeezeventConnected??!1):s.getDelegationMembersFilters(y):[],[t,y]),w=(0,F.useMemo)(()=>t?o.getDelegationCategoryMembersPossibleColumns(y,b.organization?.event?.isWeezeventConnected??!1):s.getDelegationMembersPossibleColumns(y),[t,y,b]);return C?(0,i.jsx)(ul,{}):(0,i.jsx)(yC,{children:(0,i.jsx)(Zh,{columns:d,columnsSearch:[],columnsToIncludes:t?Sh:hA,eventId:t,filters:A,getMassActionId:e=>t?e.userInfo.id:e.id,limit:h,loadDataList:t?Xs:Ds,loadDataListParams:{delegationCategoryId:n,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:t?Ks:Ps,loadRowParams:{includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:e,possibleColumns:w,predicates:p,renderActions:(e,t,n)=>(0,i.jsx)(iA,{campaigns:[],customFields:y,deleteFromEvent:!1,massActions:e,showAccreditationsEdit:!1,showAccreditationsValidate:!1,showDelete:!1,showWishedAccreditationsEdit:!1,onMassEditSuccess:n}),rendering:yh.List,setColumns:c,setLimit:m,setPredicates:f,setSort:I,showEditColumns:!0,showEditMode:l,showFilters:!0,showMassActions:l,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,sort:_,children:(0,i.jsx)(cm,{renderCell:(e,n,o)=>t?(0,i.jsx)(My,{canAccredit:!0,canAssign:!1,canChangeDelegation:!0,canClickMemberName:!0,column:e,customField:k.get(e.slug),eventId:t,reloadRow:o,row:n}):(0,i.jsx)(pA,{canClickMemberName:!0,column:e,customField:k.get(e.slug),reloadRow:o,row:n,updatable:!0})})})})},Mw=e=>{const{translate:t,params:{organizationId:n,eventId:o,delegationCategoryId:s}}=il(),r=e=>({organizationId:e?":organizationId":n,eventId:o?e?":eventId":o:void 0,delegationCategoryId:e?":delegationCategoryId":s}),a=e.organization.delegationCategory;return(0,i.jsxs)(AC,{children:[(0,i.jsx)(Dw,{category:a,reload:e.reload}),(0,i.jsxs)(Vy,{css:{flex:"1"},children:[(0,i.jsxs)(Ly,{css:{px:"$7"},children:[(0,i.jsx)(Ny,{path:to.DELEGATION_CATEGORY_DASHBOARD(r(!1)),children:t("tableau_de_bord_24627")}),(0,i.jsx)(Ny,{path:to.DELEGATION_CATEGORY_MEMBERS(r(!1)),children:t("membres_125561",a.numberOfResources)})]}),(0,i.jsx)(By,{path:to.DELEGATION_CATEGORY_DASHBOARD(r(!0)),children:(0,i.jsx)(Rw,{delegationCategory:a,reload:e.reload})}),(0,i.jsx)(By,{path:to.DELEGATION_CATEGORY_MEMBERS(r(!0)),children:(0,i.jsx)(Fw,{})})]})]})},Nw=e=>{const{params:{organizationId:t,eventId:n,delegationCategoryId:o}}=il(),{data:s,loader:r,reload:a}=Vn("query DelegationCategory(\n    $organizationId: OrganizationId!\n    $delegationCategoryId: DelegationsCategoryId!\n) {\n    organization(id: $organizationId) {\n        delegationsSpaceCustomBadges\n\n        delegationCategory(id: $delegationCategoryId) {\n            id\n            name\n            numberOfDelegations\n            numberOfResources\n\n            leaders {\n                ...LeaderInfos\n            }\n        }\n    }\n}\n",{organizationId:t,delegationCategoryId:o},[Ro.LeaderInfosFragment]);return r||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{exact:!0,path:to.DELEGATION_CATEGORY({organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(Yn,{path:to.DELEGATION_CATEGORY_DASHBOARD({organizationId:t,eventId:n,delegationCategoryId:o}),replace:!0})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Mw,{organization:s.organization,reload:a})})]})},Lw=()=>{const e=Ln();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ha,{color:"primary",leftIcon:"clock",children:e("votre_import_es_05273")}),(0,i.jsx)(Pa,{height:"6"})]})};const Bw=5e9;let Vw=class extends zl{constructor(e){super(e)}schema(){const e=this.t("le_document_est_86403");return l.Ik().shape({acl:l.Yj().required(e),key:l.Yj().required(e).test("is-a-zip",this.t("le_fichier_n_es_91526"),e=>RI(zI(e).extension)===OI.Zip),name:l.Yj().required(e),file:l.gl().test("is-not-too-big",this.t("le_fichier_est_17522"),e=>!e||e.size=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],Vw);let Uw=class extends zl{documentInputService;archiveInputService;constructor(e,t,n){super(n),this.documentInputService=e,this.archiveInputService=t}default(){return{input:{archive:this.documentInputService.documentInputDefault(),fieldId:-1}}}schema(){return l.Ik().shape({input:l.Ik().shape({archive:this.archiveInputService.schema(),fieldId:l.Yj().required(this.t("le_champ_person_80074")).typeError(this.t("le_champ_person_80074"))})})}};Uw=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[ej,Vw,Dn])],Uw);const Ww=()=>{const{translate:e,params:{organizationId:t}}=il();return(0,i.jsx)(Cm,{hideToggle:!0,initialIsOpen:!0,subtitle:e("s_lectionnez_vo_27155",Hk.bytesToGigabytes(Bw),Hk.bytesToMegabytes(2e7)),title:e("votre_fichier_d_51776"),children:(0,i.jsx)(oj,{accept:HI.Archives,acl:"private",organizationId:t,prefix:"input.archive.",withFileField:!0})})},Gw=({customFields:e})=>{const t=Ln();return(0,i.jsx)(Cm,{hideToggle:!0,initialIsOpen:!0,subtitle:t("_ditez_la_corre_24969"),title:t("correspondance_10480"),children:(0,i.jsxs)(lj,{label:t("sur_quel_champ_17516"),name:"input.fieldId",children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:-1,children:t("s_lectionnez_un_82446")}),e.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})})},Hw=({customFileFields:e})=>(0,i.jsx)(Gw,{customFields:e}),qw=e=>!!e.getFieldState("input.archive.key")?.valid&&!!e.getFieldState("input.archive.file")?.valid,Yw=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=il(),o=Nn(Uw),s=Nn(za),r=(0,F.useRef)(null),{data:a,loader:l}=Vn("query FilesImportCustomFields($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        customFileFields: customFields(variety: UserInfo, fieldTypes: [File]) {\n            nodes {\n                id\n                name\n                slug\n                customFieldCategoryId\n                customFieldCategoryName\n                fieldType\n                fieldProperty\n                canSelectMultiple\n\n                values {\n                    id\n                    value\n                }\n            }\n        }\n    }\n}\n",{organizationId:t},[]),{mutate:d}=function(e={}){return Un("mutation FilesImport(\n    $eventId: EventId\n    $organizationId: OrganizationId!\n    $input: FilesImportInput!\n) {\n    jobId: filesImport(eventId: $eventId, organizationId: $organizationId, input: $input)\n}\n",e)}(),{checkFilesImport:c}=Yv();return l||(0,i.jsx)(dl,{customErrorRef:r,height:1,initialValues:{input:o.default().input},render:({form:o,handleSubmit:s,submitting:l,values:d})=>(0,i.jsx)(bm,{button:(0,i.jsx)(pl,{isLoading:l,onClick:s,children:e("importer_la_lis_12866")}),category:e("importe_des_fic_85041"),color:"dark",fallbackClosePath:n?So.VOLUNTEERS(t,n):fi.COMMUNITY_USERS({organizationId:t}),title:e("nouvel_import_48306"),children:(0,i.jsxs)(Im,{ref:r,children:[o.getState().submitSucceeded&&(0,i.jsx)(Lw,{}),(0,i.jsx)(sl,{}),(0,i.jsxs)(Ea,{direction:"column",gap:"5",children:[(0,i.jsx)(Ww,{}),d.input.archive?.file&&qw(o)&&(0,i.jsx)(Hw,{customFileFields:a.organization.customFileFields.nodes})]})]})}),validate:s.validateForForm(o.schema()),onSubmit:async({input:e})=>{const i=(e=>{const t={...e.archive};return delete t.file,{...e,archive:t}})(e);try{const{jobId:e}=await d({eventId:n,organizationId:t,input:i});r.current&&(r.current.scrollTop=0),c(t,e)}catch{}}})},Kw=e=>{const t=Ln(),{mutate:n}=Kr(),{data:o}=qr({organizationId:e.organizationId}),s=(0,F.useMemo)(()=>(o.organization?.events.nodes??[]).filter(t=>t.id!==e.eventId),[o.organization,e.eventId]),r=(0,F.useMemo)(()=>l.Ik().shape({eventId:l.ai().required(t("l_v_nement_est_88155")).oneOf(s.map(e=>e.id),t("l_v_nement_est_88155"))}),[s]);return(0,i.jsxs)(gj,{buttonText:t("dupliquer_ce_fo_10581"),icon:"sliders",initialValues:{eventId:-1},schema:r,size:"md",subtitle:t("dupliquer_votre_17703"),title:t("dupliquer_vers_48809"),onClose:e.onClose,onSubmit:async t=>{await n({organizationId:e.organizationId,eventId:e.eventId,formId:e.formId,newEventId:t.eventId}),e.onClose()},children:[(0,i.jsxs)(Ha,{color:"warning",leftIcon:"triangle-exclamation",children:[t("toutes_les_info_60876"),(0,i.jsx)("br",{}),t("certains_param_05954")]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Sm,{isSearchVisible:!0,label:t("sur_quel_v_nem_94155"),multiple:!1,name:"eventId",children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})},Zw=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{showNotification:s}=Yv(),{mutate:r}=Kr(),{mutate:a}=function(e={}){return Un("mutation FormDelete($organizationId: OrganizationId!, $eventId: EventId, $formId: FormId!) {\n    formDelete(organizationId: $organizationId, eventId: $eventId, formId: $formId) {\n        id\n    }\n}\n",e)}(),[l,d]=(0,F.useState)(!1),[c,u]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",css:{bd:!0,padding:"$4 $6"},gap:"6",width:1,children:[(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(j_,{to:zi.FORM_ELEMENTS({organizationId:n,eventId:o,formId:e.form.id}),children:e.form.name})}),(0,i.jsxs)(fr,{color:"gray500",children:[t("nombre_de_champ_91879")," ",(0,i.jsx)(Pm,{color:"gray800",children:e.form.numberOfCustomFields})]}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[e.canDuplicate&&(0,i.jsx)(Od,{icon:"clone",onClick:async t=>{Il(t),await r({organizationId:n,eventId:o,formId:e.form.id}),e.reload()},children:t("dupliquer_28256")}),o&&e.canDuplicate&&(0,i.jsx)(Od,{icon:"clone",onClick:()=>{d(!0)},children:t("dupliquer_sur_u_11076")}),e.canDuplicate&&(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:e=>{Il(e),u(!0)},children:t("supprimer_43083")})]})]})})]}),l&&(0,i.jsx)(Kw,{eventId:o,formId:e.form.id,organizationId:n,onClose:()=>{d(!1)}}),c&&(0,i.jsx)(kk,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_75358"),text:t("suppression_de_73669",e.form.name),onClose:()=>{u(!1)},onDelete:async()=>{await a({organizationId:n,eventId:o,formId:e.form.id}),s(t("le_formulaire_76783",e.form.name)),e.reload()}})]})};let Xw=class extends zl{constructor(e){super(e)}formInputDefault(){return{name:""}}formInputSchema(){return l.Ik().shape({name:l.Yj().required(this.t("le_nom_est_requ_61536"))})}createFormSchema(){return l.Ik().shape({form:this.formInputSchema()})}};Xw=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],Xw);const Jw=e=>{const t=Ln(),n=Nn(Xw),{mutate:o}=function(e={}){return Un("mutation FormCreate($organizationId: OrganizationId!, $eventId: EventId, $form: FormInput!) {\n    formCreate(organizationId: $organizationId, eventId: $eventId, form: $form) {\n        id\n    }\n}\n",e)}();return(0,i.jsx)(gj,{buttonText:t("cr_er_le_formul_42369"),icon:"sliders",initialValues:{form:n.formInputDefault()},schema:n.createFormSchema(),size:"md",title:t("nouveau_formula_44488"),onClose:e.onClose,onSubmit:async t=>{const{formCreate:n}=await o({organizationId:e.organizationId,eventId:e.eventId,form:t.form});e.onSuccess(n.id)},children:(0,i.jsx)(Sl,{label:t("nom_du_formulai_14952"),name:"form.name"})})},Qw=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=il(),{isOrganizationAdmin:r}=nI(),{isEventAdmin:a}=Uv(),[l,d]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{gap:"4",width:1,children:[(0,i.jsx)(fr,{css:{flex:"1"},font:"gray900 displayXs semiBold",children:n("Form_plural")}),e.isSearchVisible&&(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:n("rechercher_un_f_28561"),value:e.name,onChange:e.setName})}),(r||s&&a)&&e.canCreateNewForm&&(0,i.jsx)(pl,{onClick:()=>{d(!0)},children:n("cr_er_un_formul_78352")})]}),l&&(0,i.jsx)(Jw,{eventId:s,organizationId:o,onClose:()=>{d(!1)},onSuccess:e=>{t.push(zi.FORM_ELEMENTS({organizationId:o,eventId:s,formId:e}))}})]})},eS=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qd,{borderRadius:"$2",height:72,width:1}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(qd,{borderRadius:"$2",height:72,width:1}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(qd,{borderRadius:"$2",height:72,width:1})]}),tS=e=>{const{translate:t,params:{eventId:n}}=il(),{event:o}=Uv(),{hasFeature:s}=nI();Cd(`${o?.name??t("communaut_20896")} ${t("Form_plural")}`);const[r,a]=(0,F.useState)(""),l=(0,F.useMemo)(()=>h(r)?e.forms.filter(e=>e.name.toLowerCase().includes(r.toLowerCase())||e.id.toString(10)===r):e.forms,[e.forms,r]),d=(0,F.useMemo)(()=>0===e.forms.length||s(Fe.Multiform),[e.forms]);return(0,i.jsxs)(Ea,{css:{padding:n?"$7":"$9 0 $7 0"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Qw,{canCreateNewForm:d,isSearchVisible:Zo(e.forms),name:r,setName:a}),e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(eS,{})]}):0===e.forms.length?(0,i.jsx)(fr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(rk,{subtitle:t("cr_er_vos_formu_26049"),title:t("aucun_formulair_74743")})}):(0,i.jsxs)(i.Fragment,{children:[!d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ha,{color:"warning",leftIcon:"circle-info",children:(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{fontWeight:"semiBold",children:t("vous_avez_attei_23858")}),(0,i.jsx)(fr,{children:t("votre_abonnemen_18069")})]})})]}),(0,i.jsx)(Pa,{height:"7"}),l.map(t=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(Zw,{canDuplicate:d,form:t,reload:e.reload}),(0,i.jsx)(Pa,{height:"3"})]},t.id))]})]})},nS=()=>{const{organizationId:e,eventId:t}=Wn(),{data:n,isLoading:o,reload:s}=Zr({organizationId:e,level:et.Event,eventId:t}),r=(0,F.useMemo)(()=>(0,Zd.A)(n.organization?.forms.nodes??[],e=>e.name.toLowerCase()),[n.organization]);return(0,i.jsx)(tS,{forms:r,isLoading:o,reload:s})},iS=()=>{const{organizationId:e}=Wn(),{data:t,isLoading:n,reload:o}=Zr({organizationId:e,level:et.Organization}),s=(0,F.useMemo)(()=>(0,Zd.A)(t.organization?.forms.nodes??[],e=>e.name.toLowerCase()),[t.organization]);return(0,i.jsx)(Ea,{css:{margin:"auto"},height:1,width:"$container",children:(0,i.jsx)(tS,{forms:s,isLoading:n,reload:o})})};function oS(e){const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}function sS(){const[e,t]=(0,F.useState)(!1);return{isLoading:e,copy:(0,F.useCallback)(e=>{t(!0),oS(e),setTimeout(()=>t(!1),500)},[])}}const rS=({children:e,isActive:t,onClick:n,replace:o=!0,to:s})=>{const r=Hn(),a=t?.(r.pathname)??r.pathname===s;return(0,i.jsx)(Ea,{align:"center",css:{borderBottom:a?"2px solid $primary700":"2px solid transparent",borderTop:"2px solid transparent",color:a?"$primary700":"$gray500",fontWeight:"$medium",px:"$3",userSelect:"none"},height:1,children:(0,i.jsx)(La,{height:1,replace:o,to:s,width:1,onClick:async()=>{n&&await n()},children:e})})},aS=e=>(0,i.jsx)(Ea,{as:Aa.Nav,css:{borderBottom:"1px solid $gray200"},gap:"2",height:e.height,justify:"center",role:"menubar",width:e.width,children:e.children}),lS=()=>{const{translate:e,params:t}=il();return(0,i.jsxs)(aS,{height:1,width:1,children:[(0,i.jsx)(rS,{to:zi.FORM_ELEMENTS(t),children:e("champs_91671")}),(0,i.jsx)(rS,{isActive:e=>null!==e.match(/\/form\/\d+\/parameters/),to:zi.FORM_PARAMETERS_GENERAL(t),children:e("param_tres_78420")}),(0,i.jsx)(rS,{to:zi.FORM_INTEGRATION(t),children:e("int_gration_10662")}),(0,i.jsx)(rS,{to:zi.FORM_EMAILS(t),children:e("mod_les_e_mail_91257")}),(0,i.jsx)(rS,{to:zi.FORM_PREVIEW(t),children:e("aper_u_25595")})]})},dS=e=>{const{translate:t}=il(),{isOrganizationAdmin:n}=nI(),{isEventAdmin:o}=Uv(),s=n||o;return(0,i.jsx)(bm,{button:s&&e.button,category:t("cr_ation_d_un_f_67278"),color:"dark",title:e.title,onClose:e.onClose,children:(0,i.jsxs)(Jl,{gridtemplatecolumns:"1fr",gridtemplaterows:"55px 1fr",height:1,width:1,children:[(0,i.jsx)(lS,{}),(0,i.jsx)(fr,{css:{overflowY:"auto"},children:e.children})]})})},cS=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,formId:s}}=il(),{data:r}=Xr({organizationId:n,formId:s});Cd(r.organization?.form.name??"");const{isLoading:a,copy:l}=sS(),d=Hm({organizationId:n,eventId:o,formId:s}),c=``.replace(/\s+/g," ");return(0,i.jsx)(dS,{title:r.organization?.form.name??"-",onClose:()=>{e.push(zi.FORMS({organizationId:n,eventId:o}))},children:(0,i.jsx)(Ea,{justify:"center",width:1,children:(0,i.jsxs)(Ea,{direction:"column",width:"$container",children:[(0,i.jsx)(Pa,{height:"8"}),(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",children:t("FormLink")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(j_,{css:{color:"$primary700"},to:d,children:d}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",children:t("code_html_pour_00029")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{css:{"& pre":{border:"1px solid $gray300",borderRadius:"$2",padding:"$3"}},children:(0,i.jsx)("pre",{children:c})}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{isLoading:a,leftIcon:"copy",onClick:()=>l(c),children:t("copier_le_code_99588")})}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",children:t("qr_code_du_lien_34278")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{height:100,width:100,children:(0,i.jsx)("img",{height:"100%",src:Ym(d,{height:100,width:100}),width:"100%"})})]})})})},uS=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,formId:s}}=il(),{data:r}=Xr({organizationId:n,formId:s});Cd(r.organization?.form.name??"");const[a,l]=(0,F.useState)("opened"),d=Hm({organizationId:n,eventId:o,formId:s,query:{preview:!0,previewState:a}});return(0,i.jsx)(dS,{title:r.organization?.form.name??"-",onClose:()=>{e.push(zi.FORMS({organizationId:n,eventId:o}))},children:(0,i.jsxs)(Ea,{align:"center",direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ea,{direction:"column",width:"$container",children:[(0,i.jsx)(Pa,{height:"8"}),(0,i.jsxs)(Ea,{align:"center",gap:"4",children:[(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(fr,{font:"gray900 textLg semiBold",children:t("aper_u_du_formu_51076")}),(0,i.jsx)(fr,{color:"gray500",children:t("pr_visualiser_v_58073")})]}),(0,i.jsx)(fr,{width:200,children:(0,i.jsxs)(gu,{value:a,onChange:e=>{l(e)},children:[(0,i.jsx)("option",{value:"opened",children:t("Opened")}),(0,i.jsx)("option",{value:"closed",children:t("cl_tur_79063")}),(0,i.jsx)("option",{value:"blocked",children:t("acc_s_r_fus_68875")})]})})]})]}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(fr,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)("iframe",{height:"100%",src:d,style:{border:"none"},width:"100%"})})]})})},hS=e=>{const{history:t,translate:n}=il();return(0,i.jsx)(nb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"triangle-exclamation",children:n("changements_non_17558")}),(0,i.jsx)(Qv,{children:(0,i.jsxs)(Ea,{align:"center",direction:"column",gap:"1",width:1,children:[(0,i.jsx)(fr,{font:"gray900 textLg medium",children:n("voulez_vous_qui_84408")}),(0,i.jsx)(fr,{color:"gray500",children:n("des_donn_es_ne_27178")})]})}),(0,i.jsx)(Jv,{children:(0,i.jsx)(pl,{color:"error",onClick:()=>t.goBack(e.fallbackPath),children:n("quitter_sans_sa_28486")})})]})})},mS=(0,or.I4)("div",{alignItems:"center",borderRadius:"$1",cursor:"pointer",display:"flex",fontWeight:"$semiBold",overflow:"hidden",userSelect:"none",variants:{color:{primary:{background:"$primary700",color:"white","& > .h-button-dropdown-content":{border:"1px solid $primary700",borderRadius:"$1",borderBottomRightRadius:"0",borderTopRightRadius:"0",borderRight:"none"},"& > .h-button-dropdown-icon":{border:"1px solid $primary700",borderRadius:"$1",borderBottomLeftRadius:"0",borderTopLeftRadius:"0",borderLeft:"1px solid $primary800"},"& > .h-button-dropdown-content:hover":{background:"$primary800",border:"1px solid $primary800",borderRight:"none"},"& > .h-button-dropdown-icon:hover":{background:"$primary800",border:"1px solid $primary800"}},white:{background:"white",color:"$gray700","& > .h-button-dropdown-content":{border:"1px solid $gray300",borderRadius:"$1",borderBottomRightRadius:"0",borderTopRightRadius:"0",borderRight:"none"},"& > .h-button-dropdown-icon":{border:"1px solid $gray300",borderRadius:"$1",borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},"& > .h-button-dropdown-content:hover":{background:"$gray50",color:"$gray800"},"& > .h-button-dropdown-icon:hover":{background:"$gray50",color:"$gray800"}}},size:{sm:{height:"32px",fontSize:"$textSm"},md:{height:"40px",fontSize:"$textSm"},lg:{height:"44px",fontSize:"$textMd"},xl:{height:"48px",fontSize:"$textMd"},"2xl":{height:"60px",fontSize:"$textLg"}}},defaultVariants:{color:"primary",size:"md"}}),gS=F.forwardRef((e,t)=>{const{history:n}=il();return(0,i.jsxs)(mS,{color:e.color,size:e.size,children:[(0,i.jsx)(Ea,{ref:t,align:"center",className:"h-button-dropdown-content",css:{flex:"1",px:"$4"},height:1,onClick:t=>{e.onClick&&e.onClick(t),h(e.path)&&n.push(e.path)},children:e.children}),(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(Ea,{align:"center",className:"h-button-dropdown-icon",height:40,justify:"center",width:40,children:(0,i.jsx)(Va,{icon:"chevron-down"})})}),(0,i.jsx)(Pd,{placement:"bottom-end",renderOnPortal:!0,children:e.menu})]})]})});gS.displayName="ButtonDropdown";const pS=({returnPathFallback:e})=>(0,i.jsx)(eu,{returnToFallback:e,size:"md",children:(0,i.jsx)(tu,{children:(0,i.jsx)(ul,{})})});let fS=class extends zl{documentInputService;constructor(e,t){super(t),this.documentInputService=e}customFieldInputDefault(e,t){return{name:e?.name??"",label:e?.label??"",customFieldCategoryId:e?.customFieldCategoryId??t[0].id,description:e?.description??"",variety:e?.variety??Ie.UserInfo,fieldType:e?.fieldType??Ne.Text,isPrivate:e?.isPrivate??!1,values:Zo(e?.values)?e.values:[],hasCondition:e?.hasCondition??!1,conditionCustomFieldId:e?.conditionCustomFieldId??null,conditionValue:e?.conditionValue??!1,canSelectMultiple:e?.canSelectMultiple??!1,document:e?.document||this.documentInputService.documentInputDefault(),isEncrypted:e?.isEncrypted??!1}}customFieldInputSchema(){return l.Ik().shape({name:l.Yj().required(this.t("le_nom_du_champ_17959")),label:l.Yj(),customFieldCategoryId:l.ai().required(this.t("la_cat_gorie_es_14008")).typeError(this.t("la_cat_gorie_es_14008")).min(1,this.t("la_cat_gorie_es_14008")),fieldType:l.Yj().required(this.t("le_type_est_req_41180")).oneOf(sn,this.t("le_type_est_req_41180")),isPrivate:l.zM().nullable(),hasCondition:l.zM().nullable(),values:l.YO().when("fieldType",{is:Ne.Select,then:e=>e.of(l.Ik().shape({id:l.ai(),value:l.Yj().required(this.t("la_valeur_est_r_70136"))})).required(this.t("vous_devez_s_le_95641")).min(1,this.t("vous_devez_s_le_95641"))}),conditionCustomFieldId:l.ai().when("hasCondition",{is:!0,then:e=>e.required(),otherwise:e=>e.nullable()}),conditionValue:l.gl(),canSelectMultiple:l.zM().nullable(),document:this.documentInputService.documentInputSchemaNotRequired(),isEncrypted:l.zM().required()})}createUpdateCustomFieldSchema(){return l.Ik().shape({customField:this.customFieldInputSchema()})}};fS=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[ej,Dn])],fS);const xS=e=>{const t=Ln(),n=(0,F.useCallback)(({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&e.change("customField.values",es(e.values,n.index,i.index))},[e.values,e.change]),o=!e.isEdit||e.isSelectV2;return(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray700 textSm medium",children:t("valeurs_de_la_l_43599")}),(0,i.jsxs)(Ea,{css:{background:"$gray100",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[o?(0,i.jsx)(Qc.JY,{onDragEnd:n,children:(0,i.jsx)(Qc.gL,{droppableId:"1",children:t=>(0,i.jsxs)(Ea,{direction:"column",gap:"3",...t.droppableProps,ref:t.innerRef,children:[e.values.map((t,n)=>(0,i.jsx)(Qc.sx,{draggableId:n.toString(),index:n,children:t=>(0,i.jsxs)(Ea,{align:"center",gap:"4",...t.draggableProps,ref:t.innerRef,children:[(0,i.jsx)(fr,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...t.dragHandleProps,children:(0,i.jsx)(Va,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(Sl,{name:`customField.values[${n}].value`})}),(0,i.jsx)(fr,{color:"gray500",css:{cursor:"pointer"},onClick:()=>{e.change("customField.values",ts(e.values,n))},children:(0,i.jsx)(Va,{icon:"trash-can"})})]})},n)),t.placeholder]})})}):e.values.map((e,t)=>(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(Sl,{name:`customField.values[${t}].value`})},t)),(0,i.jsxs)(fr,{css:{cursor:"pointer"},font:"primary700 textSm medium",onClick:()=>{e.change("customField.values",e.values.concat([{value:""}]))},children:["+ ",t("ajouter_une_nou_98358")]})]})]})},_S=e=>{const{translate:t}=il(),{showNotification:n}=Yv(),o=Nn(fS),s=Ac(),r=Nn(za),{mutate:a}=function(e={}){return Un("mutation CustomFieldCategoryCreate(\n    $organizationId: OrganizationId!\n    $category: CustomFieldsCategoryInput!\n) {\n    customFieldCategoryCreate(organizationId: $organizationId, customFieldCategory: $category) {\n        id\n        name\n    }\n}\n",e)}(),l=(0,F.useRef)(null),d=(0,F.useMemo)(()=>e.isEdit?t("mise_jour_de_17055",e.initialValues.customField.name):t("nouveau_champ_p_27686"),[e.isEdit,e.initialValues]);Cd(d);const c=(0,F.useMemo)(()=>(0,Zd.A)(e.organization.customFields.nodes.filter(t=>t.id!==e.customFieldId),e=>e.name.toLowerCase()),[e.customFieldId,e.organization]),[u,h]=(0,F.useState)(lC(e.organization.customFieldsCategories.nodes)),[m,g]=(0,F.useState)(e.initialValues.customField.fieldType),[p,f]=(0,F.useState)(e.initialValues.customField.hasCondition),[x,_]=(0,F.useState)(c.find(t=>t.id===e.initialValues.customField.conditionCustomFieldId)),[I,v]=(0,F.useState)(!1),b=!e.isFromForm,j=x?.fieldType===Ne.Checkbox,C=VC(x);return(0,i.jsx)(dl,{customErrorRef:l,initialValues:e.initialValues,render:({form:n,handleSubmit:o,submitting:r,values:y})=>{const k=(y.customField.variety===Ie.Delegation||y.customField.variety===Ie.UserInfo)&&m===Ne.Text,A=(y.customField.variety===Ie.Delegation||y.customField.variety===Ie.UserInfo)&&m!==Ne.Validation&&!0!==e.isFromForm,w=y.customField.variety===Ie.UserInfo&&Zo(c);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(eu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Lb,{children:d}),(0,i.jsxs)(tu,{ref:l,children:[(0,i.jsx)(Sr.Yr,{name:"customField.fieldType",children:e=>{g(e),e===Ne.Validation&&n.change("customField.isPrivate",!1)}}),(0,i.jsx)(Sr.Yr,{name:"customField.hasCondition",children:e=>{n.change("customField.conditionCustomFieldId",c[0].id),f(e)}}),(0,i.jsx)(Sr.Yr,{name:"customField.conditionCustomFieldId",children:e=>{const t=c.find(t=>t.id===e);t&&(n.change("customField.conditionValue",t.fieldType===Ne.Checkbox||[]),_(t))}}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(sl,{}),(0,i.jsxs)(Ea,{direction:"column",gap:"6",width:1,children:[b&&(0,i.jsxs)(lj,{label:t("typologie_34041"),name:"customField.variety",state:e.isEdit?"disabled":"active",children:[(0,i.jsx)("option",{value:Ie.Accreditation,children:t("accr_ditations_39450")}),(0,i.jsx)("option",{value:Ie.Delegation,children:t("d_l_gations_78318")}),(0,i.jsx)("option",{value:Ie.Event,children:t("Event")}),(0,i.jsx)("option",{value:Ie.Position,children:t("missions_63972")}),(0,i.jsx)("option",{value:Ie.UserInfo,children:t("membres_11310")})]}),(0,i.jsx)(Sl,{hint:t("titre_de_la_que_69079"),label:t("nom_du_champ_48329"),name:"customField.name"}),(0,i.jsx)(Sl,{hint:t("nom_technique_u_74183"),label:(0,i.jsx)(nv,{children:t("label_08243")}),name:"customField.label"}),(0,i.jsx)(Sl,{hint:t("sous_titre_de_l_90967"),label:(0,i.jsx)(nv,{children:t("sous_titre_97472")}),name:"customField.description"}),(0,i.jsx)(lj,{label:t("type_35427"),name:"customField.fieldType",state:e.isEdit?"disabled":"active",children:s(sn)}),(0,i.jsx)(Sm,{isCreateVisible:!0,isSearchVisible:!0,label:t("cat_gorie_00291"),name:"customField.customFieldCategoryId",placeholder:t("rechercher_ou_c_16469"),onCreateClick:()=>{v(!0)},children:u.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),m===Ne.Select&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xS,{change:n.change,isEdit:e.isEdit,isSelectV2:e.isSelectV2,values:y.customField.values}),(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:t("est_ce_qu_il_es_10680")}),(0,i.jsx)(ym,{disabled:e.isEdit,name:"customField.canSelectMultiple",children:t("oui_il_est_pos_25233")})]})]}),m===Ne.Validation&&(0,i.jsx)(oj,{accept:[HI.Images,HI.Pdf],acl:"public-read",label:(0,i.jsx)(nv,{children:t("document_87149")}),organizationId:e.organizationId,prefix:"customField.document."}),k&&(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("chiffrement_des_84602")}),(0,i.jsx)(zm,{disabled:e.isEdit,name:"customField.isEncrypted",subtext:t("seuls_les_4_der_85542"),children:t("les_donn_es_son_85588")})]}),A&&(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:t("ce_champ_est_il_98722")}),(0,i.jsx)(ym,{name:"customField.isPrivate",children:t("oui_le_champ_n_99925")})]}),w&&(0,i.jsxs)(Ea,{direction:"column",gap:"4",children:[(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:t("l_affichage_de_99189")}),(0,i.jsx)(ym,{name:"customField.hasCondition",children:t("oui_le_champ_d_00513")})]}),p&&(0,i.jsxs)(Ea,{css:{paddingLeft:"$6"},direction:"column",gap:"4",children:[(0,i.jsx)(Sm,{isSearchVisible:!0,label:t("nom_du_champ_do_17104"),name:"customField.conditionCustomFieldId",children:c.map(e=>(0,i.jsx)("option",{value:e.id,children:Sk(e)},e.id))}),x&&(0,i.jsx)(i.Fragment,{children:j?(0,i.jsxs)(lj,{label:t("pour_quelle_val_60529",x.name),name:"customField.conditionValue",shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]}):(0,i.jsx)(Sm,{isSearchVisible:!0,label:t("pour_quelle_val_60529",x.name),multiple:!0,name:"customField.conditionValue",children:C},x.id)})]})]})]}),(0,i.jsx)(Pa,{height:"7"})]}),(0,i.jsx)(nu,{children:(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{isLoading:r,onClick:o,children:e.isEdit?t("mettre_jour_l_31784"):t("cr_er_le_champ_05516")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})})]}),I&&(0,i.jsx)(dC,{initialName:"",isEdit:!1,mutate:async t=>{const{customFieldCategoryCreate:n}=await a({organizationId:e.organizationId,category:{name:t}});return n},onClose:()=>{v(!1)},onSuccess:e=>{h(lC([...u,e])),n.change("customField.customFieldCategoryId",e.id)}})]})},validate:r.validateForForm(o.createUpdateCustomFieldSchema()),onSubmit:async i=>{const{customField:o}=await e.mutate({organizationId:e.organizationId,customField:{...i.customField,description:i.customField.description||""}});n(e.isEdit?t("le_champ_person_31517"):t("le_champ_person_90348")),e.onClose(),e.onSuccess(o)}})},IS=e=>{const{organizationId:t}=Wn(),n=Nn(fS),{data:o,loader:s}=Vn("query OrganizationInfos($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        ...CreateCustomFieldInfos\n    }\n}\n",{organizationId:e.organizationId},[Ro.CreateCustomFieldInfosFragment]);const{mutate:r}=function(e={}){return Un("mutation CustomFieldCreate($organizationId: OrganizationId!, $customField: CustomFieldInput!) {\n    customField: customFieldCreate(organizationId: $organizationId, customField: $customField) {\n        id\n        name\n        label\n        fieldType\n        fieldProperty\n\n        category {\n            id\n            name\n        }\n\n        conditionCustomField {\n            id\n            name\n        }\n\n        values {\n            id\n            value\n        }\n    }\n}\n",e)}({redirectOnSuccess:!0});return s?(0,i.jsx)(pS,{returnPathFallback:So.CUSTOM_FIELDS(t)}):(0,i.jsx)(_S,{customFieldId:null,initialValues:{customField:n.customFieldInputDefault(null,o.organization.customFieldsCategories.nodes)},isEdit:!1,isFromForm:e.isFromForm,isSelectV2:!0,mutate:r,organization:o.organization,organizationId:e.organizationId,onClose:e.onClose,onSuccess:e.onSuccess})},vS=e=>{const{organizationId:t}=Wn(),n=Nn(fS),{data:o,loader:s}=Vn("query CustomFieldToEdit($organizationId: OrganizationId!, $customFieldId: CustomFieldId!) {\n    organization(id: $organizationId) {\n        ...CreateCustomFieldInfos\n\n        customField(id: $customFieldId) {\n            name\n            label\n            customFieldCategoryId\n            description\n            variety\n            fieldType\n            isPrivate\n            hasCondition\n            conditionCustomFieldId\n            canSelectMultiple\n            conditionValue\n            isSelectV2\n            isEncrypted\n\n            document {\n                acl\n                name\n                key\n            }\n\n            values {\n                id\n                value\n            }\n        }\n    }\n}\n",{organizationId:e.organizationId,customFieldId:e.customFieldId},[Ro.CreateCustomFieldInfosFragment]);const{mutate:r}=function(e={}){return Un("mutation CustomFieldUpdate(\n    $organizationId: OrganizationId!\n    $customFieldId: CustomFieldId!\n    $customField: CustomFieldInput!\n) {\n    customField: customFieldUpdate(\n        organizationId: $organizationId\n        customFieldId: $customFieldId\n        customField: $customField\n    ) {\n        id\n        name\n        label\n        fieldType\n        fieldProperty\n\n        category {\n            id\n            name\n        }\n\n        conditionCustomField {\n            id\n            name\n        }\n\n        values {\n            id\n            value\n        }\n    }\n}\n",e)}({redirectOnSuccess:!0});return s?(0,i.jsx)(pS,{returnPathFallback:So.CUSTOM_FIELDS(t)}):(0,i.jsx)(_S,{customFieldId:e.customFieldId,initialValues:{customField:n.customFieldInputDefault(o.organization.customField,o.organization.customFieldsCategories.nodes)},isEdit:!0,isSelectV2:o.organization.customField.isSelectV2,mutate:t=>r({...t,customFieldId:e.customFieldId}),organization:o.organization,organizationId:e.organizationId,onClose:e.onClose,onSuccess:e.onSuccess})},bS=e=>{const{params:{organizationId:t,customFieldId:n}}=il();return(0,i.jsx)(vS,{customFieldId:n,organizationId:t,...e})},jS=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.initialName);return(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ea,{justify:"center",children:(0,i.jsx)(mj,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("nouvelle_sectio_88105")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:t("ajouter_des_sec_58545")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(wl,{label:t("nom_de_la_secti_38728"),value:n,onChange:o}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{onClick:()=>{e.onAdd(n),e.onClose()},children:h(e.initialName)?t("renommer_la_sec_00650"):t("cr_er_la_sectio_96175")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},CS=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.initialText);return(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ea,{justify:"center",children:(0,i.jsx)(mj,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("champ_texte_lib_91587")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:t("ajouter_des_cha_68672")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(mv,{initialValue:n,onChange:o})}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{onClick:()=>{e.onAdd(n),e.onClose()},children:h(e.initialText)?t("mettre_jour_l_69246"):t("ajouter_le_cham_74670")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},yS=e=>{const{translate:t,params:{organizationId:n}}=il(),[o,s]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qc.sx,{draggableId:e.elementId,index:e.index,children:n=>(0,i.jsxs)(Ea,{align:"center",css:{bd:!0,padding:"$4 $6",...e.css},gap:"5",...n.draggableProps,ref:n.innerRef,children:[(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsx)(fr,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...n.dragHandleProps,children:(0,i.jsx)(Va,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Ea,{gap:"2",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:e.field.name}),e.field.conditionCustomField&&(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{color:"gray800",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(Va,{icon:"split"})})}),(0,i.jsx)(am,{placement:"top",children:t("ce_champ_d_pend_31209",e.field.conditionCustomField?.name)})]})]}),(0,i.jsx)(fr,{color:"gray500",children:t(e.field.fieldType)})]}),(0,i.jsxs)(ub,{rolesTypes:zv,children:[(0,i.jsx)(su,{value:e.isMandatory,onChange:t=>{e.toggleIsMandatory(e.index,t)},children:t("obligatoire_35326")}),(0,i.jsxs)(Ea,{gap:"2",children:[(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.onDelete(e.index)}})})}),(0,i.jsx)(am,{placement:"top",children:t("supprimer_le_ch_99740")})]}),e.showEdit&&(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{s(!0)}})})}),(0,i.jsx)(am,{placement:"top",children:t("_diter_le_champ_78018")})]})]})]})]})}),o&&(0,i.jsx)(vS,{customFieldId:e.field.id,organizationId:n,onClose:()=>{s(!1)},onSuccess:e.updateCustomField})]})},kS=e=>{const{translate:t}=il(),[n,o]=F.useState(e.element.conditionCustomFieldId),[s,r]=F.useState(e.element.conditionValue),a=t=>{const n=e.conditionCustomFields.find(e=>e.id===t);n&&(r(n.fieldType===Ne.Checkbox||[]),o(t))},l=e.conditionCustomFields.find(e=>e.id===n),d=null!==n&&("boolean"==typeof s||Zo(s)),c=VC(l);return(0,i.jsx)(nb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"split",children:t("ajouter_une_con_66324")}),(0,i.jsxs)(Qv,{gap:"4",children:[(0,i.jsx)(dc,{isSearchVisible:!0,label:t("champ_sur_leque_68198"),renderOnPortal:!0,values:n?[n]:[],onChange:e=>{Zo(e)?a(e[0]):a(null)},children:e.conditionCustomFields.map(e=>(0,i.jsx)("option",{value:e.id,children:Sk(e)},e.id))}),l&&(0,i.jsx)(i.Fragment,{children:l.fieldType===Ne.Checkbox?(0,i.jsxs)(gu,{label:t("pour_quelle_val_60529",l.name),shouldParseAsBoolean:!0,value:s,onChange:r,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]}):(0,i.jsx)(dc,{isSearchVisible:!0,label:t("pour_quelle_val_60529",l.name),multiple:!0,renderOnPortal:!0,values:s,onChange:r,children:c},l.id)})]}),(0,i.jsxs)(Jv,{hideCancelButton:!0,children:[(0,i.jsx)(pl,{disabled:!d,onClick:()=>{e.onConditionAdd(e.index,n,s),e.onClose()},children:t("ajouter_une_con_66324")}),(0,i.jsx)(pl,{color:"white",onClick:()=>{e.onConditionDelete(e.index),e.onClose()},children:t("supprimer_la_co_57888")})]})]})})},AS=e=>{const t=Ln(),[n,o]=(0,F.useState)(!1),[s,r]=(0,F.useState)(!1),a=(0,F.useMemo)(()=>e.conditionCustomFields.find(t=>t.id===e.element.conditionCustomFieldId),[e.element.conditionCustomFieldId,e.conditionCustomFields]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qc.sx,{draggableId:e.element.id,index:e.index,children:n=>(0,i.jsxs)(Ea,{align:"center",css:{background:"$gray900",bd:"gray900 2",color:"white",marginBottom:"$2",marginTop:"$5",padding:"$4 $6"},gap:"5",...n.draggableProps,ref:n.innerRef,children:[(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsx)(fr,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...n.dragHandleProps,children:(0,i.jsx)(Va,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(Ea,{css:{flex:"1"},gap:"2",children:[(0,i.jsx)(fr,{fontWeight:"semiBold",children:e.element.section||""}),a&&(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{color:"white",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(Va,{icon:"split"})})}),(0,i.jsx)(am,{placement:"top",children:t("cette_section_d_50768",a.name)})]})]}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsxs)(Ea,{gap:"2",children:[(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"split",size:"sm",onClick:()=>r(!0)})})}),(0,i.jsx)(am,{placement:"top",children:t("ajouter_une_con_66324")})]}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>e.onDelete(e.index)})})}),(0,i.jsx)(am,{placement:"top",children:t("supprimer_43083")})]}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>o(!0)})})}),(0,i.jsx)(am,{placement:"top",children:t("renommer_42135")})]})]})})]})}),n&&(0,i.jsx)(jS,{initialName:e.element.section||"",onAdd:t=>{e.onRename(e.index,t)},onClose:()=>{o(!1)}}),s&&(0,i.jsx)(kS,{conditionCustomFields:e.conditionCustomFields,element:e.element,index:e.index,isOpen:s,onClose:()=>r(!1),onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete})]})},wS=e=>{const t=Ln(),[n,o]=(0,F.useState)(!1),[s,r]=(0,F.useState)(!1),a=(0,F.useMemo)(()=>e.conditionCustomFields.find(t=>t.id===e.element.conditionCustomFieldId),[e.element.conditionCustomFieldId,e.conditionCustomFields]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qc.sx,{draggableId:e.element.id,index:e.index,children:n=>(0,i.jsxs)(Ea,{align:"center",css:{bd:!0,padding:"$4 $6"},gap:"5",...n.draggableProps,ref:n.innerRef,children:[(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsx)(fr,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...n.dragHandleProps,children:(0,i.jsx)(Va,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(Ea,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(fr,{children:(0,i.jsx)(ng,{text:e.element.text||""})}),a&&(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{color:"gray800",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(Va,{icon:"split"})})}),(0,i.jsx)(am,{placement:"top",children:t("ce_texte_d_pend_87251",a.name)})]})]}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsxs)(Ea,{gap:"2",children:[(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"split",size:"sm",onClick:()=>r(!0)})})}),(0,i.jsx)(am,{placement:"top",children:t("ajouter_une_con_66324")})]}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>e.onDelete(e.index)})})}),(0,i.jsx)(am,{placement:"top",children:t("supprimer_43083")})]}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>o(!0)})})}),(0,i.jsx)(am,{placement:"top",children:t("_diter_62574")})]})]})})]})}),n&&(0,i.jsx)(CS,{initialText:e.element.text||"",onAdd:t=>{e.onEdit(e.index,t)},onClose:()=>o(!1)}),s&&(0,i.jsx)(kS,{conditionCustomFields:e.conditionCustomFields,element:e.element,index:e.index,isOpen:s,onClose:()=>r(!1),onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete})]})},SS=e=>{const t=(0,F.useMemo)(()=>Object.fromEntries(e.customFields.map(e=>[e.id,e])),[e.customFields]),n=(0,F.useMemo)(()=>e.customFields.filter(e=>[Ne.Checkbox,Ne.Country,Ne.Language,Ne.Nationality,Ne.Select].includes(e.fieldType)),[e.customFields]);return(0,i.jsx)(Qc.JY,{onDragEnd:e.onDragEnd,children:(0,i.jsx)(Qc.gL,{droppableId:"1",children:o=>(0,i.jsxs)(Ea,{direction:"column",gap:"3",width:1,...o.droppableProps,ref:o.innerRef,children:[e.elements.map((o,s)=>{switch(o.elementType){case Ve.Field:return(0,i.jsx)(yS,{elementId:o.id,field:t[o.customFieldId],index:s,isMandatory:o.isMandatory,showEdit:!0,toggleIsMandatory:e.fieldsToggleMandatory,updateCustomField:e.updateCustomField,onDelete:e.onDelete},o.id);case Ve.Section:return(0,i.jsx)(AS,{conditionCustomFields:n,element:o,index:s,onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete,onDelete:e.onDelete,onRename:e.sectionOnRename},o.id);case Ve.Text:return(0,i.jsx)(wS,{conditionCustomFields:n,element:o,index:s,onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete,onDelete:e.onDelete,onEdit:e.textOnEdit},o.id);default:return Za(o.elementType)}}),o.placeholder]})})})},ES=e=>{const{translate:t,params:{organizationId:n}}=il(),{isOrganizationAdmin:o}=nI(),[s,r]=F.useState(!1),[a,l]=F.useState(!1),[d,c]=F.useState(!1),[u,h]=F.useState(e.customFields),m=F.useMemo(()=>new Set(e.elements.flatMap(e=>e.elementType===Ve.Field?[e.customFieldId]:[])),[e.elements]),g=F.useCallback(({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&e.setElements(es(e.elements,n.index,i.index))},[e.elements,e.setElements]),p=F.useCallback(t=>{m.has(t.id)?e.setElements(e.elements.filter(e=>!e.customFieldId||e.customFieldId!==t.id)):e.setElements([...e.elements,{id:N(),elementType:Ve.Field,customFieldId:t.id,isMandatory:!0,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements,m]),f=F.useCallback((t,n)=>{e.setElements((0,Jc.jM)(e=>{e[t].isMandatory=n}))},[e.setElements]),x=F.useCallback(t=>{e.setElements([...e.elements,{id:N(),elementType:Ve.Section,section:t,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements]),_=F.useCallback((t,n)=>{e.setElements((0,Jc.jM)(e=>{e[t].section=n}))},[e.setElements]),I=F.useCallback(t=>{e.setElements([...e.elements,{id:N(),elementType:Ve.Text,text:t,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements]),v=F.useCallback((t,n)=>{e.setElements((0,Jc.jM)(e=>{e[t].text=n}))},[e.setElements]),b=F.useCallback(t=>{e.setElements((0,Jc.jM)(e=>{e.splice(t,1)}))},[e.setElements]),j=F.useCallback(e=>{h(u.map(t=>t.id===e.id?e:t))},[u]),C=F.useCallback((t,n,i)=>{e.setElements((0,Jc.jM)(e=>{e[t].hasCondition=!0,e[t].conditionCustomFieldId=n,e[t].conditionValue=i}))},[e.setElements]),y=F.useCallback(t=>{e.setElements((0,Jc.jM)(e=>{e[t].hasCondition=!1,e[t].conditionCustomFieldId=null,e[t].conditionValue=!1}))},[e.setElements]);return(0,i.jsxs)(i.Fragment,{children:[0===e.elements.length?(0,i.jsx)(fr,{height:.5,width:1,children:(0,i.jsx)(rk,{subtitle:t("ajouter_des_cha_37944"),title:t("aucun_champ_ou_18338")})}):(0,i.jsx)(SS,{customFields:u,elements:e.elements,fieldsToggleMandatory:f,sectionOnRename:_,textOnEdit:v,updateCustomField:j,onConditionAdd:C,onConditionDelete:y,onDelete:b,onDragEnd:g}),(0,i.jsxs)(ub,{rolesTypes:zv,children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{gap:"4",justify:0===e.elements.length?"center":"start",width:1,children:[(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:o?(0,i.jsx)(gS,{menu:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Od,{icon:"pen-field",onClick:()=>{c(!0)},children:t("cr_eer_un_champ_08883")})}),children:t("ajouter_des_cha_35843")}):(0,i.jsx)(pl,{children:t("ajouter_des_cha_35843")})}),(0,i.jsx)(Pd,{css:{padding:"0"},placement:"top-start",width:400,children:(0,i.jsx)($j,{customFields:u,selectedCustomFieldsIds:m,toggle:p})})]}),(0,i.jsx)(pl,{color:"white",onClick:()=>{r(!0)},children:t("ajouter_une_sec_90063")}),(0,i.jsx)(pl,{color:"white",onClick:()=>{l(!0)},children:t("ajouter_un_cham_31151")})]})]}),s&&(0,i.jsx)(jS,{initialName:"",onAdd:x,onClose:()=>{r(!1)}}),a&&(0,i.jsx)(CS,{initialText:"",onAdd:I,onClose:()=>{l(!1)}}),d&&(0,i.jsx)(IS,{isFromForm:!0,organizationId:n,onClose:()=>{c(!1)},onSuccess:async t=>{h([...u,t]),setTimeout(()=>{p(t),e.onSave()}),c(!1)}})]})},TS=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qd,{borderRadius:"$2",height:76,width:1}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(qd,{borderRadius:"$2",height:76,width:1}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(qd,{borderRadius:"$2",height:76,width:1})]}),zS=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,formId:s}}=il(),{data:r,isLoading:a}=Vn("query FormElements($organizationId: OrganizationId!, $formId: FormId!) {\n    organization(id: $organizationId) {\n        ...FormCustomFields\n\n        form(id: $formId) {\n            name\n\n            elements {\n                ...FormElementsElement\n            }\n        }\n    }\n}\n",{organizationId:n,formId:s},[Ro.FormCustomFieldsFragment,Ro.FormElementsElementFragment]);Cd(r.organization?.form.name??"");const{mutate:l,isLoading:d}=function(e={}){return Un("mutation FormElementsUpdate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $formId: FormId!\n    $elements: [FormsElementInput!]!\n) {\n    formElementsUpdate(\n        organizationId: $organizationId\n        eventId: $eventId\n        formId: $formId\n        elements: $elements\n    ) {\n        id\n    }\n}\n",e)}(),[c,u]=(0,F.useState)([]),[h,m]=(0,F.useState)(""),g=(0,F.useCallback)(async()=>{await l({organizationId:n,eventId:o,formId:s,elements:c.map((e,t)=>({id:e.id,elementType:e.elementType,customFieldId:e.customFieldId,section:e.section,text:e.text,isMandatory:e.isMandatory,hasCondition:e.hasCondition,conditionCustomFieldId:e.conditionCustomFieldId,conditionValue:e.conditionValue,index:t}))}),m(JSON.stringify(c))},[l,c]),[p,f]=(0,F.useState)(!1),x=(0,F.useCallback)(()=>{JSON.stringify(c)===h?e.goBack(zi.FORMS({organizationId:n,eventId:o})):f(!0)},[c,h]);return(0,F.useEffect)(()=>{u(r.organization?.form.elements??[]),m(JSON.stringify(r.organization?.form.elements??[]))},[r.organization]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(dS,{button:(0,i.jsx)(pl,{isLoading:d,onClick:g,children:t("enregistrer_06519")}),title:r.organization?.form.name??"-",onClose:x,children:(0,i.jsx)(Ea,{justify:"center",width:1,children:(0,i.jsxs)(Ea,{direction:"column",width:"$container",children:[(0,i.jsx)(Pa,{height:"8"}),a?(0,i.jsx)(TS,{}):(0,i.jsx)(ES,{customFields:r.organization.formCustomFields.nodes,elements:c,setElements:u,onSave:g}),(0,i.jsx)(Pa,{height:"8"})]})})}),(0,i.jsx)(hS,{fallbackPath:zi.FORMS({organizationId:n,eventId:o}),isOpen:p,onClose:()=>{f(!1)}})]})},$S=e=>(0,i.jsx)(Cc,{css:{background:e.isSelected?"$primary100":"white",cursor:"pointer","&:hover":{background:"$gray100"}},onClick:e.onClick,children:(0,i.jsxs)(xc,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(fr,{color:"gray900",fontWeight:"medium",children:e.title}),(0,i.jsx)(fr,{color:"gray500",children:e.subtitle})]})});let OS=class extends zl{constructor(e){super(e)}emailTemplateDefault(e,t,n,i,o){const s=this.emailTypeToDefault(e,t,i,o);return n&&(s.subject=n.subject,s.content=n.content),{useDefault:n?.useDefault??!0,emailType:e,emailSenderId:n?.emailSenderId,attachments:n?.attachments??[],...s}}emailTemplateSchema(){return l.Ik().shape({useDefault:l.zM().required(""),emailType:l.Yj().required(this.t("le_type_d_e_mai_84281")).oneOf(tn,this.t("le_type_d_e_mai_84281")),subject:l.Yj().when("useDefault",{is:!1,then:e=>e.required(this.t("le_sujet_est_re_18923"))}),content:l.Yj().when("useDefault",{is:!1,then:e=>e.required(this.t("le_contenu_est_45048")).test("contains-code",this.t("le_contenu_doit_64437"),function(){return!(!this.parent.useDefault&&this.parent.emailType===ze.Code)||this.parent.content.includes("{code}")})}),attachments:l.YO().of(l.Yj())})}updateEmailTemplateSchema(){return l.Ik().shape({emailTemplate:this.emailTemplateSchema()})}emailTypeToDefault(e,t,n,i){switch(e){case ze.Accreditations:return this.accreditationsDefault();case ze.AccreditationsRefused:return this.accreditationsRefusedDefault();case ze.Assignments:return this.assignmentsDefault();case ze.Code:return this.codeDefault(n,i);case ze.FormInvite:return this.formInviteDefault();case ze.FormSubmit:return this.formSubmitDefault(n);case ze.NotifyLeaders:return this.notifyLeadersDefault(t);case ze.DelegationCategoryLeaderAssign:return this.delegationCategoryLeaderAssign(t);case ze.DelegationFormInvite:return this.delegationFormInviteDefault();case ze.DelegationLeaderAssign:return this.delegationLeaderAssign();case ze.PositionCategoryLeaderAssign:return this.positionCategoryLeaderAssignDefault(t);case ze.PositionLeaderAssign:return this.positionLeaderAssign(t);case ze.Refused:return this.refusedDefault();case ze.VolunteerRegistration:return this.volunteerRegistrationDefault();case ze.Campaign:case ze.DelegationsImport:case ze.FilesImport:case ze.Documents:case ze.EventInvite:case ze.Export:case ze.MembersImport:case ze.NewMember:case ze.NewVolunteer:case ze.OrganizationInvite:case ze.PositionsImport:throw new Error("Impossible to change this email");default:return Za()}}accreditationsDefault(){return{subject:this.t("_event_name_49280"),content:this.t("accreditations_default")}}accreditationsRefusedDefault(){return{subject:this.t("_event_name_01805"),content:this.t("accreditations_refused_default")}}assignmentsDefault(){return{subject:this.t("_event_name_72063"),content:this.t("assignments_default")}}codeDefault(e,t){return{subject:e&&!t?this.t("code_de_v_rific_41117"):this.t("code_de_connexi_57121"),content:this.t("code_default")}}formInviteDefault(){return{subject:this.t("form_invite_subject"),content:this.t("form_invite_content")}}formSubmitDefault(e){return e?{subject:this.t("_event_name_12686"),content:this.t("form_submit_event_default")}:{subject:this.t("_organization_n_21926"),content:this.t("form_submit_organization_default")}}notifyLeadersDefault(e){return{subject:this.t("_event_name_95901"),content:this.t("notify_leaders_default_1",e.href,cd)}}delegationCategoryLeaderAssign(e){return{subject:this.t("_event_name_69973"),content:this.t("_p_bonjour_use_97817",cd,e.href,cd)}}delegationLeaderAssign(){return{subject:this.t("_event_name_92886"),content:this.t("_p_bonjour_use_96380")}}delegationFormInviteDefault(){return{subject:this.t("invitation_re_29033"),content:this.t("_p_bonjour_use_29618")}}positionCategoryLeaderAssignDefault(e){return{subject:this.t("_event_name_63708"),content:this.t("category_leader_assign_default_1",cd,e.href,cd)}}positionLeaderAssign(e){return{subject:this.t("_event_name_60486"),content:this.t("leader_assign_default_1",cd,e.href,cd)}}refusedDefault(){return{subject:this.t("_event_name_59248"),content:this.t("refused_default")}}volunteerRegistrationDefault(){return{subject:this.t("_event_name_12686"),content:this.t("volunteer_registration_default")}}};OS=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],OS);const RS=e=>{const{history:t,translate:n}=il(),{organization:o}=nI(),{data:s,loader:r}=Vn("query EmailTemplate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $formId: FormId\n    $source: LoginCodeSource\n    $emailType: EmailType!\n) {\n    organization(id: $organizationId) {\n        emailsSenders {\n            id\n            name\n        }\n\n        event: eventMaybe(id: $eventId) {\n            customDocuments {\n                slug\n                name\n            }\n        }\n\n        emailTemplate(emailType: $emailType, eventId: $eventId, formId: $formId, source: $source) {\n            emailType\n            useDefault\n            subject\n            content\n            emailSenderId\n            attachments\n        }\n    }\n}\n",{organizationId:e.organizationId,eventId:e.eventId,formId:e.formId,source:e.source,emailType:e.emailType},[]);const{mutate:a,isLoading:l}=function(e={}){return Un("mutation EmailTemplateUpdate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $formId: FormId\n    $source: LoginCodeSource\n    $emailTemplate: EmailsTemplateInput!\n) {\n    emailTemplateUpdate(\n        organizationId: $organizationId\n        eventId: $eventId\n        formId: $formId\n        source: $source\n        emailTemplate: $emailTemplate\n    ) {\n        id\n    }\n}\n",e)}(),d=Nn(OS),c=Nn(za),u=e.emailType===ze.Accreditations||e.emailType===ze.Assignments||e.emailType===ze.FormSubmit&&e.eventId;return r||(0,i.jsx)(dl,{direction:"column",initialValues:{emailTemplate:d.emailTemplateDefault(e.emailType,R.HEAVENT_APP_URL,s.organization.emailTemplate,e.eventId,e.formId)},render:({handleSubmit:r,values:a})=>(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:n("contenu_de_l_e_19848")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(ym,{name:"emailTemplate.useDefault",children:n("utiliser_le_mod_93521")}),(0,i.jsx)(Pa,{height:"6"}),!a.emailTemplate.useDefault&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sl,{label:n("sujet_de_l_e_ma_66809"),name:"emailTemplate.subject"}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Sm,{hint:n("cet_metteur_se_80394"),isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(nv,{children:n("_metteur_de_l_e_51616")}),name:"emailTemplate.emailSenderId",onCreateClick:()=>{t.push(So.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:(s.organization?.emailsSenders??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(gv,{hint:(0,i.jsx)(fr,{css:{"& a":{color:"$primary700"}},dangerouslySetInnerHTML:{__html:n("vous_pouvez_ajo_23408")}}),label:n("contenu_de_l_e_19848"),name:"emailTemplate.content"}),(0,i.jsx)(Pa,{height:"6"}),u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Sm,{isSearchVisible:!0,label:n("pi_ce_s_jointe_82370"),multiple:!0,name:"emailTemplate.attachments",children:[(s.organization?.event?.customDocuments??[]).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),o.customBadges.map(e=>(0,i.jsx)("option",{value:e,children:b_(e)},e)),TI.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))]}),(0,i.jsx)(Pa,{height:"6"})]})]}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{isLoading:l,onClick:r,children:n("enregistrer_le_77369")})})})]}),validate:c.validateForForm(d.updateEmailTemplateSchema()),width:1,onSubmit:async t=>{await a({organizationId:e.organizationId,eventId:e.eventId,formId:e.formId,source:e.source,emailTemplate:t.emailTemplate})}})},PS=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,formId:s}}=il(),{data:r}=Xr({organizationId:n,formId:s});Cd(r.organization?.form.name??"");const[a,l]=(0,F.useState)(ze.FormSubmit);return(0,i.jsx)(dS,{title:r.organization?.form.name??"-",onClose:()=>{e.push(zi.FORMS({organizationId:n,eventId:o}))},children:(0,i.jsx)(Ea,{justify:"center",width:1,children:(0,i.jsxs)(Ea,{direction:"column",width:"$container",children:[(0,i.jsx)(Pa,{height:"8"}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("liste_des_e_mai_73508")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(mc,{children:[(0,i.jsx)(cc,{children:(0,i.jsx)(Tc,{children:t("type_d_e_mail_06577")})}),(0,i.jsx)($S,{isSelected:a===ze.FormSubmit,subtitle:t("cet_e_mail_est_29404"),title:t("remplissage_du_09925"),onClick:()=>l(ze.FormSubmit)}),(0,i.jsx)($S,{isSelected:a===ze.Code,subtitle:t("cet_e_mail_est_49525"),title:t("code_20843"),onClick:()=>l(ze.Code)}),o&&(0,i.jsx)($S,{isSelected:a===ze.FormInvite,subtitle:t("cet_email_est_e_46197"),title:t("invitation_d_un_88753"),onClick:()=>l(ze.FormInvite)})]})]}),(0,i.jsx)(fr,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Ea,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(RS,{emailType:a,eventId:o,formId:s,organizationId:n,source:null})})]}),(0,i.jsx)(Pa,{height:"8"})]})})})};let DS=class extends zl{constructor(e){super(e)}formParametersBroadcastInputDefault(e){return{segmentsIds:(e?.segments??[]).map(e=>e.segmentId),noAccessTitle:e?.noAccessTitle||"",noAccessMessage:e?.noAccessMessage||""}}formParametersBroadcastInputSchema(){return l.Ik().shape({segmentsIds:l.YO().of(l.ai())})}updateFormParametersBroadcastSchema(){return l.Ik().shape({form:this.formParametersBroadcastInputSchema()})}};DS=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],DS);const FS=({children:e,isActive:t,replace:n=!0,to:o})=>{const s=Hn(),r=t?.(s.pathname)??s.pathname===o;return(0,i.jsx)(fr,{css:{background:r?"$primary100":"transparent",borderRadius:"6px",color:r?"$primary700":"$gray500",cursor:r?"default":"pointer",padding:"$2 $3"},children:(0,i.jsx)(La,{replace:n,to:o,children:e})})},MS=e=>(0,i.jsx)(Ea,{"aria-orientation":"vertical",as:Aa.Nav,direction:"column",gap:"2",role:"menubar",width:1,children:e.children}),NS=e=>{const{translate:t,params:n}=il(),{hasFeature:o}=nI();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Jl,{css:{py:"$8"},gridtemplatecolumns:"1fr 210px 80px 880px 1fr",gridtemplaterows:"1fr",width:1,children:[(0,i.jsx)(fr,{css:{gridColumn:"2 / 3"},children:(0,i.jsxs)(MS,{children:[(0,i.jsx)(FS,{to:zi.FORM_PARAMETERS_GENERAL(n),children:t("g_n_ral_64953")}),(0,i.jsx)(FS,{to:zi.FORM_PARAMETERS_DESIGN(n),children:t("design_15043")}),n.eventId&&(0,i.jsx)(FS,{to:zi.FORM_PARAMETERS_AVAILABILITIES(n),children:t("disponibilit_s_49923")}),n.eventId&&(0,i.jsx)(FS,{to:zi.FORM_PARAMETERS_MISSIONS(n),children:t("missions_63972")}),n.eventId&&o(Fe.Accreditation)&&(0,i.jsx)(FS,{to:zi.FORM_PARAMETERS_ACCREDITATIONS(n),children:t("accr_ditations_39450")}),(0,i.jsx)(FS,{to:zi.FORM_PARAMETERS_BROADCAST(n),children:t("diffusion_56689")}),(0,i.jsx)(FS,{to:zi.FORM_PARAMETERS_STATE(n),children:t("cl_turer_88223")})]})}),(0,i.jsx)(fr,{css:{gridColumn:"4 / 5"},width:1,children:e.children})]}),(0,i.jsx)(hS,{fallbackPath:zi.FORMS({organizationId:n.organizationId,eventId:n.eventId}),isOpen:e.isNotSavedOpen,onClose:e.onNotSavedClose})]})};function LS(e,t,n){const{history:i,params:{organizationId:o,eventId:s}}=il(),[r,a]=(0,F.useState)(!1),[l,d]=(0,F.useState)(JSON.stringify(e)),c=(0,F.useCallback)(()=>{const e=JSON.stringify(t);l===e?i.goBack(zi.FORMS({organizationId:o,eventId:s})):a(!0)},[l,t]),u=(0,F.useCallback)(()=>{a(!1)},[a]),h=(0,F.useCallback)(()=>{n(),d(JSON.stringify(t))},[n,t]);return(0,F.useEffect)(()=>{d(JSON.stringify(e))},[e]),{isNotSavedModalOpen:r,onClose:c,onNotSavedClose:u,onSave:h}}const BS=e=>{const t=Ln(),{isNotSavedModalOpen:n,onClose:o,onNotSavedClose:s,onSave:r}=LS(e.initialValues,e.values,e.handleSubmit),[a,l]=F.useState(Zo(e.initialValues.form.segmentsIds)),d=F.useMemo(()=>Zo(e.eventSegments)&&Zo(e.organizationSegments)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("optgroup",{label:t("vues_de_l_v_ne_57031"),children:e.eventSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)("optgroup",{label:t("vues_de_l_organ_32624"),children:e.organizationSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}):Zo(e.eventSegments)?(0,i.jsx)(i.Fragment,{children:e.eventSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):Zo(e.organizationSegments)?(0,i.jsx)(i.Fragment,{children:e.organizationSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):(0,i.jsx)(i.Fragment,{}),[e.eventSegments,e.organizationSegments]);return F.useEffect(()=>{l(Zo(e.initialValues.form.segmentsIds))},[e.initialValues.form.segmentsIds]),(0,i.jsx)(dS,{button:(0,i.jsx)(pl,{isLoading:e.isMutateLoading,onClick:r,children:t("enregistrer_06519")}),title:e.name,onClose:o,children:(0,i.jsx)(NS,{isNotSavedOpen:n,onNotSavedClose:s,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("diffusion_du_fo_47764")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("personnalisez_l_57514")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:t("_qui_s_adresse_82507")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:a?"unchecked":"checked",onClick:()=>{l(!1),e.change("form.segmentsIds",[])},children:t("_tout_le_monde_35921")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:a?"checked":"unchecked",onClick:()=>{l(!0)},children:t("_certaines_vue_55512")}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!0,name:"form.segmentsIds",children:d})]}),(0,i.jsx)($u,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sl,{label:t("nom_de_l_tape_85862"),name:"form.noAccessTitle"}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(gv,{label:t("message_affich_57692"),name:"form.noAccessMessage"})]})]})})})},VS=e=>{const{params:{organizationId:t,eventId:n,formId:o}}=il(),s=Nn(za),r=Nn(DS),{mutate:a,isLoading:l}=function(e={}){return Un("mutation FormParametersBroadcastUpdate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $formId: FormId!\n    $form: FormParametersBroadcastInput!\n) {\n    formParametersBroadcastUpdate(\n        organizationId: $organizationId\n        eventId: $eventId\n        formId: $formId\n        form: $form\n    ) {\n        id\n    }\n}\n",e)}(),d=F.useMemo(()=>({form:r.formParametersBroadcastInputDefault(e.form)}),[e.form]);return(0,i.jsx)(dl,{direction:"column",height:1,initialValues:d,render:({form:t,handleSubmit:n,values:o})=>(0,i.jsx)(BS,{change:t.change,eventSegments:e.eventSegments,handleSubmit:n,initialValues:d,isMutateLoading:l,loader:e.loader,name:e.form?.name??"",organizationSegments:e.organizationSegments,values:o}),validate:s.validateForForm(r.updateFormParametersBroadcastSchema()),width:1,onSubmit:e=>a({organizationId:t,eventId:n,formId:o,form:e.form})})},US=()=>{const{params:{organizationId:e,formId:t}}=il(),{data:n,loader:o}=Vn("query FormParametersBroadcastOrganization($organizationId: OrganizationId!, $formId: FormId!) {\n    organization(id: $organizationId) {\n        segments(segmentType: Volunteers) {\n            id\n            name\n        }\n\n        form(id: $formId) {\n            name\n            noAccessMessage\n            noAccessTitle\n\n            segments {\n                segmentId\n            }\n        }\n    }\n}\n",{organizationId:e,formId:t},[]);return Cd(n.organization?.form.name??""),(0,i.jsx)(VS,{eventSegments:[],form:n.organization?.form,loader:o,organizationSegments:n.organization?.segments??[]})},WS=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=il(),{data:o,loader:s}=Vn("query FormParametersBroadcastEvent(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $formId: FormId!\n) {\n    organization(id: $organizationId) {\n        form(id: $formId) {\n            name\n            noAccessMessage\n            noAccessTitle\n\n            segments {\n                segmentId\n            }\n        }\n\n        segments(segmentType: Volunteers) {\n            id\n            name\n        }\n    }\n\n    event(id: $eventId) {\n        segments(segmentType: Volunteers) {\n            id\n            name\n        }\n    }\n}\n",{organizationId:e,eventId:t,formId:n},[]);return Cd(o.organization?.form.name??""),(0,i.jsx)(VS,{eventSegments:o.event?.segments??[],form:o.organization?.form,loader:s,organizationSegments:o.organization?.segments??[]})};function GS(e){return{gray50:e?.gray50??lr.colors.gray50.value,gray500:e?.gray500??lr.colors.gray500.value,gray700:e?.gray700??lr.colors.gray700.value,gray800:e?.gray800??lr.colors.gray800.value,gray900:e?.gray900??lr.colors.gray900.value,primary700:e?.primary700??lr.colors.primary700.value,primary800:e?.primary800??lr.colors.primary800.value}}let HS=class extends zl{documentInputService;constructor(e,t){super(t),this.documentInputService=e}organizationDesignInputDefault(e){return{banner:e?.banner??this.documentInputService.documentInputDefault(),logo:e?.logo??this.documentInputService.documentInputDefault(),colors:GS(e?.colors)}}formParametersDesignInputDefault(e){return{banner:e?.banner??this.documentInputService.documentInputDefault(),colors:GS(e?.colors)}}};HS=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[ej,Dn])],HS);const qS=e=>{const{translate:t}=il();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:e.title}),e.showLogo&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",width:300,children:t("logo_18191")}),(0,i.jsx)(Tj,{hint:t("nous_recommando_20904"),label:t("s_lectionnez_un_82734"),organizationId:e.organizationId,prefix:`${e.prefix}logo.`})]})]}),(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",width:300,children:t("banni_re_86634")}),(0,i.jsx)(oj,{accept:HI.Images,acl:"public-read",hint:t("taille_de_l_ima_84109"),organizationId:e.organizationId,prefix:`${e.prefix}banner.`})]}),(0,i.jsx)(Pa,{height:"10"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("charte_graphiqu_02725")}),(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",width:300,children:t("couleur_de_fond_75677")}),(0,i.jsx)(Ea,{css:{flex:"1"},direction:"column",gap:"4",children:(0,i.jsx)(nj,{initialValue:lr.colors.gray50.value,label:t("couleur_de_fond_75677"),name:`${e.prefix}colors.gray50`})})]}),(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",width:300,children:t("textes_07935")}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(nj,{initialValue:lr.colors.gray800.value,label:t("couleur_du_text_32021"),name:`${e.prefix}colors.gray800`}),(0,i.jsx)(nj,{initialValue:lr.colors.gray900.value,label:t("couleur_des_tit_58918"),name:`${e.prefix}colors.gray900`}),(0,i.jsx)(nj,{initialValue:lr.colors.gray500.value,label:t("couleur_des_sou_18968"),name:`${e.prefix}colors.gray500`}),(0,i.jsx)(nj,{initialValue:lr.colors.gray700.value,label:t("couleur_des_lab_38397"),name:`${e.prefix}colors.gray700`})]})]}),(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",width:300,children:t("boutons_35604")}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(nj,{initialValue:lr.colors.primary700.value,label:t("couleur_des_bou_24410"),name:`${e.prefix}colors.primary700`}),(0,i.jsx)(nj,{initialValue:lr.colors.primary800.value,label:t("couleur_des_bou_16515"),name:`${e.prefix}colors.primary800`})]})]})]})},YS=e=>{const t=Ln(),{isNotSavedModalOpen:n,onClose:o,onNotSavedClose:s,onSave:r}=LS(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(dS,{button:(0,i.jsx)(pl,{isLoading:e.isMutateLoading,onClick:r,children:t("enregistrer_06519")}),title:e.name,onClose:o,children:(0,i.jsx)(NS,{isNotSavedOpen:n,onNotSavedClose:s,children:e.loader||(0,i.jsx)(qS,{organizationId:e.organizationId,prefix:"design.",showLogo:!1,title:t("images_de_votre_00576")})})})},KS=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=il(),{data:o,loader:s}=Vn("query FormParametersDesign($organizationId: OrganizationId!, $formId: FormId!) {\n    organization(id: $organizationId) {\n        form(id: $formId) {\n            name\n\n            design {\n                banner {\n                    acl\n                    name\n                    key\n                }\n\n                colors\n            }\n        }\n    }\n}\n",{organizationId:e,formId:n},[]);Cd(o.organization?.form.name??"");const r=Nn(HS),{mutate:a,isLoading:l}=function(e={}){return Un("mutation FormParametersDesignUpdate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $formId: FormId!\n    $design: DesignInput!\n) {\n    formParametersDesignUpdate(\n        organizationId: $organizationId\n        eventId: $eventId\n        formId: $formId\n        design: $design\n    ) {\n        id\n    }\n}\n",e)}(),d=F.useMemo(()=>({design:r.formParametersDesignInputDefault(o.organization?.form.design)}),[o.organization]);return(0,i.jsx)(dl,{direction:"column",height:1,initialValues:d,render:({handleSubmit:t,values:n})=>(0,i.jsx)(YS,{handleSubmit:t,initialValues:d,isMutateLoading:l,loader:s,name:o.organization?.form.name??"",organizationId:e,values:n}),width:1,onSubmit:i=>a({organizationId:e,eventId:t,formId:n,design:i.design})})};let ZS=class extends zl{constructor(e){super(e)}formParametersGeneralInputDefault(e){return{name:e?.name??"",setAssignmentStateToWaiting:e?.setAssignmentStateToWaiting??!1,setAccreditationStateToWaiting:e?.setAccreditationStateToWaiting??!1,allowMultiProfiles:e?.allowMultiProfiles??!1,canRefill:e?.canRefill??!1,description:e?.description||"",successMessage:e?.successMessage||"",customFields:e?.customFields||[],areTeamsAllowed:e?.areTeamsAllowed??!1,maxTeamMembers:e?.maxTeamMembers,teamMemberFillFullForm:e?.teamMemberFillFullForm??!0,emailTitle:e?.emailTitle||"",informationTitle:e?.informationTitle||"",registerButtonText:e?.registerButtonText||"",isEditableInMemberSpace:e?.isEditableInMemberSpace??!0}}formParametersGeneralInputSchema(){return l.Ik().shape({name:l.Yj().required(this.t("le_nom_est_requ_61536")),allowMultiProfiles:l.zM().required(),setAssignmentStateToWaiting:l.zM().required(),setAccreditationStateToWaiting:l.zM().required(),description:l.Yj(),successMessage:l.Yj(),areTeamsAllowed:l.zM().required(),maxTeamMembers:l.ai().nullable(),teamMemberFillFullForm:l.zM().required(),informationTitle:l.Yj(),registerButtonText:l.Yj()})}updateFormParametersGeneralSchema(){return l.Ik().shape({form:this.formParametersGeneralInputSchema()})}};ZS=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],ZS);const XS=e=>{const t=Ln(),[n,o]=F.useState(Zo(e.values)),s=F.useCallback(t=>{o(t),t||e.change(e.name,[])},[e.name,e.change,o]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("d_finir_la_vale_27863")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("choisissez_une_24029")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(su,{value:n,onChange:s,children:t("je_souhaite_d_f_72912")}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(hj,{...e})]})]})},JS=e=>{const{translate:t,params:{eventId:n}}=il(),{isNotSavedModalOpen:o,onClose:s,onNotSavedClose:r,onSave:a}=LS(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(dS,{button:(0,i.jsx)(pl,{isLoading:e.isMutateLoading,onClick:a,children:t("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(NS,{isNotSavedOpen:o,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("initialisation_29288")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("personnaliser_l_27381")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sl,{label:t("nom_du_formulai_14952"),name:"form.name"}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:t("affectation_des_81808")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(ym,{name:"form.setAssignmentStateToWaiting",children:t("les_membres_ser_52180")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:t("accr_ditation_d_48426")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(ym,{name:"form.setAccreditationStateToWaiting",children:t("les_membres_ser_34727")})]}),(0,i.jsx)($u,{height:"7"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("param_trage_de_41992")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("donner_la_possi_56694")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{font:"gray800 textSm semiBold",children:t("inscriptions_mu_35073")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(zm,{name:"form.allowMultiProfiles",children:t("autoriser_les_i_26880")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{font:"gray800 textSm semiBold",children:t("remplissages_mu_72343")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(zm,{name:"form.canRefill",subtext:t("permet_aux_memb_26701"),children:t("autoriser_les_m_44818")}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{font:"gray800 textSm semiBold",children:t("inscriptions_en_77739")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(zm,{name:"form.areTeamsAllowed",children:t("permettre_aux_m_56083")}),e.values.form.areTeamsAllowed&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(zm,{name:"form.teamMemberFillFullForm",children:t("tous_les_membre_59937")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sl,{label:t("nombre_maximum_14615"),name:"form.maxTeamMembers",shouldParseAsInt:!0})]})]}),(0,i.jsx)($u,{height:"7"}),(0,i.jsx)(XS,{change:e.change,customFields:e.customFields,name:"form.customFields",values:e.values.form.customFields}),(0,i.jsx)($u,{height:"7"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("texte_de_l_tap_00197")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("personnaliser_l_68212")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sl,{name:"form.emailTitle"}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("description_de_80800")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("la_description_13257")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(gv,{name:"form.description"}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("texte_de_l_tap_92536")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("personnaliser_l_66470")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sl,{name:"form.informationTitle"}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("texte_du_bouton_05866")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("personnaliser_l_02611")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sl,{name:"form.registerButtonText"}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("message_de_succ_99510")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("personnaliser_l_55334")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(gv,{name:"form.successMessage"}),(0,i.jsx)($u,{height:"7"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("_dition_des_inf_90758")}),(0,i.jsx)(fr,{color:"gray500",children:t("donner_la_possi_56683")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:t("espace_membre_06532")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(zm,{name:"form.isEditableInMemberSpace",children:t("permettre_aux_m_40630")})]})})})},QS=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=il(),{data:o,loader:s}=Vn("query FormParametersGeneral($organizationId: OrganizationId!, $formId: FormId!) {\n    organization(id: $organizationId) {\n        customFields(variety: UserInfo, sort: { attribute: Name, direction: Asc }) {\n            nodes {\n                ...MassEditCustomField\n            }\n        }\n\n        form(id: $formId) {\n            name\n            setAssignmentStateToWaiting\n            setAccreditationStateToWaiting\n            allowMultiProfiles\n            canRefill\n            description\n            successMessage\n            areTeamsAllowed\n            maxTeamMembers\n            teamMemberFillFullForm\n            emailTitle\n            informationTitle\n            registerButtonText\n            isEditableInMemberSpace\n\n            customFields {\n                addValues\n                customFieldId\n                value\n            }\n        }\n    }\n}\n",{organizationId:e,formId:n},[Ro.MassEditCustomFieldFragment]);Cd(o.organization?.form.name??"");const r=Nn(za),a=Nn(ZS),{mutate:l,isLoading:d}=function(e={}){return Un("mutation FormParametersGeneralUpdate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $formId: FormId!\n    $form: FormParametersGeneralInput!\n) {\n    formParametersGeneralUpdate(\n        organizationId: $organizationId\n        eventId: $eventId\n        formId: $formId\n        form: $form\n    ) {\n        id\n    }\n}\n",e)}(),c=F.useMemo(()=>({form:a.formParametersGeneralInputDefault(o.organization?.form)}),[o.organization]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(dl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(JS,{change:e.change,customFields:o.organization?.customFields.nodes??[],handleSubmit:t,initialValues:c,isMutateLoading:d,loader:s,name:o.organization?.form.name??"",values:n}),validate:r.validateForForm(a.updateFormParametersGeneralSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:{...i.form,description:i.form.description||"",successMessage:i.form.successMessage||""}})})})};let eE=class extends zl{constructor(e){super(e)}formParametersStateInputDefault(e){return{state:e?.state||Ge.Open,closedTitle:e?.closedTitle||"",closedMessage:e?.closedMessage||"",closedAt:e?.closedAt||null}}formParametersStateInputSchema(){return l.Ik().shape({state:l.Yj().required(this.t("cl_turer_le_for_10541")).oneOf(an,this.t("cl_turer_le_for_10541")),closedMessage:l.Yj(),closedAt:$m.when("state",{is:Ge.ClosedAt,then:e=>e.required(this.t("la_date_de_cl_t_63358")).typeError(this.t("la_date_de_cl_t_63358")),otherwise:e=>e.nullable()})})}updateFormParametersStateSchema(){return l.Ik().shape({form:this.formParametersStateInputSchema()})}};eE=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],eE);const tE=e=>{const{translate:t,params:{eventId:n}}=il(),{isNotSavedModalOpen:o,onClose:s,onNotSavedClose:r,onSave:a}=LS(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(dS,{button:(0,i.jsx)(pl,{isLoading:e.isMutateLoading,onClick:a,children:t("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(NS,{isNotSavedOpen:o,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sr.Yr,{name:"form.state",children:t=>{t!==Ge.ClosedAt&&e.change("form.closedAt",null)}}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("cl_turer_le_for_46483")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("choisir_si_le_f_14519")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(vv,{name:"form.state",value:Ge.Open,children:t("ne_pas_cl_turer_46870")}),(0,i.jsx)(Pa,{height:"3"}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vv,{name:"form.state",value:Ge.CloseWhenEventDone,children:t("cl_turer_le_for_61719")}),(0,i.jsx)(Pa,{height:"3"})]}),(0,i.jsx)(vv,{name:"form.state",value:Ge.Closed,children:t("cl_turer_le_for_10120")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"form.state",value:Ge.ClosedAt,children:t("cl_turer_le_for_19176")}),e.values.form.state===Ge.ClosedAt&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(ij,{name:"form.closedAt"})]})]}),e.values.form.state!==Ge.Open&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($u,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sl,{label:t("nom_de_l_tape_85862"),name:"form.closedTitle"}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(gv,{hint:t("ce_message_sera_03472"),label:t("message_de_cl_t_95276"),name:"form.closedMessage"})]})]})})})},nE=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=il(),{data:o,loader:s}=Vn("query FormParametersState($organizationId: OrganizationId!, $formId: FormId!) {\n    organization(id: $organizationId) {\n        form(id: $formId) {\n            name\n            state\n            closedTitle\n            closedMessage\n            closedAt\n        }\n    }\n}\n",{organizationId:e,formId:n},[]);Cd(o.organization?.form.name??"");const r=Nn(za),a=Nn(eE),{mutate:l,isLoading:d}=function(e={}){return Un("mutation FormParametersStateUpdate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $formId: FormId!\n    $form: FormParametersStateInput!\n) {\n    formParametersStateUpdate(\n        organizationId: $organizationId\n        eventId: $eventId\n        formId: $formId\n        form: $form\n    ) {\n        id\n    }\n}\n",e)}(),c=F.useMemo(()=>({form:a.formParametersStateInputDefault(o.organization?.form)}),[o.organization]);return(0,i.jsx)(dl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(tE,{change:e.change,handleSubmit:t,initialValues:c,isMutateLoading:d,loader:s,name:o.organization?.form.name??"",values:n}),validate:r.validateForForm(a.updateFormParametersStateSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:i.form})})};function iE(e,t){return[{icon:"user-plus",text:e("cr_er_un_membre_38547"),link:kI.CREATE({organizationId:t})},{icon:"user-group",text:e("voir_les_membre_27923"),link:fi.COMMUNITY_USERS({organizationId:t})},{icon:"cake-candles",text:e("cr_er_un_v_nem_28126"),link:So.CREATE_EVENT(t)},{icon:"cake-candles",text:e("voir_les_v_nem_52491"),link:`${mi.ORGANIZATION({organizationId:t})}/events`},{icon:"users",text:e("cr_er_une_d_l_g_23035"),link:So.COMMUNITY_CREATE_DELEGATION(t)},{icon:"users",text:e("voir_les_d_l_ga_71959"),link:to.DELEGATIONS({organizationId:t})},{icon:"paper-plane",text:e("cr_er_une_campa_96023"),link:rI.CREATE({organizationId:t})},{icon:"paper-plane",text:e("voir_les_campag_02148"),link:rI.CAMPAIGNS({organizationId:t})}]}function oE(e,t,n){return[{icon:"user-plus",text:e("cr_er_un_membre_38547"),link:kI.CREATE({organizationId:t,eventId:n})},{icon:"user-group",text:e("voir_les_membre_27923"),link:So.VOLUNTEERS(t,n)},{icon:"cake-candles",text:e("cr_er_un_v_nem_28126"),link:So.CREATE_EVENT(t)},{icon:"cake-candles",text:e("voir_les_v_nem_52491"),link:`${mi.ORGANIZATION({organizationId:t})}/events`},{icon:"sitemap",text:e("cr_er_une_missi_66818"),link:So.CREATE_POSITION(t,n)},{icon:"sitemap",text:e("voir_les_missio_71964"),link:ao.POSITIONS({organizationId:t,eventId:n})},{icon:"badge-check",text:e("cr_er_une_accr_33475"),link:So.CREATE_ACCREDITATION(t,n)},{icon:"badge-check",text:e("voir_les_accr_d_34867"),link:Hi.ACCREDITATIONS({organizationId:t,eventId:n})},{icon:"users",text:e("cr_er_une_d_l_g_23035"),link:So.CREATE_DELEGATION(t,n)},{icon:"users",text:e("voir_les_d_l_ga_71959"),link:to.DELEGATIONS({organizationId:t,eventId:n})},{icon:"paper-plane",text:e("cr_er_une_campa_96023"),link:rI.CREATE({organizationId:t,eventId:n})},{icon:"paper-plane",text:e("voir_les_campag_02148"),link:rI.CAMPAIGNS({organizationId:t,eventId:n})},{icon:"hand-sparkles",text:e("cr_er_une_autom_91246"),link:SI.CREATE({organizationId:t,eventId:n})},{icon:"hand-sparkles",text:e("voir_les_automa_58340"),link:SI.WORKFLOWS({organizationId:t,eventId:n})}]}const sE=e=>{const{history:t}=il();return(0,i.jsxs)(Ea,{align:"center",css:{cursor:"pointer",px:"$4","&:hover":{background:"$gray100"}},gap:"2",height:40,onClick:()=>{t.push(e.link),e.onClose()},children:[e.avatar,e.icon&&(0,i.jsx)(fr,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(Va,{icon:e.icon})}),(0,i.jsx)(fr,{font:"gray800 textSm medium",children:e.children})]})},rE=e=>(0,i.jsx)(Ea,{css:{px:"$4"},children:(0,i.jsx)(fr,{font:"gray500 textSm medium",children:e.children})}),aE=e=>(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(rE,{children:e.title}),e.children]}),lE="h-open-omnibar",dE=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),[s,r]=(0,F.useState)(!1),[a,l]=(0,F.useState)(!1),[d,u,m]=Ec(""),[g,p]=(0,F.useState)(e.isAdmin?o?oE(t,n,o):iE(t,n):[]),[f,x]=(0,F.useState)([]),[_,I]=(0,F.useState)([]),[v,b]=(0,F.useState)([]),[j,C]=(0,F.useState)([]),[y,k]=(0,F.useState)([]),[A,w]=(0,F.useState)([]),[S,E]=(0,F.useState)([]),[T,z]=(0,F.useState)([]),[$,O]=(0,F.useState)([]),R=(0,F.useMemo)(()=>Xo(g)&&Xo(f)&&Xo(_)&&Xo(v)&&Xo(j)&&Xo(y)&&Xo(A)&&Xo(S)&&Xo(T)&&Xo($),[g,f,_,v,j,y,A,S,T,$]),P=(0,F.useCallback)(()=>{p(e.isAdmin?o?oE(t,n,o):iE(t,n):[]),x([]),I([]),b([]),C([]),k([]),w([]),E([]),z([]),O([])},[n,o,e.isAdmin,p,x,I,b,C,k,w,E,z,O]),D=(0,F.useCallback)(e=>{Il(e),l(!1),m(""),P(),r(e=>!e)},[r,l,m,P]),M=(0,F.useCallback)(()=>{r(!1)},[r]);return Hh("k",D),kd(M),yd(M),(0,F.useEffect)(()=>(document.addEventListener(lE,D),()=>{document.removeEventListener(lE,D)}),[D]),(0,F.useEffect)(()=>{(async()=>{if(h(u)){if(l(!0),o){const{organization:r,event:a}=await(i={organizationId:n,eventId:o,name:u},s=await H(),ss('query EventOmnibar($organizationId: OrganizationId!, $eventId: EventId!, $name: String) {\n    organization(id: $organizationId) {\n        customFields(name: $name, limit: 5) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        events(name: $name, limit: 5) {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        accreditations(columnsSearch: ["id", "name", "acronym"], name: $name, limit: 5) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        campaigns(name: $name, limit: 5) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        delegations(name: $name, limit: 5) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        forms(name: $name, limit: 5) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        positions(columnsSearch: ["id", "name", "acronym"], name: $name, limit: 5) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        volunteersRegistrations(\n            columnsSearch: [\n                "email"\n                "id"\n                "name"\n                "phone"\n                "teamCode"\n                "weezevent_barcode_id"\n                "weezevent_short_tag"\n            ]\n            name: $name\n            limit: 5\n        ) {\n            nodes {\n                userInfo {\n                    id\n                    email\n                    name\n\n                    picture {\n                        url\n                    }\n                }\n            }\n        }\n\n        workflows(name: $name, limit: 5) {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n}\n',{variables:i,token:s||void 0,fragments:[]}));p(e.isAdmin?oE(t,n,o).filter(e=>c(e.text).includes(c(u))):[]),x(a.volunteersRegistrations.nodes.map(e=>e.userInfo)),I(e.isAdmin?r.events.nodes:[]),b(e.isAdmin?r.customFields.nodes:[]),C(a.positions.nodes),k(a.forms.nodes),w(a.accreditations.nodes),E(a.delegations.nodes),z(a.campaigns.nodes),O(a.workflows.nodes)}else{const{organization:e}=await function(e,t){return ss("query OrganizationOmnibar($organizationId: OrganizationId!, $name: String) {\n    organization(id: $organizationId) {\n        accreditations(name: $name, limit: 5) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        campaigns(level: Both, name: $name, limit: 5) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        customFields(name: $name, limit: 5) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        delegations(level: Both, name: $name, limit: 5) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        events(name: $name, limit: 5) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        forms(level: Both, name: $name, limit: 5) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        positions(name: $name, limit: 5) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        usersInfos(name: $name, limit: 5) {\n            nodes {\n                id\n                email\n                name\n\n                picture {\n                    url\n                }\n            }\n        }\n\n        workflows(level: Both, name: $name, limit: 5) {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n,name:u},await H());p(iE(t,n).filter(e=>c(e.text).includes(c(u)))),x(e.usersInfos.nodes),I(e.events.nodes),b(e.customFields.nodes),C(e.positions.nodes),k(e.forms.nodes),w(e.accreditations.nodes),E(e.delegations.nodes),z(e.campaigns.nodes),O(e.workflows.nodes)}l(!1)}else P();var i,s})()},[n,o,e.isAdmin,u,l,p,x,I,b,C,k,w,E,z,O,P]),s&&("organization"===e.level&&!o||"event"===e.level&&o)?(0,ee.createPortal)((0,i.jsx)(Ea,{align:"center",css:{background:"rgba(52, 64, 84, 0.7)",height:"100%",left:0,position:"absolute",top:0,width:"100%",zIndex:"300"},justify:"center",children:(0,i.jsxs)(Ea,{css:{background:"white",borderRadius:"$3",overflow:"hidden"},direction:"column",width:640,onClick:e=>Il(e),children:[(0,i.jsx)(fr,{css:{"& .h-styled-input-container":{height:"48px"}},height:48,children:(0,i.jsx)(wl,{autoFocus:!0,css:{borderBottom:"1px solid $gray200","& .h-styled-input-container":{border:"none"}},height:"fluid",icon:"magnifying-glass",placeholder:t("rechercher_un_m_45772"),value:d,onChange:m})}),(0,i.jsx)(Ea,{css:{overflowY:"auto",py:"$4"},direction:"column",height:350,children:a?(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(qd,{borderRadius:"$1",height:36}),(0,i.jsx)(qd,{borderRadius:"$1",height:36}),(0,i.jsx)(qd,{borderRadius:"$1",height:36})]}):R?(0,i.jsxs)(Ea,{align:"center",direction:"column",gap:"4",height:1,justify:"center",children:[(0,i.jsx)(Ea,{align:"center",css:{bd:!0,fontSize:"$textMd"},height:48,justify:"center",width:48,children:(0,i.jsx)(Va,{icon:"magnifying-glass"})}),(0,i.jsx)(fr,{font:"gray900 textSm semiBold",children:t("aucun_r_sultat_73664",u)})]}):(0,i.jsxs)(Ea,{direction:"column",gap:"6",children:[Zo(g)&&(0,i.jsx)(aE,{title:t("actions_rapides_42479"),children:g.map((e,t)=>(0,i.jsx)(sE,{icon:e.icon,link:e.link,onClose:M,children:e.text},t))}),Zo(f)&&(0,i.jsx)(aE,{title:t("membres_11310"),children:f.map(e=>(0,i.jsx)(sE,{avatar:(0,i.jsx)(Fg,{email:e.email,image:e.picture?.url,name:e.name,size:24}),link:kI.MEMBER_INFORMATION({organizationId:n,eventId:o,userInfoId:e.id}),onClose:M,children:e.name},e.id))}),Zo(_)&&(0,i.jsx)(aE,{title:t("Event"),children:_.map(e=>(0,i.jsx)(sE,{icon:"cake-candles",link:So.EDIT_EVENT(n,e.id),onClose:M,children:e.name},e.id))}),Zo(v)&&(0,i.jsx)(aE,{title:t("champs_de_formu_64126"),children:v.map(e=>(0,i.jsx)(sE,{icon:"text",link:So.EDIT_CUSTOM_FIELD(n,-1,e.id),onClose:M,children:e.name},e.id))}),Zo(j)&&(0,i.jsx)(aE,{title:t("missions_63972"),children:j.map(e=>(0,i.jsx)(sE,{icon:"sitemap",link:ao.POSITION({organizationId:n,eventId:o,positionId:e.id}),onClose:M,children:e.name},e.id))}),Zo(y)&&(0,i.jsx)(aE,{title:t("Form_plural"),children:y.map(e=>(0,i.jsx)(sE,{icon:"file-lines",link:zi.FORM_ELEMENTS({organizationId:n,eventId:o,formId:e.id}),onClose:M,children:e.name},e.id))}),Zo(A)&&(0,i.jsx)(aE,{title:t("accr_ditations_39450"),children:A.map(e=>(0,i.jsx)(sE,{icon:"badge-check",link:Hi.ACCREDITATION({organizationId:n,eventId:o,accreditationId:e.id}),onClose:M,children:e.name},e.id))}),Zo(S)&&(0,i.jsx)(aE,{title:t("d_l_gations_78318"),children:S.map(e=>(0,i.jsx)(sE,{icon:"users",link:to.DELEGATION({organizationId:n,eventId:o,delegationId:e.id}),onClose:M,children:e.name},e.id))}),Zo(T)&&(0,i.jsx)(aE,{title:t("Campaigns"),children:T.map(e=>(0,i.jsx)(sE,{icon:"paper-plane",link:rI.CAMPAIGN_DASHBOARD({organizationId:n,eventId:o,campaignId:e.id}),onClose:M,children:e.name},e.id))}),Zo($)&&(0,i.jsx)(aE,{title:t("automatisations_60045"),children:$.map(e=>(0,i.jsx)(sE,{icon:"hand-sparkles",link:SI.UPDATE({organizationId:n,eventId:o,workflowId:e.id}),onClose:M,children:e.name},e.id))})]})})]})}),document.body):null};function cE(e){return e.endsWith("@weezevent.com")||e.endsWith("@weeztix.com")}const uE=(0,F.memo)(function(){const{translate:e}=il(),{pathname:t}=Hn(),{organization:n,selectedEventId:o}=nI(),[s,r]=(0,F.useState)(!1),a=t===Pi.EVENTS({organizationId:n.id})||null!==t.match(/\/events/)||null!==t.match(/\/event\/\d+/),l=(0,Zd.A)(n.events.nodes.filter(e=>e.state===Re.Ongoing||e.state===Re.Upcoming),e=>e.name),d=n.events.nodes.find(e=>e.id===o);return(0,i.jsxs)(Ed,{onStateChange:r,children:[(0,i.jsx)(Dd,{children:(0,i.jsxs)(Ea,{align:"center","aria-expanded":s,"aria-label":e("ouvrir_la_liste_52670"),"aria-selected":s,css:{blockSize:"100%",color:"white",opacity:a?"1":"0.6",px:"$4","&:hover":{opacity:"1"}},gap:"2",role:"button",onClick:e=>{e.nativeEvent.stopImmediatePropagation(),document.getElementById("events-menu")?.focus()},children:[d?d.name:e("_v_nements_53672"),s?(0,i.jsx)(Va,{icon:"angle-up"}):(0,i.jsx)(Va,{icon:"angle-down"})]})}),(0,i.jsxs)(Pd,{"aria-orientation":"vertical",id:"events-menu",maxHeight:300,offset:-10,placement:"bottom-start",children:[(0,i.jsx)(Ea,{css:{flex:"1",overflowY:"auto"},direction:"column",children:l.map(e=>(0,i.jsx)($d,{to:Pi.EVENT({organizationId:n.id,eventId:e.id}),onClick:e=>{wd(e.target),document.getElementById("main")?.focus()},children:e.name},e.id))}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)($d,{to:Pi.EVENTS({organizationId:n.id}),onClick:e=>{wd(e.target),document.getElementById("main")?.focus()},children:e("tous_les_v_nem_16033")})]})]})});var hE,mE;function gE(){return gE=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{translate:t,params:{eventId:n}}=il(),{organization:o}=nI(),s=(0,F.useMemo)(()=>{let t=`https://admin.${R.WEEZEVENT_DOMAIN}/ticket/O${e.weezeventOrganizationId}`;if(n){const e=o.events.nodes.find(e=>e.id===n);"number"==typeof e?.weezeventEventId&&(t+=`/E${e.weezeventEventId}`)}return t},[n,o]),r=`https://admin.${R.WEEZEVENT_DOMAIN}/access/O${e.weezeventOrganizationId}`,a=`https://admin.${R.WEEZEVENT_DOMAIN}/pay/#!/${e.weezeventOrganizationId}`;return(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(Ea,{align:"center",css:{borderRadius:"$2",padding:"$2","&:hover":{background:"$gray700"}},justify:"center",children:(0,i.jsx)(Ea,{align:"center",css:{fontSize:"$textMd"},children:(0,i.jsx)(Va,{icon:"grid",iconStyle:"solid"})})})}),(0,i.jsx)(Pd,{css:{padding:"0"},placement:"bottom-end",children:(0,i.jsxs)(Ea,{css:{padding:"$3 $4"},direction:"column",gap:"3",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:t("passer_75488")}),(0,i.jsxs)(Ea,{direction:"column",gap:"4",children:[(0,i.jsx)(La,{to:s,children:(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(fr,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(CE,{})}),(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:"WeezTicket"}),(0,i.jsx)(fr,{color:"gray500",fontWeight:"medium",children:t("billetterie_53780")})]})]})}),(0,i.jsx)(La,{to:r,children:(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(fr,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(pE,{})}),(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:"WeezAccess"}),(0,i.jsx)(fr,{color:"gray500",fontWeight:"medium",children:t("contr_le_d_acc_03854")})]})]})}),(0,i.jsx)(La,{to:a,children:(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(fr,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(IE,{})}),(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:"WeezPay"}),(0,i.jsx)(fr,{color:"gray500",fontWeight:"medium",children:"Cashless"})]})]})})]})]})})]})},kE=({to:e,children:t,isActive:n,onClick:o})=>{const{pathname:s}=Hn(),r=n?n(s):e===s;return(0,i.jsx)(Ea,{"aria-selected":r,css:{alignItems:"center",blockSize:"100%",color:"white",cursor:"pointer",opacity:r?"1":"0.6",px:"$4","&:hover":{opacity:"1"}},height:1,role:"menuitem",children:(0,i.jsx)(La,{height:1,to:e,width:1,onClick:o,children:t})})},AE=F.memo(function(){const{translate:e,params:{organizationId:t}}=il(),{organization:n,user:o,updateLocalOrganization:s}=nI(),{data:r}=Qr({}),[a,l]=F.useState(!1),d=F.useMemo(()=>{const e=(0,Kd.A)(r.user?.roles??[],e=>e.organizationId);return(0,Zd.A)((r.organizations||[]).filter(t=>Zo(e[t.id])),e=>e.name)},[r.organizations,r.user]);return(0,i.jsxs)(Ea,{align:"center",css:{background:lr.colors.blueGray900.value,color:"white",cursor:"pointer",position:"relative",px:"$6"},height:1,justify:"between",width:1,children:[(0,i.jsx)(Ea,{align:"center","aria-label":e("page_d_accueil_12532"),css:{"& svg":{height:"50%"}},height:1,width:300,children:(0,i.jsx)(La,{height:1,to:Pi.EVENTS({organizationId:t}),children:(0,i.jsx)(Ul,{})})}),(0,i.jsx)(Ea,{"aria-label":e("menu_de_l_organ_58508"),as:Aa.Nav,height:1,children:(0,i.jsxs)(Ea,{align:"center",justify:"center",role:"menubar",children:[(0,i.jsx)(uE,{}),(0,i.jsx)(ub,{rolesTypes:Ov,children:(0,i.jsx)(kE,{isActive:e=>e.startsWith(So.CUSTOM_FIELDS(t)),to:So.CUSTOM_FIELDS(t),onClick:async()=>await s({customFieldsSegmentId:null}),children:e("champs_de_formu_64126")})}),(0,i.jsx)(ub,{rolesTypes:Ov,children:(0,i.jsx)(kE,{isActive:e=>e.startsWith(fi.COMMUNITY({organizationId:t})),to:fi.COMMUNITY_USERS({organizationId:t}),children:e("communaut_20896")})}),(0,i.jsx)(kE,{isActive:e=>e.startsWith(So.ORGANIZATION_PARAMETERS(t)),to:So.ORGANIZATION_PARAMETERS_PROFILE(t),children:e("param_tres_78420")})]})}),(0,i.jsxs)(Ea,{align:"center",gap:"6",justify:"end",width:300,children:["number"==typeof n.weezeventOrganizationId&&(0,i.jsx)(yE,{weezeventOrganizationId:n.weezeventOrganizationId}),(0,i.jsxs)(Ed,{"aria-label":e("menu_utilisateu_40033"),"aria-orientation":"vertical",isOpen:a,onStateChange:l,children:[(0,i.jsx)(Dd,{children:(0,i.jsxs)(Ea,{align:"center","aria-expanded":a,"aria-label":e("ouvrir_le_menu_47803"),css:{color:"white",cursor:"default"},gap:"3",role:"button",onClick:()=>document.getElementById("user-menu")?.focus(),children:[(0,i.jsx)(Fg,{email:o.email,image:o.userInfo.picture?.url,name:o.userInfo.name,size:32}),(0,i.jsxs)(fr,{css:{maxWidth:"calc(100% - 66px)"},children:[(0,i.jsx)(fr,{css:{ellipsis:!0},fontWeight:"semiBold",children:o.userInfo.firstName||o.email}),(0,i.jsx)(fr,{css:{ellipsis:!0},fontSize:"textXs",children:n.name})]}),(0,i.jsx)("div",{children:a?(0,i.jsx)("i",{className:"far fa-angle-up"}):(0,i.jsx)("i",{className:"far fa-angle-down"})})]})}),(0,i.jsxs)(Pd,{"aria-orientation":"vertical",id:"user-menu",maxHeight:500,placement:"bottom-end",width:300,children:[(0,i.jsx)($d,{children:(0,i.jsxs)(Ea,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(Fg,{email:o.email,image:o.userInfo.picture?.url,name:o.userInfo.name,size:32}),(0,i.jsxs)(fr,{css:{width:"calc(100% - 44px)"},children:[(0,i.jsx)(fr,{css:{ellipsis:!0},fontWeight:"semiBold",children:o.userInfo.name||o.email}),h(o.userInfo.name)&&(0,i.jsx)(fr,{color:"gray500",css:{ellipsis:!0},children:o.email})]})]})}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsxs)(Ea,{as:Aa.Nav,direction:"column",role:"menubar",children:[d.map(({id:e,name:t})=>(0,i.jsx)($d,{onClick:async()=>{await s({eventsSegmentId:null}),location.href=`${R.HEAVENT_APP_URL.pathname}${Pi.EVENTS({organizationId:e})}`,document.getElementById("main")?.focus()},children:t},e)),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsxs)(ub,{rolesTypes:Ov,children:[(0,i.jsx)($d,{to:So.ORGANIZATION_PARAMETERS_PROFILE(t),onClick:()=>{l(!1),document.getElementById("main")?.focus()},children:e("mon_profil_48224")}),(0,i.jsx)($d,{to:So.ORGANIZATION_PARAMETERS_INFOS(t),onClick:()=>{l(!1),document.getElementById("main")?.focus()},children:e("organisation_71863")}),(0,i.jsx)($d,{to:So.ORGANIZATION_PARAMETERS_TEAM(t),onClick:()=>{l(!1),document.getElementById("main")?.focus()},children:e("utilisateurs_04975")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"})]}),cE(o.email)&&(0,i.jsx)($d,{to:So.BACKOFFICE,onClick:()=>{document.getElementById("main")?.focus()},children:e("back_office_83072")}),(0,i.jsx)($d,{color:"red",onClick:Y,children:e("se_d_connecter_74151")})]})]})]})]})]})}),wE=[1033,1538,1787,2574,2954,3059],SE=e=>{const t=Ln(),{organizationId:n}=Wn(),o=Hn(),{isOrganizationAdmin:s,organization:r}=nI(),[a,l]=F.useState(!1),d=function(e){return Math.ceil(e.periodEndAt.diff(Fo.c9.utc(),"days").days)}(r),c=(u=d)>0&&u<=15;var u;const h=r.invoices.length>0,m=F.useCallback(()=>{l(!0)},[l]);if(F.useEffect(()=>(document.addEventListener(os,m),()=>{document.removeEventListener(os,m)}),[]),r.isBlocked&&!o.pathname.endsWith(ci))return(0,i.jsx)(Yn,{path:mi.IS_BLOCKED(mi.ORGANIZATION({organizationId:n}))});if(!r.isBlocked&&o.pathname.endsWith(ci))return(0,i.jsx)(Yn,{path:mi.ORGANIZATION({organizationId:n})});if(d<=0&&!o.pathname.endsWith(ui))return(0,i.jsx)(Yn,{path:mi.IS_EXPIRED(mi.ORGANIZATION({organizationId:n}))});if(d>0&&o.pathname.endsWith(ui))return(0,i.jsx)(Yn,{path:mi.ORGANIZATION({organizationId:n})});{const o=h&&!wE.includes(n),u=64+(a?40:0)+(c||o?64:0);return(0,i.jsxs)(Ea,{css:{overflow:"hidden"},direction:"column",height:1,role:"presentation",width:1,children:[a&&(0,i.jsxs)(Ea,{align:"center",css:{background:"$primary700",px:"$6"},gap:"1",height:40,justify:"between",role:"alert",width:1,children:[(0,i.jsx)(fr,{}),(0,i.jsxs)(Ea,{gap:"1",children:[(0,i.jsx)(fr,{color:"white",children:t("une_nouvelle_ve_69718")}),(0,i.jsx)(fr,{color:"white",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{window.location.reload()},children:t("cliquez_pour_re_36838")})]}),(0,i.jsx)(fr,{color:"white",css:{cursor:"pointer"},fontSize:"textMd",onClick:()=>{l(!1)},children:(0,i.jsx)(Va,{icon:"xmark"})})]}),c&&!o&&(0,i.jsx)(Ea,{align:"center",css:{background:"$primary700",color:"white"},dangerouslySetInnerHTML:{__html:`${t("trial_remaining_days",d,`${R.EMAIL_FROM} `,cd)}
`},height:64,justify:"center",width:1}),o&&(0,i.jsx)(Ea,{align:"center",css:{background:"$primary700",color:"white","& > a":{color:"white",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:t("sauf_erreur_de_03325",r.invoices[0].url,r.invoices[0].invoiceNumber)},height:64,justify:"center",width:1}),(0,i.jsx)(fr,{as:Aa.Header,height:64,width:1,children:(0,i.jsx)(AE,{})}),(0,i.jsx)(fr,{as:Aa.Main,css:{height:`calc(100% - ${u}px)`},id:"main",tabIndex:-1,width:1,children:e.children}),(0,i.jsx)(dE,{isAdmin:s,level:"organization"})]})}};let EE=class extends zl{countriesService;documentInputService;fieldInputService;phoneInputService;constructor(e,t,n,i,o){super(e),this.countriesService=t,this.documentInputService=n,this.fieldInputService=i,this.phoneInputService=o}userInfoUpdateInputDefault(e,t,n={}){const i=this.countriesService.getDefaultCountryValues(n.countryCode);return{id:e?.id??null,fields:this.fieldInputService.fieldsUpdateInputDefault(e?.fields||{},t,i,n.checkboxDefaultEmpty)}}formUserInfoInputSchema(e){return l.Ik().shape({fields:l.Ik().shape(Object.fromEntries(e.map(({isMandatory:e,customField:t})=>[t.slug,this.fieldInputService.fieldSchema(t,e)])))})}userInfoInputSchema(e,t){const n={};return e.forEach(e=>{const t=e.field,i=this.fieldInputService.fieldSchema(e.field,e.isMandatory);n[t.slug]=i}),t&&t.forEach(e=>{n[e.slug]=this.fieldInputService.fieldSchema(e,!1)}),l.Ik().shape({fields:l.Ik().shape({...n})})}userInfoProfileInputDefault(e){const t=this.countriesService.getDefaultCountryValues();return{email:e.email,fields:{firstName:e.userInfo?.fields?.firstName??"",lastName:e.userInfo?.fields?.lastName??"",language:e.userInfo?.fields?.language??e.language??t.user.language??It.En,picture:e.userInfo.fields.picture?(0,Ir.A)(e.userInfo.fields.picture,Qb):this.documentInputService.documentInputDefault(),phone:e.userInfo.fields.phone?(0,Ir.A)(e.userInfo.fields.phone,P_):this.phoneInputService.phoneInputDefault(t)}}}userInfoFields(){return{fields:l.Ik().shape({firstName:l.Yj().nullable(),lastName:l.Yj().nullable(),picture:this.documentInputService.documentInputSchemaNotRequired(),language:l.Yj().required(this.t("les_langues_doi_27712")).oneOf(ad,this.t("les_langues_doi_27712")),phone:this.phoneInputService.phoneInputSchemaNotRequired()})}}userInfoProfileInputSchema(){return l.Ik().shape({email:l.Yj().email(this.t("l_e_mail_est_re_04856")).required(this.t("l_e_mail_est_re_04856")),...this.userInfoFields()})}updateUserInfoSchema(e){return l.Ik().shape({userInfo:this.formUserInfoInputSchema(e)})}updateProfileSchema(){return l.Ik().shape({userInfo:this.userInfoProfileInputSchema()})}userInfoAndTermsInputDefault(e){return{...(0,tr.A)(e.userInfo,["id"]),termsAccepted:!1}}userInfoAndTermsInputSchema(){return l.Ik().shape({firstName:l.Yj().nullable(),lastName:l.Yj().nullable(),phone:this.phoneInputService.phoneInputSchemaNotRequired(),termsAccepted:l.zM().oneOf([!0],this.t("il_est_n_cessai_83896")).required(this.t("il_est_n_cessai_83896"))})}updateUserInfoAndTermsSchema(){return l.Ik().shape({userInfoAndTerms:this.userInfoAndTermsInputSchema()})}};EE=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn,Hc,ej,yj,D_])],EE);let TE=class extends zl{constructor(e){super(e)}volunteersRegistrationsSlotInputDefault(e){return{startDate:e||Fo.c9.invalid("Invalid"),startTime:"",endDate:e||Fo.c9.invalid("Invalid"),endTime:""}}volunteersRegistrationsSlotInputSchema(e,t){const n=t.plus({day:1}).endOf("day");return l.Ik().shape({startDate:$m.required(this.t("la_date_de_d_bu_05030")).typeError(this.t("la_date_de_d_bu_05030")).test("after-event-start-date",this.t("la_date_de_d_bu_68630",e.toLocaleString()),t=>t>=e),startTime:l.Yj().required(this.t("heure_de_d_but_90785")),endDate:$m.required(this.t("la_date_de_fin_32246")).typeError(this.t("la_date_de_fin_32246")).test("after-start-date",this.t("la_date_de_fin_00429"),(e,t)=>Fo.c9.isDateTime(t.parent.startDate)&&t.parent.startDate.isValid&&Fo.c9.isDateTime(t.parent.endDate)&&t.parent.endDate.isValid&&t.parent.endDate>=t.parent.startDate).test("before-event-end-date",this.t("la_date_de_fin_49125",t.toLocaleString()),e=>e<=n),endTime:l.Yj().required(this.t("l_heure_de_fin_78626"))})}};TE=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],TE);let zE=class extends zl{translationService;userInfoInputService;volunteerRegistrationSlotInputService;constructor(e,t,n){super(e),this.translationService=e,this.userInfoInputService=t,this.volunteerRegistrationSlotInputService=n}slotsFields(e,t,n){switch(e){case gt.Display:case gt.DisplayDays:case gt.Calendar:case gt.Custom:return{slots:l.YO().of(this.volunteerRegistrationSlotInputService.volunteersRegistrationsSlotInputSchema(t,n)).min(1,this.t("vous_devez_ajou_68961"))};case gt.Hide:return{};default:return Za()}}volunteersRegistrationsSlotsUpdateInputDefault(e){return Zo(e)?e.map(e=>({startDate:e.startDate,startTime:e.startTime,endDate:e.endDate,endTime:e.endTime})):[]}userInfoSlotsSchema(e,t,n){return l.Ik().shape({userInfo:l.Ik().shape({slots:l.YO().of(l.Ik().shape({formId:l.ai().required(),...this.slotsFields(e,t,n)}))})})}volunteersRegistrationsWishedPositionsInputDefault(){return{positionsCategoriesIds:[],positionsIds:[],positionsSlotsIds:[]}}volunteersRegistrationsWishedPositionsUpdateInputDefault(e){return e?{positionsCategoriesIds:e?.positionsCategoriesIds,positionsIds:e?.positionsIds,positionsSlotsIds:e?.positionsSlotsIds}:this.volunteersRegistrationsWishedPositionsInputDefault()}wishedPositionsFields(e,t){if(e===Ue.Ranked){if(t===ht.Category)return{positionsCategoriesIds:l.YO().of(l.ai().typeError(this.t("s_lectionner_un_26253"))).min(1,this.t("vous_devez_s_le_32044")).test("different",this.t("les_missions_so_04441"),e=>{const t=(0,Da.A)((e||[]).filter(e=>-1!==e));return Zo(t)&&(0,Oo.A)(t).length===t.length})};if(t===ht.Position)return{positionsIds:l.YO().of(l.ai().typeError(this.t("s_lectionner_un_26253"))).min(1,this.t("vous_devez_s_le_89603")).test("different",this.t("les_missions_so_04441"),e=>{const t=(0,Da.A)((e||[]).filter(e=>-1!==e));return Zo(t)&&(0,Oo.A)(t).length===t.length})};throw new Error("Should not happen")}switch(t){case ht.Category:return{positionsCategoriesIds:l.YO().of(l.ai().typeError(this.t("s_lectionner_un_26253"))).min(1,this.t("vous_devez_s_le_32044"))};case ht.Position:return{positionsIds:l.YO().of(l.ai().typeError(this.t("s_lectionner_un_26253"))).min(1,this.t("vous_devez_s_le_89603"))};case ht.Slot:return{positionsSlotsIds:l.YO().of(l.ai()).min(1,this.t("vous_devez_s_le_89603"))};case ht.None:return{};default:return Za()}}volunteerRegistrationWishedPositionsSchema(e,t){return l.Ik().shape({volunteerRegistration:l.Ik().shape({...this.wishedPositionsFields(e,t)})})}userInfoWishedPositionsSchema(e,t){return l.Ik().shape({userInfo:l.Ik().shape({missions:l.YO().of(l.Ik().shape({formId:l.ai().required(),...this.wishedPositionsFields(e,t)}))})})}volunteersRegistrationsWishedAccreditationsInputDefault(){return{accreditationsSlotsIds:[]}}volunteersRegistrationsWishedAccreditationsUpdateInputDefault(e){return e?{accreditationsSlotsIds:e.accreditationsSlotsIds}:this.volunteersRegistrationsWishedAccreditationsInputDefault()}accreditationsFields(e,t){if(t)return{};switch(e){case ct.Accreditation:return{accreditationsSlotsIds:l.YO().of(l.ai().typeError(this.t("s_lectionner_un_96571"))).min(1,this.t("vous_devez_s_le_72138"))};case ct.None:return{};default:return Za()}}volunteerRegistrationAccreditationsSchema(e){return l.Ik().shape({volunteerRegistration:l.Ik().shape({...this.accreditationsFields(e,null)})})}userInfoAccreditationsSchema(e){return l.Ik().shape({userInfo:l.Ik().shape({accreditations:l.YO().of(l.Ik().shape({formId:l.ai().required(),...this.accreditationsFields(e,null)}))})})}updateVolunteerRegistrationSchema(e,t,n,i,o,s,r){let a={userInfo:this.userInfoInputService.userInfoInputSchema(e,t)};return a={...a,...this.slotsFields(n,s,r),...this.wishedPositionsFields(i,o)},l.Ik().shape({email:l.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856")),volunteerRegistration:l.Ik().shape({...a})})}adminCreateSchema(){return l.Ik().shape({email:l.Yj().email(this.t("l_e_mail_n_est_57882")).required(this.t("l_e_mail_n_est_57882")),sendVolunteerRegistrationEmail:l.zM().required(),firstName:l.Yj(),lastName:l.Yj()})}adminAddSchema(){return l.Ik().shape({usersInfosIds:l.YO().of(l.ai()).min(1,this.t("vous_devez_s_le_83608")),sendVolunteerRegistrationEmail:l.zM().required()})}};zE=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn,EE,TE])],zE);let $E=class extends zl{fieldInputService;userInfoInputService;volunteerRegistrationInputService;volunteerRegistrationSlotInputService;constructor(e,t,n,i,o){super(e),this.fieldInputService=t,this.userInfoInputService=n,this.volunteerRegistrationInputService=i,this.volunteerRegistrationSlotInputService=o}formRegisterInputDefault(e,t,n,i){return{autoAccredit:!1,forOther:i.forOther,positionsSlotsIds:i.team?.positionsSlotsIds??[],positionsIds:i.team?.positionsIds??[],positionsCategoriesIds:i.team?.positionsCategoriesIds??[],accreditationsSlotsIds:(i.delegationAccreditations??[]).filter(e=>e.isDefault).map(e=>e.accreditationSlotId),userInfo:this.userInfoInputService.userInfoUpdateInputDefault(t,n,{countryCode:i.countryCode}),sendNotificationEmail:i.sendNotificationEmail,slots:i.slotDisplay===gt.Display?[this.volunteerRegistrationSlotInputService.volunteersRegistrationsSlotInputDefault(i.eventStartDate)]:i.team?.slots??[],source:e}}formRegisterInformationsSchema(e){return l.Ik().shape({formRegister:l.Ik().shape({userInfo:this.userInfoInputService.formUserInfoInputSchema(e)})})}formRegisterSlotsSchema(e,t,n){return l.Ik().shape({formRegister:l.Ik().shape({...this.volunteerRegistrationInputService.slotsFields(e,t,n)})})}formRegisterPositionsSchema(e,t){return l.Ik().shape({formRegister:l.Ik().shape({...this.volunteerRegistrationInputService.wishedPositionsFields(e,t)})})}formRegisterAccreditationsSchema(e,t,n,i){const o=function(e){return Object.values(e.reduce((e,t)=>{if(e[t.customField.slug]){const n=e[t.customField.slug];return{...e,[t.customField.slug]:{accreditationsSlotsIds:n.accreditationsSlotsIds.concat(t.accreditationsSlotsIds),customField:t.customField,isMandatory:n.isMandatory||t.isMandatory}}}return{...e,[t.customField.slug]:{accreditationsSlotsIds:t.accreditationsSlotsIds,customField:t.customField,isMandatory:t.isMandatory}}},{}))}(n);return l.Ik().shape({formRegister:l.Ik().shape({...this.volunteerRegistrationInputService.accreditationsFields(e,i),userInfo:l.Ik().shape({fields:l.Ik().shape(Object.fromEntries(o.map(e=>{const n=e.isMandatory&&Zo((0,Zu.A)(e.accreditationsSlotsIds,t));return[e.customField.slug,this.fieldInputService.fieldSchema(e.customField,n)]})))})})})}formRegisterSchema(e,t,n,i,o,s,r,a){return l.Ik().shape({email:l.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856")),formRegister:l.Ik().shape({userInfo:this.userInfoInputService.formUserInfoInputSchema(e),...this.volunteerRegistrationInputService.slotsFields(t,n,i),...this.volunteerRegistrationInputService.wishedPositionsFields(o,s),...this.volunteerRegistrationInputService.accreditationsFields(r,a)})})}};$E=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn,yj,EE,zE,TE])],$E);const OE=e=>{const t=Nn(Hc);return(0,i.jsx)(Sr.Yr,{name:e.name,children:n=>{e.change(`${e.prefix}street`,n.name);const i=n.geometry?.location?.lat(),o=n.geometry?.location?.lng(),s=n.address_components?.find(({types:e})=>e.includes("locality")),r=n.address_components?.find(({types:e})=>e.includes("postal_code")),a=n.address_components?.find(({types:e})=>e.includes("country"))?.short_name;"number"==typeof i&&"number"==typeof o&&e.changeLatLng&&(e.change(`${e.prefix}latitude`,i),e.change(`${e.prefix}longitude`,o)),s&&e.changeCity&&e.change(`${e.prefix}city`,s.long_name),r&&e.changePostalCode&&e.change(`${e.prefix}postalCode`,r.long_name),t.countryCodeExists(a)&&e.changeCountry&&e.change(`${e.prefix}country`,a)}})},RE=e=>{const t=F.useMemo(()=>e.elements.flatMap(e=>e.elementType===Ve.Field?[e.customField]:e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]),[e.elements]);return(0,i.jsx)(fr,{children:e.elements.map((n,o)=>{switch(n.elementType){case Ve.Field:{const s=n.customField,r=jj(s,e.values,t);return(0,i.jsxs)(F.Fragment,{children:[s.fieldProperty===Me.Street&&(0,i.jsx)(OE,{change:e.change,changeCity:!0,changeCountry:!0,changeLatLng:!0,changePostalCode:!0,name:"place",prefix:e.prefix}),r&&0!==o&&(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(zj,{change:e.change,countryCode:e.countryCode,display:r,field:s,isMandatory:!0===n.isMandatory,organizationId:e.organizationId,prefix:e.prefix},o)]},o)}case Ve.Section:return jj(n,e.values,t)?(0,i.jsx)(F.Fragment,{children:"function"==typeof e.renderSection?e.renderSection(n.section,o):(0,i.jsxs)(i.Fragment,{children:[e.featureFlags?.isV4?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(Pa,{height:"5"})]}):0!==o&&(0,i.jsx)(Pa,{height:"8"}),(0,i.jsx)(fr,{font:"gray800 textMd semiBold",children:"function"==typeof e.renderText?e.renderText(n.section):n.section})]})},o):null;case Ve.Text:return jj(n,e.values,t)?(0,i.jsx)(F.Fragment,{children:(0,i.jsxs)(i.Fragment,{children:[0!==o&&(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(ng,{text:"function"==typeof e.renderText?e.renderText(n.text):n.text})]})},o):null;default:return Za(n.elementType)}})})},PE=e=>{const t=Ln();return(0,i.jsxs)(Bc,{buttons:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(pl,{onClick:e.onClose,children:t("fermer_62479")})}),size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ea,{justify:"center",width:1,children:(0,i.jsx)(mj,{color:"primary",icon:"circle-info"})}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{font:"gray900 textLg medium",textAlign:"center",width:1,children:t("informations_su_86120",e.name)}),(0,i.jsx)(Pa,{height:"7"}),h(e.description)&&(0,i.jsxs)(Ea,{css:{overflowY:"auto"},direction:"column",gap:"2",children:[(0,i.jsx)(fr,{font:"gray900 textMd semiBold",children:t("description_58935")}),(0,i.jsx)(ng,{text:e.description})]}),(0,i.jsx)(Pa,{height:"4"})]})},DE=e=>{const{translate:t}=il(),n=Nn($c);return(0,i.jsx)(i.Fragment,{children:Zo(e.slots)?e.slots.map(t=>(0,i.jsx)(nc,{state:e.accreditationsSlotsIds.includes(t.id)?"checked":"unchecked",onClick:n=>{e.change(`${e.prefix}accreditationsSlotsIds`,Jo(e.accreditationsSlotsIds,t.id,"checked"===n))},children:(0,i.jsx)(fr,{css:{textTransform:"capitalize"},children:ph(n,t,e.accreditation.name,{date:{localeFormat:Ho.DateOnly.WeekdayLongMonthLong}})})},t.id)):(0,i.jsx)(rk,{imageSrc:sd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},FE=e=>{const{translate:t}=il(),n=Nn($c),o=(0,F.useMemo)(()=>e.slots.map(e=>e.id),[e.slots]);return(0,i.jsx)(i.Fragment,{children:Zo(e.slots)?e.slots.map(t=>(0,i.jsx)(sc,{state:e.accreditationsSlotsIds.includes(t.id)?"checked":"unchecked",onClick:n=>{const i=[...e.accreditationsSlotsIds.filter(e=>!o.includes(e)),..."checked"===n?[t.id]:[]];e.change(`${e.prefix}accreditationsSlotsIds`,i)},children:(0,i.jsx)(fr,{css:{textTransform:"capitalize"},children:ph(n,t,e.accreditation.name,{date:{localeFormat:Ho.DateOnly.WeekdayLongMonthLong}})})},t.id)):(0,i.jsx)(rk,{imageSrc:sd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},ME=e=>{const{params:{organizationId:t},translate:n}=il(),[o,s]=(0,F.useState)(!1),r=(0,F.useMemo)(()=>(0,Zd.A)(e.accreditation.slots.filter(t=>fh(t,e.slots,e.options,e.delegationAccreditations)),e=>(0,Da.A)([e.date?.toMillis(),e.name.toLowerCase()])),[e.accreditation.slots,e.delegationAccreditations,e.slots,e.options]),a=(0,F.useMemo)(()=>h(e.accreditation.description)&&e.options.showAccreditationDescription,[e.accreditation,e.options]),l=(0,F.useMemo)(()=>{const t=e.accreditation.hasSlots?r.map(e=>e.id):[e.accreditation.hiddenSlotId];return e.displayFormCustomFields&&Zo(e.accreditation.formCustomFields)&&Zo((0,Zu.A)(t,e.accreditationsSlotsIds))},[e.accreditation,e.accreditationsSlotsIds,e.displayFormCustomFields,r]),d=e.accreditationsSlotsIds.includes(e.accreditation.hiddenSlotId)?"checked":"unchecked";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Jj,{accreditation:e.accreditation,displayFormCustomFields:l,displayNumberOfSlots:!1,displaySlots:e.accreditation.hasSlots,numberOfSlots:0,renderActions:()=>a&&(0,i.jsx)(pl,{color:"white",onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),s(!0)},children:n("voir_la_descrip_62304")}),renderCheckbox:()=>!e.accreditation.hasSlots&&(0,i.jsx)(tc,{shouldPreventDefault:!1,state:d,onClick:Bl.A}),onClick:()=>{e.accreditation.hasSlots||e.change(`${e.prefix}accreditationsSlotsIds`,Jo(e.accreditationsSlotsIds,e.accreditation.hiddenSlotId,"unchecked"===d))},children:(0,i.jsxs)(Ea,{css:{background:"white",padding:"$4"},direction:"column",gap:"3",children:[e.accreditation.hasSlots?e.accreditation.accreditationDisplay===ne.Calendar?(0,i.jsx)(Gk,{accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,prefix:e.prefix,slots:r}):(0,i.jsx)(Ea,{css:{background:"white",bd:!0,padding:"$4"},direction:"column",gap:"3",width:1,children:e.accreditation.accreditationDisplay===ne.Radio?(0,i.jsx)(FE,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,prefix:e.prefix,slots:r}):(0,i.jsx)(DE,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,prefix:e.prefix,slots:r})}):null,l&&(0,i.jsx)(Ea,{css:{background:"white",bd:!0,padding:"$4"},direction:"column",gap:"3",width:1,children:e.accreditation.formCustomFields.map(({customField:n,isMandatory:o})=>(0,i.jsx)(zj,{change:e.change,display:!0,field:n,isMandatory:o,organizationId:t,prefix:`${e.prefix}userInfo.fields.`},n.id))})]})}),o&&(0,i.jsx)(PE,{description:e.accreditation.description,name:e.accreditation.name,onClose:()=>{s(!1)}})]})},NE=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>Vj(e.category.accreditations.filter(t=>Mj(t,e.slots,e.userInfoFields,e.options,e.delegationAccreditations))),[e.category,e.delegationAccreditations,e.slots,e.userInfoFields,e.options]);return(0,i.jsx)(Kj,{category:e.category,children:Zo(n)?n.map(t=>(0,i.jsx)(ME,{accreditation:t,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,delegationAccreditations:e.delegationAccreditations,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,slots:e.slots},t.id)):(0,i.jsx)(rk,{imageSrc:sd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},LE=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>(0,Zd.A)(e.categories,e=>e.name.toLowerCase()),[e.categories]);return(0,i.jsx)(Yj,{css:{background:"transparent",padding:"0"},children:Zo(n)?(0,i.jsxs)(i.Fragment,{children:[n.map(t=>(0,i.jsx)(NE,{accreditationsSlotsIds:e.accreditationsSlotsIds,category:t,change:e.change,delegationAccreditations:e.delegationAccreditations,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields},t.id)),e.showAutoAccredit&&(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray900 textSm medium",children:t("attribution_des_59896")}),(0,i.jsx)(zm,{name:`${e.prefix}autoAccredit`,children:t("attribuer_les_a_75431")})]})]}):(0,i.jsx)(rk,{imageSrc:sd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},BE=e=>{const t=(0,F.useMemo)(()=>e.event.accreditationsCategories.filter(t=>{return n=t,i=e.slots,o=e.userInfosFields,s=e.options,r=e.delegationAccreditations,s.accreditationDisplay!==ct.None&&!s.hiddenAccreditationsCategoriesIds.includes(n.id)&&(0===s.displayedAccreditationsCategoriesIds.length||s.displayedAccreditationsCategoriesIds.includes(n.id))&&n.accreditations.some(e=>Mj(e,i,o,s,r))||r.some(e=>e.accreditationCategoryId===n.id&&n.accreditations.some(e=>Mj(e,i,o,s,r)));var n,i,o,s,r}),[e.event.accreditationsCategories,e.slots,e.userInfosFields,e.options]);return Zo(e.delegationAccreditations)||e.options.accreditationDisplay===ct.Accreditation?(0,i.jsx)(LE,{accreditationsSlotsIds:e.accreditationsSlotsIds,categories:t,change:e.change,delegationAccreditations:e.delegationAccreditations,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,showAutoAccredit:e.showAutoAccredit,slots:e.slots,userInfoFields:e.userInfosFields}):null},VE=e=>{const[t,n]=(0,F.useState)(!1),o=h(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nc,{css:{alignItems:"center"},state:e.positionsCategoriesIds.includes(e.category.id)?"checked":"unchecked",onClick:t=>{e.change(`${e.prefix}positionsCategoriesIds`,Jo(e.positionsCategoriesIds,e.category.id,"checked"===t))},children:(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{children:e.category.name}),o&&(0,i.jsx)(fr,{onClick:e=>{Il(e),n(!0)},children:(0,i.jsx)(Va,{icon:"circle-info"})})]})}),t&&(0,i.jsx)(PE,{description:e.category.description,name:e.category.name,onClose:()=>{n(!1)}})]})},UE=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>(0,Zd.A)(e.categories,e=>e.name),[e.categories]);return(0,i.jsx)(i.Fragment,{children:Zo(n)?n.map((t,n)=>(0,i.jsxs)(F.Fragment,{children:[0!==n&&(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(VE,{category:t,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix})]},t.id)):(0,i.jsx)(rk,{imageSrc:sd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},WE=e=>{const[t,n]=(0,F.useState)(!1),o=h(e.position.description)&&e.options.showPositionDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nc,{css:{alignItems:"center"},state:e.positionsIds.includes(e.position.id)?"checked":"unchecked",onClick:t=>{e.change(`${e.prefix}positionsIds`,Jo(e.positionsIds,e.position.id,"checked"===t))},children:(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{children:e.position.name}),o&&(0,i.jsx)(fr,{onClick:e=>{Il(e),n(!0)},children:(0,i.jsx)(Va,{icon:"circle-info"})})]})}),t&&(0,i.jsx)(PE,{description:e.position.description,name:e.position.name,onClose:()=>{n(!1)}})]})},GE=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>(0,Zd.A)(e.category.positions.filter(t=>ch(t,e.userInfoFields,e.slots,e.options)),e=>e.name),[e.category,e.userInfoFields,e.slots,e.options]),[o,s]=(0,F.useState)(!1),r=h(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{color:"gray900",fontWeight:"semiBold",children:e.category.name}),r&&(0,i.jsx)(fr,{color:"gray700",onClick:()=>{s(!0)},children:(0,i.jsx)(Va,{icon:"circle-info"})})]}),(0,i.jsx)(Pa,{height:"2"}),Zo(n)?n.map((t,n)=>(0,i.jsxs)(F.Fragment,{children:[0!==n&&(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(WE,{change:e.change,options:e.options,position:t,positionsIds:e.positionsIds,prefix:e.prefix})]},t.id)):(0,i.jsx)(rk,{imageSrc:sd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),o&&(0,i.jsx)(PE,{description:e.category.description,name:e.category.name,onClose:()=>{s(!1)}})]})},HE=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>(0,Zd.A)(e.categories,e=>e.name),[e.categories]);return(0,i.jsx)(i.Fragment,{children:Zo(n)?n.map((t,n)=>(0,i.jsxs)(F.Fragment,{children:[0!==n&&(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(GE,{category:t,change:e.change,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields})]},t.id)):(0,i.jsx)(rk,{imageSrc:sd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},qE=e=>{const t=Ln(),n=(0,F.useMemo)(()=>(0,Zd.A)(e.categories,e=>e.name).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[e.categories]);return(0,i.jsxs)(i.Fragment,{children:[Zo(n)?(0,i.jsxs)(gu,{label:t("souhait_n_1_47211",e.index+1),shouldParseAsInt:!0,value:e.positionsCategoriesIds?.[e.index]??-1,onChange:t=>{e.change(`${e.prefix}positionsCategoriesIds[${e.index}]`,t)},children:[(0,i.jsx)("option",{value:-1,children:t("choisir_une_mis_90627")}),n]}):(0,i.jsx)(rk,{imageSrc:sd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),e.index!==e.options.positionLimit-1&&(0,i.jsx)(Pa,{height:"4"})]})},YE=e=>{const t=Ln(),n=(0,F.useMemo)(()=>e.categories.flatMap(t=>(0,Zd.A)(t.positions.filter(t=>ch(t,e.userInfoFields,e.slots,e.options)),e=>e.name).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))),[e.categories]);return(0,i.jsxs)(i.Fragment,{children:[Zo(n)?(0,i.jsxs)(gu,{label:t("souhait_n_1_47211",e.index+1),shouldParseAsInt:!0,value:e.positionsIds?.[e.index]??-1,onChange:t=>{e.change(`${e.prefix}positionsIds[${e.index}]`,t)},children:[(0,i.jsx)("option",{value:-1,children:t("choisir_une_mis_90627")}),n]}):(0,i.jsx)(rk,{imageSrc:sd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),e.index!==e.options.positionLimit-1&&(0,i.jsx)(Pa,{height:"4"})]})},KE=e=>{const{translate:t}=il();return(0,i.jsx)(i.Fragment,{children:Zo(e.categories)?(0,vc.A)(0,e.options.positionLimit).map(t=>e.options.positionDisplay===ht.Category?(0,i.jsx)(qE,{categories:e.categories,change:e.change,index:t,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix},t):(0,i.jsx)(YE,{categories:e.categories,change:e.change,index:t,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields},t)):(0,i.jsx)(rk,{imageSrc:sd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})};function ZE(e){const t=Nn(Ku),n=(0,F.useMemo)(()=>t.toDisplayString(e.range,{formats:{displayWeekday:!0}}),[e]),i=h(e.name);return{isRenamed:i,finalName:i?e.name:n,rangeString:n}}const XE=e=>{const{translate:t}=il(),{rangeString:n,finalName:o,isRenamed:s}=ZE(e.slot),r=(0,F.useMemo)(()=>{if(e.options.willAutoAssign){const t=e.allSlots.filter(t=>e.positionsSlotsIds.includes(t.id));return oh(e.slot,t)}return!1},[e.options.willAutoAssign,e.allSlots,e.positionsSlotsIds]);return(0,i.jsxs)(F.Fragment,{children:[0!==e.index&&(0,i.jsx)(Pa,{height:"3"}),r?(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(nc,{disabled:!0,shouldPreventDefault:!1,state:e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked",subtext:s?n:void 0,onClick:Bl.A,children:o})})}),(0,i.jsx)(am,{placement:"top-start",children:t("ce_cr_neau_en_c_55775")})]}):(0,i.jsx)(nc,{state:e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked",subtext:s?n:void 0,onClick:t=>{e.change(`${e.prefix}positionsSlotsIds`,Jo(e.positionsSlotsIds,e.slot.id,"checked"===t))},children:o})]},e.slot.id)},JE=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>(0,Zd.A)(e.position.slots.filter(t=>rh(t,e.slots,e.options)),[e=>e.range.start.toMillis(),e=>e.nameOrRange]),[e.position,e.slots,e.options]),[o,s]=(0,F.useState)(!1),r=h(e.position.description)&&e.options.showPositionDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{color:"gray900",fontWeight:"semiBold",children:e.position.name}),r&&(0,i.jsx)(fr,{color:"gray700",onClick:()=>{s(!0)},children:(0,i.jsx)(Va,{icon:"circle-info"})})]}),(0,i.jsx)(Pa,{height:"2"}),Zo(n)?n.map((t,n)=>(0,i.jsx)(XE,{allSlots:e.allSlots,change:e.change,index:n,options:e.options,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slot:t},t.id)):(0,i.jsx)(rk,{imageSrc:sd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),o&&(0,i.jsx)(PE,{description:e.position.description,name:e.position.name,onClose:()=>{s(!1)}})]})},QE=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>(0,Zd.A)(e.category.positions.filter(t=>ch(t,e.userInfoFields,e.slots,e.options)),e=>e.name),[e.category,e.userInfoFields,e.slots,e.options]),[o,s]=(0,F.useState)(!1),r=h(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{color:"gray500",css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"semiBold",children:e.category.name}),r&&(0,i.jsx)(fr,{color:"gray700",onClick:()=>{s(!0)},children:(0,i.jsx)(Va,{icon:"circle-info"})})]}),Zo(n)?n.map(t=>(0,i.jsx)(JE,{allSlots:e.allSlots,change:e.change,options:e.options,position:t,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slots:e.slots},t.id)):(0,i.jsx)(rk,{imageSrc:sd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),o&&(0,i.jsx)(PE,{description:e.category.description,name:e.category.name,onClose:()=>{s(!1)}})]})},eT=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>(0,Zd.A)(e.categories,e=>e.name),[e.categories]),o=(0,F.useMemo)(()=>e.categories.flatMap(e=>e.positions.flatMap(e=>e.slots)),[e.categories]);return(0,i.jsx)(i.Fragment,{children:Zo(n)?n.map((t,n)=>(0,i.jsxs)(F.Fragment,{children:[0!==n&&(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(QE,{allSlots:o,category:t,change:e.change,options:e.options,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields},t.id)]},t.id)):(0,i.jsx)(rk,{imageSrc:sd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},tT=e=>{const t=(0,F.useMemo)(()=>(0,Zd.A)(e.event.positionsCategories.filter(t=>{return n=t,i=e.slots,o=e.userInfoFields,!(s=e.options).hiddenPositionsCategoriesIds.includes(n.id)&&(0===s.displayedPositionsCategoriesIds.length||s.displayedPositionsCategoriesIds.includes(n.id))&&n.positions.some(e=>ch(e,o,i,s));var n,i,o,s}),e=>(0,Xu.A)(e.positions.flatMap(e=>e.slots.flatMap(e=>e.range.start.toMillis())))),[e.event.positionsCategories,e.slots,e.userInfoFields,e.options]);if(e.options.positionRanking===Ue.Ranked)return(0,i.jsx)(KE,{categories:t,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields});switch(e.options.positionDisplay){case ht.Category:return(0,i.jsx)(UE,{categories:t,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix});case ht.Position:return(0,i.jsx)(HE,{categories:t,change:e.change,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields});case ht.Slot:return(0,i.jsx)(eT,{categories:t,change:e.change,options:e.options,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields});case ht.None:return null;default:return Za(e.options.positionDisplay)}},nT=e=>{const t=(0,F.useMemo)(()=>Th(e.startAt,e.endAt,e.ranges,e.daysDisplay),[e.startAt,e.endAt,e.ranges,e.daysDisplay]),n=(0,F.useMemo)(()=>(0,Lu.A)(t,e=>e.toMillis()),[t]),o=(0,F.useMemo)(()=>(0,Bu.A)(t,e=>e.toMillis()),[t]),s=(0,F.useMemo)(()=>Math.ceil(o.endOf("month").diff(n.startOf("month"),"months").months),[n,o]),r=(0,F.useCallback)((t,n)=>{const i=e.currentSlots.filter(e=>!(e.startDate.year===t.year&&e.startDate.month===t.month)).concat(n.map(e=>Wo(Fo.IX.fromDateTimes(e,e.plus({day:1})))));e.change(`${e.prefix}slots`,i)},[e.currentSlots,e.prefix,e.change]);return(0,i.jsx)(Ea,{gap:"6",wrap:"wrap",children:(0,vc.A)(0,s).map(t=>{const a=n.plus({month:t}).startOf("month"),l=0===t?n:a,d=t===s-1?o:a.endOf("month"),c=e.currentSlots.flatMap(e=>e.startDate.year===a.year&&e.startDate.month===a.month?[e.startDate.startOf("day")]:[]);return(0,i.jsx)(Uk,{firstDayOfMonth:a,max:d,min:l,values:c,onChange:e=>{r(a,e)}},t)})})},iT=e=>{const{intervals:t,minDate:n,maxDate:o,numberOfMonths:s}=(0,F.useMemo)(()=>{const t=e.intervalsGrouped.flatMap(([e,t])=>t.map(({interval:e})=>e)),n=(0,Lu.A)(t,e=>e.start.toMillis()).start.startOf("day"),i=(0,Bu.A)(t,e=>e.end.toMillis()).end.endOf("day"),o=Math.ceil(i.endOf("month").diff(n.startOf("month"),"months").months);return{intervals:t,minDate:n,maxDate:i,numberOfMonths:o}},[e.intervalsGrouped]),r=t.flatMap(t=>e.isSelected(t)?[t.start.startOf("day")]:[]);return(0,i.jsx)(Ea,{gap:"6",wrap:"wrap",children:(0,vc.A)(0,s).map(a=>{const l=n.plus({month:a}).startOf("month"),d=0===a?n:l,c=a===s-1?o:l.endOf("month"),u=r.filter(e=>e.month===l.month&&e.year===l.year);return(0,i.jsx)(Uk,{firstDayOfMonth:l,max:c,min:d,values:u,onChange:n=>{((n,i)=>{e.setSelectedBatch(t.flatMap(e=>{if(e.start.startOf("month").equals(n)){const t=i.some(t=>t.equals(e.start.startOf("day")));return[{interval:e,isSelected:t}]}return[]}))})(l,n)}},a)})})},oT=e=>{const[t,n]=(0,F.useState)(e.intervals.some(({interval:t})=>e.isSelected(t))?"checked":"unchecked"),o=(0,F.useCallback)(()=>{const i="checked"===t?"unchecked":"checked";n(i),"unchecked"===i&&e.intervals.forEach(({interval:t})=>{e.setSelected(t,!1)})},[e.intervals,t,n,e.setSelected]);return(0,i.jsxs)(Ea,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs"},direction:"column",children:[(0,i.jsxs)(Ea,{align:"center",css:{cursor:"pointer",padding:"$4 $5"},gap:"2",onClick:o,children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textXs",children:(0,i.jsx)(Va,{icon:"checked"===t?"chevron-down":"chevron-right"})}),(0,i.jsx)(fr,{font:"gray800 textSm medium",children:e.day})]}),"checked"===t&&(0,i.jsx)(Ea,{css:{borderTop:"1px solid $gray200",padding:"$4 $5"},direction:"column",gap:"3",children:e.intervals.map(({name:t,interval:n},o)=>(0,i.jsx)(nc,{state:e.isSelected(n)?"checked":"unchecked",onClick:t=>{e.setSelected(n,"checked"===t)},children:$h(t,n)},o))})]})},sT=e=>(0,i.jsx)(Ea,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $5"},direction:"column",gap:"3",children:e.intervalsGrouped.map(([t,[{name:n,interval:o}]],s)=>{const r=`${n} ${o.toFormat("HH:mm")}`.trim(),a=`${t} ${e.hideNameDates?"":`(${r})`}`.trim();return(0,i.jsx)(nc,{state:e.isSelected(o)?"checked":"unchecked",onClick:t=>{e.setSelected(o,"checked"===t)},children:a},s)})}),rT=({customSlotPeriod:e,daysDisplay:t,event:n,isSelected:o,setSelected:s,setSelectedBatch:r})=>{const a=Nn($c),l=(0,F.useMemo)(()=>zh(e.startDate??n.startAt,e.endDate??n.endAt,e.customSlots,n.ranges,t),[e,n,t]),d=(0,F.useMemo)(()=>(0,Zd.A)(Object.entries((0,Kd.A)(l,({interval:e})=>a.toLocaleString(e.start.startOf("day"),Ho.DateOnly.WeekdayLongMonthLong))),([e,[{interval:t}]])=>t.start.startOf("day").toMillis()),[l]);return(0,i.jsxs)(Ea,{direction:"column",gap:"2",width:1,children:[h(e.name)&&(0,i.jsx)(fr,{font:"gray900 textSm semiBold",children:e.name}),1===e.customSlots.length?0===d.length?null:e.displayAsCalendar?(0,i.jsx)(iT,{intervalsGrouped:d,isSelected:o,setSelectedBatch:r}):(0,i.jsx)(sT,{hideNameDates:e.hideNameDates,intervalsGrouped:d,isSelected:o,setSelected:s}):d.map(([e,t],n)=>(0,i.jsx)(oT,{day:e,intervals:t,isSelected:o,setSelected:s},n))]})},aT=e=>{const t=(0,F.useMemo)(()=>e.customSlotsPeriods.flatMap(t=>zh(t.startDate??e.event.startAt,t.endDate??e.event.endAt,t.customSlots,e.event.ranges,e.daysDisplay)).map(({interval:e})=>e),[e.customSlotsPeriods,e.event,e.daysDisplay]),[n,o]=(0,F.useState)(Object.fromEntries(t.map(t=>{const n=e.currentSlots.some(e=>Vo(e).equals(t));return[t.toISO(),n]}))),s=(0,F.useCallback)(e=>n[e.toISO()],[n]),r=(0,F.useCallback)((t,n)=>{const i=t.toISO();o(e=>({...e,[i]:n})),e.change(`${e.prefix}slots`,Oh(e.currentSlots,t,n))},[e.currentSlots,o]),a=(0,F.useCallback)(t=>{const n=t.reduce((e,{interval:t,isSelected:n})=>{const i=t.toISO();return o(e=>({...e,[i]:n})),Oh(e,t,n)},e.currentSlots);e.change(`${e.prefix}slots`,n)},[e.currentSlots,o]);return(0,i.jsx)(i.Fragment,{children:e.customSlotsPeriods.map((t,n)=>(0,i.jsxs)(F.Fragment,{children:[0!==n&&(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(rT,{customSlotPeriod:t,daysDisplay:e.daysDisplay,event:e.event,isSelected:s,setSelected:r,setSelectedBatch:a})]},n))})},lT=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>Th(e.startAt,e.endAt,e.ranges,e.daysDisplay),[e.startAt,e.endAt,e.ranges,e.daysDisplay]),o=(0,F.useMemo)(()=>n.filter(t=>(e.blockedSlots??[]).some(e=>Go(e,t))),[e.blockedSlots,n]),s=Nn($c),[r,a]=(0,F.useState)(Object.fromEntries(n.map((t,n)=>{const i=Fo.IX.fromDateTimes(t,t.plus({day:1}));return[`day${n}`,void 0!==e.currentSlots.find(e=>Vo(e).equals(i))]})));return(0,i.jsx)(i.Fragment,{children:n.map((n,l)=>{const d=o.includes(n);return(0,i.jsxs)(F.Fragment,{children:[0!==l&&(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(nc,{disabled:d,state:r[`day${l}`]?"checked":"unchecked",onClick:t=>{a({...r,[`day${l}`]:"checked"===t}),e.change(`${e.prefix}slots`,Oh(e.currentSlots,Fo.IX.fromDateTimes(n,n.plus({day:1})),"checked"===t))},children:d?(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(Ka,{children:s.toLocaleString(n,Ho.DateOnly.WeekdayLongMonthLong)})}),(0,i.jsx)(am,{placement:"right",children:t("vous_avez_d_j_92810")})]}):s.toLocaleString(n,Ho.DateOnly.WeekdayLongMonthLong)})]},l)})})};var dT=n(3088);const cT=e=>{const t=Ln();return(0,i.jsx)(cj,{buttons:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})})}),title:t("disponibilit_n_50484",e.index+1),children:(0,i.jsxs)(Ea,{direction:{"@initial":"column","@desktop":"row"},gap:"4",children:[(0,i.jsx)(km,{label:t("date_de_d_but_43380"),max:e.max,min:e.min,name:`${e.prefix}startDate`}),(0,i.jsx)(dv,{label:t("heure_de_d_but_27566"),name:`${e.prefix}startTime`}),(0,i.jsx)(km,{label:t("date_de_fin_86920"),max:e.max,min:e.min,name:`${e.prefix}endDate`}),(0,i.jsx)(dv,{label:t("heure_de_fin_95071"),name:`${e.prefix}endTime`})]})})},uT=e=>{const t=Ln(),n=Nn(TE),o=(0,F.useMemo)(()=>e.max.endOf("day"),[e.max]);return(0,i.jsx)(dT.ED,{name:`${e.prefix}slots`,children:({fields:s})=>(0,i.jsxs)(i.Fragment,{children:[s.map((t,n)=>(0,i.jsxs)(F.Fragment,{children:[0!==n&&(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(cT,{index:n,max:o,min:e.min,prefix:`${t}.`,remove:()=>{s.remove(n)}})]},n)),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(pl,{color:"invisible",leftIcon:"plus",onClick:()=>{s.push(n.volunteersRegistrationsSlotInputDefault(e.min))},children:t("ajouter_une_dis_96540")})]})})},hT=e=>{switch(e.slotDisplay){case gt.Display:return(0,i.jsx)(uT,{max:e.event.endAt,min:e.event.startAt,prefix:e.prefix});case gt.DisplayDays:return(0,i.jsx)(lT,{blockedSlots:e.blockedSlots,change:e.change,currentSlots:e.currentSlots,daysDisplay:e.daysDisplay,endAt:e.event.endAt,prefix:e.prefix,ranges:e.event.ranges,startAt:e.event.startAt});case gt.Calendar:return(0,i.jsx)(nT,{change:e.change,currentSlots:e.currentSlots,daysDisplay:e.daysDisplay,endAt:e.event.endAt,prefix:e.prefix,ranges:e.event.ranges,startAt:e.event.startAt});case gt.Custom:return(0,i.jsx)(aT,{change:e.change,currentSlots:e.currentSlots,customSlotsPeriods:e.customSlotsPeriods,daysDisplay:e.daysDisplay,event:e.event,prefix:e.prefix});case gt.Hide:return null;default:return Za(e.slotDisplay)}},mT=e=>(0,i.jsxs)(Ea,{css:{bd:!0,padding:"$6",background:"$white"},direction:"column",children:[e.title&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{font:"gray800 textMd semiBold",children:e.title}),(0,i.jsx)(Pa,{height:"5"})]}),e.children]}),gT=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),s=(0,F.useMemo)(()=>o&&e.form.slotDisplay!==gt.Hide,[e.form,o]),r=(0,F.useMemo)(()=>o&&e.form.positionDisplay!==ht.None,[e.form,o]),a=(0,F.useMemo)(()=>o&&(e.form.accreditationDisplay!==ct.None||Zo(e.delegationAccreditations)),[e.delegationAccreditations,e.form,o]);return(0,i.jsxs)(i.Fragment,{children:[e.showEmail&&(0,i.jsxs)(mT,{children:[h(e.form.description)&&(0,i.jsx)(ng,{text:e.form.description}),(0,i.jsx)(Sl,{isEmail:!0,label:t("Email"),name:"email"})]}),(0,i.jsx)(mT,{title:h(e.form.informationTitle)?e.form.informationTitle:t("informations_pe_37892"),children:(0,i.jsx)(RE,{change:e.change,elements:e.form.elements,organizationId:n,prefix:"formRegister.userInfo.fields.",values:e.values.formRegister.userInfo.fields})}),s&&e.event&&(0,i.jsxs)(mT,{title:h(e.form.slotTitle)?e.form.slotTitle:t("disponibilit_s_49923"),children:[h(e.form.slotSubtitle)&&(0,i.jsx)(ng,{text:e.form.slotSubtitle}),(0,i.jsx)(hT,{blockedSlots:e.blockedSlots,change:e.change,currentSlots:e.values.formRegister.slots,customSlotsPeriods:e.form.customSlotsPeriods,daysDisplay:e.form.daysDisplay,event:e.event,prefix:"formRegister.",slotDisplay:e.form.slotDisplay})]}),r&&e.event&&(0,i.jsxs)(mT,{title:h(e.form.positionTitle)?e.form.positionTitle:t("missions_souhai_23225"),children:[h(e.form.positionSubtitle)&&(0,i.jsx)(ng,{text:e.form.positionSubtitle}),(0,i.jsx)(tT,{change:e.change,event:e.event,options:e.form,positionsCategoriesIds:e.values.formRegister.positionsCategoriesIds,positionsIds:e.values.formRegister.positionsIds,positionsSlotsIds:e.values.formRegister.positionsSlotsIds,prefix:"formRegister.",slots:e.values.formRegister.slots,userInfoFields:e.values.formRegister.userInfo.fields})]}),a&&e.event&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(mT,{title:h(e.form.accreditationTitle)?e.form.accreditationTitle:t("accr_ditations_74375"),children:[h(e.form.accreditationSubtitle)&&(0,i.jsx)(ng,{text:e.form.accreditationSubtitle}),(0,i.jsx)(BE,{accreditationsSlotsIds:e.values.formRegister.accreditationsSlotsIds,change:e.change,delegationAccreditations:e.delegationAccreditations??[],displayFormCustomFields:!0,event:e.event,options:e.form,prefix:"formRegister.",showAutoAccredit:e.showAutoAccredit,slots:e.values.formRegister.slots,userInfosFields:e.values.formRegister.userInfo.fields})]})})]})},pT=e=>{const t=Nn($E),n=(0,F.useMemo)(()=>(e.organization.form.elements??[]).flatMap(e=>e.elementType===Ve.Field?[e.customField]:[]),[e.organization]);return(0,F.useEffect)(()=>{const i=t.formRegisterInputDefault(We.Admin,null,n,{countryCode:e.organization?.event?.country??e.organization?.country,delegationAccreditations:e.organization.delegation?.accreditationsSlots??[],eventStartDate:e.organization?.event?.startAt,forOther:!0,sendNotificationEmail:!1,slotDisplay:e.organization.form.slotDisplay,team:null});e.setInitialValues({email:e.values.email||"",formRegister:{...i,userInfo:{...i.userInfo,...e.values.formRegister.userInfo}}})},[e.organization]),(0,i.jsx)(jm,{css:{gap:"$6"},children:(0,i.jsx)(gT,{change:e.change,delegationAccreditations:e.organization.delegation?.accreditationsSlots??[],event:e.organization.event,form:e.organization.form,showAutoAccredit:!0,showEmail:!1,values:e.values})})},fT=e=>{const{translate:t,params:{delegationId:n}}=il();return(0,i.jsxs)(Ea,{direction:"column",gap:"6",width:1,children:[(0,i.jsxs)(Ea,{direction:"column",gap:"4",children:[(0,i.jsx)(Sl,{isEmail:!0,label:t("Email"),name:"email"}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(Sl,{label:(0,i.jsx)(nv,{children:t("pr_nom_66988")}),name:"formRegister.userInfo.fields.firstName"}),(0,i.jsx)(Sl,{label:(0,i.jsx)(nv,{children:t("Name")}),name:"formRegister.userInfo.fields.lastName"})]})]}),!n&&(0,i.jsxs)(Ea,{direction:"column",gap:"4",children:[(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{font:"gray800 textMd medium",children:t("param_tres_du_m_69378")}),(0,i.jsx)(fr,{color:"gray500",children:t("s_lectionnez_le_16209")})]}),(0,i.jsx)(Sm,{isSearchVisible:!0,label:(0,i.jsx)(nv,{children:t("population_38615")}),name:"formRegister.userInfo.fields.population",children:e.population.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(dc,{isSearchVisible:!0,label:(0,i.jsx)(nv,{children:t("Delegation")}),values:e.delegationsIds,onChange:e.setDelegationsIds,children:e.delegations.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(dc,{isSearchVisible:!0,label:(0,i.jsx)(nv,{children:t("Form")}),state:Zo(e.delegationsIds)?"disabled":"active",values:e.formsIds,onChange:e.setFormsIds,children:e.forms.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})]})},xT=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,delegationId:r}}=il(),a=Nn($E),l=Nn(za),d=(0,F.useRef)(null),{mutate:c,isLoading:u}=function(e={}){return Un("mutation UserInfoAdminCreate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $email: UserEmail!\n    $userInfo: UsersInfoInput!\n) {\n    userInfoAdminCreate(\n        organizationId: $organizationId\n        eventId: $eventId\n        email: $email\n        userInfo: $userInfo\n    ) {\n        id\n    }\n}\n",e)}(),{mutate:h}=function(e={}){return Un("mutation FormRegister(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $delegationId: DelegationId\n    $formId: FormId!\n    $email: UserEmail!\n    $formRegister: FormRegisterInput!\n) {\n    formRegister(\n        organizationId: $organizationId\n        eventId: $eventId\n        delegationId: $delegationId\n        formId: $formId\n        email: $email\n        formRegister: $formRegister\n    ) {\n        teamCode\n    }\n}\n",e)}(),[m,g]=(0,F.useState)(null),p=(0,F.useMemo)(()=>m?.form.elements.filter(e=>e.elementType===Ve.Field)??[],[m]),[f,x]=(0,F.useState)({email:"",formRegister:a.formRegisterInputDefault(We.Admin,null,[],{countryCode:e.organization?.event?.country??e.organization?.country,delegationAccreditations:[],eventStartDate:e.organization?.event?.startAt,forOther:!0,sendNotificationEmail:!1,slotDisplay:gt.Hide,team:null})}),_=(0,F.useCallback)(e=>l.validateForForm(a.formRegisterSchema(p,m?.form.slotDisplay??gt.Hide,m?.event?.startAt??Fo.c9.now(),m?.event?.endAt??Fo.c9.now(),m?.form.positionRanking??Ue.Unranked,m?.form.positionDisplay??ht.None,m?.form.accreditationDisplay??ct.None,m?.delegation?.id))(e),[p,a,m,l]),I=(0,F.useCallback)(async n=>{m?await h({organizationId:o,eventId:s,delegationId:m.delegation?.id,formId:m.form.id,email:n.email,formRegister:n.formRegister}):await c({organizationId:o,eventId:s,email:n.email,userInfo:n.formRegister.userInfo}),t.push(e.closePath)},[e.closePath,m]),v=e.organization.delegations.nodes,b=e.organization.forms.nodes,[j,C]=(0,F.useState)(!1),[y,k]=(0,F.useState)([]),[A,w]=(0,F.useState)([]),S=(0,F.useCallback)(async e=>{if(w(e),Zo(e)){C(!0);const{organization:t}=await ga({organizationId:o,eventId:s,formId:e[0]},await H());g(t),C(!1)}else g(null)},[s,o]),E=(0,F.useCallback)(async e=>{if(k(e),Zo(e)){const t=v.find(t=>t.id===e[0]);w([t.formId]),C(!0);const{organization:n}=await ga({organizationId:o,delegationId:e[0],eventId:s,formId:t.formId},await H());g(n),C(!1)}else g(null)},[v,o,s]);return Cd(n("cr_ation_d_un_m_98624")),(0,F.useEffect)(()=>{r&&E([r])},[r,E]),(0,i.jsx)(dl,{customErrorRef:d,height:1,hideDefaultErrors:!0,initialValues:f,render:({form:t,handleSubmit:o,values:s})=>(0,i.jsx)(bm,{category:n("cr_ation_d_un_m_98624"),color:"dark",fallbackClosePath:e.closePath,title:n("nouveau_membre_94535"),children:(0,i.jsx)(Im,{ref:d,children:(0,i.jsxs)(Ea,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(sl,{hideSpacer:!0}),(0,i.jsx)(Cm,{hideToggle:!0,initialIsOpen:!0,title:n("informations_su_05921"),children:(0,i.jsx)(fT,{delegations:v,delegationsIds:y,forms:b,formsIds:A,population:e.organization.population,setDelegationsIds:E,setFormsIds:S})}),j&&(0,i.jsx)(jm,{css:{minHeight:"200px"},children:(0,i.jsx)(ul,{})}),!j&&m&&(0,i.jsx)(pT,{change:t.change,organization:m,setInitialValues:x,values:s}),(0,i.jsx)(jm,{children:(0,i.jsx)(pl,{isLoading:u,textAlign:"center",onClick:o,children:n("ajouter_le_memb_57505")})})]})})}),validate:_,width:1,onSubmit:I})},_T=()=>{const{params:{organizationId:e,eventId:t,delegationId:n}}=il(),{data:o,loader:s}=Vn('query CreateUserInfos(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $level: OrganizationEventLevel!\n) {\n    organization(id: $organizationId) {\n        country\n\n        population: customFieldBySlug(slug: "population") {\n            values {\n                id\n                value\n            }\n        }\n\n        forms(level: $level, eventId: $eventId) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        delegations(level: $level, eventId: $eventId) {\n            nodes {\n                id\n                name\n                formId\n            }\n        }\n\n        event: eventMaybe(id: $eventId) {\n            startAt\n            endAt\n            country\n        }\n    }\n}\n',{organizationId:e,eventId:t,level:t?et.Event:et.Organization},[]);return s||(0,i.jsx)(xT,{closePath:n?to.DELEGATION_MEMBERS({organizationId:e,eventId:t,delegationId:n}):t?So.VOLUNTEERS(e,t):fi.COMMUNITY_USERS({organizationId:e}),organization:o.organization})};let IT=class extends zl{constructor(e){super(e)}commentInputDefault(){return{content:""}}commentInputSchema(){return l.Ik().shape({content:l.Yj().required(this.t("le_commentaire_33393"))})}createCommentSchema(){return l.Ik().shape({comment:this.commentInputSchema()})}};IT=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],IT);const vT=e=>{const t=Ln(),{mutate:n}=function(e={}){return Un("mutation CommentDelete(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $commentId: CommentId!\n) {\n    commentDelete(organizationId: $organizationId, eventId: $eventId, commentId: $commentId) {\n        id\n    }\n}\n",e)}();return(0,i.jsx)(kk,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_55928"),text:t("suppression_d_u_90124"),onClose:e.onClose,onDelete:async()=>{await n({organizationId:e.organizationId,eventId:e.eventId,commentId:e.commentId}),e.onSuccess()}})},bT=e=>{const{organizationId:t,eventId:n}=Wn(),o=Nn($c),[s,r]=(0,F.useState)(!1),a=e.comment.event,l=e.comment.writtenBy;return(0,i.jsxs)(Ea,{gap:"3",children:[(0,i.jsx)(Fg,{email:l.email,image:l.userInfo.picture?.url,name:l.userInfo.name,size:40}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"2",children:[(0,i.jsxs)(Ea,{gap:"2",children:[(0,i.jsx)(fr,{color:"gray800",css:{flex:"1"},fontWeight:"medium",children:l.userInfo.nameOrEmail}),(0,i.jsx)(fr,{color:"gray500",children:o.toLocaleString(e.comment.insertedAt.toLocal(),Ho.DateTime)}),e.showEvent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray500",children:"•"}),(0,i.jsx)(fr,{color:"gray500",children:a?.name??"Communauté"})]}),(0,i.jsxs)(ub,{positionsPermissions:db.ADD_COMMENTS,children:[(0,i.jsx)(fr,{color:"gray500",children:"•"}),(0,i.jsx)(fr,{color:"gray500",css:{cursor:"pointer"},onClick:()=>{r(!0)},children:(0,i.jsx)(Va,{icon:"trash-can"})})]})]}),(0,i.jsx)(fr,{color:"gray800",css:{background:"$gray100",borderRadius:"0 $2 $2 $2",boxShadow:"$sm",padding:"$3",whiteSpace:"pre-line"},children:e.comment.content})]}),s&&(0,i.jsx)(vT,{commentId:e.comment.id,eventId:n,organizationId:t,onClose:()=>{r(!1)},onSuccess:e.reload})]})},jT=e=>{const{params:{organizationId:t,eventId:n,userInfoId:o},translate:s}=il(),r=Nn(IT),a=Nn(za),{data:l,loader:d,reload:c}=fa({organizationId:t,userInfoId:o}),{mutate:u,isLoading:h}=pa(),[m,g]=(0,F.useState)(1),p=(0,F.useCallback)(()=>{g(m+1),c()},[m,g,c]);return(0,i.jsx)(dl,{direction:"column",hideDefaultErrors:!0,initialValues:{comment:r.commentInputDefault()},render:({handleSubmit:t})=>(0,i.jsxs)(i.Fragment,{children:[d||(l.organization?.userInfo.comments??[]).map((t,n)=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(bT,{comment:t,reload:p,showEvent:e.showEvent})]},n)),(0,i.jsxs)(ub,{positionsPermissions:db.ADD_COMMENTS,children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(sl,{}),(0,i.jsx)(Tm,{label:s("commentaire_08754"),name:"comment.content"}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(pl,{isLoading:h,onClick:t,children:(0,i.jsx)(fr,{textAlign:"center",width:1,children:s("ajouter_un_nouv_86295")})})]}),(0,i.jsx)(Pa,{height:"8"})]}),validate:a.validateForForm(r.createCommentSchema()),width:1,onSubmit:async e=>{await u({organizationId:t,eventId:n,userInfoId:o,comment:e.comment}),p()}},m)},CT=({canEdit:e,editFormPath:t,editPath:n,formsUsersInfos:o,isEditDisabled:s=!1})=>{const{params:{organizationId:r,eventId:a,userInfoId:l},translate:d}=il(),c=Nn($c),u=(0,F.useMemo)(()=>(0,Zd.A)(o.filter(e=>Zo(e.accreditationsSlots)).map(e=>({...e,accreditationsSlots:(0,Zd.A)(e.accreditationsSlots,e=>[e.accreditationCategory.name.toLowerCase(),Bj(e.accreditation.index),e.accreditation.name.toLowerCase(),e.date?.toMillis()??1,e.name.toLowerCase()])})),e=>e.form.name.toLowerCase()),[o]),h=pc();return(0,i.jsxs)(Ea,{direction:"column",gap:"6",children:[s&&(0,i.jsx)(lk,{message:d("you_are_already_assigned_to_accreditations"),title:d("wished_accreds_can_no_longer_be_changed")}),(0,i.jsx)(kc,{filters:e&&(0,i.jsx)(pl,{color:"white",disabled:s,size:"sm",to:n,children:d("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:d("nom_de_l_accr_d_11908")}),!h&&(0,i.jsx)(Tc,{children:d("cr_neau_11117")}),!h&&(0,i.jsx)(Tc,{children:d("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:Zo(u)?u.flatMap((e,n)=>e.accreditationsSlots.map((o,d)=>(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{children:o.accreditation.name}),!h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{children:ph(c,o,"")}),(0,i.jsx)(xc,{children:(0,i.jsx)(dk,{editDisabled:s,editPath:t,eventId:a,form:e.form,organizationId:r,userInfoId:l})})]})]},`${n}-${d}`))):(0,i.jsx)(Cc,{css:{height:"200px"},children:(0,i.jsx)(xc,{children:(0,i.jsx)(rk,{title:d("aucune_accr_dit_56501")})})})}),setOffset:Bl.A,title:d("accr_ditations_74375"),totalCount:0})]})},yT=e=>{const t=Nn($c),n=F.useMemo(()=>{const t=Vd(e.aui.accreditation.color);return{background:t[50],color:t[700]}},[e.aui]);return(0,i.jsx)(i.Fragment,{children:e.renderAccreditation((0,i.jsxs)(Ea,{css:{...n,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsxs)(Ea,{align:"center",css:{fontSize:"10px"},gap:"1",children:[(0,i.jsx)(fr,{children:ph(t,e.aui.accreditationSlot,"")}),e.aui.isAutoAccredit&&(0,i.jsx)(fr,{fontSize:"textXs",children:(0,i.jsx)(Va,{icon:"bolt-auto"})})]}),(0,i.jsx)(fr,{fontSize:"textXs",fontWeight:"medium",children:e.aui.accreditation.name})]}),e.aui.accreditation.id)})},kT=e=>{const t=xA(),n=F.useMemo(()=>(0,Zd.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(e=>!e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name.toLowerCase(),Bj(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.name.toLowerCase()]),[e.event]),o=F.useMemo(()=>(0,Zd.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(e=>e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name.toLowerCase(),Bj(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.name.toLowerCase()]),[e.event]);return(0,i.jsxs)(bA,{css:e.featureFlags?.isV4?{bd:!0,overflow:"auto"}:{borderTop:"1px solid $gray200"},date:e.selectedDay,display:t?"week":"day",maxDate:e.event.endAt,minDate:e.event.startAt,children:[n.map(t=>(0,i.jsx)(vA,{children:(0,i.jsx)(yT,{aui:t,renderAccreditation:e.renderAccreditation})},t.id)),o.map(t=>(0,i.jsx)(vA,{endAt:t.accreditationSlot.date,startAt:t.accreditationSlot.date,children:(0,i.jsx)(yT,{aui:t,renderAccreditation:e.renderAccreditation})},t.id))]})},AT=e=>{const{translate:t,params:{organizationId:n,eventId:o,userInfoId:s}}=il(),r=Nn($c),{mutate:a}=ps(),{mutate:l}=function(e={}){return Un("mutation AccreditationsSlotsUsersInfosCheckIn(\n    $eventId: EventId!\n    $checkIn: AccreditationSlotCheckInInput!\n) {\n    accreditationsSlotsUsersInfosCheckIn(eventId: $eventId, checkIn: $checkIn)\n}\n",e)}(),d=(0,F.useMemo)(()=>ph(r,e.aui.accreditationSlot,e.aui.accreditation.name),[e.aui]);return(0,i.jsxs)(Cc,{children:[(0,i.jsxs)(xc,{align:"center",gap:"3",children:[(0,i.jsx)(Xj,{color:e.aui.accreditation.color,icon:e.aui.accreditation.icon}),(0,i.jsxs)(Ea,{css:{overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(j_,{css:{overflow:"hidden",width:"100%","& > a":{width:"100%"}},to:Hi.ACCREDITATION({organizationId:n,eventId:o,accreditationId:e.aui.accreditation.id}),children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.aui.accreditation.name,width:1,children:e.aui.accreditation.name})}),(0,i.jsx)(fr,{color:"gray500",css:{ellipsis:!0},title:d,width:1,children:d})]})]}),(0,i.jsxs)(xc,{align:"start",direction:"column",justify:"center",children:[e.aui.state===he.Waiting&&(0,i.jsxs)(Ea,{align:"center",gap:"1",children:[(0,i.jsx)(fr,{color:"warning500",children:(0,i.jsx)(Va,{icon:"hourglass-empty",iconStyle:"solid"})}),(0,i.jsx)(fr,{font:"gray800 textXs medium",children:t("pas_encore_scan_88057")})]}),e.aui.state===he.CheckedIn&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",gap:"1",children:[(0,i.jsx)(fr,{color:"success500",children:(0,i.jsx)(Va,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(fr,{font:"gray800 textXs medium",children:t("scann_e_01567")})]}),(0,i.jsx)(fr,{font:"gray500 textXs regular",children:e.aui.checkInAt?.isValid?r.toLocaleString(e.aui.checkInAt.toLocal(),Ho.DateTime):""})]})]}),(0,i.jsx)(xc,{children:e.aui.isAutoAccredit&&(0,i.jsx)(fr,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(Va,{icon:"check"})})}),(0,i.jsx)(xc,{children:e.aui.isWorkflow&&(0,i.jsx)(fr,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(Va,{icon:"check"})})}),(0,i.jsxs)(xc,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(fr,{children:e.aui.createdBy?.name??"-"}),(0,i.jsx)(fr,{color:"gray500",children:r.toLocaleString(e.aui.insertedAt.toLocal(),Ho.DateTime)})]}),(0,i.jsxs)(im,{justify:"end",width:200,children:[e.aui.state===he.Waiting&&(0,i.jsx)(pl,{color:"white",size:"sm",onClick:async()=>{await l({eventId:e.aui.eventId,checkIn:{strategy:me.CheckIn,accreditationsSlotsUsersInfosIds:[e.aui.id]}}),e.reload()},children:"Scanner"}),(0,i.jsx)(pm,{children:(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:async()=>{await a({eventId:o,massAccredit:{accreditationsSlotsIds:[e.aui.accreditationSlot.id],selecteds:{ids:[s]},strategy:Je.Delete}}),e.reload()},children:t("d_saffecter_du_47122")})})]})]})},wT=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>(0,Zd.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(t=>!e.selectedDay?.isValid||!!t.accreditationSlot.date?.isValid&&t.accreditationSlot.date.startOf("day").toMillis()===e.selectedDay.startOf("day").toMillis()),e=>[e.accreditationCategory.name.toLowerCase(),Bj(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.date?.toMillis()??1,e.accreditationSlot.name.toLowerCase()]),[e.event,e.selectedDay]);return(0,i.jsxs)(mc,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(cc,{children:[(0,i.jsx)(Tc,{children:t("Accreditation")}),(0,i.jsx)(Tc,{children:t("scann_e_le_27812")}),(0,i.jsx)(Tc,{children:t("affect_e_automa_74071")}),(0,i.jsx)(Tc,{children:t("ajout_via_une_69544")}),(0,i.jsx)(Tc,{children:t("ajout_e_par_71330")}),(0,i.jsx)(Tc,{width:200})]}),n.map(t=>(0,i.jsx)(AT,{aui:t,reload:e.reload},t.id))]})},ST=e=>{const{translate:t}=il(),[n,o]=F.useState(k_(e.event.startAt,e.event.endAt)),[s,r]=F.useState(null);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Ea,{as:"section",css:{background:"white",bd:!0,overflow:"hidden",padding:e.featureFlags?.isV4?"$6 $7 $7 $7":void 0},direction:"column",gap:e.featureFlags?.isV4?"6":void 0,justify:"center",children:[(0,i.jsxs)(Ea,{align:"center",as:"header",css:{padding:e.featureFlags?.isV4?void 0:"$5 $6"},gap:"4",children:[(0,i.jsxs)(fr,{as:"hgroup",css:{flex:"1"},children:[(0,i.jsx)(Qa,{textStyle:"heading",children:e.title}),e.subtitle&&(0,i.jsx)(Ka,{textStyle:"subtitle",children:e.subtitle})]}),(0,i.jsxs)(Ea,{as:"nav",gap:"3",children:["calendar"===e.accreditationsDisplay&&(0,i.jsx)(_A,{max:e.event.endAt,min:e.event.startAt,value:n,onChange:o}),"list"===e.accreditationsDisplay&&!e.hideListView&&(0,i.jsx)(fr,{width:160,children:(0,i.jsx)(_u,{rightIcon:"xmark",value:s,onChange:r,onRightIconClick:()=>r(null)})}),!e.hideListView&&e.setAccreditationsDisplay&&(0,i.jsx)(fr,{width:200,children:(0,i.jsxs)(gu,{value:e.accreditationsDisplay,onChange:e.setAccreditationsDisplay,children:[(0,i.jsx)("option",{value:"calendar",children:t("Calendar")}),(0,i.jsx)("option",{value:"list",children:t("List")})]})}),e.actions]})]}),"calendar"===e.accreditationsDisplay?(0,i.jsx)(kT,{event:e.event,featureFlags:e.featureFlags,renderAccreditation:e.renderAccreditation,selectedDay:n}):(0,i.jsx)(wT,{event:e.event,reload:e.reload,selectedDay:s})]})})};function ET(e,t,n={}){const{localEvent:i,updateLocalEvent:o}=Uv(),[s,r]=F.useState("function"==typeof n.deserialize?n.deserialize(i?.[e])||t:i?.[e]??t);return[s,F.useCallback(async t=>{r(t),await o({[e]:"function"==typeof n.serialize?n.serialize(t):t})},[e,r,o])]}const TT=e=>{const{params:{organizationId:t,eventId:n,userInfoId:o},translate:s}=il(),[r,a]=ET("user.accreditations.display","calendar");return(0,i.jsx)(ST,{...e,accreditationsDisplay:r,actions:(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsx)(pl,{to:So.EDIT_ACCREDIT(t,n,o),children:s("_diter_les_accr_86042")})}),setAccreditationsDisplay:a})},zT=e=>{const{params:{organizationId:t,eventId:n,userInfoId:o},translate:s}=il(),{isEventAdmin:r}=Uv(),a=(0,F.useMemo)(()=>Zo(e.organization.userInfo.formsUsersInfos.filter(e=>Zo(e.accreditationsSlots)))||(e.event?.hasFormWithAccreditationDisplay??!1),[e.organization,e.event]);return(0,i.jsxs)(Ea,{direction:"column",gap:"6",width:1,children:[Zo(e.event.volunteerRegistration.accreditationsUsersInfos)&&(0,i.jsx)(TT,{event:e.event,reload:e.reload,renderAccreditation:(e,o)=>(0,i.jsx)(La,{style:{width:"100%"},to:Hi.ACCREDITATION({organizationId:t,eventId:n,accreditationId:o}),children:e}),subtitle:s("visualisez_tout_53227"),title:s("accr_ditations_33155")}),a&&(0,i.jsx)(CT,{canEdit:r,editPath:So.EDIT_USER_ACCREDITATIONS(t,n,o),formsUsersInfos:e.organization.userInfo.formsUsersInfos}),(0,i.jsx)(Pa,{height:"8"})]})},$T=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Wn(),{data:o,loader:s,reload:r}=Vn("query UserProfileAccreditations(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $userInfoId: UsersInfoId!\n) {\n    organization(id: $organizationId) {\n        userInfo(id: $userInfoId) {\n            formsUsersInfos(eventId: $eventId, level: Event) {\n                accreditationsSlots {\n                    name\n                    date\n\n                    accreditation {\n                        id\n                        name\n                        index\n                    }\n\n                    accreditationCategory {\n                        name\n                    }\n                }\n\n                form {\n                    id\n                    name\n                }\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        name\n        dayStartTime\n        startAt\n        endAt\n        hasFormWithAccreditationDisplay\n\n        volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n            accreditationsUsersInfos {\n                ...UserPanelAccreditationSlotUserInfo\n            }\n        }\n    }\n}\n",{organizationId:e,eventId:t,userInfoId:n},[Ro.UserPanelAccreditationSlotUserInfoFragment]);return s||(0,i.jsx)(zT,{event:o.event,organization:o.organization,reload:r})},OT=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=il(),{organization:r,hasFeature:a}=nI(),{isEventAdmin:l}=Uv(),{mutate:d,isLoading:c}=Ns(),{mutate:u,isLoading:m}=Gs(),{mutate:g,isLoading:p}=Gs(),{mutate:f,isLoading:x}=Gs(),{mutate:_}=Es(),{mutate:I}=Rs(),{mutate:v,isLoading:b}=Vs(),{mutate:j,isLoading:C}=Vs(),[y,k]=(0,F.useState)(!1),[A,w]=(0,F.useState)(!1),S=(0,F.useMemo)(()=>(0,Zd.A)(e.customDocuments.filter(t=>yk(t.populationsIds,e.userInfo.fields.population)),e=>e.name),[e.customDocuments,e.userInfo]),E=e.links&&(e.state===Et.Assigned||Zo(r.customBadges))||h(S),{permissions:[T]}=wy(((...e)=>({name:"canUserInfoAssignFn",args:e}))(e.userInfo.id)),z={lang:e.userInfo.language};return(0,i.jsxs)(Ea,{direction:"column",children:[T&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:s("affectation")})]}),l&&(e.state===Et.Assigned||e.state===Et.Refused||e.state===Et.NotApplicable||e.state===Et.PreAssigned)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",isLoading:m,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await u({eventId:o,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:Et.WaitingAssignment}}),e.reload()},children:s("changer_le_stat_90266")})]}),l&&(e.state===Et.Assigned||e.state===Et.WaitingAssignment||e.state===Et.NotApplicable||e.state===Et.PreAssigned)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",isLoading:p,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await g({eventId:o,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:Et.Refused}}),e.reload()},children:s("changer_le_stat_68392")})]}),l&&(e.state===Et.WaitingAssignment||e.state===Et.Assigned)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",isLoading:x,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await f({eventId:o,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:Et.NotApplicable}}),e.reload()},children:s("changer_le_stat_62507")})]}),l&&e.state===Et.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",leftIcon:"pen",rightIcon:"arrow-right",to:So.EDIT_ASSIGNMENT(n,o,e.userInfo.id),children:s("_diter_les_affe_42283")})]}),T&&(e.state===Et.WaitingAssignment||e.state===Et.PreAssigned)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",leftIcon:"wand-magic-sparkles",rightIcon:"arrow-right",to:So.ASSIGNMENT(n,o,e.userInfo.id),children:s("affecter_94255")})]}),T&&e.state===Et.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",isLoading:c,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await d({organizationId:n,eventId:o,userInfoId:e.userInfo.id,emailType:ze.Assignments})},children:s("r_envoyer_l_e_65315")})]}),l&&e.state===Et.Refused&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",isLoading:c,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await d({organizationId:n,eventId:o,userInfoId:e.userInfo.id,emailType:ze.Refused})},children:s("r_envoyer_l_e_06733")})]}),a(Fe.Accreditation)&&l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:s("Accreditation")}),(e.accreditationState===ae.NotApplicable||e.accreditationState===ae.Refused||e.accreditationState===ae.Accredited||e.accreditationState===ae.AutoAccredited)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",isLoading:C,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await j({eventId:o,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:ae.WaitingAccreditation}}),e.reload()},children:s("changer_le_stat_20528")})]}),(e.accreditationState===ae.Accredited||e.accreditationState===ae.AutoAccredited||e.accreditationState===ae.WaitingAccreditation||e.accreditationState===ae.NotApplicable)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",isLoading:C,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await j({eventId:o,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:ae.Refused}}),e.reload()},children:s("changer_le_stat_68392")})]}),(e.accreditationState===ae.WaitingAccreditation||e.accreditationState===ae.Accredited||e.accreditationState===ae.AutoAccredited)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",isLoading:b,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await v({eventId:o,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:ae.NotApplicable}}),e.reload()},children:s("changer_le_stat_62507")})]}),e.accreditationState===ae.Accredited&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",leftIcon:"pen",rightIcon:"arrow-right",to:So.EDIT_ACCREDIT(n,o,e.userInfo.id),children:s("_diter_les_accr_86042")})]}),(e.accreditationState===ae.AutoAccredited||e.accreditationState===ae.WaitingAccreditation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",leftIcon:"badge-check",rightIcon:"arrow-right",to:So.ACCREDIT(n,o,e.userInfo.id),children:s("accr_diter_70543")})]}),(e.accreditationState===ae.Accredited||e.accreditationState===ae.AutoAccredited)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",isLoading:c,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await d({organizationId:n,eventId:o,userInfoId:e.userInfo.id,emailType:ze.Accreditations})},children:s("r_envoyer_l_e_24677")})]})]}),E&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:s("Documents")}),(0,i.jsx)(Pa,{height:"3"})]}),E&&e.state===Et.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pl,{color:"white",download:`${e.userInfo.nameOrEmail}-assignments`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Zm(e.links.userAssignmentsLink,"pdf",z),children:s("t_l_charger_la_82882")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",download:`${e.userInfo.nameOrEmail}-planning`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Zm(e.links.userPlanningLink,"pdf",z),children:s("t_l_charger_le_74660")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",download:`${e.userInfo.nameOrEmail}-planning-days`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Zm(e.links.userPlanningDaysLink,"pdf",z),children:s("t_l_charger_le_43587")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",download:`${e.userInfo.nameOrEmail}-planning-list`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Zm(e.links.userPlanningListLink,"pdf",z),children:s("t_l_charger_le_58518")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",download:`${e.userInfo.nameOrEmail}-user-hours`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Zm(e.links.userHoursLink,"pdf",z),children:s("t_l_charger_les_98537")}),a(Fe.Documents)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",download:`${e.userInfo.nameOrEmail}-badge`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Zm(e.links.userBadgeLink,"pdf",z),children:s("t_l_charger_le_53240")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",download:`${e.userInfo.nameOrEmail}-certificate`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Zm(e.links.userCertificateLink,"pdf",z),children:s("t_l_charger_l_a_02386")})]})]}),r.customBadges.map(t=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",download:`${e.userInfo.nameOrEmail}-custom-badge`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Zm(e.links.userCustomBadgeLinks[t],"pdf",z),children:s("t_l_charger_1_80752",b_(t))})]},t)),S.map((t,n)=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",download:`${e.userInfo.name}-custom-document`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Zm(e.links.userCustomDocumentLinks[t.slug],"pdf",z),children:s("t_l_charger_1_80752",t.name)})]},n)),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:s("g_n_ral_64953")}),a(Fe.Delegation)&&e.delegation&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",leftIcon:"minus",rightIcon:"arrow-right",onClick:()=>k(!0),children:s("retirer_de_la_d_64963")})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",leftIcon:"trash-can",rightIcon:"arrow-right",onClick:()=>w(!0),children:s("d_sinscrire_de_06416")})]}),a(Fe.Delegation)&&e.delegation&&y&&(0,i.jsx)(kk,{buttonText:s("retirer_de_la_d_64963"),subtext:[s("_tes_vous_sur_d_34901",e.delegation.name)],text:s("suppression_de_73669",e.userInfo.name),onClose:()=>k(!1),onDelete:async()=>{await _({organizationId:r.id,eventId:o,delegationId:e.delegation.id,selecteds:{ids:[e.userInfo.id]}}),t.push(So.VOLUNTEERS(n,o))}}),A&&(0,i.jsx)(kk,{buttonText:s("d_sinscrire_27046"),subtext:[s("_tes_vous_s_r_d_29576"),s("_1_sera_toujou_13334",e.userInfo.nameOrEmail)],text:s("d_sinscription_69522",e.userInfo.nameOrEmail),onClose:()=>w(!1),onDelete:async()=>{await I({eventId:o,selecteds:{ids:[e.userInfo.id]}}),t.push(So.VOLUNTEERS(n,o))}}),(0,i.jsx)(Pa,{height:"8"})]})},RT=()=>{const{params:{eventId:e,userInfoId:t}}=il(),{data:n,loader:o,reload:s}=Vn("query UserOverlayActionsEvent($eventId: EventId!, $userInfoId: UsersInfoId!) {\n    event(id: $eventId) {\n        customDocuments {\n            ...CustomDocumentPopulation\n        }\n\n        volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n            accreditationState\n            state\n\n            delegation {\n                id\n                name\n            }\n\n            userInfo {\n                ...UserInfoOverlay\n\n                links(eventId: $eventId) {\n                    ...UserInfoLinks\n                }\n            }\n        }\n    }\n}\n",{eventId:e,userInfoId:t},[Ro.CustomDocumentPopulationFragment,Ro.UserInfoOverlayFragment,Ro.UserInfoLinksFragment]);if(o)return o;{const e=n.event.volunteerRegistration;return(0,i.jsx)(OT,{accreditationState:e.accreditationState,customDocuments:n.event.customDocuments,delegation:e.delegation,links:e.userInfo.links,reload:s,state:e.state,userInfo:e.userInfo})}},PT=e=>{const{history:t,params:{organizationId:n},translate:o}=il(),{mutate:s}=function(e={}){return Un("mutation UserInfoAdminDelete($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n    userInfoAdminDelete(organizationId: $organizationId, userInfoId: $userInfoId) {\n        id\n    }\n}\n",e)}(),[r,a]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("g_n_ral_64953")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",leftIcon:"trash-can",rightIcon:"arrow-right",onClick:()=>a(!0),children:o("supprimer_43083")}),r&&(0,i.jsx)(kk,{buttonText:o("supprimer_43083"),subtext:[o("_tes_vous_s_r_d_53083"),o("cette_action_es_08212")],text:o("suppression_de_04261",e.userInfo.nameOrEmail),onClose:()=>a(!1),onDelete:async()=>{await s({organizationId:n,userInfoId:e.userInfo.id}),t.push(fi.COMMUNITY_USERS({organizationId:n}))}})]})},DT=()=>{const{params:{organizationId:e,userInfoId:t}}=il(),{data:n,loader:o}=Vn("query UserOverlayActionsOrganization($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n    organization(id: $organizationId) {\n        userInfo(id: $userInfoId) {\n            ...UserInfoOverlay\n        }\n    }\n}\n",{organizationId:e,userInfoId:t},[Ro.UserInfoOverlayFragment]);return o||(0,i.jsx)(PT,{userInfo:n.organization.userInfo})},FT=e=>{const{translate:t,params:{organizationId:n,eventId:o,userInfoId:s}}=il(),r=Nn(Ev),a=Nn($c),{mutate:l}=fs(),{data:d}=_s({organizationId:n,eventId:o,userInfoId:s}),c=(0,F.useMemo)(()=>{const n=r.createUpdateCampaignValuesDefault(!0,!1,d.organization?.event?.emailSender?.id??d.organization?.emailSenderId,null,null),i=d.organization?.userInfo?.name||"",o=a.toLocaleString(Fo.c9.now(),Ho.FullDateTime);return{...n,campaign:{...n.campaign,name:e.campaignType===ue.Sms?t("sms_1_le_2_25252",i,o):t("e_mail_1_le_21805",i,o),campaignType:e.campaignType,state:ce.InProgress,sendToEveryone:!1,usersInfosIds:[s]}}},[e.campaignType,d.organization]);return(0,i.jsx)(dl,{initialValues:c,render:n=>(0,i.jsxs)(eu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Lb,{children:e.campaignType===ue.Sms?t("envoi_d_un_sms_22148"):t("envoi_d_un_emai_99336")}),(0,i.jsx)(tu,{css:{padding:"$6"},children:e.campaignType===ue.Email?(0,i.jsx)(pv,{campaignType:e.campaignLevel,customDocuments:d.organization?.event?.customDocuments??[],emailSenderId:d.organization?.event?.emailSender?.id??d.organization?.emailSenderId,emailsSenders:d.organization?.emailsSenders??[],form:n.form,values:n.values}):(0,i.jsx)(bv,{formProps:n})}),(0,i.jsx)(nu,{children:(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")}),(0,i.jsx)(pl,{isLoading:n.submitting,onClick:n.handleSubmit,children:t("envoyer_26609")})]})})]}),onSubmit:async t=>{await l({organizationId:n,eventId:o,campaign:t.campaign}),e.onClose()}})},MT=e=>{const t=Ln(),n=Nn(Dl),{mutate:o}=function(e={}){return Un("mutation EmailUpdate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $delegationId: DelegationId\n    $userInfoId: UsersInfoId!\n    $email: UserEmail!\n) {\n    emailUpdate(\n        organizationId: $organizationId\n        eventId: $eventId\n        delegationId: $delegationId\n        userInfoId: $userInfoId\n        email: $email\n    )\n}\n",e)}();return(0,i.jsx)(gj,{buttonText:t("modifier_l_adre_94026"),icon:"pen",initialValues:{email:e.email},schema:n.emailSchema(),title:t("modification_de_69462"),onClose:e.onClose,onSubmit:async t=>{await o({email:t.email,eventId:e.eventId,organizationId:e.organizationId,userInfoId:e.userInfoId}),e.onClose(),e.onSuccess()},children:(0,i.jsx)(Sl,{label:t("adresse_e_mail_60930"),name:"email"})})},NT=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{hasFeature:s}=nI(),[r,a]=(0,F.useState)(!1),[l,d]=(0,F.useState)(!1),[c,u]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",gap:"4",width:1,children:[(0,i.jsx)(Fg,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:88}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"3",children:[(0,i.jsx)(fr,{font:"gray800 textXl medium",children:e.userInfo.name}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("Email")}),(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(Gd,{color:"white",cursor:"pointer",leftIcon:"at",rightIcon:"chevron-down",size:"md",children:e.userInfo.email})}),(0,i.jsxs)(Pd,{placement:"bottom-start",children:[(0,i.jsx)(Od,{icon:"copy",onClick:()=>{oS(e.userInfo.email)},children:t("copier_1_59210",e.userInfo.email)}),e.canEditEmail&&(0,i.jsx)(Od,{icon:"pen",onClick:()=>{a(!0)},children:t("modifier_1_38587",e.userInfo.email)}),(0,i.jsx)(Od,{icon:"at",onClick:()=>d(!0),children:t("_crire_1_90053",e.userInfo.email)})]})]})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("t_l_phone_31755")}),h(e.userInfo.phone?.internationalFormat)?(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(Gd,{color:"white",cursor:"pointer",leftIcon:"phone",rightIcon:"chevron-down",size:"md",children:e.userInfo.phone?.internationalFormat??"-"})}),(0,i.jsxs)(Pd,{placement:"bottom-start",children:[(0,i.jsx)(Od,{color:"default",icon:"copy",onClick:()=>oS(e.userInfo.phone.internationalFormat),children:t("copier_1_59210",e.userInfo.phone?.internationalFormat??"-")}),(0,i.jsx)(La,{to:{pathname:`tel:${e.userInfo.phone.internationalFormat.replaceAll(" ","")}`},children:(0,i.jsx)(Od,{color:"default",icon:"phone",children:t("appeler_1_57163",e.userInfo.phone?.internationalFormat??"-")})}),s(Fe.Sms)&&(0,i.jsx)(Od,{icon:"phone",onClick:()=>u(!0),children:t("_crire_1_90053",e.userInfo.phone?.internationalFormat??"-")})]})]}):(0,i.jsx)(fr,{color:"gray500",children:"-"})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray800 textSm medium",children:e.populationFieldName}),(0,i.jsx)(fr,{color:"gray500",children:h(e.userInfo.population)?e.userInfo.population:"-"})]}),e.assignmentState&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("status_d_affect_75769")}),(0,i.jsx)(Ea,{children:(0,i.jsx)(Gd,{...Rb(e.assignmentState),children:t(e.assignmentState)})})]})}),e.accreditationState&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("statut_d_accr_d_75527")}),(0,i.jsx)(Ea,{children:(0,i.jsx)(Gd,{...Pb(e.accreditationState),children:t(e.accreditationState)})})]})})]})]})]}),r&&(0,i.jsx)(MT,{email:e.userInfo.email,eventId:o,organizationId:n,userInfoId:e.userInfo.id,onClose:()=>{a(!1)},onSuccess:e.reload}),l&&(0,i.jsx)(FT,{campaignLevel:o?"event":"organization",campaignType:ue.Email,onClose:()=>d(!1)}),c&&(0,i.jsx)(FT,{campaignLevel:o?"event":"organization",campaignType:ue.Sms,onClose:()=>u(!1)})]})},LT=()=>(0,i.jsxs)(Ea,{gap:"4",width:1,children:[(0,i.jsx)(qd,{size:88,variant:"circular"}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"3",children:[(0,i.jsx)(qd,{borderRadius:"$1",height:28,width:200}),(0,i.jsx)(qd,{borderRadius:"$1",height:48,width:1})]})]}),BT=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,userInfoId:r}}=il(),a=Nn($c),{mutate:l}=Js(),d=e.campaign.sentAt?.setZone(Fo.c9.local().zone),c=(0,F.useMemo)(()=>e.campaign.campaignType===ue.Email&&e.campaign.email?e.campaign.email.state:null,[e.campaign]),u=(0,F.useMemo)(()=>e.campaign.campaignType===ue.Sms&&e.campaign.textMessage?e.campaign.textMessage.state:null,[e.campaign]);return(0,i.jsxs)(Cc,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},onClick:()=>{t.push(rI.CAMPAIGN({organizationId:e.campaign.organizationId,eventId:e.campaign.eventId||void 0,campaignId:e.campaign.id}))},children:[(0,i.jsx)(xc,{children:(0,i.jsxs)(Ea,{direction:"column",width:1,children:[(0,i.jsx)(fr,{color:"gray800",children:e.campaign.name}),d&&(0,i.jsx)(fr,{color:"gray500",children:n("envoy_e_le_1_31494",a.toLocaleString(d,Ho.DateOnly.MonthLong),a.toLocaleString(d,Ho.TimeOnly))})]})}),(0,i.jsxs)(xc,{width:150,children:[(0,i.jsx)(fr,{width:22,children:e.campaign.campaignType===ue.Email?(0,i.jsx)(Va,{icon:"at"}):(0,i.jsx)(Va,{icon:"message"})}),e.campaign.campaignType]}),(0,i.jsxs)(xc,{width:200,children:[c&&(0,i.jsx)(Gd,{...Tb(c),children:n(c)}),u&&(0,i.jsx)(Gd,{...Nb(u),children:n(u)})]}),(0,i.jsx)(xc,{children:(0,i.jsx)(fr,{css:{ellipsis:!0},children:e.campaign.event?.name??n("communaut_20896")})}),(0,i.jsx)(im,{justify:"end",children:(0,i.jsx)(pm,{children:(0,i.jsx)(Od,{icon:"paper-plane",onClick:async()=>{await l({organizationId:o,eventId:s,campaignId:e.campaign.id,selecteds:{ids:[r]}})},children:n("r_envoyer_90741")})})})]})},VT=()=>{const{translate:e,params:{organizationId:t,userInfoId:n}}=il(),{data:o,isLoading:s,reload:r}=Vn("query UserHistoryCampaigns($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n    organization(id: $organizationId) {\n        userInfo(id: $userInfoId) {\n            campaigns {\n                nodes {\n                    id\n                    organizationId\n                    eventId\n                    name\n                    campaignType\n                    sentAt\n\n                    event {\n                        name\n                    }\n\n                    email(userInfoId: $userInfoId) {\n                        state\n                    }\n\n                    textMessage(userInfoId: $userInfoId) {\n                        state\n                    }\n                }\n            }\n        }\n    }\n}\n",{organizationId:t,userInfoId:n},[]);return(0,i.jsxs)(mc,{hideBorder:!0,children:[(0,i.jsxs)(cc,{children:[(0,i.jsx)(Tc,{children:e("nom_de_la_campa_45063")}),(0,i.jsx)(Tc,{width:150,children:e("type_35427")}),(0,i.jsx)(Tc,{width:200,children:e("status_06428")}),(0,i.jsx)(Tc,{children:e("_v_nement_22345")}),(0,i.jsx)(Tc,{width:100})]}),s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{})]}):o.organization.userInfo.campaigns.nodes.map(e=>(0,i.jsx)(BT,{campaign:e,reload:r},e.id))]})},UT=e=>{const{translate:t}=il(),n=Nn($c),o=(0,F.useMemo)(()=>Object.values((0,Kd.A)(e.vr.positionsSlotsUsersInfos,e=>e.position.id)).map(e=>{const t=e[0].position;return{id:t.id,text:h(t.acronym)?t.acronym:t.name,color:t.color,count:e.length,icon:t.icon}}),[e.vr]),s=(0,F.useMemo)(()=>Object.values((0,Kd.A)(e.vr.accreditationsUsersInfos,e=>e.accreditation.id)).map(e=>{const t=e[0].accreditation;return{id:t.id,text:h(t.acronym)?t.acronym:t.name,color:t.color,count:e.length,icon:t.icon}}),[e.vr]);return(0,i.jsxs)(Cc,{children:[(0,i.jsxs)(xc,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(fr,{children:e.vr.event.name}),(0,i.jsx)(fr,{color:"gray500",children:t("inscrit_le_1_12018",n.toLocaleString(e.vr.insertedAt.toLocal(),Ho.DateTime))})]}),(0,i.jsx)(xc,{children:(0,i.jsx)(qC,{badges:o})}),(0,i.jsx)(xc,{children:(0,i.jsx)(qC,{badges:s})}),(0,i.jsx)(xc,{children:e.vr.delegation&&(0,i.jsx)(Gd,{ellipsis:!0,children:e.vr.delegation.name})})]})},WT=()=>{const{translate:e,params:{organizationId:t,userInfoId:n}}=il(),{data:o,isLoading:s}=Vn("query UserHistoryEvents($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n    organization(id: $organizationId) {\n        userInfo(id: $userInfoId) {\n            volunteersRegistrations {\n                id\n                insertedAt\n\n                delegation {\n                    name\n                }\n\n                event {\n                    id\n                    name\n                }\n\n                accreditationsUsersInfos {\n                    accreditation {\n                        id\n                        acronym\n                        color\n                        icon\n                        name\n                    }\n                }\n\n                positionsSlotsUsersInfos {\n                    position {\n                        id\n                        acronym\n                        color\n                        icon\n                        name\n                    }\n                }\n            }\n        }\n    }\n}\n",{organizationId:t,userInfoId:n},[]);return(0,i.jsxs)(mc,{hideBorder:!0,children:[(0,i.jsxs)(cc,{children:[(0,i.jsx)(Tc,{children:e("nom_de_l_v_nem_08711")}),(0,i.jsx)(Tc,{children:e("missions_63972")}),(0,i.jsx)(Tc,{children:e("accr_ditations_39450")}),(0,i.jsx)(Tc,{children:e("Delegation")})]}),s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{})]}):o.organization.userInfo.volunteersRegistrations.map(e=>(0,i.jsx)(UT,{vr:e},e.id))]})},GT=e=>{const{translate:t}=il(),n=Nn($c);return(0,i.jsxs)(Cc,{children:[(0,i.jsxs)(xc,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(fr,{children:e.fui.form.name}),(0,i.jsx)(fr,{color:"gray500",children:t("rempli_le_1_29292",n.toLocaleString(e.fui.insertedAt.toLocal(),Ho.DateTime))})]}),(0,i.jsx)(xc,{children:(0,i.jsx)(fr,{css:{ellipsis:!0},children:e.fui.event?.name??t("communaut_20896")})})]})},HT=()=>{const{translate:e,params:{organizationId:t,userInfoId:n}}=il(),{data:o,isLoading:s}=Vn("query UserHistoryForms($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n    organization(id: $organizationId) {\n        userInfo(id: $userInfoId) {\n            formsUsersInfos {\n                id\n                insertedAt\n\n                form {\n                    name\n                }\n\n                event {\n                    name\n                }\n            }\n        }\n    }\n}\n",{organizationId:t,userInfoId:n},[]);return(0,i.jsxs)(mc,{hideBorder:!0,children:[(0,i.jsxs)(cc,{children:[(0,i.jsx)(Tc,{children:"Nom du formulaire"}),(0,i.jsx)(Tc,{children:e("_v_nement_22345")})]}),s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{})]}):o.organization.userInfo.formsUsersInfos.map(e=>(0,i.jsx)(GT,{fui:e},e.id))]})},qT=e=>{const t=Nn($c),{organization:n}=nI(),o=(0,F.useMemo)(()=>Fo.c9.fromISO(e.weezeventWebhook.data?.values?.validated)?.isValid?Fo.c9.fromISO(e.weezeventWebhook.data?.values?.validated):e.weezeventWebhook.insertedAt,[e.weezeventWebhook]),s=e.weezeventWebhook.checklist?Xm(n.weezeventOrganizationId,e.weezeventWebhook.checklist.id):"";return(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(j_,{to:s,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.weezeventWebhook.checklist?.name??"-",width:1,children:e.weezeventWebhook.checklist?.name??"-"})})}),(0,i.jsx)(xc,{children:t.toLocaleString(o,{...Ho.DateTime,weekday:"long"})}),(0,i.jsx)(xc,{children:e.weezeventWebhook.data?.values?.partner_name??"-"})]})},YT=()=>{const{translate:e,params:{eventId:t,userInfoId:n}}=il(),{data:o,isLoading:s}=Vn('query UserHistoryScans($eventId: EventId!, $userInfoId: UsersInfoId!) {\n    event(id: $eventId) {\n        volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n            weezeventWebhooks(type: "scan") {\n                nodes {\n                    id\n                    data\n                    insertedAt\n\n                    checklist {\n                        id\n                        name\n                    }\n                }\n            }\n        }\n    }\n}\n',{eventId:t,userInfoId:n},[]);return(0,i.jsxs)(mc,{hideBorder:!0,children:[(0,i.jsxs)(cc,{children:[(0,i.jsx)(Tc,{children:e("liste_de_contr_79815")}),(0,i.jsx)(Tc,{children:e("Date")}),(0,i.jsx)(Tc,{children:e("op_rateur_30804")})]}),s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{})]}):o.event.volunteerRegistration.weezeventWebhooks.nodes.map(e=>(0,i.jsx)(qT,{weezeventWebhook:e},e.id))]})},KT=e=>{const{translate:t,params:n}=il(),o={organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,userInfoId:":userInfoId"},s=e.isEvent&&e.isWeezeventConnected;return(0,i.jsxs)(Ea,{css:{background:"white",bd:!0,overflow:"hidden",paddingTop:"$5"},direction:"column",gap:"5",children:[(0,i.jsx)(fr,{css:{px:"$6"},font:"gray900 textMd semiBold",children:"Historique"}),(0,i.jsxs)(Vy,{css:{flex:"1"},children:[(0,i.jsxs)(Ly,{css:{px:"$6"},children:[(0,i.jsx)(Ny,{path:kI.MEMBER_HISTORY_EVENTS(n),children:t("Event")}),(0,i.jsx)(Ny,{path:kI.MEMBER_HISTORY_CAMPAIGNS(n),children:t("Campaigns")}),(0,i.jsx)(Ny,{path:kI.MEMBER_HISTORY_FORMS(n),children:t("Form_plural")}),s&&(0,i.jsx)(Ny,{path:kI.MEMBER_HISTORY_SCANS(n),children:"Scans"})]}),(0,i.jsx)(By,{path:kI.MEMBER_HISTORY_EVENTS(o),children:(0,i.jsx)(WT,{})}),(0,i.jsx)(By,{path:kI.MEMBER_HISTORY_CAMPAIGNS(o),children:(0,i.jsx)(VT,{})}),(0,i.jsx)(By,{path:kI.MEMBER_HISTORY_FORMS(o),children:(0,i.jsx)(HT,{})}),s&&(0,i.jsx)(By,{path:kI.MEMBER_HISTORY_SCANS(o),children:(0,i.jsx)(YT,{})})]})]})},ZT=e=>(0,i.jsx)(fr,{color:"gray800",css:{overflow:"hidden",textOverflow:"ellipsis",...e.css},fontSize:"textSm",fontWeight:"medium",children:e.children}),XT=e=>(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(ZT,{children:e.field.name}),(0,i.jsx)(BA,{field:e.field,fields:e.fields})]});function JT(e,t){return{name:t("commentaire_r_12290"),slug:`form${e}`,fieldType:Ne.Textarea,values:[]}}const QT=e=>{const{translate:t}=il(),n=Nn($c),[o,s]=(0,F.useState)(!0),r=(0,F.useCallback)(async()=>{const t=!o;s(t),await X_.forms.put({id:e.form.id,isOpenInUserOverlay:t})},[o,s]),a=(0,F.useMemo)(()=>e.form.elements.flatMap(e=>e.elementType===Ve.Field?[e.customField]:e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]),[e.form]),l=(0,F.useMemo)(()=>e.form.elements.filter(t=>t.elementType===Ve.Field?jj(t.customField,e.userInfo.fields,a):t.elementType===Ve.Section&&jj(t,e.userInfo.fields,a)),[a,e.form.elements,e.userInfo.fields]),d=e.canEdit&&!1!==e.form.isEditableInMemberSpace,c="all"!==e.form.id?JT(e.form.id,t):null;return(0,F.useEffect)(()=>{(async()=>{s((await X_.forms.get(e.form.id))?.isOpenInUserOverlay??!0)})()},[]),(0,i.jsxs)(Ea,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$xs"},direction:"column",width:1,children:[(0,i.jsxs)(Ea,{align:"center",css:{cursor:"pointer",padding:"$5 $6",userSelect:"none"},gap:"4",onClick:r,children:[(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:o?"chevron-up":"chevron-down"})}),(0,i.jsxs)(Ea,{align:"start",css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{children:e.form.name}),e.showIsFilled?e.filledAt?(0,i.jsx)(Gd,{color:"success",size:"sm",children:t("rempli_le_1_29292",n.toLocaleString(e.filledAt.toLocal(),Ho.DateTime))}):(0,i.jsx)(Gd,{color:"error",size:"sm",children:t("non_rempli_80877")}):null]}),d&&(0,i.jsx)(pl,{color:"white",size:"sm",to:e.getEditUserFormPath(e.form.id),children:t("_diter_62574")})]}),o&&(0,i.jsxs)(Ea,{css:{borderTop:"1px solid $gray200",padding:"$6"},direction:"column",children:[l.map((t,n)=>{switch(t.elementType){case Ve.Field:return(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(XT,{field:t.customField,fields:e.userInfo.fields}),n!==l.length-1&&(0,i.jsx)(Pa,{height:"6"})]},t.id);case Ve.Section:return(0,i.jsxs)(F.Fragment,{children:[0!==n&&(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:t.section}),n!==l.length-1&&(0,i.jsx)(Pa,{height:"4"})]},t.id);case Ve.Text:return null;default:return Za(t.elementType)}}),c&&h(e.userInfo.fields[c.slug])&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:t("inscription_en_49989")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(XT,{field:c,fields:e.userInfo.fields})]})]})]})};function ez(e,t){switch(e){case Ne.Text:case Ne.Textarea:return"text";case Ne.Checkbox:return"square-check";case Ne.Validation:return"check";case Ne.Select:return"population"===t?"users":"list-ul";case Ne.Date:return"calendar";case Ne.Datetime:return"calendar-day";case Ne.Time:return"clock";case Ne.File:return"file";case Ne.Phone:return"phone";case Ne.Language:return"language";case Ne.Number:return"00";case Ne.Sex:return"venus-mars";case Ne.Nationality:case Ne.Country:return"flag";case Ne.Address:return"map-location";default:return Za()}}function tz(e){return(0,Zd.A)(Object.entries((0,Kd.A)(e,e=>e.category.name)),([e])=>e).flatMap(([e,t])=>[{id:N(),elementType:Ve.Section,section:e,hasCondition:!1,conditionValue:!1}].concat(t.map(e=>({id:N(),elementType:Ve.Field,customField:e,hasCondition:!1,conditionValue:!1}))))}const nz=e=>(0,i.jsxs)(Ea,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"3",children:[(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(Va,{icon:e.icon}),(0,i.jsx)(fr,{font:"gray900 textMd medium",children:e.title})]}),e.children]}),iz=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=il();return(0,i.jsx)(nz,{icon:"people-group",title:n("d_l_gations_78318"),children:(0,i.jsx)(Ea,{gap:"2",wrap:"wrap",children:e.delegations.map(e=>{const n=s?e.name:e.event?`${e.event.name} : ${e.name}`:e.name;return(0,i.jsx)(Gd,{color:"white",cursor:"pointer",ellipsis:!0,size:"md",onClick:()=>{t.push(e.event?to.DELEGATION({organizationId:o,eventId:e.event.id,delegationId:e.id}):So.COMMUNITY_DELEGATION(o,e.id))},children:n},e.id)})})})},oz=e=>{const{history:t,translate:n}=il(),o=Nn($c),[s,r]=(0,F.useState)(!1),a=(0,F.useMemo)(()=>e.customFields.filter(e=>e.isPrivate),[e.customFields]),l=(0,F.useMemo)(()=>Zo(e.profilePrivateFields)?e.profilePrivateFields:a.map(e=>e.slug),[a,e.profilePrivateFields]),d=(0,F.useMemo)(()=>(0,Zd.A)(a.filter(t=>l.includes(t.slug)&&jj(t,e.userInfo.fields,e.customFields)),({slug:e})=>l.indexOf(e)),[e.customFields,a,l]),c=(0,F.useCallback)(async t=>{await e.profilePrivateFieldsUpdate(t),e.reload()},[e.profilePrivateFieldsUpdate,e.reload]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(nz,{icon:"lock-keyhole",title:n("informations_pr_15873"),children:[d.map(t=>(0,i.jsx)(XT,{field:t,fields:e.userInfo.fields},t.slug)),(0,i.jsx)(fr,{css:{textTransform:"uppercase"},font:"gray500 textXs regular",children:n("inscrit_le_1_12018",o.toLocaleString(e.insertedAt.toLocal(),Ho.DateTime))}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsx)(gS,{color:"white",menu:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Od,{icon:"gear",onClick:()=>{r(!0)},children:n("g_rer_les_champ_00431")})}),onClick:()=>t.push(e.getEditUserFormPath("private")),children:n("_diter_62574")})})]}),s&&(0,i.jsx)(ru,{columns:a,css:{zIndex:"210"},initialSelectedColumns:l,saveButtonText:n("mettre_jour_85141"),searchPlaceholder:n("rechercher_un_c_86475"),subtitle:n("personnaliser_l_69296"),title:n("gestion_des_cha_66775"),onClose:()=>{r(!1)},onSave:c})]})},sz=e=>{const{translate:t}=il();return(0,i.jsxs)(Ea,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"3",children:[(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(Va,{icon:"users-viewfinder"}),(0,i.jsx)(fr,{font:"gray900 textMd medium",children:t("profils_li_s_03417")})]}),e.usersInfos.map(e=>(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(Eb,{size:32,userInfo:e}),Zo(e.delegations)&&(0,i.jsx)(Ea,{css:{paddingLeft:"44px"},gap:"2",wrap:"wrap",children:e.delegations.map(e=>(0,i.jsx)(Gd,{color:"white",size:"md",children:e.name},e.id))})]},e.id))]})},rz=({team:{organizationId:e,eventId:t,formId:n,teamCode:o,teamMembers:s}})=>{const r=Ln(),a=Hm({organizationId:e,eventId:t,formId:n,teamCode:o}),{isLoading:l,copy:d}=sS(),c=(0,F.useCallback)(()=>{d(Hm({organizationId:e,eventId:t,formId:n,teamCode:o}))},[e,t,n,o]);return(0,i.jsxs)(nz,{icon:"user-group",title:(0,i.jsxs)(i.Fragment,{children:[r("_quipe_76857")," ",(0,i.jsxs)(Pm,{font:"gray500 textSm regular",children:["(",o,")"]})]}),children:[s.map(e=>(0,i.jsx)(Eb,{size:32,userInfo:e},e.id)),(0,i.jsxs)(Ea,{align:"center",gap:"3",justify:"end",children:[(0,i.jsx)(La,{to:a,children:r("lien_d_invitati_45319")}),(0,i.jsx)(pl,{color:"white",isLoading:l,rightIcon:"copy",size:"sm",onClick:c})]})]})},az=e=>{const{translate:t,params:{eventId:n}}=il(),{isEventAdmin:o}=Uv(),s=Nn($c),{mutate:r}=function(e={}){return Un("mutation VolunteerRegistrationTicketIdRegenerate(\n    $eventId: EventId!\n    $volunteerRegistrationId: VolunteersRegistrationId!\n) {\n    volunteerRegistrationTicketIdRegenerate(\n        eventId: $eventId\n        volunteerRegistrationId: $volunteerRegistrationId\n    ) {\n        id\n        ticketId\n    }\n}\n",e)}(),[a,l]=(0,F.useState)(!1),d=(0,F.useMemo)(()=>h(e.volunteerRegistration.weezevent.lastSynchronizedAt)&&Fo.c9.fromISO(e.volunteerRegistration.weezevent.lastSynchronizedAt)?.isValid?s.toLocaleString(Fo.c9.fromISO(e.volunteerRegistration.weezevent.lastSynchronizedAt).toLocal(),Ho.DateTime):"-",[e.volunteerRegistration]),c=(0,F.useMemo)(()=>e.volunteerRegistration.weezeventPairedAt?.isValid?s.toLocaleString(e.volunteerRegistration.weezeventPairedAt.toLocal(),Ho.DateTime):"-",[e.volunteerRegistration]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(Va,{icon:"memo-circle-info"}),(0,i.jsx)(fr,{font:"gray900 textMd medium",children:t("informations_22954")})]}),(0,i.jsxs)(Ea,{align:"center",gap:"5",children:[(0,i.jsx)(ay,{nameOrEmail:e.nameOrEmail,size:64,ticketId:e.volunteerRegistration.ticketId}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{color:"gray500",children:t("TicketId")}),(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(Gd,{color:"white",cursor:"pointer",leftIcon:"ticket",rightIcon:"chevron-down",size:"md",children:e.volunteerRegistration.ticketId})}),(0,i.jsxs)(Pd,{placement:"bottom-start",children:[(0,i.jsx)(Od,{icon:"copy",onClick:()=>{oS(e.volunteerRegistration.ticketId)},children:t("copier_75889")}),h(e.volunteerRegistration.weezeventTicketUrl)&&(0,i.jsx)(La,{to:e.volunteerRegistration.weezeventTicketUrl,children:(0,i.jsx)(Od,{icon:"arrow-up-right-from-square",children:t("ouvrir_dans_wee_97529")})}),h(e.volunteerRegistration.weezeventPayUrl)&&(0,i.jsx)(La,{to:e.volunteerRegistration.weezeventPayUrl,children:(0,i.jsx)(Od,{icon:"arrow-up-right-from-square",children:t("ouvrir_dans_wee_14636")})}),o&&(0,i.jsx)(Od,{icon:"repeat",onClick:()=>l(!0),children:t("r_g_n_rer_le_co_81294")})]})]})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{color:"gray500",children:t("num_ro_de_puce_50039")}),(0,i.jsx)(fr,{font:"gray800 textSm medium",children:h(e.volunteerRegistration.shortTag)?e.volunteerRegistration.shortTag:"-"})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{color:"gray500",children:t("derni_re_synchr_59823")}),(0,i.jsx)(fr,{font:"gray800 textSm medium",children:d})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{color:"gray500",children:t("appair_le_70213")}),(0,i.jsx)(fr,{font:"gray800 textSm medium",children:c})]})]})]}),a&&(0,i.jsx)(kk,{buttonText:t("r_g_n_rer_37440"),subtext:[t("_tes_vous_s_r_d_57752"),t("cela_rendra_l_a_42228")],text:t("r_g_n_rer_le_co_81294"),onClose:()=>l(!1),onDelete:async()=>{await r({eventId:n,volunteerRegistrationId:e.volunteerRegistration.id}),e.reload()}})]})},lz=e=>{const{translate:t,params:{userInfoId:n}}=il(),{isOrganizationAdmin:o,organization:s}=nI(),{hasPositionPermission:r}=Uv(),a=o||r(db.EDIT_MEMBER),[l,d]=(0,F.useState)(""),[c,u]=(0,F.useState)(e.initialShowNotFilled),m=(0,F.useCallback)(t=>{u(t),e.setShowNotFilled(t)},[e.setShowNotFilled,u]),g=(0,F.useMemo)(()=>Object.fromEntries(e.formsUsersInfos.map(e=>[e.formId,e.insertedAt])),[e.formsUsersInfos]),p=(0,F.useMemo)(()=>(0,Zd.A)(e.forms.filter(e=>!(!c&&void 0===g[e.id])&&(!h(l)||e.name.toLowerCase().includes(l.toLowerCase().trim()))),[e=>void 0!==g[e.id]?1:2,e=>e.name]),[e.forms,g,l,c]),f=(0,F.useMemo)(()=>e.formsUsersInfos.filter(e=>h(e.teamCode)),[e.formsUsersInfos]),x=(0,F.useMemo)(()=>e.usersInfos.filter(e=>e.id!==n),[e.usersInfos,n]),_=(0,F.useMemo)(()=>ey(e.userPermissions,t),[e.userPermissions,s]);return(0,i.jsxs)(Ea,{gap:"6",width:1,children:[(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"4",children:[e.isWeezeventConnected&&e.volunteerRegistration&&(0,i.jsx)(az,{nameOrEmail:e.userInfo.nameOrEmail,reload:e.reload,volunteerRegistration:e.volunteerRegistration}),(0,i.jsxs)(Ea,{align:"center",css:{background:"white",bd:!0,padding:"$4"},gap:"2",children:[(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_un_f_28561"),value:l,onChange:d})}),(0,i.jsx)(nc,{state:c?"checked":"unchecked",onClick:e=>{m("checked"===e)},children:t("afficher_les_fo_84832")})]}),(0,i.jsx)(Ea,{direction:"column",gap:"3",children:0===p.length?(0,i.jsx)(Ea,{css:{background:"white",bd:!0},height:400,children:(0,i.jsx)(rk,{button:(0,i.jsx)(ub,{positionsPermissions:db.EDIT_MEMBER,children:(0,i.jsx)(pl,{to:e.getEditUserFormPath("all"),children:t("_diter_les_cham_66020")})}),title:t("aucun_formulair_41857")})}):p.map(t=>(0,i.jsx)(QT,{canEdit:a,filledAt:g[t.id],form:t,getEditUserFormPath:e.getEditUserFormPath,showIsFilled:"all"!==t.id,userInfo:e.userInfo},t.id))})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"4",width:348,children:[Zo(_)&&(0,i.jsx)(nz,{icon:"shield",title:"Rôles",children:(0,i.jsx)(Ea,{gap:"2",wrap:"wrap",children:_.map(e=>(0,i.jsx)(GC,{badge:e},e.id))})}),Zo(x)&&(0,i.jsx)(sz,{usersInfos:x}),Zo(e.delegations)&&(0,i.jsx)(iz,{delegations:e.delegations}),f.map((e,t)=>(0,i.jsx)(rz,{team:e},t)),(0,i.jsx)(oz,{customFields:e.customFields,getEditUserFormPath:e.getEditUserFormPath,insertedAt:e.insertedAt,profilePrivateFields:e.profilePrivateFields,profilePrivateFieldsUpdate:e.profilePrivateFieldsUpdate,reload:e.reload,userInfo:e.userInfo})]})]})},dz=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Wn(),{localEvent:o,updateLocalEvent:s}=Uv(),{mutate:r}=function(e={}){return Un("mutation EventProfilePrivateFieldsUpdate(\n    $eventId: EventId!\n    $profilePrivateFields: [CustomFieldSlug!]!\n) {\n    eventProfilePrivateFieldsUpdate(\n        eventId: $eventId\n        profilePrivateFields: $profilePrivateFields\n    ) {\n        id\n    }\n}\n",e)}(),{data:a,loader:l,reload:d}=Vn("query UserInformationsEvent(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $userInfoId: UsersInfoId!\n) {\n    organization(id: $organizationId) {\n        customFields(variety: UserInfo) {\n            nodes {\n                ...CustomFieldWithCondition\n            }\n        }\n\n        userInfo(id: $userInfoId) {\n            ...UserInfoOverlay\n            ...UserAllPermissions\n\n            formsUsersInfos(level: Event, eventId: $eventId) {\n                ...FormUserInfoUserProfile\n            }\n\n            user {\n                usersInfos(organizationId: $organizationId, eventId: $eventId) {\n                    id\n                    name\n                    email\n\n                    picture {\n                        url\n                    }\n\n                    delegations(level: Event) {\n                        id\n                        name\n                    }\n                }\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        isWeezeventConnected\n        profilePrivateFields\n\n        forms {\n            nodes {\n                ...FormUserOverlay\n            }\n        }\n\n        volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n            id\n            insertedAt\n            shortTag\n            ticketId\n            weezevent\n            weezeventPairedAt\n            weezeventPayUrl\n            weezeventTicketUrl\n\n            delegation {\n                ...DelegationUserProfile\n            }\n        }\n    }\n}\n",{organizationId:e,eventId:t,userInfoId:n},[Ro.CustomFieldWithConditionFragment,Ro.UserInfoOverlayFragment,Ro.UserAllPermissionsFragment,Ro.FormUserInfoUserProfileFragment,Ro.FormUserOverlayFragment,Ro.DelegationUserProfileFragment]),c=(0,F.useMemo)(()=>(0,Zd.A)(a.event?.forms.nodes??[],e=>e.name),[a.event]),u=(0,F.useMemo)(()=>(0,Da.A)([a.event?.volunteerRegistration.delegation]),[a.event]);return l||(0,i.jsx)(lz,{customFields:a.organization.customFields.nodes,delegations:u,forms:c,formsUsersInfos:a.organization?.userInfo.formsUsersInfos??[],getEditUserFormPath:i=>So.EDIT_USER_FORM(e,t,n,i),initialShowNotFilled:o?.showNotFilled??!1,insertedAt:a.event.volunteerRegistration.insertedAt,isWeezeventConnected:a.event.isWeezeventConnected,profilePrivateFields:a.event.profilePrivateFields,profilePrivateFieldsUpdate:e=>r({eventId:t,profilePrivateFields:e}),reload:d,setShowNotFilled:e=>{s({showNotFilled:e})},userInfo:a.organization.userInfo,userPermissions:a.organization.userInfo,usersInfos:a.organization.userInfo.user.usersInfos,volunteerRegistration:a.event?.volunteerRegistration})},cz=()=>{const{params:{organizationId:e,userInfoId:t},translate:n}=il(),{localOrganization:o,updateLocalOrganization:s}=nI(),{mutate:r}=function(e={}){return Un("mutation OrganizationProfilePrivateFieldsUpdate(\n    $organizationId: OrganizationId!\n    $profilePrivateFields: [CustomFieldSlug!]!\n) {\n    organizationProfilePrivateFieldsUpdate(\n        organizationId: $organizationId\n        profilePrivateFields: $profilePrivateFields\n    ) {\n        id\n    }\n}\n",e)}(),{data:a,loader:l,reload:d}=Vn("query UserInformationsOrganization(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $userInfoId: UsersInfoId!\n) {\n    organization(id: $organizationId) {\n        profilePrivateFields\n\n        customFields(variety: UserInfo) {\n            nodes {\n                ...CustomFieldWithCondition\n\n                category {\n                    name\n                }\n            }\n        }\n\n        forms(level: Organization) {\n            nodes {\n                ...FormUserOverlay\n            }\n        }\n\n        userInfo(id: $userInfoId) {\n            ...UserInfoOverlay\n            ...UserAllPermissions\n            insertedAt\n\n            delegations(level: Both) {\n                ...DelegationUserProfile\n            }\n\n            formsUsersInfos(level: Organization) {\n                ...FormUserInfoUserProfile\n            }\n\n            user {\n                usersInfos(organizationId: $organizationId) {\n                    id\n                    name\n                    email\n\n                    picture {\n                        url\n                    }\n                }\n            }\n        }\n    }\n}\n",{organizationId:e,userInfoId:t},[Ro.CustomFieldWithConditionFragment,Ro.FormUserOverlayFragment,Ro.UserInfoOverlayFragment,Ro.UserAllPermissionsFragment,Ro.DelegationUserProfileFragment,Ro.FormUserInfoUserProfileFragment]),c=(0,F.useMemo)(()=>{if(a.organization){const e=tz(a.organization.customFields.nodes),t={id:"all",name:n("tous_les_champs_57939"),elements:e};return(0,Zd.A)(a.organization.forms.nodes,e=>e.name).concat([t])}return[]},[a.organization,n]);return l||(0,i.jsx)(lz,{customFields:a.organization.customFields.nodes,delegations:a.organization.userInfo.delegations,forms:c,formsUsersInfos:a.organization?.userInfo.formsUsersInfos??[],getEditUserFormPath:n=>So.COMMUNITY_EDIT_USER_FORM(e,t,n),initialShowNotFilled:o?.showNotFilled??!1,insertedAt:a.organization.userInfo.insertedAt,isWeezeventConnected:!1,profilePrivateFields:a.organization.profilePrivateFields,profilePrivateFieldsUpdate:t=>r({organizationId:e,profilePrivateFields:t}),reload:d,setShowNotFilled:e=>{s({showNotFilled:e})},userInfo:a.organization.userInfo,userPermissions:a.organization.userInfo,usersInfos:a.organization.userInfo.user.usersInfos,volunteerRegistration:null})},uz=e=>{const{translate:t,params:{eventId:n}}=il(),o=Nn(Ku),{mutate:s}=zs(),r=(0,F.useMemo)(()=>qo(),[]),[a,l]=(0,F.useState)(e.assignments.map(e=>({...e,checkInAt:e.checkInAt?.toLocal(),checkOutAt:e.checkOutAt?.toLocal()}))),d=(0,F.useMemo)(()=>a.every(e=>e.checkInAt?.isValid&&e.checkOutAt?.isValid&&e.checkOutAt>e.checkInAt||e.checkInAt?.isValid&&!e.checkOutAt?.isValid||!e.checkInAt?.isValid&&!e.checkOutAt?.isValid),[a]),c=(0,F.useCallback)((e,t,n)=>{l((0,Jc.jM)(i=>{i.forEach(i=>{i.id===e&&(i[t]=n||void 0)})}))},[a,l]);return(0,i.jsx)(nb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"sliders",children:t("mettre_jour_d_54198")}),(0,i.jsx)(Qv,{gap:"4",children:a.map(e=>(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsxs)(fr,{font:"gray800 textSm medium",children:[e.position.name," -"," ",(0,i.jsx)(Pm,{fontWeight:"regular",children:ih(o,e.positionSlot,"",{slot:{includeRange:!0}})})]}),(0,i.jsxs)(Ea,{gap:"6",children:[(0,i.jsx)(ju,{rightIcon:"xmark",value:e.checkInAt,zone:r,onChange:t=>{c(e.id,"checkInAt",t)},onRightIconClick:()=>{c(e.id,"checkInAt",null)}}),(0,i.jsx)(ju,{rightIcon:"xmark",value:e.checkOutAt,zone:r,onChange:t=>{c(e.id,"checkOutAt",t)},onRightIconClick:()=>{c(e.id,"checkOutAt",null)}}),(0,i.jsx)(wl,{shouldParseAsInt:!0,value:e.breakTime,onChange:t=>{c(e.id,"breakTime",t)}})]})]},e.id))}),(0,i.jsx)(Jv,{children:(0,i.jsx)(pl,{disabled:!d,onClick:async()=>{await Promise.all(a.map(e=>s({eventId:n,checkIn:{strategy:me.CheckInOut,breakTime:e.breakTime,checkInAt:e.checkInAt,checkOutAt:e.checkOutAt,positionsSlotsUsersInfosIds:[e.id]}}))),e.onClose(),e.onSuccess()},children:t("mettre_jour_85141")})})]})})},hz=e=>{const{translate:t}=il(),n=Nn(Ku),o=F.useMemo(()=>{const t=Vd(e.psui.position.color);return{background:t[50],color:t[700]}},[e.psui]);return(0,i.jsx)(i.Fragment,{children:e.renderPosition((0,i.jsxs)(Ea,{css:{...o,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsxs)(Ea,{align:"center",css:{fontSize:"10px"},gap:"1",children:[(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[e.psui.positionSlot.name&&(0,i.jsx)(fr,{children:e.psui.positionSlot.name}),(0,i.jsx)(fr,{children:n.toDisplayString(e.psui.positionSlot.range,{hideDate:!0})})]}),e.psui.state===he.CheckedOut&&(0,i.jsx)(Va,{icon:"stopwatch",title:t("d_pointer_25328")}),e.psui.state===he.CheckedIn&&(0,i.jsx)(Va,{icon:"timer",title:t("pointer_80927")})]}),(0,i.jsx)(fr,{fontSize:"textXs",fontWeight:"medium",children:e.psui.position.name})]}),e.psui.position.id)})},mz=e=>{const t=xA(),[n]=nh(e.dayStartTime),o=F.useMemo(()=>Hu(e.assignments.map(e=>({...e,range:e.positionSlot.range})),e.startAt,e.endAt,n),[e.assignments,e.startAt,e.endAt,n]);return(0,i.jsx)(bA,{css:e.featureFlags?.isV4?{bd:!0,overflow:"auto"}:{borderTop:"1px solid $gray200"},date:e.selectedDay,display:t?"week":"day",maxDate:e.endAt,minDate:e.startAt,children:o.map((t,o)=>(0,i.jsx)(vA,{endAt:t.range.start,startAt:t.range.start,startHour:n,children:(0,i.jsx)(hz,{psui:t,renderPosition:e.renderPosition,startHour:n})},o))})},gz=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{hasPositionPermission:s}=Nv(),r=Nn($c),a=Nn(Ng),l=Nn(Ku),{mutate:d}=zs(),c=(0,F.useMemo)(()=>ih(l,e.psui.positionSlot,"",{slot:{includeRange:!0}}),[e.psui]),u=s(db.ASSIGN_MEMBER),h=s(db.READ_POSITION,{positionCategoryId:e.psui.positionCategoryId,positionId:e.psui.position.id});return(0,i.jsxs)(Cc,{children:[(0,i.jsxs)(xc,{align:"center",gap:"3",children:[(0,i.jsx)(Xj,{color:e.psui.position.color,icon:e.psui.position.icon}),(0,i.jsxs)(Ea,{css:{overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(j_,{css:{overflow:"hidden",width:"100%","& > a":{width:"100%"}},to:ao.POSITION({organizationId:n,eventId:o,positionId:e.psui.position.id}),children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.psui.position.name,width:1,children:e.psui.position.name})}),(0,i.jsx)(fr,{color:"gray500",css:{ellipsis:!0},title:c,width:1,children:c})]})]}),(0,i.jsx)(xc,{children:e.psui.state===he.CheckedOut?(0,i.jsx)(Gd,{leftIcon:"clock",children:t("temps_total_79448",a.minutesToHoursMinutesString(e.psui.timeDifferenceMinutes))}):e.psui.state===he.CheckedIn?(0,i.jsx)(Gd,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:t("point_le_1_63576",r.toLocaleString(e.psui.checkInAt.toLocal(),Ho.DateTime))}):(0,i.jsx)(Gd,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:t("non_point_42145")})}),(0,i.jsx)(xc,{children:e.psui.isAutoAssign&&(0,i.jsx)(fr,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(Va,{icon:"check"})})}),(0,i.jsxs)(xc,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(fr,{children:e.psui.createdBy?.name??"-"}),(0,i.jsx)(fr,{color:"gray500",children:r.toLocaleString(e.psui.insertedAt.toLocal(),Ho.DateTime)})]}),(0,i.jsxs)(im,{justify:"end",width:200,children:[h&&(e.psui.state===he.Waiting?(0,i.jsx)(pl,{color:"white",size:"sm",onClick:async()=>{await d({eventId:e.psui.eventId,checkIn:{strategy:me.CheckIn,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reload()},children:t("pointer_80927")}):e.psui.state===he.CheckedIn?(0,i.jsx)(pl,{color:"white",size:"sm",onClick:async()=>{await d({eventId:e.psui.eventId,checkIn:{strategy:me.CheckOut,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reload()},children:t("d_pointer_25328")}):null),(0,i.jsx)(ek,{canCheckIn:h,canDelete:u,psui:e.psui,reloadCheckIn:e.reload,onDelete:e.reload})]})]})},pz=e=>{const{translate:t}=il(),{hasPositionPermission:n}=Nv(),o=n(db.READ_POSITION),s=(0,F.useMemo)(()=>e.assignments.filter(t=>!e.selectedDay?.isValid||t.positionSlot.range.contains(e.selectedDay)||t.positionSlot.range.start.startOf("day").toMillis()===e.selectedDay.startOf("day").toMillis()||t.positionSlot.range.end.startOf("day").toMillis()===e.selectedDay.startOf("day").toMillis()),[e.assignments,e.selectedDay]);return(0,i.jsxs)(mc,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(cc,{children:[(0,i.jsx)(Tc,{children:t("Position")}),(0,i.jsx)(Tc,{children:t("statut_du_point_52451")}),(0,i.jsx)(Tc,{children:t("affect_e_automa_74071")}),(0,i.jsx)(Tc,{children:t("ajout_e_par_71330")}),o&&(0,i.jsx)(Tc,{width:200})]}),s.map(t=>(0,i.jsx)(gz,{psui:t,reload:e.reload},t.id))]})},fz=e=>{const{params:{organizationId:t,eventId:n,userInfoId:o},translate:s}=il(),{isEventAdmin:r}=Nv(),[a,l]=F.useState(k_(e.event.startAt,e.event.endAt)),[d,c]=F.useState(null),[u,h]=F.useState(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{as:"section",css:{background:"white",bd:!0,overflow:"hidden",padding:e.featureFlags?.isV4?"$6 $7 $7 $7":void 0},direction:"column",gap:e.featureFlags?.isV4?"6":void 0,justify:"center",children:[(0,i.jsxs)(Ea,{align:"center",as:"header",gap:"4",css:{padding:e.featureFlags?.isV4?void 0:"$5 $6"},children:[(0,i.jsxs)(fr,{as:"hgroup",css:{flex:"1"},children:[(0,i.jsx)(Qa,{textStyle:"heading",children:e.title}),e.subtitle&&(0,i.jsx)(Ka,{textStyle:"subtitle",children:e.subtitle})]}),(0,i.jsxs)(Ea,{as:"nav",gap:"3",children:["calendar"===e.positionsDisplay&&(0,i.jsx)(_A,{max:e.event.endAt,min:e.event.startAt,value:a,onChange:l}),"list"===e.positionsDisplay&&!e.hideListView&&(0,i.jsx)(fr,{width:160,children:(0,i.jsx)(_u,{rightIcon:"xmark",value:d,onChange:c,onRightIconClick:()=>c(null)})}),!e.hideListView&&e.setPositionsDisplay&&(0,i.jsx)(fr,{width:200,children:(0,i.jsxs)(gu,{value:e.positionsDisplay,onChange:e.setPositionsDisplay,children:[(0,i.jsx)("option",{value:"calendar",children:s("Calendar")}),(0,i.jsx)("option",{value:"list",children:s("List")})]})}),r&&(0,i.jsx)(pl,{to:So.EDIT_ASSIGNMENT(t,n,o),children:s("_diter_les_affe_42283")}),r&&(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(Pd,{placement:"bottom-end",children:(0,i.jsx)(Od,{icon:"circle-check",onClick:()=>h(!0),children:s("mettre_jour_d_54198")})})]})]})]}),"calendar"===e.positionsDisplay?(0,i.jsx)(mz,{assignments:e.assignments,dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,featureFlags:e.featureFlags,renderPosition:e.renderPosition,selectedDay:a,startAt:e.event.startAt}):!e.hideListView&&(0,i.jsx)(pz,{assignments:e.assignments,reload:e.reload,selectedDay:d})]}),uz&&(0,i.jsx)(uz,{assignments:e.assignments,isOpen:u,onClose:()=>h(!1),onSuccess:()=>e.reload()})]})},xz=e=>{const[t,n]=ET("user.positions.display","calendar");return(0,i.jsx)(fz,{...e,positionsDisplay:t,setPositionsDisplay:n})},_z=e=>{const t=Ln(),n=Nn(Ku),{mutate:o,isLoading:s}=Us(),r=h(e.slot.name)?`${e.slot.name} - ${n.toDisplayString(e.slot.range)}`:n.toDisplayString(e.slot.range);return(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{children:e.slot.position.name}),(0,i.jsx)(xc,{children:r}),(0,i.jsx)(xc,{justify:"end",width:200,children:(0,i.jsx)(pl,{color:"white",isLoading:s,size:"sm",onClick:async()=>{await o({eventId:e.eventId,massAssign:{strategy:Je.Add,selecteds:{ids:[e.userInfoId]},positionsSlotsIds:[e.slot.id]}}),e.reload()},children:t("affecter_94255")})})]})},Iz=e=>{const{params:{eventId:t,userInfoId:n},translate:o}=il(),[s,r,a]=Ec(""),[l,d]=(0,F.useState)(0),[c,u]=(0,F.useState)(null),m=(0,F.useCallback)(e=>{u(e),d(0)},[u,d]),{data:g,isLoading:p}=Vn("query UserPositionsAvailablePositionsSlots(\n    $eventId: EventId!\n    $userInfoId: UsersInfoId!\n    $name: String\n    $offset: Int\n    $sort: PositionsSlotsSort\n) {\n    event(id: $eventId) {\n        volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n            availablePositionsSlots(name: $name, limit: 25, offset: $offset, sort: $sort) {\n                nodes {\n                    id\n                    name\n                    range\n\n                    position {\n                        name\n                    }\n                }\n\n                numberOfPages\n                totalCount\n            }\n        }\n    }\n}\n",{eventId:t,userInfoId:n,name:h(r)?r:void 0,offset:l,sort:c},[]);const{numberOfPages:f,totalCount:x}=lu(g.event?.volunteerRegistration.availablePositionsSlots),_=g.event?.volunteerRegistration.availablePositionsSlots.nodes??[];return(0,i.jsx)(kc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:o("rechercher_une_69998"),value:s,onChange:a})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tm,{attribute:rt.Position,setSort:m,sort:c,children:o("nom_de_la_missi_64605")}),(0,i.jsx)(tm,{attribute:rt.Range,setSort:m,sort:c,children:o("cr_neau_11117")}),(0,i.jsx)(Tc,{width:200})]}),numberOfPages:f,offset:l,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):Zo(_)?_.map(n=>(0,i.jsx)(_z,{eventId:t,reload:e.reload,slot:n,userInfoId:e.userInfoId},n.id)):(0,i.jsx)(Cc,{css:{height:"200px"},children:(0,i.jsx)(rk,{title:o("aucune_mission_03533")})}),setOffset:d,title:o("missions_dispon_68881"),totalCount:x})},vz=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=il(),r=Nn(Ku),a=(0,F.useMemo)(()=>{const t=e.volunteerRegistration.preassignPositions.map(e=>({name:e.name,range:e.range?r.toDisplayString(e.range):"-",path:ao.POSITION({organizationId:n,eventId:o,positionId:e.id})})),i=e.volunteerRegistration.preassignPositionsCategories.map(e=>({name:e.name,range:e.range?r.toDisplayString(e.range):"-",path:ao.POSITION_CATEGORY({organizationId:n,eventId:o,positionCategoryId:e.id})}));return t.concat(i)},[e.volunteerRegistration]);return Zo(a)?(0,i.jsx)(kc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:s("nom_de_la_missi_64605")}),(0,i.jsx)(Tc,{children:s("Date")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:a.map((e,n)=>(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(fr,{color:"gray900",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{t.push(e.path)},children:e.name})}),(0,i.jsx)(xc,{children:e.range})]},n))}),setOffset:Bl.A,title:s("pr_affectation_68999"),totalCount:0}):null},bz=e=>{const{translate:t}=il(),n=Nn(Ng);return(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsxs)(Ea,{css:{background:"white",bd:!0,padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(fr,{font:"gray500 textSm medium",children:t("nombre_d_heures_46954")}),(0,i.jsx)(fr,{font:"gray900 displaySm semiBold",children:n.minutesToHoursMinutesString(e.volunteerRegistration.volunteerMinutes)})]}),(0,i.jsxs)(Ea,{css:{background:"white",bd:!0,padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(fr,{font:"gray500 textSm medium",children:t("nombre_de_missi_80367")}),(0,i.jsx)(fr,{font:"gray900 displaySm semiBold",children:e.numberOfAssignments})]})]})},jz=e=>{const{params:{organizationId:t,eventId:n,userInfoId:o},translate:s}=il(),r=(0,F.useMemo)(()=>(0,Zd.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.event]);return(0,i.jsxs)(Ea,{direction:"column",gap:"6",width:1,children:[Zo(r)&&(0,i.jsx)(xz,{assignments:r,event:e.event,reload:()=>{e.reload(),r.length<=1&&e.reloadHeader()},renderPosition:(e,o)=>(0,i.jsx)(La,{style:{width:"100%"},to:ao.POSITION({organizationId:t,eventId:n,positionId:o}),children:e}),subtitle:s("visualisez_tout_59046"),title:s("missions_affect_97811")}),(0,i.jsx)(vz,{volunteerRegistration:e.event.volunteerRegistration}),e.event.hasFormWithPositionDisplay&&(0,i.jsx)(ck,{editPath:So.EDIT_USER_MISSIONS(t,n,o),formsUsersInfos:e.organization.userInfo.formsUsersInfos}),(0,i.jsx)(ub,{positionsPermissions:db.ASSIGN_MEMBER,children:(0,i.jsx)(Iz,{reload:e.reload,userInfoId:o})}),Zo(r)&&(0,i.jsx)(bz,{numberOfAssignments:r.length,volunteerRegistration:e.event.volunteerRegistration})]})},Cz=e=>{const{params:{organizationId:t,eventId:n,userInfoId:o}}=il(),{data:s,loader:r,reload:a}=$s({organizationId:t,eventId:n,userInfoId:o});return r||(0,i.jsx)(jz,{event:s.event,organization:s.organization,reload:a,reloadHeader:e.reload})},yz=()=>{const{params:{organizationId:e,eventId:t,userInfoId:n}}=il(),{data:o,loader:s}=Ls({organizationId:e,eventId:t,userInfoId:n}),{permissions:[r],isLoading:a}=wy(jy({eventId:t,userInfoId:n}));return s||a?s:(0,i.jsx)(i.Fragment,{children:o.event.hasFormWithSlotDisplay&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(bk,{editPath:So.EDIT_USER_SLOTS(e,t,n),eventId:t,formsUsersInfos:o.organization.userInfo.formsUsersInfos,organizationId:e,showEditButton:r,userInfoId:n})})})},kz=e=>{const{params:t,translate:n}=il(),{data:o,isLoading:s,reload:r}=Vn('query UserOverlay($organizationId: OrganizationId!, $eventId: EventId, $userInfoId: UsersInfoId!) {\n    organization(id: $organizationId) {\n        populationField: customFieldBySlug(slug: "population") {\n            name\n        }\n\n        event: eventMaybe(id: $eventId) {\n            isWeezeventConnected\n        }\n\n        userInfo(id: $userInfoId) {\n            ...UserInfoOverlay\n            numberOfComments\n\n            volunteerRegistration(eventId: $eventId) {\n                state\n                accreditationState\n            }\n        }\n    }\n}\n',t,[Ro.UserInfoOverlayFragment]),a=(0,F.useMemo)(()=>o.organization?.userInfo.numberOfComments??0,[o.organization]),l={organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,userInfoId:":userInfoId"};Cd(o.organization?.userInfo?.nameOrEmail||"");const{params:{eventId:d,delegationId:c,organizationId:u,userInfoId:h}}=il(),{permissions:[m,g],isLoading:p}=wy(vy({eventId:d,organizationId:u,userInfoId:h}),((...e)=>({name:"canEmailUpdateFn",args:e}))({delegationId:c,eventId:d,organizationId:u,userInfoId:h})),f=s||p;return(0,i.jsxs)(AC,{children:[(0,i.jsx)(kC,{hideBorder:!0,children:f?(0,i.jsx)(LT,{}):(0,i.jsx)(NT,{accreditationState:o.organization?.userInfo.volunteerRegistration?.accreditationState,assignmentState:o.organization?.userInfo.volunteerRegistration?.state,canEditEmail:g,populationFieldName:o.organization?.populationField.name||"",reload:r,userInfo:o.organization.userInfo})}),(0,i.jsxs)(Vy,{css:{flex:"1"},children:[(0,i.jsxs)(Ly,{css:{px:"$7"},children:[(0,i.jsx)(Ny,{path:kI.MEMBER_INFORMATION(t),children:n("informations_22954")}),e.isEvent&&(0,i.jsx)(Ny,{path:kI.MEMBER_AVAILABILITIES(t),children:n("disponibilit_s_49923")}),e.isEvent&&(0,i.jsx)(Ny,{path:kI.MEMBER_POSITIONS(t),children:n("missions_63972")}),e.showAccreditations&&(0,i.jsx)(Ny,{path:kI.MEMBER_ACCREDITATIONS(t),children:n("accr_ditations_39450")}),e.showActions&&(0,i.jsx)(Ny,{path:kI.MEMBER_ACTIONS(t),children:n("actions_21689")}),m&&(0,i.jsx)(Ny,{path:kI.MEMBER_COMMENTS(t),children:n("commentaires_97857",a)}),(0,i.jsx)(Ny,{basePath:kI.MEMBER_HISTORY(t),path:kI.MEMBER_HISTORY_EVENTS(t),children:n("historique_06296")})]}),(0,i.jsx)(By,{path:kI.MEMBER_INFORMATION(l),children:e.isEvent?(0,i.jsx)(yC,{children:(0,i.jsx)(dz,{})}):(0,i.jsx)(yC,{children:(0,i.jsx)(cz,{})})}),e.isEvent&&(0,i.jsx)(By,{path:kI.MEMBER_AVAILABILITIES(l),children:(0,i.jsx)(yC,{children:(0,i.jsx)(yz,{})})}),e.isEvent&&(0,i.jsx)(By,{path:kI.MEMBER_POSITIONS(l),children:(0,i.jsx)(yC,{children:(0,i.jsx)(Cz,{reload:r})})}),e.showAccreditations&&(0,i.jsx)(By,{path:kI.MEMBER_ACCREDITATIONS(l),children:(0,i.jsx)(yC,{children:(0,i.jsx)($T,{})})}),e.showActions&&(0,i.jsx)(By,{path:kI.MEMBER_ACTIONS(l),children:e.isEvent?(0,i.jsx)(yC,{children:(0,i.jsx)(RT,{})}):(0,i.jsx)(yC,{children:(0,i.jsx)(DT,{})})}),m&&(0,i.jsx)(By,{path:kI.MEMBER_COMMENTS(l),children:(0,i.jsx)(yC,{children:(0,i.jsx)(jT,{showEvent:!0})})}),(0,i.jsx)(By,{path:kI.MEMBER_HISTORY(l),children:(0,i.jsx)(yC,{children:(0,i.jsx)(KT,{isEvent:e.isEvent,isWeezeventConnected:o.organization?.event?.isWeezeventConnected??!1})})})]})]})},Az=()=>{const{hasFeature:e}=nI(),{isEventReader:t,hasPositionPermission:n}=Uv();return(0,i.jsx)(kz,{isEvent:!0,showAccreditations:e(Fe.Accreditation)&&t,showActions:n(db.EDIT_POSITION)})},wz=()=>(0,i.jsx)(kz,{isEvent:!1,showAccreditations:!1,showActions:!0});var Sz=n(6301);function Ez(e=[]){const t=String.fromCharCode(65+(0,Sz.A)(25));return!1===e.includes(t)?t:Ez(e)}function Tz(e=[]){const t=(0,Sz.A)(9);return!1===e.includes(t)?t:Tz(e)}const zz=["Q","O","I","L"],$z=[0,1];function Oz(e=10){const t=(0,vc.A)(0,e-1).map(()=>{return e=zz,t=$z,0===(0,Sz.A)(1)?Ez(e):Tz(t).toString();var e,t}).join("");return`${Ez(zz)}${t}`}const Rz=e=>{const t=Ln(),n=`formKeyToTeamCode.f${e.form.id}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{font:"gray900 textLg medium",children:"Équipe"}),(0,i.jsx)($u,{height:"4"}),(0,i.jsx)(Sl,{hint:t("d_finissez_votr_19710"),label:t("code_quipe_14296"),name:n,rightIcon:"arrows-rotate",onRightIconClick:()=>{e.change(n,Oz())}}),(0,i.jsx)(Pa,{height:"9"})]})},Pz=e=>{const{history:t,params:{eventId:n},translate:o}=il(),s=F.useMemo(()=>(0,Zd.A)(e.forms,e=>e.name.toLowerCase()),[e.forms]);return(0,i.jsxs)(Ea,{css:{overflow:"hidden"},direction:"column",height:1,width:1,children:[(0,i.jsx)(fr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsxs)(Ea,{align:"center",css:{margin:"auto",overflowY:"auto"},direction:"column",height:1,width:1,children:[e.banner,(0,i.jsxs)(Ea,{css:{padding:"$6 $4",width:"100%","@tablet":{padding:"$6 $8"},"@desktop":{padding:"$7",width:n?"100%":"$container"}},direction:"column",children:[(0,i.jsx)(fr,{font:"gray900 displayXs semiBold",children:e.title}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Vy,{children:[(0,i.jsxs)(Ly,{children:[s.map(t=>(0,i.jsx)(Ny,{path:e.getTabPath(t.id),children:t.name},t.id)),e.extraTabs]}),e.children]})]})]})}),(0,i.jsx)(Ea,{css:{boxShadow:"0px 0px 0px 1px rgba(0, 0, 0, 0.03), 0px 3px 6px rgba(0, 0, 0, 0.04), 0px 4px 16px rgba(0, 0, 0, 0.08)",padding:"$4 $7"},justify:"center",children:(0,i.jsxs)(Ea,{align:"center",css:{width:"100%","@desktop":{width:n?"100%":"$container"}},gap:"4",children:[(0,i.jsx)(pl,{isLoading:e.isLoading,onClick:e.handleSubmit,children:o("mettre_jour_85141")}),(0,i.jsx)(fr,{color:"gray700",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>t.goBack(e.returnPathFallback),children:o("annuler_48254")})]})})]})},Dz=({banner:e,change:t,customFields:n,formIdToInsertedAt:o,forms:s,getEditUserFormPath:r,handleSubmit:a,isLoading:l,returnPathFallback:d,showAllAndPrivate:c,showIsFilled:u,userInfo:h,values:m})=>{const{translate:g,params:{organizationId:p}}=il(),f=Nn($c),x=F.useMemo(()=>n.filter(e=>e.isPrivate).map(e=>({id:N(),elementType:Ve.Field,customField:e,hasCondition:!1,conditionValue:!1})),[n]),_=F.useMemo(()=>tz(n),[n]),I=F.useCallback((e,t)=>(0,i.jsxs)(i.Fragment,{children:[0!==t&&(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{font:"gray900 textLg medium",children:e}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(zu,{direction:"horizontal"})]}),[]);return(0,i.jsxs)(Pz,{banner:e,extraTabs:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ny,{path:r("all"),children:g("tous_les_champs_57939")}),(0,i.jsx)(Ny,{path:r("private"),children:g("champs_priv_s_84670")})]}):void 0,forms:s,getTabPath:r,handleSubmit:a,isLoading:l,returnPathFallback:d,title:g("mise_jour_de_17055",h.nameOrEmail),children:[s.map(e=>{const n=o[e.id];return(0,i.jsxs)(By,{path:r(e.id),children:[(0,i.jsx)(Pa,{height:"7"}),u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"4",children:[(0,i.jsx)(fr,{css:{flex:"1"},font:"gray800 textMd semiBold",children:g("statut_du_formu_08195")}),(0,i.jsx)(fr,{width:320,children:(0,i.jsxs)(gu,{shouldParseAsBoolean:!0,state:n?"disabled":"active",value:m.filledFormsIds.includes(e.id),onChange:n=>{t("filledFormsIds",Jo(m.filledFormsIds,e.id,n))},children:[(0,i.jsx)("option",{value:"true",children:n?g("rempli_le_1_29292",f.toLocaleString(n,Ho.DateTime)):g("rempli_78674")}),(0,i.jsx)("option",{value:"false",children:g("non_rempli_80877")})]})})]}),(0,i.jsx)(Pa,{height:"6"}),e.areTeamsAllowed&&(0,i.jsx)(Rz,{change:t,form:e})]}),(0,i.jsx)(RE,{change:t,elements:e.elements,organizationId:p,prefix:"userInfo.fields.",renderSection:I,values:m.userInfo.fields})]},e.id)}),c&&(0,i.jsxs)(By,{path:r("all"),children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(RE,{change:t,elements:_,organizationId:p,prefix:"userInfo.fields.",renderSection:I,values:m.userInfo.fields})]}),c&&(0,i.jsxs)(By,{path:r("private"),children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(RE,{change:t,elements:x,organizationId:p,prefix:"userInfo.fields.",renderSection:I,values:m.userInfo.fields})]})]})},Fz=[Ne.Address,Ne.Text,Ne.Textarea,Ne.Time],Mz=({banner:e,customFields:t,country:n,formIdToInsertedAt:o,formIdToTeamCode:s,forms:r,from:a,getEditUserFormPath:l,showAllAndPrivate:d,showIsFilled:c,userInfo:u})=>{const{organizationId:h,eventId:m,delegationId:g}=Wn(),p=Gn(),f=Nn(EE),{mutate:x,isLoading:_}=function(e={}){return Un("mutation UserInfoUpdate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $delegationId: DelegationId\n    $userId: UserId!\n    $userInfo: UsersInfoInput!\n    $filledFormsIds: [FormId!]\n    $formKeyToTeamCode: JSON\n) {\n    userInfoUpdate(\n        organizationId: $organizationId\n        eventId: $eventId\n        delegationId: $delegationId\n        userId: $userId\n        userInfo: $userInfo\n        filledFormsIds: $filledFormsIds\n        formKeyToTeamCode: $formKeyToTeamCode\n    ) {\n        id\n    }\n}\n",e)}(),I=F.useMemo(()=>Object.keys(o).map(e=>parseInt(e,10)),[o]),v=F.useMemo(()=>Object.fromEntries(Object.entries(s).map(([e,t])=>[`f${e}`,t])),[s]);return(0,i.jsx)(dl,{direction:"column",height:1,initialValues:{filledFormsIds:I,formKeyToTeamCode:v,userInfo:f.userInfoUpdateInputDefault(u,t,{checkboxDefaultEmpty:!0,countryCode:n})},render:({form:n,handleSubmit:s,values:p})=>(0,i.jsx)(Dz,{banner:e,change:n.change,customFields:t,formIdToInsertedAt:o,forms:r,getEditUserFormPath:l,handleSubmit:s,isLoading:_,returnPathFallback:"app"===a?m?So.VOLUNTEERS(h,m):fi.COMMUNITY_USERS({organizationId:h}):g?to.DELEGATION_MEMBERS({organizationId:h,eventId:m,delegationId:g}):kI.MEMBER({organizationId:h,eventId:m,userInfoId:u.id}),showAllAndPrivate:d,showIsFilled:c,userInfo:u,values:p}),width:1,onSubmit:async e=>{const n=e.userInfo.fields;t.forEach(e=>{Fz.includes(e.fieldType)&&!n[e.slug]?n[e.slug]="":e.fieldType!==Ne.File||n[e.slug]||(n[e.slug]=null)}),await x({organizationId:h,eventId:m,userId:u.userId,userInfo:{id:u.id,fields:e.userInfo.fields},filledFormsIds:c?e.filledFormsIds:void 0,formKeyToTeamCode:e.formKeyToTeamCode}),p.goBack("app"===a?So.VOLUNTEERS(h,m):kI.MEMBER({organizationId:h,eventId:m,userInfoId:u.id}))}})},Nz=({country:e,data:t,forms:n,getEditFormPath:o})=>{const{params:{organizationId:s,eventId:r,delegationId:a,userInfoId:l}}=il(),d=(0,F.useMemo)(()=>t.organization?.userInfo.formsUsersInfos??[],[t.organization]),c=(0,F.useMemo)(()=>d.map(e=>e.formId),[d]),u=(0,F.useMemo)(()=>Object.fromEntries(d.map(e=>[e.formId,e.insertedAt])),[d]),h=(0,F.useMemo)(()=>r?Object.fromEntries(d.map(e=>[e.formId,e.teamCode])):{},[r,d]);return(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:[So.EDIT_USER_FORM(":organizationId",":eventId",":userInfoId",":formId"),So.EDIT_USER_DELEGATION_FORM(":organizationId",":eventId",":delegationId",":userInfoId",":formId"),So.COMMUNITY_EDIT_USER_FORM(":organizationId",":userInfoId",":formId"),So.COMMUNITY_EDIT_USER_DELEGATION_FORM(":organizationId",":delegationId",":userInfoId",":formId")],children:(0,i.jsx)(Mz,{country:e,customFields:t.organization.customFields.nodes,formIdToInsertedAt:u,formIdToTeamCode:h,forms:n,from:"app",getEditUserFormPath:o,showAllAndPrivate:!0,showIsFilled:!0,userInfo:t.organization.userInfo})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:r?a?So.EDIT_USER_DELEGATION_FORM(s,r,a,l,n.length>0?n[0].id:"all"):So.EDIT_USER_FORM(s,r,l,c?.[0]??"all"):a?So.COMMUNITY_EDIT_USER_DELEGATION_FORM(s,a,l,n.length>0?n[0].id:"all"):So.COMMUNITY_EDIT_USER_FORM(s,l,c?.[0]??"all"),replace:!0})})]})},Lz=()=>{const{params:{organizationId:e,eventId:t,delegationId:n,userInfoId:o}}=il(),s=Gn(),{data:r,loader:a}=Vn("query UpdateUserInfosEvent(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $userInfoId: UsersInfoId!\n) {\n    organization(id: $organizationId) {\n        customFields(variety: UserInfo) {\n            nodes {\n                ...CustomFieldWithCondition\n\n                category {\n                    name\n                }\n            }\n        }\n\n        userInfo(id: $userInfoId) {\n            id\n            isEditable\n            userId\n            email\n            nameOrEmail\n            fields\n\n            formsUsersInfos(level: Event, eventId: $eventId) {\n                formId\n                insertedAt\n                teamCode\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        country\n\n        forms {\n            nodes {\n                ...UpdateUserForm\n            }\n        }\n    }\n}\n",{organizationId:e,eventId:t,userInfoId:o},[Ro.CustomFieldWithConditionFragment,Ro.UpdateUserFormFragment]);return a||(r.organization.userInfo.isEditable??1)||s.push(So.DASHBOARD(e,t)),a||(0,i.jsx)(Nz,{country:r.event.country,data:r,forms:n?r.event.forms.nodes.filter(e=>Zo(e.delegationsIds)&&e.delegationsIds.includes(n)):r.event.forms.nodes,getEditFormPath:i=>n?So.EDIT_USER_DELEGATION_FORM(e,t,n,o,i):So.EDIT_USER_FORM(e,t,o,i)})},Bz=()=>{const{organizationId:e,delegationId:t,userInfoId:n}=Wn(),{data:o,loader:s}=Vn("query UpdateUserInfosOrganization($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n    organization(id: $organizationId) {\n        country\n\n        customFields(variety: UserInfo) {\n            nodes {\n                ...CustomFieldWithCondition\n\n                category {\n                    name\n                }\n            }\n        }\n\n        forms(level: Organization) {\n            nodes {\n                ...UpdateUserForm\n            }\n        }\n\n        userInfo(id: $userInfoId) {\n            id\n            userId\n            email\n            nameOrEmail\n            fields\n\n            formsUsersInfos(level: Organization) {\n                formId\n                insertedAt\n                teamCode\n            }\n        }\n    }\n}\n",{organizationId:e,userInfoId:n},[Ro.CustomFieldWithConditionFragment,Ro.UpdateUserFormFragment]);return s||(0,i.jsx)(Nz,{country:o.organization.country,data:o,forms:t?o.organization.forms.nodes.filter(e=>Zo(e.delegationsIds)&&e.delegationsIds.includes(t)):o.organization.forms.nodes,getEditFormPath:i=>t?So.COMMUNITY_EDIT_USER_DELEGATION_FORM(e,t,n,i):So.COMMUNITY_EDIT_USER_FORM(e,n,i)})};var Vz=n(6632),Uz=n(4809),Wz=n.n(Uz);const Gz=2e7;let Hz=class extends zl{constructor(e){super(e)}csvDocumentInputDefault(e){return{key:"",name:"",acl:"",formats:{timeFormat:"HH:mm",dateFormat:Mo,datetimeFormat:"yyyy-MM-dd HH:mm",...e}}}schema(){const e=this.t("le_document_est_86403");return l.Ik().shape({acl:l.Yj().required(e),delimiter:l.Yj().optional().test("is-valid-value",this.t("delimiter_value_52108"),e=>!e||!Wz().BAD_DELIMITERS.includes(e)),key:l.Yj().required(e).test("is-a-csv",this.t("le_fichier_n_es_33134"),e=>RI(zI(e).extension)===OI.Csv),name:l.Yj().required(e),newline:l.Yj().optional().test("is-valid-value",this.t("newline_charact_88066"),e=>!e||["\r","\n","\r\n"].includes(e)),quoteChar:l.Yj().optional(),formats:l.Ik().shape({timeFormat:l.Yj().optional(),dateFormat:l.Yj().optional(),datetimeFormat:l.Yj().optional()}),file:l.gl().test("is-not-empty",this.t("the_file_is_emp_77243"),e=>!e||e.size>0).test("is-not-too-big",this.t("le_fichier_est_17522"),e=>!e||e.size=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],Hz);const qz=({formats:e,file:t,ids:n,localStorageKeyPrefix:o,onChange:s})=>{const{params:{organizationId:r},translate:a}=il(),{data:l,loader:d}=Ts({organizationId:r}),c=(0,F.useMemo)(()=>{const e=localStorage.getItem(El[`${o}_FORMATS`]);return e?JSON.parse(e):e},[o]),u=(0,F.useMemo)(()=>{const t=t=>e?.[t]===l.organization?.[t]?(0,i.jsx)(Gd,{css:{textTransform:"uppercase"},children:a("from_organisati_25675")}):c?.[t]===e?.[t]&&(0,i.jsx)(Gd,{css:{textTransform:"uppercase"},children:a("from_saved_22150")});return{datetime:t("datetimeFormat"),date:t("dateFormat"),timeBadge:t("timeFormat")}},[l.organization,c,e]);return d||(0,i.jsxs)(Cm,{...n,hideToggle:!0,initialIsOpen:!0,subtitle:a("s_lectionnez_vo_125161",Hk.bytesToMegabytes(Gz)),title:a("votre_fichier_d_51776"),children:[(0,i.jsx)(oj,{...n,accept:HI.Csv,acl:"private",organizationId:r,prefix:"input.csv.",withFileField:!0,onChange:s}),(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{direction:"column",gap:"4",children:[(0,i.jsxs)(Ea,{gap:"2",align:"center",children:[(0,i.jsx)(fr,{font:"gray900 textMd medium",children:a("param_tres_du_f_01675")}),c&&(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(pl,{disabled:!c,color:"white",leftIcon:"arrows-rotate",size:"sm",onClick:()=>{localStorage.removeItem(El[`${o}_FORMATS`]),window.location.reload()}})}),(0,i.jsx)(am,{placement:"top",children:a("reset_defaults_72577")})]})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"6",children:[(0,i.jsx)(fr,{width:1,children:(0,i.jsx)(Sl,{description:a("you_must_set_th_73159"),label:a("set_delimiter_20565"),name:"input.csv.delimiter",state:t?"disabled":void 0})}),(0,i.jsxs)(Ea,{direction:"row",gap:"2",children:[(0,i.jsx)(fr,{width:1,children:(0,i.jsx)(Sl,{description:a("leave_blank_if_02058"),label:a("set_quote_chara_43496"),name:"input.csv.quoteChar",state:t?"disabled":void 0})}),(0,i.jsx)(fr,{width:1,children:(0,i.jsxs)(lj,{description:a("leave_blank_to_11865"),label:a("set_newline_cha_37738"),name:"input.csv.newline",state:t?"disabled":void 0,children:[(0,i.jsx)("option",{value:void 0,children:"Auto-detect"}),(0,i.jsx)("option",{value:"\r",children:"\\r"}),(0,i.jsx)("option",{value:"\n",children:"\\n"}),(0,i.jsx)("option",{value:"\r\n",children:"\\r\\n"})]})})]}),(0,i.jsxs)(Ea,{direction:"row",gap:"2",children:[(0,i.jsx)(fr,{width:1,children:(0,i.jsx)(Sl,{label:(0,i.jsxs)(Ea,{gap:"2",align:"center",children:[a("format_d_heure_46798"),u.timeBadge]}),name:"input.csv.formats.timeFormat",state:t?"disabled":void 0})}),(0,i.jsx)(fr,{width:1,children:(0,i.jsx)(Sl,{label:(0,i.jsxs)(Ea,{gap:"2",align:"center",children:[a("format_de_date_82059"),u.date]}),name:"input.csv.formats.dateFormat",state:t?"disabled":void 0})}),(0,i.jsx)(fr,{width:1,children:(0,i.jsx)(Sl,{label:(0,i.jsxs)(Ea,{gap:"2",align:"center",children:[a("format_de_date_24474"),u.datetime]}),name:"input.csv.formats.datetimeFormat",state:t?"disabled":void 0})})]})]})]})]})},Yz=e=>{const t=Ln(),n=(0,F.useMemo)(()=>[{id:-1,name:t("default_fields_04920"),fields:Object.entries(e.defaultFields).map(([e,n])=>({name:h(t(e))?t(e):e,slug:n,id:Math.random()}))},...e.categories].map(t=>({...t,fields:(0,Zd.A)(t.fields,t=>{const n=t.name.toLowerCase(),i=t.slug.toLowerCase(),o=e.column.name.toLowerCase(),s=Math.min(f(n,o),f(i,o));return s{const o=Object.values(e.defaultFields).find(e=>e===t);return o&&e.requiredFieldSlugs.includes(o)?(0,i.jsx)("strong",{children:n}):n},[e.defaultFields,e.requiredFieldSlugs]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wl,{state:"disabled",value:e.column.name,onChange:()=>{}}),(0,i.jsx)(Va,{icon:"arrow-right"}),(0,i.jsx)(Sm,{isSearchVisible:!0,multiple:!1,name:`input.mappings.${e.column.index}`,placeholder:t("s_lectionnez_un_12007"),renderValue:o,children:n.map(t=>(0,i.jsx)("optgroup",{label:t.name,children:t.fields.map(t=>(0,i.jsx)("option",{style:{fontWeight:e.requiredFieldSlugs.includes(t.slug)?"bold":"inherit",opacity:e.values.includes(t.slug)?.5:1},value:t.slug,children:t.name},t.id))},t.id))})]})},Kz=ar("div",{display:"grid",gridTemplateColumns:"[column] 1fr auto [field] 1fr",gap:"$4 $5",alignItems:"center"}),Zz=ar("div",{color:"$gray800",gridColumn:"column",fontWeight:"$medium"}),Xz=ar("div",{color:"$gray800",gridColumn:"field",fontWeight:"$medium"}),Jz=({categories:e,columns:t,defaultFields:n,requiredFieldSlugs:o,values:s})=>{const r=Ln();return(0,i.jsxs)(Kz,{children:[(0,i.jsx)(Zz,{children:r("titres_de_vos_c_31388")}),(0,i.jsx)(Xz,{children:r("champs_de_formu_64126")}),t.map((t,r)=>(0,i.jsx)(Yz,{categories:e,column:{name:t,index:r},defaultFields:n,requiredFieldSlugs:o,values:s},r))]})},Qz=e=>{const t=Ln();return(0,i.jsxs)(Cm,{hideToggle:!0,initialIsOpen:!0,subtitle:t("_ditez_la_corre_24969"),title:t("liste_des_champ_40104"),children:[e.modeSelection,(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Jz,{...e})]})},e$=({file:e,onToggle:t,...n})=>{const o=Ln();return(0,i.jsx)(Cm,{initialIsOpen:Zo(n.values)??!1,subtitle:o("d_finissez_dire_31742"),title:o("attribution_d_u_50979"),onToggle:t,children:(0,i.jsx)(hj,{name:"input.presets",...n})})},t$=(e,t)=>{switch(t.type){case"LOADING":return{isLoading:!0,columns:void 0,errors:void 0};case"SUCCESS":return{isLoading:!1,columns:t.columns,errors:void 0};case"ERROR":return{isLoading:!1,columns:void 0,errors:t.errors}}};function n$({additionalCategories:e,customFields:t,defaultFields:n,file:o,form:s,modeSelection:r,onToggle:a,requiredFieldSlugs:l,values:d}){const{isLoading:c,columns:u,errors:h}=((e,t)=>{const[n,i]=(0,F.useReducer)(t$,{isLoading:!0,columns:void 0,errors:void 0});return(0,F.useEffect)(()=>{i({type:"LOADING"}),(0,Uz.parse)(e,{preview:1,...t,complete:({data:e,errors:t})=>{t.filter(e=>"UndetectableDelimiter"!==e.code).length?i({type:"ERROR",errors:t}):i({type:"SUCCESS",columns:e[0]})}})},[e]),n})(o,{delimiter:d.input.csv.delimiter??void 0,quoteChar:d.input.csv.quoteChar??void 0,newline:d.input.csv.newline??void 0}),m=F.useMemo(()=>{const n=Object.entries((0,Kd.A)(t,e=>e.customFieldCategoryId)).map(([e,t])=>{const n=t[0];return{id:n.customFieldCategoryId,name:n.customFieldCategoryName,fields:t}});return e?n.concat(e):n},[e,t]);return c||h?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qz,{categories:m,columns:u,defaultFields:n,modeSelection:r,requiredFieldSlugs:l,values:d.input.mappings}),Zo(t)&&(0,i.jsx)(e$,{change:s.change,customFields:t,file:o,values:d.input.presets,onToggle:a})]})}const i$=e=>!!e.getFieldState("input.csv.key")?.valid&&!!e.getFieldState("input.csv.file")?.valid,o$=(0,Vz.A)(({ImportInputService:e,columns:t,customFields:n})=>t.map(t=>Object.keys(e.IMPORT_COLUMNS_DEFAULT).map(e=>e.toLowerCase()).includes(t.toLowerCase())?e.IMPORT_COLUMNS_DEFAULT[Object.keys(e.IMPORT_COLUMNS_DEFAULT).find(e=>e.toLowerCase()===t.toLowerCase())]:n.find(e=>e.slug.toLowerCase()===t.toLowerCase()||e.name.toLowerCase()===t.toLowerCase())?.slug??null)),s$=(e,t)=>e.IMPORT_COLUMNS_REQUIRED(t.mode).every(e=>t.mappings.includes(e)),r$=(e,t,n)=>t.formatListValues(e.IMPORT_COLUMNS_REQUIRED(n.mode).filter(e=>!n.mappings.includes(e)),"conjunction"),a$=({ImportInputService:e,additionalCategories:t,centeredContainerRef:n,closePath:o,createUpdateKey:s,customFields:r,form:a,handleSubmit:l,importTagPrefix:d,isTagInputDisabled:c=!1,itemName:u,localStorageKeyPrefix:m,showModeSelection:g=!0,submitting:p,title:f,values:x})=>{const{params:{organizationId:_},translate:I}=il(),v=bl(),b=Nn(Dn),j=F.useRef(null),C=()=>Fo.c9.now().toFormat(Lo),y=()=>(a.change("input.tag",`${d}-csv-${C()}`),setInterval(()=>a.change("input.tag",`${d}-csv-${C()}`),1e3)),k=()=>clearInterval(j.current);F.useEffect(()=>(j.current=y(),()=>k()),[j]);const A=F.useCallback(t=>{a.change("input.tag",`${d}-csv-${Fo.c9.now().toFormat(Lo)}`),(0,Uz.parse)(t,{delimiter:x.input.csv.delimiter,preview:1,newline:x.input.csv.newline,quoteChar:x.input.csv.quoteChar,complete:({data:t,errors:n})=>{let i;if(!n.length){const n=t[0],o=o$({ImportInputService:e,columns:n,customFields:r});try{i=JSON.parse(localStorage.getItem(El[`${m}_MAPPINGS`])??"{}")}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}a.change("input.mappings",n.map((e,t)=>void 0!==i[e]?i[e]:o[t]))}}});try{a.change("input.presets",JSON.parse(localStorage.getItem(El[`${m}_PRESETS`](_))??"[]")),g&&a.change("input.mode",localStorage.getItem(El[`${m}_MODE`])??qe.CreateUpdate)}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}},[r,a,x]);return(0,i.jsx)(bm,{button:(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(pl,{disabled:!(x.input.csv.file&&s$(e,x.input)),isLoading:p,onClick:()=>{k(),l()},children:I("importer_la_lis_12866")})}),(!x.input.csv.file||!s$(e,x.input))&&(0,i.jsx)(am,{placement:"top",children:x.input.csv.file?I("you_have_not_ma_46806",r$(e,b,x.input)):I("the_file_is_emp_77243")})]}),category:f,color:"dark",fallbackClosePath:o,title:I("nouvel_import_48306"),children:(0,i.jsxs)(Im,{ref:n,children:[a.getState().submitSucceeded&&(0,i.jsx)(Lw,{}),(0,i.jsx)(sl,{errorId:v.errorId}),(0,i.jsxs)(Ea,{direction:"column",gap:"5",children:[(0,i.jsx)(qz,{formats:x.input.csv.formats,file:x.input.csv.file,ids:v,localStorageKeyPrefix:m,onChange:A}),x.input.csv?.file&&i$(a)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n$,{additionalCategories:t,customFields:r,defaultFields:e.IMPORT_COLUMNS_DEFAULT,file:x.input.csv.file,form:a,modeSelection:g?(0,i.jsx)(i.Fragment,{children:x.input.mode&&(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:I("que_souhaitez_v_33936")}),(0,i.jsx)(vv,{name:"input.mode",value:qe.Create,children:I("add_one_1_per_91911",u?.singular,s?.name)}),(0,i.jsx)(vv,{name:"input.mode",value:qe.CreateUpdate,children:I("add_one_1_per_73704",u?.singular,s?.name)}),(0,i.jsx)(vv,{name:"input.mode",value:qe.Update,children:I("do_not_add_any_50401",u?.plural)})]})}):void 0,requiredFieldSlugs:e.IMPORT_COLUMNS_REQUIRED(x.input.mode),values:x,onToggle:e=>{if(!x.input.csv.file)throw new Error("No file in input!");try{e?a.change("input.presets",JSON.parse(localStorage.getItem(El[`${m}_PRESETS`](_))??"[]")):a.change("input.presets",[])}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}}}),(0,i.jsxs)(Cm,{hideToggle:!0,initialIsOpen:!0,subtitle:I(c?"your_imported_i_20879":"by_default_you_75833"),title:I("identify_your_i_87636"),children:[(0,i.jsx)(Sl,{label:I("your_import_tag_41852"),name:"input.tag",state:"disabled"}),!c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:2}),(0,i.jsx)(wl,{label:I("specify_an_impo_41868"),onChange:e=>{h(e)?(j.current&&k(),a.change("input.tag",`${d}-csv-${e}`)):(a.change("input.tag",`${d}-csv-${C()}`),j.current=y())}})]})]})]})]})]})})},l$=({checkImport:e,mutate:t,...n})=>{const{params:{organizationId:o,eventId:s,delegationId:r},translate:a}=il(),l=Nn(Dn),{data:d,loader:c}=Ts({organizationId:o}),u=qn(),m=Nn(n.ImportInputService),g=Nn(za),p=F.useRef(null),f=F.useMemo(()=>{try{const e={dateFormat:d.organization.dateFormat,datetimeFormat:d.organization.datetimeFormat,timeFormat:d.organization.timeFormat},t=JSON.parse(u.getItem(El[`${n.localStorageKeyPrefix}_FORMATS`])??"{}");return{...e,...t}}catch{return null}},[d.organization]);return c||(0,i.jsx)(dl,{customErrorRef:p,height:1,initialValues:{input:m.default(f).input},mutators:{setValue:([e,t],n,{changeValue:i})=>i(n,e,()=>t)},render:({form:e,handleSubmit:t,submitting:o,values:s})=>(0,i.jsx)(a$,{centeredContainerRef:p,form:e,handleSubmit:t,submitting:o,values:s,...n}),validate:g.validateForForm(m.schema()),onSubmit:async({input:i})=>{if(!s$(n.ImportInputService,i))return{[Ta.Ym]:a("you_have_not_ma_46806",r$(n.ImportInputService,l,i))};(e=>{const t=e.csv.file;if(!t)throw new Error("No file in input!");(0,Uz.parse)(t,{delimiter:e.csv.delimiter,preview:1,newline:e.csv.newline,quoteChar:e.csv.quoteChar,complete:({data:t,errors:i})=>{if(!i.length)try{const i=t[0],o=o$({ImportInputService:n.ImportInputService,columns:i,customFields:n.customFields}),s=JSON.parse(u.getItem(El[`${n.localStorageKeyPrefix}_MAPPINGS`])??"{}"),r={};for(const[t,n]of e.mappings.entries()){const e=i[t];n?r[e]=n:delete s[e],h(o[t])&&!r[e]&&(r[e]=null)}u.setItem(El[`${n.localStorageKeyPrefix}_MAPPINGS`],JSON.stringify({...s,...r}))}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}}});try{const t=JSON.parse(u.getItem(El[`${n.localStorageKeyPrefix}_PRESETS`](o))??"[]");u.setItem(El[`${n.localStorageKeyPrefix}_PRESETS`](o),JSON.stringify([...new Map([...t,...e.presets].map(e=>[e.customFieldId,e])).values()])),u.setItem(El[`${n.localStorageKeyPrefix}_FORMATS`],JSON.stringify(e.csv.formats?Object.fromEntries(Object.entries(e.csv.formats).filter(([e,t])=>h(t))):{})),n.showModeSelection&&u.setItem(El[`${n.localStorageKeyPrefix}_MODE`],e.mode)}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}})(i);const d=(e=>{const t={...e.csv};return delete t.file,{...e,csv:t}})(i);try{const{jobId:n}=await t({organizationId:o,eventId:s,delegationId:r,input:d});p.current&&(p.current.scrollTop=0),e(o,n)}catch{}}})};var d$;let c$=class extends zl{static{d$=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={Id:"id"};static IMPORT_COLUMNS_REQUIRED=e=>e===qe.Update?[d$.IMPORT_COLUMNS_DEFAULT.Id]:[];constructor(e,t){super(t),this.csvInputService=e}default(e){return{input:{csv:this.csvInputService.csvDocumentInputDefault(e),mode:qe.CreateUpdate}}}schema(){return l.Ik().shape({input:l.Ik().shape({csv:this.csvInputService.schema(),mode:l.Yj().oneOf(dn,this.t("le_mode_d_impor_75706"))})})}};c$=d$=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hz,Dn])],c$);let u$=class extends c${csvInputService;default(e){return{input:{csv:this.csvInputService.csvDocumentInputDefault(e),mappings:[],presets:[],mode:qe.CreateUpdate,tag:""}}}schema(){return l.Ik().shape({input:l.Ik().shape({csv:this.csvInputService.schema(),mappings:l.YO().of(l.Yj().nullable()),presets:l.YO().of(l.Ik().shape({customFieldId:l.ai().positive(this.t("le_choix_du_typ_07079")),value:l.gl().when("customFieldId",{is:e=>e>-1,then:e=>e.required(this.t("la_valeur_du_ch_65599"))})})),mode:l.Yj().oneOf(dn,this.t("le_mode_d_impor_75706")),tag:l.Yj().required("a_tag_must_be_s_23274")})})}constructor(e,t){super(e,t),this.csvInputService=e}};u$=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hz,Dn])],u$);var h$;let m$=class extends u${static{h$=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...u$.IMPORT_COLUMNS_DEFAULT,Email:"email",TicketId:"ticketId"};static IMPORT_COLUMNS_REQUIRED=e=>e===qe.Update?[h$.IMPORT_COLUMNS_DEFAULT.Id]:[h$.IMPORT_COLUMNS_DEFAULT.Email];constructor(e,t){super(e,t),this.csvInputService=e}};m$=h$=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hz,Dn])],m$);const g$=({accreditations:e,closePath:t,customFields:n})=>{const o=Ln(),s=Nn($c),{mutate:r}=function(e={}){return Un("mutation VolunteersImport(\n    $eventId: EventId\n    $organizationId: OrganizationId!\n    $delegationId: DelegationId\n    $input: MappableImportInput!\n) {\n    jobId: volunteersImport(\n        eventId: $eventId\n        organizationId: $organizationId\n        delegationId: $delegationId\n        input: $input\n    )\n}\n",e)}(),{checkVolunteersImport:a}=Yv(),l=(0,F.useMemo)(()=>e.map(e=>({...e,fields:e.slots.map(t=>({id:t.id,slug:`accreditation_slot_${t.id}`,name:ph(s,t,e.name,{accreditation:{includeNameAtEnd:!0}})}))})),[e]);return(0,i.jsx)(l$,{ImportInputService:m$,additionalCategories:l,checkImport:a,closePath:t,createUpdateKey:{slug:"email",name:o("email_address_53451")},customFields:n,importTagPrefix:"volunteers",itemName:{singular:o("membre_53723"),plural:o("membres_67337")},localStorageKeyPrefix:"VOLUNTEERS_IMPORT",mutate:r,title:o("import_de_membr_48618")})},p$=()=>{const{params:{organizationId:e}}=il(),{data:t,loader:n}=Ia({organizationId:e,variety:Ie.UserInfo});return n||(0,i.jsx)(g$,{accreditations:[],closePath:fi.COMMUNITY_USERS({organizationId:e}),customFields:t.organization.customFields.nodes})},f$=()=>{const{params:{organizationId:e,eventId:t}}=il(),{data:n,loader:o}=Vn("query EventVolunteersImportInfos(\n    $organizationId: OrganizationId!\n    $variety: CustomFieldVariety!\n    $eventId: EventId!\n) {\n    organization(id: $organizationId) {\n        customFields(\n            variety: $variety\n            fieldTypes: [\n                Address\n                Checkbox\n                Country\n                Date\n                Datetime\n                Language\n                Nationality\n                Number\n                Phone\n                Select\n                Sex\n                Text\n                Textarea\n                Time\n                Validation\n            ]\n        ) {\n            nodes {\n                ...CustomFieldImport\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        accreditations {\n            nodes {\n                ...AccreditationImport\n            }\n        }\n    }\n}\n",{organizationId:e,variety:Ie.UserInfo,eventId:t},[Ro.CustomFieldImportFragment,Ro.AccreditationImportFragment]);return o||(0,i.jsx)(g$,{accreditations:n.event.accreditations.nodes,closePath:So.VOLUNTEERS(e,t),customFields:n.organization.customFields.nodes})};let x$=class extends zl{constructor(e){super(e)}workflowInputDefault(e){return{name:e?.name??"",state:e?.state??Dt.Active,frequency:e?.frequency??Ot.Every10Minutes,trigger:e?.trigger??Ft.VolunteersSegment,action:e?.action??$t.SendCampaign,data:(0,Lv.A)({recipients:Rt.View},e?.data??{})}}workflowInputSchema(){return l.Ik().shape({name:l.Yj().required(this.t("le_nom_est_requ_61536")),state:l.Yj().required(this.t("le_statut_est_r_13164")).oneOf(Tn,this.t("le_statut_est_r_13164")),action:l.Yj().required(this.t("l_action_est_re_08934")).oneOf(Sn,this.t("l_action_est_re_08934")),trigger:l.Yj().required(this.t("le_d_clencheur_32555")).oneOf(zn,this.t("le_d_clencheur_32555")),data:l.gl().required().test("positions-valid",this.t("les_missions_so_67594"),function(){return this.parent.trigger!==Ft.Assigned||Zo(this.parent.data.positionsCategoriesIds)||Zo(this.parent.data.positionsIds)||Zo(this.parent.data.positionsSlotsIds)||Zo(this.parent.data.positionsSegmentsIds)}).test("volunteers-segment-id-valid",this.t("la_vue_est_requ_65480"),function(){return this.parent.trigger!==Ft.VolunteersSegment||Number.isInteger(this.parent.data.volunteersSegmentId)}).test("form-id-valid",this.t("le_formulaire_e_77404"),function(){return this.parent.trigger!==Ft.FormSubmit||Number.isInteger(this.parent.data.formId)}).test("campaign-id-valid",this.t("la_campagne_est_06708"),function(){return this.parent.trigger!==Ft.VolunteersSegment||this.parent.action!==$t.SendCampaign||Number.isInteger(this.parent.data.campaignId)}).test("campaign-recipients-valid",this.t(this.t("les_destinatair_82420")),function(){return this.parent.trigger!==Ft.VolunteersSegment||this.parent.action!==$t.SendCampaign||En.includes(this.parent.data.recipients)}).test("campaign-recipients-users-infos",this.t("la_liste_des_me_55886"),function(){return this.parent.trigger!==Ft.VolunteersSegment||this.parent.action!==$t.SendCampaign||this.parent.data.recipients!==Rt.UsersInfosIds||Zo(this.parent.data.usersInfosIds)}).test("custom-field-id-valid",this.t("le_champ_person_80074"),function(){return this.parent.trigger===Ft.VolunteersSegment&&this.parent.action===$t.SetCustomField?Number.isInteger(this.parent.data.customFieldId):this.parent.trigger!==Ft.FormSubmit||this.parent.action!==$t.CreateDelegation||Number.isInteger(this.parent.data.customFieldId)}).test("accreditations-valid",this.t("les_accr_ditati_27943"),function(){return this.parent.trigger!==Ft.Assigned&&(this.parent.trigger!==Ft.VolunteersSegment||this.parent.action!==$t.AddAccreditations&&this.parent.action!==$t.DeleteAccreditations)||Zo(this.parent.data.accreditationsSlotsIds)}).test("delegation-id-valid",this.t("la_d_l_gation_c_71684"),function(){return this.parent.trigger!==Ft.FormSubmit||this.parent.action!==$t.CreateDelegation||Number.isInteger(this.parent.data.delegationId)}).test("event-id-valid",this.t("l_v_nement_est_88155"),function(){return this.parent.trigger!==Ft.VolunteersSegment||this.parent.action!==$t.AddEvent||Number.isInteger(this.parent.data.eventId)})})}};x$=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],x$);const _$=e=>(0,i.jsxs)(Ea,{css:{background:"white",bd:!0,padding:"$4",width:"min($container, 100%)"},direction:"column",gap:"5",children:[(0,i.jsxs)(Ea,{css:{borderBottom:"1px solid $gray200",paddingBottom:"$3"},gap:"3",width:1,children:[(0,i.jsx)(Xj,{color:"gray",icon:e.icon}),(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{font:"gray500 textXs regular",children:e.category}),(0,i.jsx)(fr,{font:"gray800 textSm medium",children:e.title})]})]}),(0,i.jsx)(Ea,{direction:"column",gap:"4",width:1,children:e.children})]}),I$=e=>{const{translate:t,params:{eventId:n}}=il(),{hasFeature:o}=nI(),s=e.workflow.trigger===Ft.VolunteersSegment,r=e.workflow.trigger===Ft.VolunteersSegment,a=!!n&&o(Fe.Accreditation)&&(e.workflow.trigger===Ft.Assigned||e.workflow.trigger===Ft.VolunteersSegment),l=!!n&&o(Fe.Accreditation)&&e.workflow.trigger===Ft.VolunteersSegment,d=o(Fe.Delegation)&&e.workflow.trigger===Ft.FormSubmit,c=!n&&e.workflow.trigger===Ft.VolunteersSegment;return(0,i.jsx)(_$,{category:t("action_s_lectio_18617"),icon:"lasso-sparkles",title:t("alors_automatiq_16268"),children:(0,i.jsxs)(Sm,{isSearchVisible:!0,name:"workflow.action",placeholder:t("choisir_une_act_51814"),state:e.isEdit?"disabled":"active",children:[s&&(0,i.jsx)("option",{value:$t.SendCampaign,children:t("SendCampaign")}),r&&(0,i.jsx)("option",{value:$t.SetCustomField,children:t("SetCustomField")}),a&&(0,i.jsx)("option",{value:$t.AddAccreditations,children:t("AddAccreditations")}),l&&(0,i.jsx)("option",{value:$t.DeleteAccreditations,children:t("DeleteAccreditations")}),d&&(0,i.jsx)("option",{value:$t.CreateDelegation,children:t("cr_er_une_d_l_g_23035")}),c&&(0,i.jsx)("option",{value:$t.AddEvent,children:t("ajouter_sur_un_56178")})]})})},v$=()=>{const{translate:e,params:{eventId:t}}=il(),n=Nn($c),{data:o}=Vn("query WorkflowAccreditations($eventId: EventId!) {\n    event(id: $eventId) {\n        accreditations {\n            nodes {\n                id\n                name\n\n                slots(includeHidden: true) {\n                    id\n                    name\n                    date\n                }\n            }\n        }\n    }\n}\n",{eventId:t},[]),s=(0,F.useMemo)(()=>(o.event?.accreditations.nodes??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:Ih(e.slots).map(t=>{const o=ph(n,t,e.name,{accreditation:{includeNameAtEnd:!0}});return(0,i.jsx)("option",{value:t.id,children:o},t.id)})},e.id)),[o.event]);return(0,i.jsx)(_$,{category:e("liste_des_accr_02647"),icon:"badge-check",title:e("les_accr_ditati_19289"),children:(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"workflow.data.accreditationsSlotsIds",children:s})})},b$=()=>{const{translate:e,params:{organizationId:t}}=il(),{data:n}=Vn("query WorkflowEvents($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        events {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n}\n",{organizationId:t},[]);return(0,i.jsx)(_$,{category:e("liste_des_v_ne_29929"),icon:"plus",title:e("l_v_nement_sui_45117"),children:(0,i.jsx)(Sm,{isSearchVisible:!0,name:"workflow.data.eventId",placeholder:e("choisir_un_v_n_58535"),children:(n.organization?.events.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})},j$=e=>{const{translate:t,params:{organizationId:n}}=il(),[o,s,r]=Ec(""),{usersInfosOptions:a,isLoading:l}=gb({organizationId:n,eventId:null,hasSelected:Zo(e.workflow.data.usersInfosIds),nameDebounced:s,userInfoIds:e.workflow.data.usersInfosIds||[]});return(0,i.jsxs)(_$,{category:t("destinataires_19592"),icon:"users",title:t("aux_membres_sui_99877"),children:[(0,i.jsxs)(Sm,{name:"workflow.data.recipients",children:[(0,i.jsx)("option",{value:Rt.View,children:t("aux_membres_de_71046")}),(0,i.jsx)("option",{value:Rt.DelegationsLeaders,children:t("aux_responsable_38147")}),(0,i.jsx)("option",{value:Rt.PositionsLeaders,children:t("aux_responsable_85620")}),(0,i.jsx)("option",{value:Rt.UsersInfosIds,children:t("_certains_memb_91094")})]}),e.workflow.data.recipients===Rt.UsersInfosIds&&(0,i.jsx)(Sm,{isSearchLoading:l,isSearchVisible:!0,label:t("liste_des_membr_89037"),multiple:!0,name:"workflow.data.usersInfosIds",searchElement:(0,i.jsx)(wl,{icon:"magnifying-glass",name:o,placeholder:t("rechercher_un_m_05904"),state:"search",onChange:r}),children:a})]})},C$=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{data:s}=Vn("query WorkflowsDelegations(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $level: OrganizationEventLevel!\n    $formId: FormId!\n) {\n    organization(id: $organizationId) {\n        delegations(level: $level, eventId: $eventId) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        form(id: $formId) {\n            elements {\n                customField {\n                    id\n                    name\n                    fieldType\n                }\n            }\n        }\n    }\n}\n",{organizationId:n,eventId:o,level:o?et.Event:et.Organization,formId:e.workflow.data.formId},[]);const r=(0,F.useMemo)(()=>s.organization?.delegations.nodes??[],[s.organization]),a=(0,F.useMemo)(()=>(s.organization?.form.elements??[]).flatMap(e=>e.customField?.fieldType===Ne.Text?[e.customField]:[]),[s.organization]);return(0,i.jsxs)(_$,{category:t("liste_des_d_l_g_86270"),icon:"users",title:t("la_d_l_gation_s_46776"),children:[(0,i.jsx)(Sm,{isSearchVisible:!0,label:t("d_l_gation_ut_74409"),name:"workflow.data.delegationId",placeholder:t("choisir_une_d_l_57897"),children:r.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Sm,{isSearchVisible:!0,label:t("champ_utilise_04526"),name:"workflow.data.customFieldId",placeholder:t("choisir_un_cham_05690"),children:a.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})},y$=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{data:s}=Vn("query WorkflowForms(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $level: OrganizationEventLevel!\n) {\n    organization(id: $organizationId) {\n        forms(level: $level, eventId: $eventId) {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n}\n",{organizationId:n,eventId:o,level:o?et.Event:et.Organization},[]);return(0,i.jsx)(_$,{category:t("liste_des_formu_69259"),icon:"file-lines",title:t("un_formulaire_p_61128"),children:(0,i.jsx)(Sm,{isSearchVisible:!0,name:"workflow.data.formId",placeholder:t("choisir_un_form_18905"),state:e.isEdit?"disabled":"active",children:(s.organization?.forms.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})},k$=e=>{const{translate:t,params:{eventId:n}}=il(),o=Nn(Ku),{data:s}=Vn("query WorkflowPositions($eventId: EventId!) {\n    event(id: $eventId) {\n        positionsCategories {\n            id\n            name\n\n            positions {\n                id\n                name\n\n                slots {\n                    id\n                    name\n                    range\n                }\n            }\n        }\n\n        segmentsFolders(segmentType: Positions) {\n            id\n            name\n\n            segments {\n                id\n                name\n            }\n        }\n    }\n}\n",{eventId:n},[]),r=(0,F.useMemo)(()=>(0,Zd.A)(s.event?.positionsCategories??[],e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[s.event]),a=(0,F.useMemo)(()=>(0,Zd.A)(s.event?.positionsCategories??[],e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,Zd.A)(e.positions,e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[s.event]),l=(0,F.useMemo)(()=>(s.event?.positionsCategories??[]).flatMap(e=>(0,Zd.A)(e.positions,e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,Zd.A)(e.slots,e=>e.range.start.toMillis()).map(t=>{const n=ih(o,t,e.name,{position:{includeNameAtEnd:!0},slot:{includeRange:!0}});return(0,i.jsx)("option",{value:t.id,children:n},t.id)})},e.id))),[s.event]),d=(0,F.useMemo)(()=>(s.event?.segmentsFolders??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[s.event]);return(0,i.jsxs)(_$,{category:t("liste_des_missi_82050"),icon:"sitemap",title:t("une_mission_par_94044"),children:[(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("est_affect_u_18005"),multiple:!0,name:"workflow.data.positionsCategoriesIds",placeholder:t("choisir_une_cat_82874"),state:e.isEdit?"disabled":"active",children:r}),(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("est_affect_u_40348"),multiple:!0,name:"workflow.data.positionsIds",placeholder:t("choisir_une_mis_90627"),state:e.isEdit?"disabled":"active",children:a}),(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("est_affect_u_82271"),multiple:!0,name:"workflow.data.positionsSlotsIds",placeholder:t("choisir_un_cr_n_50945"),state:e.isEdit?"disabled":"active",children:l}),(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("est_affect_u_31860"),multiple:!0,name:"workflow.data.positionsSegmentsIds",placeholder:t("choisir_une_vue_98781"),state:e.isEdit?"disabled":"active",children:d})]})},A$=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=il(),{data:o}=Vn("query WorkflowCampaigns(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $level: OrganizationEventLevel!\n) {\n    organization(id: $organizationId) {\n        campaigns(level: $level, eventId: $eventId, states: [Template]) {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n}\n",{organizationId:t,eventId:n,level:n?et.Event:et.Organization},[]);return(0,i.jsx)(_$,{category:e("liste_des_campa_60034"),icon:"paper-plane",title:e("la_campagne_sui_83193"),children:(0,i.jsx)(Sm,{isSearchVisible:!0,name:"workflow.data.campaignId",placeholder:e("choisir_une_cam_60181"),children:(o.organization?.campaigns.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})},w$=e=>{const{translate:t,params:{organizationId:n}}=il(),{data:o}=Vn("query WorkflowCustomFields($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        customFields(variety: UserInfo, privacy: All) {\n            nodes {\n                ...MassEditCustomField\n            }\n        }\n    }\n}\n",{organizationId:n},[Ro.MassEditCustomFieldFragment]),s=(0,F.useMemo)(()=>o.organization?.customFields.nodes??[],[o.organization]),r=s.find(t=>t.id===e.workflow.data.customFieldId);return(0,i.jsxs)(_$,{category:t("liste_des_champ_94862"),icon:"text",title:t("le_champ_suivan_27303"),children:[(0,i.jsx)(Sm,{isSearchVisible:!0,label:t("CustomField"),name:"workflow.data.customFieldId",placeholder:t("choisir_un_cham_67587"),children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),r&&(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray700 textSm medium",children:t("nouvelle_valeur_39039",r.name)}),(0,i.jsx)(dj,{campaigns:[],categories:[],change:e.change,customDocuments:[],customField:r,forms:[],name:"workflow.data.customFieldValue",slug:r.slug,tags:[],traces:[],value:e.workflow.data?.customFieldValue})]})]})},S$=e=>{const{translate:t,params:{eventId:n}}=il(),{hasFeature:o}=nI(),s=!!n&&o(Fe.Accreditation);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sr.Yr,{name:"workflow.trigger",children:t=>{t===Ft.Assigned?e.change("workflow.action",$t.AddAccreditations):t===Ft.FormSubmit?e.change("workflow.action",$t.CreateDelegation):e.change("workflow.action",$t.SendCampaign)}}),(0,i.jsx)(_$,{category:t("initialisation_38640"),icon:"hand-sparkles",title:t("quand_le_membre_51578"),children:(0,i.jsxs)(Sm,{isSearchVisible:!0,name:"workflow.trigger",placeholder:t("choisir_un_d_cl_85012"),state:e.isEdit?"disabled":"active",children:[s&&(0,i.jsx)("option",{value:Ft.Assigned,children:t("est_affect_93543")}),(0,i.jsx)("option",{value:Ft.FormSubmit,children:t("rempli_un_formu_11513")}),(0,i.jsx)("option",{value:Ft.VolunteersSegment,children:t("VolunteersSegment")})]})})]})},E$=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{data:s}=Vn("query WorkflowVolunteersSegments(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $level: OrganizationEventLevel!\n) {\n    organization(id: $organizationId) {\n        segmentsFolders(level: $level, segmentType: Volunteers, eventId: $eventId) {\n            id\n            name\n\n            segments {\n                id\n                name\n            }\n        }\n    }\n}\n",{organizationId:n,eventId:o,level:o?et.Event:et.Organization},[]);return(0,i.jsx)(_$,{category:t("liste_des_membr_89037"),icon:"user-group",title:t("une_vue_parmi_l_98342"),children:(0,i.jsx)(Sm,{isSearchVisible:!0,name:"workflow.data.volunteersSegmentId",placeholder:t("choisir_une_vue_98781"),state:e.isEdit?"disabled":"active",children:(s.organization?.segmentsFolders??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})})},T$=()=>(0,i.jsx)(Ea,{height:32,justify:"center",width:1,children:(0,i.jsx)(fr,{css:{borderRight:"1px solid $gray200"},height:1})}),z$=e=>{const{translate:t}=il(),n=e.workflow.data,o=e.workflow.trigger===Ft.VolunteersSegment,s=e.workflow.trigger===Ft.Assigned,r=e.workflow.trigger===Ft.FormSubmit,a=e.workflow.trigger===Ft.VolunteersSegment&&"number"==typeof n.volunteersSegmentId||e.workflow.trigger===Ft.Assigned&&(Zo(n.positionsCategoriesIds)||Zo(n.positionsIds)||Zo(n.positionsSlotsIds)||Zo(n.positionsSegmentsIds))||e.workflow.trigger===Ft.FormSubmit&&"number"==typeof n.formId,l=a&&e.workflow.trigger===Ft.VolunteersSegment&&e.workflow.action===$t.SendCampaign,d=l&&"number"==typeof e.workflow.data.campaignId,c=a&&e.workflow.trigger===Ft.VolunteersSegment&&e.workflow.action===$t.SetCustomField,u=a&&e.workflow.action===$t.AddAccreditations,h=a&&e.workflow.action===$t.DeleteAccreditations,m=a&&e.workflow.action===$t.CreateDelegation,g=a&&e.workflow.action===$t.AddEvent,p=l||c||u||m||g;return(0,i.jsxs)(Ea,{align:"center",direction:"column",children:[(0,i.jsx)(sl,{}),e.workflow.state===Dt.Error&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ha,{color:"warning",leftIcon:"circle-exclamation",width:"min($container, 100%)",children:[(0,i.jsx)(fr,{children:t("une_erreur_est_38715")}),(0,i.jsx)(fr,{fontWeight:"regular",children:e.workflow.data.errorMessage})]}),(0,i.jsx)(Pa,{height:"6"})]}),(0,i.jsx)(Ea,{css:{background:"white",bd:!0,borderRadius:"50px",padding:"$2 $4"},children:(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("d_but_41840")})}),(0,i.jsx)(T$,{}),(0,i.jsx)(S$,{change:e.change,isEdit:e.isEdit}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(T$,{}),(0,i.jsx)(E$,{hasBeenExecuted:e.hasBeenExecuted,isEdit:e.isEdit})]}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(T$,{}),(0,i.jsx)(k$,{isEdit:e.isEdit})]}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(T$,{}),(0,i.jsx)(y$,{isEdit:e.isEdit})]}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(T$,{}),(0,i.jsx)(I$,{isEdit:e.isEdit,workflow:e.workflow})]}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(T$,{}),(0,i.jsx)(A$,{})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(T$,{}),(0,i.jsx)(j$,{workflow:e.workflow})]}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(T$,{}),(0,i.jsx)(w$,{change:e.change,workflow:e.workflow})]}),(u||h)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(T$,{}),(0,i.jsx)(v$,{})]}),m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(T$,{}),(0,i.jsx)(C$,{workflow:e.workflow})]}),g&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(T$,{}),(0,i.jsx)(b$,{})]}),p&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(T$,{}),(0,i.jsx)(Ea,{css:{background:"white",bd:!0,borderRadius:"50px",padding:"$2 $4"},children:(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("fin_60104")})})]})]})},$$=F.forwardRef((e,t)=>{const{history:n,translate:o,params:{organizationId:s,eventId:r}}=il(),{user:a}=Zn(),l=Ac(),[d,c]=F.useState(!1),u=F.useCallback(()=>{JSON.stringify(e.workflow)===e.initialValuesString?n.goBack(SI.WORKFLOWS({organizationId:s,eventId:r})):c(!0)},[e.workflow,e.initialValuesString,c]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(bm,{button:(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsx)(pl,{isLoading:e.submitting,onClick:e.handleSubmit,children:e.isEdit?o("mettre_jour_l_18144"):o("cr_er_l_automat_04638")})}),category:e.category,color:"dark",title:e.isEdit?e.name:o("nouvelle_automa_77863"),onClose:u,children:(0,i.jsxs)(Ea,{height:1,children:[(0,i.jsxs)(Ea,{css:{background:"white",padding:"$6"},direction:"column",gap:"7",width:420,children:[(0,i.jsx)(fr,{font:"gray800 textMd medium",children:o("param_tres_de_l_25166")}),(0,i.jsxs)(Ea,{direction:"column",gap:"4",children:[(0,i.jsx)(Sl,{label:o("nom_de_l_automa_04883"),name:"workflow.name"}),(0,i.jsx)(lj,{label:o("status_06428"),name:"workflow.state",children:l(Tn.filter(e=>e!==Dt.Error))}),cE(a.email)&&r&&(0,i.jsxs)(lj,{label:o("fr_quence_43547"),name:"workflow.frequency",children:[(0,i.jsx)("option",{value:Ot.Every10Minutes,children:o(Ot.Every10Minutes)}),(0,i.jsx)("option",{value:Ot.Every5Minutes,children:o(Ot.Every5Minutes)}),(0,i.jsx)("option",{value:Ot.Every2Minutes,children:o(Ot.Every2Minutes)}),(0,i.jsx)("option",{value:Ot.EveryMinute,children:o(Ot.EveryMinute)})]})]})]}),(0,i.jsx)(Ea,{ref:t,css:{background:"$gray50",flex:"1",overflowY:"auto",padding:"$8"},direction:"column",height:1,children:(0,i.jsx)(z$,{change:e.change,hasBeenExecuted:e.hasBeenExecuted,isEdit:e.isEdit,workflow:e.workflow})})]})}),(0,i.jsx)(hS,{fallbackPath:SI.WORKFLOWS({organizationId:s,eventId:r}),isOpen:d,onClose:()=>c(!1)})]})});$$.displayName="UpdateWorkflowForm";const O$=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=il(),{showNotification:r}=Yv(),a=(0,F.useRef)(null),l=Nn(za),d=Nn(x$),[c,u]=(0,F.useState)(""),h=(0,F.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.name??""):n("cr_ation_d_une_01202"),[e.initialValues]);return Cd(h),(0,F.useEffect)(()=>{u(JSON.stringify(e.initialValues))},[e.initialValues]),(0,i.jsx)(dl,{customErrorRef:a,height:1,initialValues:{workflow:e.initialValues},render:({form:t,handleSubmit:n,submitting:o,values:s})=>(0,i.jsx)($$,{ref:a,category:h,change:t.change,handleSubmit:n,hasBeenExecuted:e.hasBeenExecuted,initialValuesString:c,isEdit:e.isEdit,name:e.initialValues.name,submitting:o,workflow:s.workflow}),validate:e=>l.validateForForm(d.workflowInputSchema())(e.workflow),width:1,onSubmit:async i=>{await e.mutate(i.workflow),r(e.isEdit?n("l_automatisatio_62036"):n("l_automatisatio_19124")),t.push(SI.WORKFLOWS({organizationId:o,eventId:s}))}})},R$=()=>{const{params:{organizationId:e,eventId:t}}=il(),n=Nn(x$),{mutate:o}=function(e={}){return Un("mutation WorkflowCreate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $workflow: WorkflowInput!\n) {\n    workflowCreate(organizationId: $organizationId, eventId: $eventId, workflow: $workflow) {\n        id\n    }\n}\n",e)}(),s=(0,F.useMemo)(()=>n.workflowInputDefault(),[]);return(0,i.jsx)(O$,{hasBeenExecuted:!1,initialValues:s,isEdit:!1,mutate:n=>o({organizationId:e,eventId:t,workflow:n})})},P$=()=>{const{params:{organizationId:e,eventId:t,workflowId:n}}=il(),o=Nn(x$),{mutate:s}=function(e={}){return Un("mutation WorkflowUpdate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $workflowId: WorkflowId!\n    $workflow: WorkflowInput!\n) {\n    workflowUpdate(\n        organizationId: $organizationId\n        eventId: $eventId\n        workflowId: $workflowId\n        workflow: $workflow\n    ) {\n        id\n    }\n}\n",e)}(),{data:r,loader:a}=Vn("query Workflow($organizationId: OrganizationId!, $workflowId: WorkflowId!) {\n    organization(id: $organizationId) {\n        workflow(id: $workflowId) {\n            id\n            name\n            frequency\n            state\n            action\n            trigger\n            hasBeenExecuted\n\n            data {\n                accreditationsSlotsIds\n                campaignId\n                customFieldId\n                customFieldValue\n                delegationId\n                errorMessage\n                eventId\n                formId\n                positionsCategoriesIds\n                positionsIds\n                positionsSegmentsIds\n                positionsSlotsIds\n                recipients\n                usersInfosIds\n                volunteersSegmentId\n            }\n        }\n    }\n}\n",{organizationId:e,workflowId:n},[]),l=(0,F.useMemo)(()=>o.workflowInputDefault(r.organization?.workflow),[r.organization]);return a||(0,i.jsx)(O$,{hasBeenExecuted:r.organization?.workflow.hasBeenExecuted,initialValues:l,isEdit:!0,mutate:i=>s({organizationId:e,eventId:t,workflowId:n,workflow:i})})};var D$;function F$(e){return{includeAccreditations:e.includes(D$.Accreditations),includeCampaign:e.includes(D$.Campaign),includeCustomField:e.includes(D$.CustomField)}}!function(e){e.Accreditations="accreditations",e.Action="Action",e.Campaign="campaign",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.CustomField="customField",e.ExecutedAt="executedAt",e.Id="id",e.Name="name",e.State="state",e.Trigger="trigger",e.VolunteersSegment="volunteersSegment"}(D$||(D$={}));class M$ extends Xc{constructor(e,t,n){super(e,t,n)}getWorkflowsFilters(e,t){return[{slug:D$.State,name:this.t("status_06428"),category:this.t("automatisations_60045"),fieldType:Be.Select,hideEmpty:!0,values:Tn.map(e=>({id:e,name:this.t(e)}))},{slug:D$.Trigger,name:this.t("d_clencheur_73493"),category:this.t("automatisations_60045"),fieldType:Be.Select,hideEmpty:!0,values:zn.map(e=>({id:e,name:this.t(e)}))},{slug:D$.Action,name:this.t("action_44224"),category:this.t("automatisations_60045"),fieldType:Be.Select,hideEmpty:!0,values:Sn.map(e=>({id:e,name:this.t(e)}))},{slug:D$.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("automatisations_60045"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:D$.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("automatisations_60045"),fieldType:Be.Datetime,hideEmpty:!0}]}getWorkflowsPossibleColumns(){return[{slug:D$.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,width:100,sortAttribute:Pt.Id},{slug:D$.Name,name:this.t("nom_de_l_automa_04883"),isSearchable:!0,isSortable:!0,sortAttribute:Pt.Name,minWidth:240},{slug:D$.State,name:this.t("status_06428"),minWidth:180},{slug:D$.Trigger,name:this.t("d_clencheur_73493"),minWidth:180},{slug:D$.Action,name:this.t("action_44224"),minWidth:180},{slug:D$.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:D$.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:Pt.CreatedAt,minWidth:180},{slug:D$.VolunteersSegment,name:this.t("vue_s_lectionn_21556"),isSortable:!0,sortAttribute:Pt.VolunteersSegment,minWidth:320},{slug:D$.ExecutedAt,name:this.t("ex_cut_e_le_99019"),isSortable:!0,sortAttribute:Pt.ExecutedAt,minWidth:180},{slug:D$.Accreditations,name:this.t("accr_ditations_39450"),minWidth:320},{slug:D$.Campaign,name:this.t("campagne_97871"),minWidth:240},{slug:D$.CustomField,name:this.t("CustomField"),minWidth:240}]}}const N$=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{showNotification:s}=Yv(),{mutate:r}=function(e={}){return Un("mutation WorkflowssMassDelete(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $selecteds: MassActionSelectedsInput!\n) {\n    workflowssMassDelete(organizationId: $organizationId, eventId: $eventId, selecteds: $selecteds)\n}\n",e)}();return(0,i.jsx)(kk,{buttonText:t("supprimer_43083"),subtext:(0,Da.A)([t("_tes_vous_s_r_d_94890"),e.workflow.trigger===Ft.Assigned?t("cela_supprimera_60220"):null]),text:t("suppression_de_73669",e.workflow.name),onClose:e.onClose,onDelete:async()=>{await r({organizationId:n,eventId:o,selecteds:{ids:[e.workflow.id]}}),s(t("l_automatisatio_64405",e.workflow.name)),e.onSuccess()}})},L$=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=il(),{mutate:r}=function(e={}){return Un("mutation WorkflowDuplicate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $workflowId: WorkflowId!\n) {\n    workflowDuplicate(organizationId: $organizationId, eventId: $eventId, workflowId: $workflowId) {\n        id\n    }\n}\n",e)}(),{mutate:a}=function(e={}){return Un("mutation WorkflowExecute(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $workflowId: WorkflowId!\n) {\n    workflowExecute(organizationId: $organizationId, eventId: $eventId, workflowId: $workflowId)\n}\n",e)}(),[l,d]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(pm,{children:[(0,i.jsx)(Od,{icon:"play",isDisabled:e.workflow.state===Dt.Paused,onClick:async()=>{await a({organizationId:o,eventId:s,workflowId:e.workflow.id}),e.reload()},children:n("ex_cuter_54158")}),(0,i.jsx)(Od,{icon:"pen",to:SI.UPDATE({organizationId:o,eventId:s,workflowId:e.workflow.id}),children:n("_diter_62574")}),(0,i.jsx)(Od,{icon:"clone",onClick:async()=>{const{workflowDuplicate:{id:n}}=await r({organizationId:o,eventId:s,workflowId:e.workflow.id});t.push(SI.UPDATE({organizationId:o,eventId:s,workflowId:n}))},children:n("dupliquer_28256")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:e=>{d(!0),wd(e.target)},children:n("supprimer_43083")})]}),l&&(0,i.jsx)(N$,{workflow:e.workflow,onClose:()=>{d(!1)},onSuccess:e.reload})]})},B$=e=>{const t=Nn($c);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:t.toLocaleString(e.insertedAt.toLocal(),Ho.DateTime)})},V$=e=>{const t=h(e.createdBy?.name),n=(t?e.createdBy?.name:e.createdBy?.email)||"";return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Ea,{direction:"column",width:1,children:[(0,i.jsx)(fr,{css:{ellipsis:!0},font:"gray900 textSm medium",title:n,width:1,children:n}),t&&(0,i.jsx)(fr,{color:"gray500",css:{ellipsis:!0},title:e.createdBy?.email||"",width:1,children:e.createdBy?.email||""})]})})};function U$(e){switch(e){case Dt.Active:return{color:"success",leftIcon:"play"};case Dt.Error:return{color:"error",leftIcon:"triangle-exclamation"};case Dt.Paused:return{color:"warning",leftIcon:"pause"};default:return Za()}}const W$=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),s=Nn($c),r=(0,F.useMemo)(()=>Zo(e.row.accreditationsSlots)?Lj(e.row.accreditationsSlots):[],[e.column]);return e.column.slug===D$.Id?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===D$.Name?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(j_,{to:SI.UPDATE({organizationId:n,eventId:o,workflowId:e.row.id}),children:e.row.name})}):e.column.slug===D$.State?(0,i.jsxs)(xc,{align:"start",direction:"column",gap:"1",justify:"center",minWidth:e.column.minWidth,width:e.column.width,children:[(0,i.jsx)(Gd,{...U$(e.row.state),children:t(e.row.state)}),"Error"===e.row.state&&(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.row.data.errorMessage||"",width:1,children:e.row.data.errorMessage||""})]}):e.column.slug===D$.Trigger?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:t(e.row.trigger)}):e.column.slug===D$.Action?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:t(e.row.action)}):e.column.slug===D$.CreatedBy?(0,i.jsx)(V$,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===D$.CreatedAt?(0,i.jsx)(B$,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===D$.VolunteersSegment?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.volunteersSegment?(0,i.jsx)(j_,{to:So.VOLUNTEERS_SEGMENT(n,o,e.row.volunteersSegment.id),children:e.row.volunteersSegment.name}):"-"}):e.column.slug===D$.ExecutedAt?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.executedAt?.isValid?s.toLocaleString(e.row.executedAt.toLocal(),Ho.DateTime):"-"}):e.column.slug===D$.Accreditations?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:r,doNotSort:!0})}):e.column.slug===D$.Campaign?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.campaign?(0,i.jsx)(j_,{to:rI.CAMPAIGN({organizationId:n,eventId:o,campaignId:e.row.campaign.id}),children:e.row.campaign.name}):"-"}):e.column.slug===D$.CustomField?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.customField?e.row.customField.name:"-"}):null},G$=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o}}=il();return(0,i.jsxs)(kC,{justify:"between",children:[(0,i.jsx)(fr,{font:"gray900 displayXs medium",children:t("automatisations_60045")}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsx)(pl,{onClick:()=>{e.push(SI.CREATE({organizationId:n,eventId:o}))},children:t("cr_er_une_autom_91246")})})]})},H$=e=>{const{params:{organizationId:t,eventId:n}}=il(),o=Nn(M$),[s,r,a]=wC(t,"workflows.columns",[D$.Name,D$.State,D$.CreatedBy]),[l,d,c]=wC(t,"workflows.limit",_c),[u,h,m]=wC(t,"workflows.predicates",[]),[g,p,f]=wC(t,"workflows.sort",null),x=(0,F.useMemo)(()=>o.getWorkflowsFilters(t,n),[n,t,o]),_=(0,F.useMemo)(()=>o.getWorkflowsPossibleColumns(),[]),I=a||c||m||f;return(0,i.jsxs)(AC,{children:[(0,i.jsx)(G$,{}),(0,i.jsx)(yC,{children:I?(0,i.jsx)(ul,{}):(0,i.jsx)(Zh,{columns:s,columnsSearch:[],columnsToIncludes:F$,eventId:n,filters:x,limit:l,loadDataList:Ca,loadDataListParams:{level:n?et.Event:et.Organization},loadRow:ya,organizationId:t,possibleColumns:_,predicates:u,rendering:jh.List,setColumns:r,setLimit:d,setPredicates:h,setSort:p,showEditColumns:!0,showEditMode:!1,showFilters:!0,showMassActions:!1,showRowDropdown:e.showRowDropdown,showRowEdit:e.showRowEdit,showSearchColumns:!1,sort:g,children:(0,i.jsx)(cm,{getEditPath:e=>SI.UPDATE({organizationId:t,eventId:n,workflowId:e.id}),renderCell:(e,t)=>(0,i.jsx)(W$,{column:e,row:t}),renderRowDropdown:(e,t)=>(0,i.jsx)(L$,{reload:t,workflow:e})})})})]})},q$=()=>{const{translate:e}=il(),{isEventAdmin:t,event:{name:n}}=Uv();return Cd(`${n} ${e("automatisations_60045")}`),(0,i.jsx)(H$,{showRowDropdown:t,showRowEdit:t})},Y$=()=>{const{translate:e}=il(),{organization:t,isOrganizationAdmin:n}=nI();return Cd(`${t.name} ${e("automatisations_60045")}`),(0,i.jsx)(H$,{showRowDropdown:n,showRowEdit:n})};let K$=class extends zl{translationService;constructor(e){super(e),this.translationService=e}segmentFolderInputDefault(e,t){return{name:t?.name??"",segmentType:e}}};K$=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],K$);const Z$=e=>{const t=Ln(),{eventId:n,organizationId:o,segmentType:s,reload:r}=zC(),{mutate:a}=function(e={}){return Un("mutation SegmentFolderCreate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $segmentFolder: SegmentsFolderInput!\n) {\n    segmentFolderCreate(\n        organizationId: $organizationId\n        eventId: $eventId\n        segmentFolder: $segmentFolder\n    ) {\n        id\n    }\n}\n",e)}(),{mutate:l}=function(e={}){return Un("mutation SegmentFolderUpdateName(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $segmentFolderId: SegmentsFolderId!\n    $name: String!\n) {\n    segmentFolderUpdateName(\n        organizationId: $organizationId\n        eventId: $eventId\n        segmentFolderId: $segmentFolderId\n        name: $name\n    ) {\n        id\n    }\n}\n",e)}(),d=Nn(K$);return(0,i.jsx)(gj,{buttonText:e.isEdit?t("mettre_jour_l_05529"):t("cr_er_le_dossie_71150"),icon:"text",initialValues:{segmentFolder:d.segmentFolderInputDefault(s,e.segmentFolder)},size:"md",subtitle:t("classez_vos_vue_39895"),title:t("nom_du_dossier_95781"),onClose:e.onClose,onSubmit:async t=>{e.isEdit&&e.segmentFolder?await l({organizationId:o,eventId:n,segmentFolderId:e.segmentFolder.id,name:t.segmentFolder.name}):await a({organizationId:o,eventId:n,segmentFolder:t.segmentFolder}),r(),e.onClose()},children:(0,i.jsx)(Sl,{label:t("nom_du_dossier_95781"),name:"segmentFolder.name"})})},X$=e=>{const[t,n]=F.useState(!1),o=F.useCallback(t=>{e.setSegmentsFolders((0,Jc.jM)(n=>{n[e.segmentFolderIndex].segments[e.index].name=t}))},[e.segmentFolderIndex,e.index,e.setSegmentsFolders]),s=F.useCallback(()=>e.setSegmentsFolders(t=>t.map(t=>({...t,segments:t.segments.filter(t=>t.id!==e.segment.id)}))),[e.segment,e.setSegmentsFolders]);return(0,i.jsx)(Qc.sx,{draggableId:`s-${e.segment.id}`,index:e.index,children:r=>(0,i.jsxs)(Ea,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",padding:"$3"},gap:"3",...r.draggableProps,ref:r.innerRef,align:"center",children:[(0,i.jsx)(fr,{color:"gray300",css:{cursor:"pointer"},...r.dragHandleProps,children:(0,i.jsx)(Va,{icon:"grip-vertical",iconStyle:"solid"})}),t?(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(wl,{value:e.segment.name,onChange:o})}):(0,i.jsx)(fr,{css:{flex:"1"},font:"gray900 textSm medium",children:e.segment.name}),(0,i.jsx)(pl,{color:"white",leftIcon:t?"check":"pen",size:"sm",onClick:()=>n(!t)}),(0,i.jsx)(pl,{color:"white",disabled:!e.canDelete,leftIcon:"trash-can",size:"sm",onClick:s})]})})},J$=e=>{const[t,n]=F.useState(!1),o=F.useCallback(t=>{e.setSegmentsFolders((0,Jc.jM)(n=>{n[e.index].name=t}))},[e.index,e.setSegmentsFolders]);return(0,i.jsx)(Qc.sx,{draggableId:`sf-${e.segmentFolder.id}`,index:e.index,children:s=>(0,i.jsxs)(Ea,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$sm",overflow:"hidden"},direction:"column",...s.draggableProps,ref:s.innerRef,children:[(0,i.jsxs)(Ea,{align:"center",css:{padding:"$4"},gap:"3",children:[(0,i.jsx)(fr,{color:"gray300",css:{cursor:"pointer"},fontSize:"textMd",...s.dragHandleProps,children:(0,i.jsx)(Va,{icon:"grip-vertical",iconStyle:"solid"})}),t?(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(wl,{value:e.segmentFolder.name,onChange:o})}):(0,i.jsx)(fr,{css:{flex:"1"},font:"gray800 textMd medium",children:e.segmentFolder.name}),(0,i.jsx)(pl,{color:"white",leftIcon:t?"check":"pen",size:"sm",onClick:()=>n(!t)}),(0,i.jsx)(pl,{color:"white",disabled:!e.canDelete,leftIcon:"trash-can",size:"sm",onClick:()=>{e.setSegmentsFolders(t=>t.filter(t=>t!==e.segmentFolder))}})]}),(0,i.jsx)(Qc.gL,{droppableId:`drop-sf-${e.segmentFolder.id}`,type:"segment",children:t=>(0,i.jsxs)(Ea,{css:{background:"$gray100",padding:"$4"},direction:"column",gap:"2",...t.droppableProps,ref:t.innerRef,children:[e.segmentFolder.segments.map((t,n)=>(0,i.jsx)(X$,{canDelete:e.segmentFolder.segments.length>1,index:n,segment:t,segmentFolderIndex:e.index,setSegmentsFolders:e.setSegmentsFolders},t.id)),t.placeholder]})})]})})},Q$=e=>{const t=Ln(),{segmentsFolders:n}=zC(),{mutate:o,isLoading:s}=function(e={}){return Un("mutation SegmentsFoldersReorder(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $segmentType: SegmentType!\n    $segmentsFolders: [SegmentFolderReorderInput!]!\n) {\n    segmentsFoldersReorder(\n        organizationId: $organizationId\n        eventId: $eventId\n        segmentType: $segmentType\n        segmentsFolders: $segmentsFolders\n    )\n}\n",e)}(),[r,a]=(0,F.useState)(n.map(e=>({id:e.id,name:e.name,segments:e.segments.map(e=>({id:e.id,name:e.name}))}))),l=(0,F.useCallback)(async()=>{await o({organizationId:e.organizationId,eventId:e.eventId,segmentType:e.segmentType,segmentsFolders:r.map(e=>({...e,id:!e.id||e.id<0?void 0:e.id}))}),e.onClose(),e.onSuccess()},[e.organizationId,e.eventId,e.segmentType,r]),d=(0,F.useCallback)(({reason:e,source:t,destination:n})=>{if("DROP"===e&&n&&t.index!==n.index&&"main"===t.droppableId&&"main"===n.droppableId)a(es(r,t.index,n.index));else if("DROP"===e&&n&&(t.droppableId!==n.droppableId||t.index!==n.index)&&t.droppableId.startsWith("drop-sf-")&&n.droppableId.startsWith("drop-sf-")){const e=parseInt(t.droppableId.substring(8),10),i=parseInt(n.droppableId.substring(8),10);a(e!==i?(0,Jc.jM)(o=>{const s=o.find(t=>t.id===e),r=o.find(e=>e.id===i),a=s.segments.find((e,n)=>n===t.index);s.segments=(0,Xd.A)(s.segments,a),r.segments.splice(n.index,0,a)}):(0,Jc.jM)(i=>{const o=i.find(t=>t.id===e);o.segments=es(o.segments,t.index,n.index)}))}},[r,a]);return(0,i.jsx)(bm,{button:(0,i.jsx)(pl,{isLoading:s,onClick:l,children:t("enregistrer_06519")}),category:t("vues_personnali_80652"),title:t("param_tres_de_v_66378"),onClose:e.onClose,children:(0,i.jsxs)(Im,{css:{background:"white"},children:[(0,i.jsxs)(Ea,{align:"center",gap:"6",justify:"between",children:[(0,i.jsx)(fr,{font:"gray900 textLg semiBold",children:t("organisation_de_95776")}),(0,i.jsx)(pl,{color:"white",leftIcon:"folder-plus",onClick:()=>{const e=Math.min((0,Lu.A)(r,e=>e.id)?.id??0,0);a([...r,{id:e-1,name:t("nouveau_dossier_94479"),segments:[]}])},children:t("nouveau_dossier_94479")})]}),(0,i.jsx)($u,{height:"5"}),(0,i.jsx)(Qc.JY,{onDragEnd:d,children:(0,i.jsx)(Qc.gL,{droppableId:"main",type:"segmentFolder",children:e=>(0,i.jsxs)(Ea,{direction:"column",gap:"6",width:1,...e.droppableProps,ref:e.innerRef,children:[r.map((e,t)=>(0,i.jsx)(J$,{canDelete:r.length>1,index:t,segmentFolder:e,setSegmentsFolders:a},t)),e.placeholder]})})})]})})},eO=ar("div",{alignItems:"center",borderRadius:"$2",cursor:"pointer",display:"flex",gap:"$4",padding:"$4",userSelect:"none","&:hover":{boxShadow:"$xs"},"& .radio-row-text":{flex:1,fontWeight:"$medium"},"& .radio-row-button":{alignItems:"center",borderRadius:"16px",color:"white",display:"flex",fontSize:"10px",height:"16px",justifyContent:"center",width:"16px"},variants:{state:{unchecked:{background:"white",border:"1px solid $gray200","&:hover":{background:"$gray50"},"& .radio-row-text":{color:"$gray700"},"& .radio-row-button":{background:"white",border:"1px solid $gray300"}},checked:{background:"$primary100",border:"1px solid $primary700",boxShadow:"$xs","& .radio-row-text":{color:"$primary800"},"& .radio-row-button":{background:"$primary700",border:"1px solid $primary700"}}}},defaultVariants:{state:"unchecked"}}),tO=e=>(0,i.jsxs)(eO,{state:e.state,onClick:()=>{"unchecked"!==e.state&&e.state?e.onClick("unchecked"):e.onClick("checked")},children:[(0,i.jsx)("div",{className:"radio-row-text",children:e.children}),(0,i.jsx)("div",{"aria-describedby":e.descId,className:"radio-row-button",id:e.inputId,role:"radio",children:"checked"===e.state&&(0,i.jsx)(Va,{icon:"check"})})]}),nO=({description:e,label:t,name:n,value:o})=>{const{inputId:s,descId:r}=bl();return(0,i.jsx)(Oa.D0,{name:n,render:n=>{const a=n.input.checked?"checked":"unchecked";return(0,i.jsx)(tO,{descId:r,inputId:s,state:a,onClick:()=>{n.input.onChange(o)},children:(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(yl,{htmlFor:s,children:(0,i.jsx)(fr,{children:t})}),e&&(0,i.jsx)(fr,{fontWeight:"regular",id:r,children:e})]})})},type:"radio",value:o})},iO=e=>{const t=Ln(),{eventId:n,organizationId:o,segmentsFolders:s,reload:r}=zC(),{mutate:a}=function(e={}){return Un("mutation SegmentMoveFolder(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $segmentId: SegmentId!\n    $segmentFolderId: SegmentsFolderId!\n) {\n    segmentMoveFolder(\n        organizationId: $organizationId\n        eventId: $eventId\n        segmentId: $segmentId\n        segmentFolderId: $segmentFolderId\n    ) {\n        id\n    }\n}\n",e)}();return(0,i.jsxs)(gj,{buttonText:t("d_placer_la_vue_27440"),icon:"sliders",initialValues:{segmentFolderId:e.segment.segmentFolderId},size:"md",title:t("d_placer_la_vue_55115",e.segment.name),onClose:e.onClose,onSubmit:async t=>{await a({organizationId:o,eventId:n,segmentId:e.segment.id,segmentFolderId:t.segmentFolderId}),r(),e.onClose()},children:[(0,i.jsx)(fr,{color:"gray900",fontWeight:"medium",children:t("vers_quel_dossi_86452")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(Ea,{css:{overflowY:"auto"},direction:"column",gap:"3",children:s.map(e=>(0,i.jsx)(nO,{label:e.name,name:"segmentFolderId",value:e.id},e.id))})]})},oO=e=>{const{translate:t}=il(),{eventId:n,organizationId:o,segmentsFolders:s,reload:r}=zC(),{mutate:a,isLoading:l}=function(e={}){return Un("mutation SegmentUpdateMetadata(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $description: String\n    $segmentFolderId: SegmentsFolderId!\n    $segmentId: SegmentId!\n    $name: String!\n) {\n    segmentUpdateMetadata(\n        organizationId: $organizationId\n        eventId: $eventId\n        description: $description\n        segmentFolderId: $segmentFolderId\n        segmentId: $segmentId\n        name: $name\n    ) {\n        id\n    }\n}\n",e)}(),[d,c]=(0,F.useState)(e.segment.name),[u,m]=(0,F.useState)(e.segment.segmentFolderId),[g,p]=(0,F.useState)(e.segment.description||void 0),f=h(d);return(0,i.jsx)(nb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"gear",subtitle:t("mettez_jour_l_55467"),children:t("mise_jour_de_80873")}),(0,i.jsxs)(Qv,{gap:"4",children:[(0,i.jsx)(wl,{label:t("nom_de_la_vue_66415"),value:d,onChange:c}),(0,i.jsx)(dc,{isSearchVisible:!0,label:t("dossier_00726"),shouldParseAsInt:!0,values:[u],onChange:e=>{Zo(e)&&m(e[0])},children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Em,{label:t("Description"),value:g,onChange:p})]}),(0,i.jsx)(Jv,{children:()=>(0,i.jsx)(pl,{disabled:!f,isLoading:l,onClick:async()=>{await a({organizationId:o,eventId:n,description:g,name:d,segmentFolderId:u,segmentId:e.segment.id}),r()},children:t("mettre_jour_85141")})})]})})},sO=ar("div",{alignItems:"center",color:"$gray700",cursor:"pointer",display:"flex",height:"32px",gap:"$space$2",px:"$3",width:"100%","&:hover":{"& .count":{background:"$primary700",color:"white"}},"& .name":{flex:"1",ellipsis:""},"& .count, & .count-admin":{borderRadius:"16px",fontSize:"$textXs",px:"8px",py:"2px"},"& .ellipsis":{display:"none"},"&:hover .count-admin":{display:"none"},"&:hover .ellipsis":{color:"$gray700",display:"block","& .trigger":{alignItems:"center",display:"flex",height:"32px",justifyContent:"end",px:"8px",width:"32px"}},variants:{selected:{true:{background:"$primary200",borderRadius:"$1",color:"$primary700","& .count":{background:"$primary700",color:"white"},"& .count, & .count-admin":{background:"$primary700",color:"white"}},false:{"&:hover":{background:"$gray100",borderRadius:"$1",color:"$gray800"},"& .count, & .count-admin":{background:"$primary50",color:"$primary700"}}}}}),rO=(0,F.memo)(function(e){const{history:t,translate:n}=il(),{eventId:o,isAdmin:s,organizationId:r,segmentId:a,getSegmentPath:l,onSegmentClick:d,reload:c}=zC(),{mutate:u}=function(e={}){return Un("mutation SegmentDelete(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $segmentId: SegmentId!\n) {\n    segmentDelete(organizationId: $organizationId, eventId: $eventId, segmentId: $segmentId) {\n        id\n    }\n}\n",e)}(),{mutate:h}=function(e={}){return Un("mutation SegmentMoveDown(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $segmentId: SegmentId!\n) {\n    segmentMoveDown(organizationId: $organizationId, eventId: $eventId, segmentId: $segmentId) {\n        id\n    }\n}\n",e)}(),{mutate:m}=function(e={}){return Un("mutation SegmentMoveUp(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $segmentId: SegmentId!\n) {\n    segmentMoveUp(organizationId: $organizationId, eventId: $eventId, segmentId: $segmentId) {\n        id\n    }\n}\n",e)}(),[g,p]=(0,F.useState)(!1),[f,x]=(0,F.useState)(!1),[_,I]=(0,F.useState)(!1);return(0,i.jsxs)(sO,{selected:e.segment.id===a,onClick:()=>{d(e.segment.id),t.push(l(e.segment.id))},onMouseLeave:e=>{wd(e.target)},children:[(0,i.jsx)("div",{className:"name",title:e.segment.name,children:e.segment.name}),(0,i.jsx)("div",{className:s?"count-admin":"count",children:e.segment.count}),s&&(0,i.jsx)("div",{className:"ellipsis",onClick:Il,children:(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)("div",{className:"trigger",children:(0,i.jsx)("i",{className:"fa-regular fa-ellipsis-vertical"})})}),(0,i.jsxs)(Pd,{offset:0,placement:"bottom-end",children:[(0,i.jsx)(Od,{icon:"pen",onClick:()=>{p(!0)},children:n("mettre_jour_85141")}),e.canMoveUpDown&&(0,i.jsx)(Od,{color:e.isLast?"disabled":"default",icon:"arrow-down",onClick:async()=>{await h({organizationId:r,eventId:o,segmentId:e.segment.id}),c()},children:n("d_placer_vers_l_52432")}),e.canMoveUpDown&&(0,i.jsx)(Od,{color:e.isFirst?"disabled":"default",icon:"arrow-up",onClick:async()=>{await m({organizationId:r,eventId:o,segmentId:e.segment.id}),c()},children:n("d_placer_vers_l_49863")}),e.canMoveFolder&&(0,i.jsx)(Od,{icon:"folder",onClick:()=>{x(!0)},children:n("d_placer_de_dos_65513")}),e.canDelete&&(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{I(!0)},children:n("supprimer_43083")})]})]})}),g&&(0,i.jsx)(oO,{segment:e.segment,onClose:()=>{p(!1)}}),f&&(0,i.jsx)(iO,{segment:e.segment,onClose:()=>{x(!1)}}),_&&(0,i.jsx)(kk,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_38950"),text:n("suppression_de_73669",e.segment.name),onClose:()=>{I(!1)},onDelete:async()=>{await u({organizationId:r,eventId:o,segmentId:e.segment.id}),c(),await e.onDelete()},children:e.segment.isUsedInWorkflow&&(0,i.jsx)(Ha,{color:"warning",leftIcon:"circle-exclamation",children:n("cette_vue_est_u_58409")})})]})}),aO=e=>{const t=Ln(),{eventId:n,isAdmin:o,organizationId:s,reload:r,segmentType:a}=zC(),{mutate:l}=function(e={}){return Un("mutation SegmentFolderDelete(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $segmentFolderId: SegmentsFolderId!\n) {\n    segmentFolderDelete(\n        organizationId: $organizationId\n        eventId: $eventId\n        segmentFolderId: $segmentFolderId\n    ) {\n        id\n    }\n}\n",e)}(),{mutate:d}=function(e={}){return Un("mutation SegmentFolderMoveDown(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $segmentFolderId: SegmentsFolderId!\n) {\n    segmentFolderMoveDown(\n        organizationId: $organizationId\n        eventId: $eventId\n        segmentFolderId: $segmentFolderId\n    ) {\n        id\n    }\n}\n",e)}(),{mutate:c}=function(e={}){return Un("mutation SegmentFolderMoveUp(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $segmentFolderId: SegmentsFolderId!\n) {\n    segmentFolderMoveUp(\n        organizationId: $organizationId\n        eventId: $eventId\n        segmentFolderId: $segmentFolderId\n    ) {\n        id\n    }\n}\n",e)}(),[u,m]=(0,F.useState)(!1),[g,p]=(0,F.useState)(!1),[f,x]=(0,F.useState)(!1),[_,I]=(0,F.useState)(!1),v=(0,F.useCallback)(async()=>{const t=!f;x(t),await X_.segmentsFolders.put({id:e.segmentFolder.id,isOpen:t})},[f,e.segmentFolder.id]),b=(0,F.useMemo)(()=>h(e.search)?e.segmentFolder.segments.filter(t=>t.name.toLowerCase().includes(e.search.toLowerCase())):e.segmentFolder.segments,[e.segmentFolder.segments,e.search]);return(0,F.useEffect)(()=>{(async()=>{x((await X_.segmentsFolders.get(e.segmentFolder.id))?.isOpen??!0)})()},[]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsxs)(Ea,{align:"center",css:{cursor:"pointer",userSelect:"none","& .ellipsis":{display:"none"},"&:hover .ellipsis":{display:"block"}},gap:"2",onClick:v,children:[(0,i.jsx)(fr,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(Va,{icon:f?"chevron-down":"chevron-right"})}),(0,i.jsx)(fr,{css:{flex:"1"},font:"gray900 textXs semiBold",children:e.segmentFolder.name}),o&&(0,i.jsx)(fr,{className:"ellipsis",onClick:Il,children:(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(Ea,{align:"center",css:{color:"$gray500",px:"$2"},justify:"end",width:24,children:(0,i.jsx)(Va,{icon:"ellipsis-vertical"})})}),(0,i.jsxs)(Pd,{offset:0,placement:"bottom-end",children:[(0,i.jsx)(Od,{icon:"pen",onClick:()=>{m(!0)},children:t("renommer_42135")}),(0,i.jsx)(Od,{icon:"gear",onClick:()=>{I(!0)},children:t("r_ordonner_41823")}),e.canDeleteSegmentFolder&&(0,i.jsx)(Od,{color:e.isLast?"disabled":"default",icon:"arrow-down",onClick:async()=>{await d({organizationId:s,eventId:n,segmentFolderId:e.segmentFolder.id}),r()},children:t("d_placer_vers_l_52432")}),e.canDeleteSegmentFolder&&(0,i.jsx)(Od,{color:e.isFirst?"disabled":"default",icon:"arrow-up",onClick:async()=>{await c({organizationId:s,eventId:n,segmentFolderId:e.segmentFolder.id}),r()},children:t("d_placer_vers_l_49863")}),e.canDeleteSegmentFolder&&(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{p(!0)},children:t("supprimer_43083")})]})]})})]}),b.length>0&&f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(Ea,{direction:"column",gap:"1",children:b.map((t,n)=>(0,i.jsx)(rO,{canDelete:e.canDeleteSegment,canMoveFolder:e.canDeleteSegmentFolder,canMoveUpDown:e.segmentFolder.segments.length>1,isFirst:0===n,isLast:n===e.segmentFolder.segments.length-1,segment:t,onDelete:e.onSegmentDelete},t.id))})]}),(0,i.jsx)(Pa,{height:"5"})]}),u&&(0,i.jsx)(Z$,{isEdit:!0,segmentFolder:e.segmentFolder,onClose:()=>{m(!1)}}),g&&(0,i.jsx)(kk,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_13885"),text:t("suppression_de_73669",e.segmentFolder.name),onClose:()=>{p(!1)},onDelete:async()=>{await l({organizationId:s,eventId:n,segmentFolderId:e.segmentFolder.id}),r()}}),_&&(0,ee.createPortal)((0,i.jsx)(fr,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"200"},height:1,width:1,children:(0,i.jsx)(Q$,{eventId:n,organizationId:s,segmentType:a,onClose:()=>{I(!1)},onSuccess:()=>(r(),e.onSegmentDelete())})}),document.body)]})},lO=e=>{const t=Ln(),{isAdmin:n,segmentsFolders:o}=zC(),[s,r]=(0,F.useState)(!1),a=(0,F.useMemo)(()=>o.flatMap(e=>e.segments).length>1,[o]),[l,d]=(0,F.useState)(""),c=(0,F.useMemo)(()=>h(l)?o.filter(e=>e.segments.some(e=>e.name.toLowerCase().includes(l.toLowerCase()))):o,[o,l]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Jl,{css:{background:"white",borderRight:"1px solid $gray200",overflow:"hidden"},gridtemplaterows:"1fr 48px",height:1,width:1,children:[(0,i.jsxs)(Ea,{css:{overflowY:"auto",padding:"$7 $4"},direction:"column",width:1,children:[(0,i.jsx)(Ea,{align:"center",children:(0,i.jsx)(fr,{color:"gray900",css:{flex:"1"},fontSize:"textMd",fontWeight:"semiBold",children:t("vues_personnali_80652")})}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{width:1,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:l,onChange:d})}),(0,i.jsx)(Pa,{height:"4"}),c.map((t,n)=>(0,i.jsx)(aO,{canDeleteSegment:a,canDeleteSegmentFolder:o.length>1,isFirst:0===n,isLast:n===o.length-1,search:l,segmentFolder:t,onSegmentDelete:e.onSegmentDelete},t.id))]}),n&&(0,i.jsxs)(Ea,{align:"center",css:{borderTop:"1px solid $gray200",cursor:"pointer",padding:"$3 $6"},gap:"4",width:1,onClick:()=>{r(!0)},children:[(0,i.jsx)(Va,{icon:"plus"}),(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",children:t("nouveau_dossier_94479")})]})]}),s&&(0,i.jsx)(Z$,{isEdit:!1,onClose:()=>{r(!1)}})]})},dO=()=>{const{history:e,translate:t}=il(),{columns:n,columnsExport:o,columnsSearch:s,eventId:r,getSegmentPath:a,infos:l,organizationId:d,predicates:c,reload:u,rendering:m,segment:g,segmentId:p,segmentType:f,segmentsFolders:x,sort:_,setIsSaveSegmentVisible:I}=zC(),v=(0,F.useCallback)(()=>{I(!1)},[I]),{mutate:b,isLoading:j}=function(e={}){return Un("mutation SegmentUpdate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $segmentFolderId: SegmentsFolderId!\n    $segmentId: SegmentId!\n    $segment: SegmentInput!\n) {\n    segmentUpdate(\n        organizationId: $organizationId\n        eventId: $eventId\n        segmentFolderId: $segmentFolderId\n        segmentId: $segmentId\n        segment: $segment\n    ) {\n        id\n    }\n}\n",e)}(),{mutate:C,isLoading:y}=function(e={}){return Un("mutation SegmentCreate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $segmentFolderId: SegmentsFolderId!\n    $segment: SegmentInput!\n) {\n    segmentCreate(\n        organizationId: $organizationId\n        eventId: $eventId\n        segmentFolderId: $segmentFolderId\n        segment: $segment\n    ) {\n        id\n    }\n}\n",e)}(),[k,A]=(0,F.useState)(!1),[w,S]=(0,F.useState)(""),[E,T]=(0,F.useState)(x.find(e=>e.segments.find(e=>e.id===p))?.id??x[0].id),[z,$]=(0,F.useState)(g.description||void 0),O=!k||h(w);return(0,i.jsx)(nb,{isOpen:!0,onClose:v,children:(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"floppy-disk",subtitle:t("sauvegarder_vos_15289"),children:t("enregistrer_une_52986")}),(0,i.jsxs)(Qv,{children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:t("que_souhaitez_v_33936")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsxs)(Ea,{direction:"column",gap:"3",children:[(0,i.jsx)(sc,{css:{"& label > div > div":{fontWeight:"$regular"}},state:k?"unchecked":"checked",onClick:()=>{A(!1)},children:t("enregistrer_les_31603").split("{1}").map((e,t)=>1===t?(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(Pm,{fontWeight:"medium",children:g.name}),e]},t):(0,i.jsx)(F.Fragment,{children:e},t))}),(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(sc,{css:{"& label > div > div":{fontWeight:"$regular"}},state:k?"checked":"unchecked",onClick:()=>{A(!0)},children:t("cr_er_une_nouve_37002")}),k&&(0,i.jsx)(fr,{css:{marginLeft:"$6"},children:(0,i.jsx)(wl,{hint:t("cette_vue_sera_83858"),placeholder:t("nom_de_votre_no_21748"),value:w,onChange:S})})]})]}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(dc,{isSearchVisible:!0,label:t("dans_quel_dossi_07643"),shouldParseAsInt:!0,values:[E],onChange:e=>{Zo(e)&&T(e[0])},children:x.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Em,{label:t("Description"),placeholder:t("entrer_une_desc_74340"),value:z,onChange:$})]}),(0,i.jsx)(Jv,{children:()=>(0,i.jsx)(pl,{disabled:!O,isLoading:y||j,onClick:async()=>{const t={segmentType:f,name:w,description:z,predicates:c,columns:n,columnsExport:o,columnsSearch:s,sort:_,rendering:m,infos:l};if(k){const{segmentCreate:{id:n}}=await C({organizationId:d,eventId:r,segmentFolderId:E,segment:t});u(),e.push(a(n))}else await b({organizationId:d,eventId:r,segmentFolderId:E,segmentId:p,segment:t}),u()},children:t("enregistrer_06519")})})]})})},cO=e=>{const t=Ln(),{areColumnsOpen:n,areSegmentsOpen:o,clearNameCursors:s,columns:r,filters:a,hideSegments:l,isFilterOpen:d,isSaveSegmentVisible:c,possibleColumns:u,predicates:h,selectedFilterPredicate:m,setAreColumnsOpen:g,setColumns:p,setIsFilterOpen:f,setPredicates:x}=zC();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{height:1,width:1,children:[!0!==l&&o&&(0,i.jsx)(fr,{css:{overflow:"hidden"},height:1,width:260,children:(0,i.jsx)(lO,{onSegmentDelete:e.onSegmentDelete})}),(0,i.jsx)(Ea,{css:{flex:"1",overflowY:"auto"},direction:"column",height:1,children:e.children})]}),d&&(0,i.jsx)(Bh,{buttonText:e.filtersButtonText,possibleFilters:a,predicates:h,selectedFilterPredicate:m,subtitle:e.filtersSubtitle,onClose:()=>{f(!1)},onFilter:e=>{s(),x(e)}}),n&&(0,i.jsx)(ru,{columns:u,initialSelectedColumns:r,saveButtonText:t("_diter_les_colo_39630"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_03763"),title:t("_dition_des_col_70300"),onClose:()=>{g(!1)},onSave:p}),c&&(0,i.jsx)(dO,{})]})},uO=e=>{const[t,n]=F.useState(e.segmentsFolders),o=F.useMemo(()=>t.flatMap(e=>e.segments),[t]),s=F.useMemo(()=>o.find(t=>t.id===e.segmentId),[e.segmentId,o]),[r,a]=F.useState(s.predicates),[l,d]=F.useState(s.columns),[c,u]=F.useState(s.columnsExport),[h,m]=F.useState(s.columnsSearch),[g,p]=F.useState(s.rendering),[f,x]=F.useState(s.sort),[_,I]=F.useState(s.infos),v=F.useMemo(()=>JSON.stringify(s.predicates),[s]),b=F.useMemo(()=>JSON.stringify(s.columns),[s]),j=F.useMemo(()=>JSON.stringify(s.columnsExport),[s]),C=F.useMemo(()=>JSON.stringify(s.columnsSearch),[s]),y=F.useMemo(()=>JSON.stringify(s.rendering),[s]),k=F.useMemo(()=>JSON.stringify(s.sort),[s]),A=F.useMemo(()=>JSON.stringify(s.infos),[s]),[w]=F.useMemo(()=>Kc(r,e.filters),[r,e.filters]),[S,E]=F.useState(!1),[T,z]=F.useState(!1),[$,O]=F.useState(!1),[R,P]=F.useState(null),[D,M]=F.useState(!1),[N,L]=F.useState(e.initialSegmentsOpen??!0),B=F.useCallback(t=>{e.onSegmentsToggle?.(t),L(t)},[L]),V=F.useMemo(()=>JSON.stringify(r)!==v||JSON.stringify(l)!==b||JSON.stringify(g)!==y||JSON.stringify(c)!==j||JSON.stringify(h)!==C||JSON.stringify(f)!==k||JSON.stringify(_)!==A,[v,r,b,l,y,g,j,c,C,h,k,f,_,A]),[U,W]=F.useState(""),[G,H]=F.useState(""),[q,Y]=F.useState(e.initialLimit),[K,Z]=F.useState(0),X=Sc(e=>{H(e),ee()}),[J,Q]=F.useState(1),ee=F.useCallback(()=>{Z(0)},[Z]),te=F.useCallback(t=>{Y(t),e.setLimit(t),ee()},[Y,ee]),ne=F.useCallback(()=>{W(""),H(""),ee()},[W,H,ee]),ie=au({}),oe=F.useCallback(()=>{ie.toggleSelectAll("unchecked"),Q(J+1)},[ie,J]),se=F.useMemo(()=>ie.isAllSelected?s.id:null,[ie,s]),re=F.useCallback(e=>{x(e),Z(0)},[x,Z]),ae=F.useCallback((e,i)=>{n((0,Jc.jM)(t,t=>{t.forEach(t=>{t.segments.forEach(t=>{t.id===e&&(t.count=i)})})}))},[t,n]);return F.useEffect(()=>{a(s.predicates),d(s.columns),u(s.columnsExport),m(s.columnsSearch),p(s.rendering),x(s.sort),I(s.infos),W(""),H(""),ee(),Q(1)},[s]),F.useEffect(()=>{n(e.segmentsFolders)},[e.segmentsFolders]),(0,i.jsx)(TC.Provider,{value:{areColumnsOpen:$,areSegmentsOpen:N,clearNameCursors:ne,columns:l,columnsExport:c,columnsSearch:h,eventId:e.eventId,filters:e.filters,filtersPredicates:w,getSegmentPath:e.getSegmentPath,hideSegments:e.hideSegments,infos:_,isAdmin:e.isAdmin,isEditMode:S,isFilterOpen:T,isSaveSegmentVisible:D,isSaveVisible:V,limit:q,massActions:ie,massEditSegmentId:se,name:U,nameDebounced:G,offset:K,onMassEditSuccess:oe,onSegmentClick:e.onSegmentClick,organizationId:e.organizationId,possibleColumns:e.possibleColumns,possibleRenderings:e.possibleRenderings,predicates:r,reload:e.reload,reloadKey:J,rendering:g,segment:s,segmentId:e.segmentId,segmentType:e.segmentType,segmentsFolders:t,selectedFilterPredicate:R,setAreColumnsOpen:O,setAreSegmentsOpen:B,setColumns:d,setColumnsExport:u,setColumnsSearch:m,setInfos:I,setIsEditMode:E,setIsFilterOpen:z,setIsSaveSegmentVisible:M,setLimit:te,setName:W,setNameDebounced:X,setOffset:Z,setPredicates:a,setReloadKey:Q,setRendering:p,setSegmentCount:ae,setSelectedFilterPredicate:P,setSort:re,sort:f},children:(0,i.jsx)(cO,{filtersButtonText:e.filtersButtonText,filtersSubtitle:e.filtersSubtitle,onSegmentDelete:e.onSegmentDelete,children:e.children})})};let hO=class extends Xc{constructor(e,t,n){super(e,t,n)}getCampaignsFilters(e){return[{slug:"state",name:this.t("status_06428"),category:this.t("Campaigns"),fieldType:Be.Select,values:Gt.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"campaign_type",name:this.t("type_35427"),category:this.t("Campaigns"),fieldType:Be.Select,values:Ht.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"created_by",name:this.t("cr_e_par_30622"),category:this.t("Campaigns"),fieldType:Be.Select,values:e.map(e=>({id:e.userId,name:e.nameOrEmail})),hideEmpty:!0},{slug:"sent_at",name:this.t("envoy_le_60398"),category:this.t("Campaigns"),fieldType:Be.Date,hideEmpty:!0}]}};hO=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hc,$c,Dn])],hO);const mO=e=>{const{translate:t}=il(),{columnsSearch:n,setColumnsSearch:o}=zC(),[s,r]=(0,F.useState)(""),a=(0,F.useMemo)(()=>h(s)?e.searchableColumns.filter(e=>e.name.toLowerCase().trim().includes(s.toLowerCase().trim())):e.searchableColumns,[e.searchableColumns,s]);return(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",css:{borderLeft:"none",borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"bars-filter"})}),(0,i.jsx)(Pd,{css:{padding:"0"},maxHeight:350,placement:"bottom-end",width:320,children:(0,i.jsxs)(Ea,{css:{padding:"$4 $6"},direction:"column",gap:"3",children:[(0,i.jsx)(fr,{font:"gray800 textMd medium",children:t("rechercher_sur_85243")}),(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("filtrer_78031"),state:"search",value:s,onChange:r}),(0,i.jsx)(Ea,{direction:"column",gap:"3",children:a.map(({slug:e,name:t})=>(0,i.jsx)(nc,{state:n.includes(e)?"checked":"unchecked",onClick:t=>{o(Jo(n,e,"checked"===t))},children:t},e))})]})})]})},gO=e=>{const t=Ln(),{isAdmin:n,isEditMode:o,isSaveVisible:s,massActions:r,name:a,possibleColumns:l,possibleRenderings:d,rendering:c,setAreColumnsOpen:u,setIsEditMode:h,setIsFilterOpen:m,setIsSaveSegmentVisible:g,setName:p,setNameDebounced:f,setRendering:x,setSelectedFilterPredicate:_}=zC(),I=e.actions&&n&&r.numberOfSelected>0,v=F.useMemo(()=>(0,Zd.A)(l.filter(e=>e.isSearchable),e=>e.name),[l]),b=F.useMemo(()=>e.showSearchColumns?{"& .h-styled-input-container":{borderBottomRightRadius:"0",borderTopRightRadius:"0"}}:{},[e.showSearchColumns]);return Hh("e",F.useCallback(()=>{h(!o)},[o,h])),(0,i.jsxs)(Ea,{align:"center",gap:"4",children:[(0,i.jsxs)(Ea,{width:320,children:[(0,i.jsx)(wl,{css:b,icon:"magnifying-glass",placeholder:e.searchPlaceholder,value:a,onChange:e=>{p(e),f(e)}}),e.showSearchColumns&&(0,i.jsx)(mO,{searchableColumns:v})]}),(0,i.jsx)(pl,{color:"gray",leftIcon:"bars-filter",onClick:()=>{_(null),m(!0)},children:t("filtres_64574")}),(0,i.jsx)(fr,{css:{flex:"1"},children:n&&s&&(0,i.jsx)(pl,{color:"invisible",onClick:()=>{g(!0)},children:t("enregistrer_la_22884")})}),!I&&e.showEditColumns&&(0,i.jsx)(pl,{color:"invisible",css:{color:"$gray800","&:hover":{color:"$gray800"}},leftIcon:"gear",onClick:()=>{u(!0)},children:t("_diter_les_colo_39630")}),!I&&e.showEditMode&&(0,i.jsx)(su,{value:o,onChange:h,children:t("mode_dition_93778")}),!I&&Zo(d)&&(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:kh(c),children:Ah(t,c)})}),(0,i.jsx)(Pd,{placement:"bottom-end",children:d.map(e=>(0,i.jsx)(Od,{icon:kh(e),onClick:()=>x(e),children:Ah(t,e)},e))})]}),I&&e.actions]})},pO=()=>{const e=Ln(),t=Nn(Xc),{filtersPredicates:n,clearNameCursors:o,setPredicates:s,setIsFilterOpen:r,setSelectedFilterPredicate:a,predicates:l}=zC(),d=(0,F.useCallback)(()=>{o(),s([])},[o,s]),c=(0,F.useCallback)(e=>{a(e),r(!0)},[r,a]),u=(0,F.useCallback)(e=>{o(),s((0,Xd.A)(l,e.predicate))},[l,o,s]);return Fh(n),Zo(n)?(0,i.jsxs)(Ea,{align:"center",gap:"3",width:1,wrap:"wrap",children:[n.map((e,n)=>e.filter.needLoading?(0,i.jsx)(Gd,{leftIcon:"loader"},n):(0,i.jsx)(Gd,{cursor:"pointer",ellipsis:!0,rightIcon:"xmark",onContentClick:()=>{c(e)},onRightIconClick:()=>{u(e)},children:t.filterPredicateToText(e)},n)),(0,i.jsx)(fr,{color:"gray700",css:{cursor:"pointer"},fontWeight:"medium",onClick:d,children:e("r_initialiser_l_66835")})]}):null},fO=e=>{const{isAdmin:t,limit:n,massActions:o}=zC(),s=t&&o.numberOfSelected===n;return(0,i.jsxs)(Ea,{css:{background:"white",border:"1px solid $gray200",borderBottom:"none",borderTopLeftRadius:"$2",borderTopRightRadius:"$2",padding:"$3 $4"},direction:"column",gap:"4",width:1,children:[e.searchRow,(0,i.jsx)(pO,{}),s&&e.selectSegment]})},xO=e=>{const{translate:t,params:{organizationId:n,segmentId:o}}=il(),{areSegmentsOpen:s,hideSegments:r,segment:a,setAreSegmentsOpen:l,setSegmentCount:d}=zC(),{data:c}=Vn("query SegmentHeader($organizationId: OrganizationId!, $segmentId: SegmentId!) {\n    organization(id: $organizationId) {\n        segment(id: $segmentId) {\n            count(shouldCompute: true)\n        }\n    }\n}\n",{organizationId:n,segmentId:a.id},[]);return F.useEffect(()=>{a.id===o&&d(a.id,c.organization?.segment.count??a.count)},[o,a,c.organization,d]),(0,i.jsx)(kC,{children:(0,i.jsxs)(Ea,{align:"center",gap:"4",width:1,children:[!r&&(0,i.jsx)(Ea,{css:{cursor:"pointer",padding:"$2"},onClick:()=>l(!s),children:(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"sidebar"})})}),(0,i.jsx)(am,{placement:"top",children:t(s?"masquer_la_list_94215":"afficher_la_lis_48771")})]})}),e.name||(0,i.jsxs)(fr,{css:{flex:"1"},font:"gray900 displayXs medium",children:[(0,i.jsxs)(Ea,{align:"center",gap:"4",children:[(0,i.jsx)(fr,{children:a.name}),a.isUsedInWorkflow&&(0,i.jsx)(Gd,{color:"white",leftIcon:"bolt-auto",children:t("utilis_e_dans_u_46582")})]}),a.description&&(0,i.jsx)(fr,{css:{whiteSpace:"pre-wrap"},font:"gray500 textXs medium",children:a.description})]}),e.children]})})},_O=()=>{const{translate:e,history:t,params:{organizationId:n}}=il();return(0,i.jsx)(xO,{children:(0,i.jsx)(ub,{rolesTypes:Tv,children:(0,i.jsx)(gS,{menu:(0,i.jsx)(Od,{icon:"paper-plane",onClick:()=>{t.push(rI.CREATE_TEMPLATE({organizationId:n}))},children:e("cr_er_un_mod_le_20298")}),onClick:()=>{t.push(rI.CREATE({organizationId:n}))},children:e("cr_er_une_campa_96023")})})})};function IO(e){switch(e){case ce.Draft:return{color:"gray",leftIcon:"pen-ruler"};case ce.Done:return{color:"success",leftIcon:"check"};case ce.InProgress:return{color:"warning",leftIcon:"hourglass-empty"};case ce.Scheduled:return{color:"primary",leftIcon:"calendar"};case ce.Template:return{color:"purple",leftIcon:"paper-plane"};default:return Za()}}const vO=e=>{const{history:t,translate:n}=il(),{showNotification:o}=Yv(),{mutate:s}=function(e={}){return Un("mutation CampaignDuplicate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $campaignId: CampaignId!\n) {\n    campaignDuplicate(organizationId: $organizationId, eventId: $eventId, campaignId: $campaignId) {\n        id\n    }\n}\n",e)}(),{mutate:r}=function(e={}){return Un("mutation CampaignSend(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $campaignId: CampaignId!\n) {\n    campaignSend(organizationId: $organizationId, eventId: $eventId, campaignId: $campaignId) {\n        id\n    }\n}\n",e)}(),{mutate:a}=function(e={}){return Un("mutation CampaignDelete(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $campaignId: CampaignId!\n) {\n    campaignDelete(organizationId: $organizationId, eventId: $eventId, campaignId: $campaignId) {\n        id\n    }\n}\n",e)}(),[l,d]=(0,F.useState)(!1),c=e.campaign.state===ce.Draft||e.campaign.state===ce.Scheduled;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(pm,{children:[(0,i.jsx)(Od,{icon:"pen",onClick:()=>{t.push(rI.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id}))},children:n("_diter_62574")}),c&&(0,i.jsx)(Od,{icon:"paper-plane",onClick:async()=>{await r({organizationId:e.organizationId,eventId:e.eventId,campaignId:e.campaign.id}),e.reload()},children:n("envoyer_26609")}),(0,i.jsx)(Od,{icon:"clone",onClick:async()=>{const{campaignDuplicate:{id:n}}=await s({organizationId:e.organizationId,eventId:e.eventId,campaignId:e.campaign.id});t.push(rI.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:n}))},children:n("dupliquer_28256")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:e=>{wd(e.target),d(!0)},children:n("supprimer_43083")})]}),l&&(0,i.jsx)(kk,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_58075"),text:n("suppression_de_73669",e.campaign.name),onClose:()=>{d(!1)},onDelete:async()=>{await a({organizationId:e.organizationId,eventId:e.eventId,campaignId:e.campaign.id}),o(n("la_campagne_1_92813",e.campaign.name)),e.reload()}})]})},bO=e=>{const{translate:t}=il(),n=Nn($c),o=e.campaign.sentAt?.setZone(Fo.c9.local().zone);return(0,i.jsxs)(Cc,{css:{"&:hover":{background:"$gray100"}},onMouseLeave:e=>{wd(e.target)},children:[(0,i.jsx)(xc,{children:(0,i.jsxs)(Ea,{direction:"column",width:1,children:[(0,i.jsx)(j_,{to:rI.CAMPAIGN({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id}),children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.campaign.name,children:e.campaign.name})}),e.campaign.state===ce.Done&&o&&(0,i.jsx)(fr,{color:"gray500",children:t("envoy_e_le_1_90336",n.toLocaleString(o,Ho.DateTime),e.campaign.createdBy?.nameOrEmail??"")}),e.campaign.state===ce.Scheduled&&e.campaign.scheduledAt?.isValid&&(0,i.jsx)(fr,{color:"gray500",children:t("programm_e_le_58279",n.toLocaleString(e.campaign.scheduledAt,Ho.DateOnly.MonthLong),n.toLocaleString(e.campaign.scheduledAt,Ho.TimeOnly))})]})}),(0,i.jsxs)(xc,{css:{flex:"0 150px"},children:[(0,i.jsx)(fr,{width:22,children:e.campaign.campaignType===ue.Email?(0,i.jsx)(Va,{icon:"at"}):(0,i.jsx)(Va,{icon:"message"})}),e.campaign.campaignType]}),(0,i.jsx)(xc,{css:{flex:"0 200px",justifyContent:"flex-end"},children:e.campaign.numberOfRecipients}),(0,i.jsx)(xc,{css:{flex:"0 150px",justifyContent:"flex-end"},children:e.campaign.campaignType===ue.Email?t("gratuit_13712"):`${e.campaign.cost} €`}),(0,i.jsx)(xc,{css:{flex:"0 150px"},children:(0,i.jsx)(Gd,{...IO(e.campaign.state),children:t(e.campaign.state)})}),(0,i.jsx)(im,{justify:"end",children:e.canSendCampaigns&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"pen",to:rI.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id})})})}),(0,i.jsx)(am,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsx)(vO,{campaign:e.campaign,eventId:e.eventId,organizationId:e.organizationId,reload:e.reload})]})})]})};function jO(e,t){(0,F.useEffect)(()=>{let n=null;return e.some(e=>e.state===ce.InProgress)&&(n=window.setInterval(t,3e4)),()=>{n&&clearInterval(n)}},[e])}const CO=()=>{const{translate:e,params:{organizationId:t}}=il(),{isOrganizationAdmin:n}=nI(),{limit:o,nameDebounced:s,offset:r,predicates:a,reloadKey:l,setLimit:d,setOffset:c,setSort:u,sort:m}=zC(),{data:g,isLoading:p,reload:f}=Vn("query CommunityCampaigns(\n    $organizationId: OrganizationId!\n    $predicates: [Predicate!]!\n    $name: String\n    $limit: Int\n    $offset: Int\n    $sort: CampaignsSort\n) {\n    organization(id: $organizationId) {\n        rows: campaigns(\n            level: Organization\n            predicates: $predicates\n            name: $name\n            limit: $limit\n            offset: $offset\n            sort: $sort\n        ) {\n            nodes {\n                ...CampaignList\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{organizationId:t,predicates:a,name:h(s)?s:null,limit:o,offset:r,sort:m},[Ro.CampaignListFragment]);const{numberOfPages:x,totalCount:_}=lu(g.organization?.rows);return(0,F.useEffect)(()=>{l>1&&f()},[l]),jO(g.organization?.rows.nodes??[],f),(0,i.jsx)(Ea,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(nm,{"aria-busy":p,headerRow:(0,i.jsxs)(cc,{children:[(0,i.jsx)(tm,{attribute:de.Name,setSort:u,sort:m,children:e("nom_de_la_campa_45063")}),(0,i.jsx)(tm,{attribute:de.Type,setSort:u,sort:m,width:150,children:e("type_35427")}),(0,i.jsx)(Tc,{width:200,children:e("nombre_de_desti_21374")}),(0,i.jsx)(Tc,{width:150,children:e("co_t_68998")}),(0,i.jsx)(tm,{attribute:de.State,css:{flex:"0 150px"},setSort:u,sort:m,children:e("status_06428")}),(0,i.jsx)(Tc,{width:100})]}),paginationRow:(0,i.jsx)(yc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(jc,{limit:o,numberOfPages:x,offset:r,setLimit:d,setOffset:c,showLimits:!0,totalCount:_})}),children:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{})]}):g.organization.rows.nodes.map(e=>(0,i.jsx)(bO,{campaign:e,canSendCampaigns:n,eventId:null,organizationId:t,reload:f},e.id))})})},yO=()=>{const e=Ln();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_O,{}),(0,i.jsxs)(yC,{children:[(0,i.jsx)(fO,{searchRow:(0,i.jsx)(gO,{searchPlaceholder:e("rechercher_une_69554"),showEditColumns:!1,showEditMode:!1,showSearchColumns:!1})}),(0,i.jsx)(CO,{})]})]})},kO=e=>{const{history:t,translate:n,params:{organizationId:o,segmentId:s}}=il(),{isOrganizationAdmin:r,localOrganization:a,updateLocalOrganization:l}=nI(),d=Nn(hO);return(0,i.jsx)(uO,{filters:d.getCampaignsFilters(e.organization.campaignsCreators),filtersButtonText:n("filtrer_les_cam_97457"),filtersSubtitle:n("appliquer_des_f_57442"),getSegmentPath:e=>rI.CAMPAIGNS_SEGMENT({organizationId:o,segmentId:e}),initialLimit:a?.campaignsLimit??_c,initialSegmentsOpen:a?.areCampaignsSegmentsOpen??!0,isAdmin:r,organizationId:o,possibleColumns:[],possibleRenderings:[],reload:e.reload,segmentId:s,segmentType:ft.Campaigns,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{l({campaignsLimit:e})},onSegmentClick:e=>{l({campaignsSegmentId:e})},onSegmentDelete:async()=>{await l({campaignsSegmentId:null}),t.replace(rI.CAMPAIGNS({organizationId:o}))},onSegmentsToggle:async e=>{await l({areCampaignsSegmentsOpen:e})},children:(0,i.jsx)(yO,{})})},AO=()=>{const{params:{organizationId:e},translate:t}=il();Cd(`${t("communaut_20896")} ${t("Campaigns")}`);const{localOrganization:n}=nI(),{data:o,loader:s,reload:r}=Vn("query CampaignsSegments($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        campaignsCreators {\n            userId\n            nameOrEmail\n        }\n\n        segmentsFolders(level: Organization, segmentType: Campaigns) {\n            ...SegmentsFoldersSegments\n        }\n    }\n}\n",{organizationId:e},[Ro.SegmentsFoldersSegmentsFragment]),a=(0,F.useMemo)(()=>(o.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[o.organization]);return s||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:rI.CAMPAIGNS_SEGMENT({organizationId:":organizationId",segmentId:":segmentId"}),children:(0,i.jsx)(kO,{organization:o.organization,reload:r})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:rI.CAMPAIGNS_SEGMENT({organizationId:e,segmentId:n?.campaignsSegmentId&&a.includes(n.campaignsSegmentId)?n?.campaignsSegmentId:a[0]}),replace:!0})})]})},wO=()=>{const{translate:e,params:{organizationId:t}}=il(),{hasFeature:n,updateLocalOrganization:o}=nI();return(0,i.jsxs)(aS,{"aria-label":e("menu_communauta_47274"),children:[(0,i.jsx)(rS,{replace:!1,to:fi.COMMUNITY_DASHBOARD({organizationId:t}),children:e("tableau_de_bord_24627")}),(0,i.jsx)(rS,{isActive:e=>e.endsWith("/users")||null!==e.match(/\/users\/\d+/)||null!==e.match(/\/member\/\d+/),replace:!1,to:fi.COMMUNITY_USERS({organizationId:t}),onClick:()=>o({usersSegmentId:null}),children:e("vos_membres_38104")}),(0,i.jsx)(rS,{isActive:e=>e.endsWith("/campaigns")&&!e.endsWith("/history/campaigns")||null!==e.match(/\/community\/campaigns\/\d+/)||null!==e.match(/\/community\/campaign\/\d+/),replace:!1,to:rI.CAMPAIGNS({organizationId:t}),onClick:()=>o({campaignsSegmentId:null}),children:e("Campaigns")}),(0,i.jsx)(rS,{replace:!1,to:zi.FORMS({organizationId:t}),children:e("Form_plural")}),n(Fe.Delegation)&&(0,i.jsx)(rS,{isActive:e=>e.endsWith("/delegations")||null!==e.match(/\/community\/delegations\/\d+/)||null!==e.match(/\/community\/delegation\/\d+/)||null!==e.match(/\/community\/delegation-category\/\d+/),replace:!1,to:So.COMMUNITY_DELEGATIONS(t),children:e("d_l_gations_78318")}),(0,i.jsx)(rS,{replace:!1,to:SI.WORKFLOWS({organizationId:t}),children:e("automatisations_60045")})]})},SO=e=>(0,i.jsx)(SE,{children:(0,i.jsxs)(Jl,{gridtemplatecolumns:"auto",gridtemplaterows:"55px 1fr",height:1,width:1,children:[(0,i.jsx)(wO,{}),(0,i.jsx)(fr,{css:{overflowY:"auto"},children:e.children})]})}),EO=()=>{const e=Ln(),{organizationId:t}=Wn(),n=Gn(),{data:o,loader:s}=Vn("query CommunityDashboard($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        events {\n            nodes {\n                id\n                name\n                range\n                assignedResources\n                resources\n                numberOfPositions\n            }\n        }\n\n        numberOfUsersInfos\n    }\n}\n",{organizationId:t},[]),r=Nn(Ku);return s||(0,i.jsxs)(Ea,{css:{margin:"auto"},direction:"column",height:1,width:"$container",children:[(0,i.jsx)(Pa,{height:"9"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("tableau_de_bord_24627")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:e("en_un_coup_d_oe_57288")}),(0,i.jsx)(Pa,{height:"9"}),(0,i.jsxs)(Ea,{gap:"6",width:1,children:[(0,i.jsx)(Aw,{icon:"megaphone",iconColor:"primary",text:e("nombre_d_v_nem_14214"),value:o.organization.events.nodes.length}),(0,i.jsx)(Aw,{icon:"user-group",iconColor:"purple",text:e("nombre_de_membr_08851"),value:o.organization.numberOfUsersInfos})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(kc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:e("nom_de_l_v_nem_08711")}),(0,i.jsx)(Tc,{children:e("date_de_l_v_ne_69973")}),(0,i.jsx)(Tc,{width:200,children:e("nombre_de_missi_67304_plural")}),(0,i.jsx)(Tc,{children:e("taux_de_remplis_11913")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:o.organization.events.nodes.map(e=>{const o=(0,ob.A)(e.assignedResources/e.resources*100);return(0,i.jsxs)(Cc,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},onClick:()=>{n.push(Pi.EVENT({organizationId:t,eventId:e.id}))},children:[(0,i.jsx)(xc,{children:e.name}),(0,i.jsx)(xc,{children:e.range?r.toDisplayString(e.range):"-"}),(0,i.jsx)(xc,{width:200,children:e.numberOfPositions}),(0,i.jsx)(xc,{children:e.resources>0?(0,i.jsxs)(Ea,{align:"center",gap:"3",height:1,width:1,children:[(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(YA,{percent:e.assignedResources/e.resources})}),(0,i.jsxs)(fr,{color:"gray700",width:40,children:[o," %"]})]}):"-"})]},e.id)})}),setOffset:Bl.A,title:e("liste_des_v_ne_29929"),totalCount:0}),(0,i.jsx)(Pa,{height:"9"})]})};var TO;function zO(e,t){return t===bh.AccreditationsMatrix?{includeAccreditationsSlots:!0,includeCampaigns:!1,includeChildren:!1,includeCreatedBy:!1,includeDocuments:!1,includeLeaders:!1,includeResources:!1,includeTags:!1,includeUsedCustomFieldsFilled:!1}:{includeAccreditationsSlots:!1,includeCampaigns:e.includes(TO.Campaigns),includeChildren:e.includes(TO.Events),includeCreatedBy:e.includes(TO.CreatedBy),includeDocuments:e.includes(TO.Documents),includeLeaders:e.includes(TO.Leaders),includeResources:e.includes(TO.FillingRate)||e.includes(TO.AssignedResources),includeTags:e.includes(TO.Tags),includeUsedCustomFieldsFilled:e.includes(TO.UsedCustomFieldsFilled)}}!function(e){e.AssignedResources="resources",e.Campaigns="campaigns",e.CanLeadersAddMembers="canLeadersAddMembers",e.CanLeadersDeleteMembers="canLeadersDeleteMembers",e.CanLeadersEditColumns="canLeadersEditColumns",e.CanLeadersEditCustomFields="canLeadersEditCustomFields",e.CanLeadersEditMembers="canLeadersEditMembers",e.CanLeadersImportMembers="canLeadersImportMembers",e.CanLeadersSeeHiddenAccreditationsSlots="canLeadersSeeHiddenAccreditationsSlots",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.DeadlineDate="deadlineDate",e.DelegationCategory="delegationCategory",e.DelegationSpaceLink="delegationSpaceLink",e.Description="description",e.Documents="documents",e.Events="events",e.FillingRate="fillingRate",e.Form="form",e.FormLink="formLink",e.Id="id",e.IsLocked="isLocked",e.Leaders="leaders",e.MaxResources="maxResources",e.Name="name",e.PrivateNote="privateNote",e.ShowFormLinkInDelegationSpace="showFormLinkInDelegationSpace",e.ShowInDelegation="showInDelegation",e.State="delegationState",e.UsedCustomFieldsFilled="usedCustomFieldsFilled",e.Tags="tags"}(TO||(TO={}));let $O=class extends Xc{constructor(e,t,n){super(e,t,n)}getDelegationsFilters(e,t,n,i){return(0,Da.A)([{slug:TO.Name,name:this.t("nom_de_la_d_l_g_28087"),category:this.t("d_l_gations_78318"),fieldType:Be.Text,hideEmpty:!0},{slug:TO.Description,name:this.t("Description"),category:this.t("d_l_gations_78318"),fieldType:Be.Text},{slug:TO.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("d_l_gations_78318"),fieldType:Be.Text},Zo(i)?{slug:TO.DelegationCategory,name:this.t("cat_gorie_00291"),category:this.t("d_l_gations_78318"),fieldType:Be.Select,values:i,hideEmpty:!0}:null,{slug:"delegationState",name:this.t("status_06428"),category:this.t("d_l_gations_78318"),fieldType:Be.Select,values:Jt.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:TO.Leaders,name:this.t("reponsable_82458_plural"),category:this.t("d_l_gations_78318"),fieldType:Be.Select,needLoading:!0,organizationId:e,eventId:t},{slug:"form",name:this.t("Form"),category:this.t("d_l_gations_78318"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:"deadlineDate",name:this.t("date_limite_d_i_79779"),category:this.t("d_l_gations_78318"),fieldType:Be.Date},{slug:"tag",name:this.t("Tag"),category:this.t("d_l_gations_78318"),fieldType:Be.Select,needLoading:!0,organizationId:e,eventId:t,tagContext:vt.Delegations},{slug:"resources",name:this.t("nombre_de_membr_08851"),category:this.t("d_l_gations_78318"),fieldType:Be.Number,hideEmpty:!0},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("d_l_gations_78318"),fieldType:Be.Number,hideEmpty:!0},{slug:TO.ShowInDelegation,name:this.t("ShowInDelegationSpace"),category:this.t("d_l_gations_78318"),fieldType:Be.Checkbox,hideEmpty:!0},{slug:TO.CanLeadersAddMembers,name:this.t("CanLeadersAddMembers"),category:this.t("d_l_gations_78318"),fieldType:Be.Checkbox,hideEmpty:!0},{slug:TO.CanLeadersDeleteMembers,name:this.t("CanLeadersAddMembers"),category:this.t("d_l_gations_78318"),fieldType:Be.Checkbox,hideEmpty:!0},{slug:TO.CanLeadersEditMembers,name:this.t("CanLeadersEditMembers"),category:this.t("d_l_gations_78318"),fieldType:Be.Checkbox,hideEmpty:!0},{slug:TO.CanLeadersEditColumns,name:this.t("CanLeadersAddMembers"),category:this.t("d_l_gations_78318"),fieldType:Be.Checkbox,hideEmpty:!0},{slug:TO.CanLeadersEditCustomFields,name:this.t("CanLeadersEditCustomFields"),category:this.t("d_l_gations_78318"),fieldType:Be.Checkbox,hideEmpty:!0},{slug:TO.CanLeadersImportMembers,name:this.t("CanLeadersImportMembers"),category:this.t("d_l_gations_78318"),fieldType:Be.Checkbox,hideEmpty:!0},{slug:TO.CanLeadersSeeHiddenAccreditationsSlots,name:this.t("CanLeadersSeeHiddenAccreditationsSlots"),category:this.t("d_l_gations_78318"),fieldType:Be.Checkbox,hideEmpty:!0},{slug:TO.ShowFormLinkInDelegationSpace,name:this.t("afficher_le_lie_05841"),category:this.t("d_l_gations_78318"),fieldType:Be.Checkbox,hideEmpty:!0},t?{slug:"accreditation",name:this.t("accr_ditations_39450"),category:this.t("d_l_gations_78318"),fieldType:Be.Select,needLoading:!0,eventId:t}:null,{slug:TO.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("d_l_gations_78318"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:TO.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("d_l_gations_78318"),fieldType:Be.Datetime,hideEmpty:!0},t?null:{slug:"event",name:this.t("_v_nement_22345"),category:this.t("d_l_gations_78318"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:TO.UsedCustomFieldsFilled,name:this.t("champs_personna_27238"),category:this.t("d_l_gations_78318"),fieldType:Be.Checkbox,hideEmpty:!0},...this.customFieldsToFilters(n)])}getDelegationsPossibleColumns(e){return[{slug:TO.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:Ce.Id,width:100},{slug:TO.Name,name:this.t("nom_de_la_d_l_g_28087"),isSearchable:!0,isSortable:!0,sortAttribute:Ce.Name,minWidth:240},{slug:TO.DelegationCategory,name:this.t("cat_gorie_00291"),isSearchable:!0,isSortable:!0,sortAttribute:Ce.Category,minWidth:240},{slug:TO.State,name:this.t("status_06428"),minWidth:180},{slug:TO.Leaders,name:this.t("reponsable_82458_plural"),isSearchable:!0,minWidth:320},{slug:TO.Form,name:this.t("Form"),isSearchable:!0,minWidth:180},{slug:TO.FormLink,name:this.t("FormLink"),minWidth:240},{slug:TO.DelegationSpaceLink,name:this.t("DelegationSpaceLink"),minWidth:240},{slug:TO.DeadlineDate,name:this.t("date_limite_d_i_79779"),minWidth:180},{slug:TO.MaxResources,name:this.t("MaxResources"),minWidth:180},{slug:TO.AssignedResources,name:this.t("membres_11310"),minWidth:240},{slug:TO.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:240},{slug:TO.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:TO.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:TO.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:Ce.CreatedAt,minWidth:180},{slug:TO.ShowInDelegation,name:this.t("ShowInDelegationSpace"),minWidth:180},{slug:TO.CanLeadersAddMembers,name:this.t("CanLeadersAddMembers"),minWidth:180},{slug:TO.CanLeadersEditMembers,name:this.t("CanLeadersEditMembers"),minWidth:180},{slug:TO.CanLeadersDeleteMembers,name:this.t("CanLeadersDeleteMembers"),minWidth:180},{slug:TO.CanLeadersEditColumns,name:this.t("CanLeadersEditColumns"),minWidth:180},{slug:TO.CanLeadersEditCustomFields,name:this.t("CanLeadersEditCustomFields"),minWidth:180},{slug:TO.CanLeadersImportMembers,name:this.t("CanLeadersImportMembers"),minWidth:180},{slug:TO.CanLeadersSeeHiddenAccreditationsSlots,name:this.t("CanLeadersSeeHiddenAccreditationsSlots"),minWidth:180},{slug:TO.ShowFormLinkInDelegationSpace,name:this.t("afficher_le_lie_05841"),minWidth:180},{slug:TO.IsLocked,name:this.t("IsLocked"),minWidth:180},{slug:TO.Events,name:this.t("_v_nements_53672"),minWidth:320},{slug:TO.Campaigns,name:this.t("campagnes_que_l_81468"),minWidth:320},{slug:TO.Documents,name:this.t("documents_que_l_18755"),minWidth:320},{slug:TO.UsedCustomFieldsFilled,name:this.t("champs_personna_27238"),minWidth:180},...this.customFieldsToPossibleColumns(e)]}};function OO(e,t,n){const[i,o]=(0,F.useState)(null);return(0,F.useCallback)(async()=>{if(i)return i;{const i=await e(t,await H()),s=n(i);return o(s),s}},[i,e,t])}$O=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hc,$c,Dn])],$O);const RO=F.createContext({}),PO=e=>{const t=OO(Cs,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?et.Event:et.Organization},e=>e.organization.campaigns.nodes),n=OO(Cs,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?et.Event:et.Organization},e=>e.organization.event?.customDocuments??[]),o=OO(Cs,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?et.Event:et.Organization},e=>e.organization.delegationsCategories.nodes),s=OO(Cs,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?et.Event:et.Organization},e=>e.organization.forms.nodes),r=OO(Cs,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?et.Event:et.Organization},e=>e.organization.tags.nodes);return(0,i.jsx)(RO.Provider,{value:{getCampaigns:t,getCustomDocuments:n,getDelegationsCategories:o,getEditPath:e.getEditPath,getShowPath:e.getShowPath,getForms:s,getTags:r},children:e.children})};function DO(){return F.useContext(RO)}const FO=e=>{const t=Ln(),{massActions:n,segment:o}=zC(),s=(0,F.useCallback)(()=>{n.toggleSelectAll("unchecked"),n.setIsAllSelected(!1)},[n]),r=(0,F.useCallback)(()=>{n.setIsAllSelected(!0)},[n]);return(0,i.jsxs)(Ea,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$3 $4"},gap:"3",children:[(0,i.jsx)(fr,{fontSize:"textMd",fontWeight:"medium",children:(0,i.jsx)(Va,{icon:"circle-exclamation"})}),n.isAllSelected?(0,i.jsx)(fr,{color:"gray700",css:{flex:"1"},fontWeight:"medium",children:e.segmentSelectedText}):(0,i.jsx)(fr,{color:"gray700",css:{flex:"1"},fontWeight:"medium",children:e.pageSelectedText}),n.isAllSelected?(0,i.jsx)(fr,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",onClick:s,children:t("effacer_la_s_le_85095")}):(0,i.jsx)(fr,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",onClick:r,children:t("s_lectionner_le_71777",o.count,o.name)})]})},MO=e=>{const{translate:t,params:{organizationId:n}}=il(),[o,s]=(0,F.useState)(!1),[r,a]=(0,F.useState)(Je.Add),[l,d]=(0,F.useState)([]),[c,u]=(0,F.useState)(e.roles[0]?.id??null),[h,m,g]=Ec(""),{usersInfosOptions:p,isLoading:f}=gb({organizationId:n,eventId:null,hasSelected:Zo(l),nameDebounced:m,userInfoIds:l}),x=Zo(l);return(0,i.jsx)(nb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"user-gear",children:t("_diter_les_resp_29588")}),(0,i.jsxs)(Qv,{gap:"6",children:[(0,i.jsxs)(gu,{label:t("que_souhaitez_v_87607"),value:r,onChange:a,children:[(0,i.jsx)("option",{value:Je.Add,children:t("ajouter_des_res_84773")}),(0,i.jsx)("option",{value:Je.Replace,children:t("remplacer_les_r_60774")}),(0,i.jsx)("option",{value:Je.Delete,children:t("supprimer_des_r_69379")})]}),(0,i.jsx)(dc,{isSearchLoading:f,isSearchVisible:!0,label:t("reponsable_82458_plural"),multiple:!0,renderOnPortal:!0,searchElement:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),state:"search",value:h,onChange:g}),values:l,onChange:d,children:p}),e.showRoleSelect&&r!==Je.Delete&&(0,i.jsx)(gu,{label:t("r_le_59302"),shouldParseAsInt:!0,value:c,onChange:u,children:e.roles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(Jv,{children:(0,i.jsx)(pl,{disabled:!x,isLoading:o,onClick:async()=>{s(!0),await e.onSuccess(r,l.map(e=>({userInfoId:e,roleId:c}))),e.onClose(),s(!1)},children:t("_diter_62574")})})]})})},NO=e=>(0,i.jsx)(Qc.JY,{onDragEnd:({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&e.setSelectedColumns(es(e.selectedColumns,n.index,i.index))},children:(0,i.jsx)(Qc.gL,{droppableId:"1",children:t=>(0,i.jsxs)(Ea,{css:{background:"$gray50",bd:"gray200 1",padding:"$4"},direction:"column",...t.droppableProps,ref:t.innerRef,children:[e.selectedColumns.map((e,t)=>(0,i.jsx)(Qc.sx,{draggableId:e.slug,index:t,children:t=>(0,i.jsxs)(Ea,{align:"center",css:{background:"white",border:"1px solid $gray200",borderTop:"none",px:"$4","&:first-child":{borderTop:"1px solid $gray200",borderTopLeftRadius:"$1",borderTopRightRadius:"$1"},"&:last-child":{borderBottomLeftRadius:"$1",borderBottomRightRadius:"$1"}},gap:"3",height:40,...t.draggableProps,ref:t.innerRef,children:[(0,i.jsx)(fr,{color:"gray300",css:{cursor:"grab"},...t.dragHandleProps,children:(0,i.jsx)(Va,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(fr,{color:"gray800",children:e.name})]})},e.slug)),t.placeholder]})})}),LO=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),s=Nn(Eh),{data:r}=Vn("query MassColumnsCustomFields($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        ...OrganizationCustomFields\n    }\n}\n",{organizationId:n},[Ro.OrganizationCustomFieldsFragment]),{mutate:a,isLoading:l}=js(),d=(0,F.useMemo)(()=>s.getDelegationMembersPossibleColumns(r.organization?.customFields.nodes??[],{isWeezeventConnected:!0,positionDisplay:ht.Position,slotDisplay:gt.Custom}),[s,r.organization]),[c,u]=(0,F.useState)(""),m=(0,F.useMemo)(()=>d.filter(e=>!h(c)||e.name.trim().toLowerCase().includes(c.trim().toLowerCase())),[d,c]),[g,p]=(0,F.useState)([]);return(0,i.jsx)(nb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"line-columns",children:t("_diter_les_colo_38837")}),(0,i.jsxs)(Qv,{gap:"2",children:[(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("quelles_colonne_05047")}),Zo(g)&&(0,i.jsx)(NO,{selectedColumns:g,setSelectedColumns:p}),(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"invisible",leftIcon:"plus",children:t("ajouter_des_col_04043")})}),(0,i.jsx)(Pd,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:400,children:(0,i.jsxs)(Ea,{css:{py:"$3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(fr,{css:{px:"$3"},children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_un_c_86475"),state:"search",value:c,onChange:u})}),(0,i.jsx)(fr,{css:{maxHeight:"300px",overflowY:"auto",px:"$3"},children:m.map(e=>(0,i.jsx)(rc,{isCheckbox:!0,isRadio:!1,isSelected:g.includes(e),value:e.slug,onClick:()=>{p(t=>Jo(t,e,!t.includes(e)))},children:e.name},e.slug))})]})})]})]}),(0,i.jsx)(Jv,{children:(0,i.jsx)(pl,{isLoading:l,onClick:async()=>{const i=(await a({organizationId:n,eventId:o,massEdit:{reset:!1,selecteds:e.selecteds,slug:ve.Columns,strategy:Je.Replace,value:g.map(e=>e.slug)}})).numberOfEdited;e.onSuccess(t("les_colonnes_de_83023",i)),e.onClose()},children:t("mettre_jour_85141")})})]})})},BO=e=>{const{translate:t}=il(),{mutate:n,isLoading:o}=function(e={}){return Un("mutation DelegationsMassMove(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $massMove: MassDelegationsMove!\n) {\n    numberOfDelegations: delegationsMassMove(\n        organizationId: $organizationId\n        eventId: $eventId\n        massMove: $massMove\n    )\n}\n",e)}(),[s,r]=(0,F.useState)([]),[a,l]=(0,F.useState)([]),{data:d}=Vn("query DelegationsMassMoveInfos(\n    $organizationId: OrganizationId!\n    $level: OrganizationEventLevel!\n    $eventId: EventId\n) {\n    organization(id: $organizationId) {\n        events {\n            nodes {\n                id\n                name\n            }\n        }\n\n        forms(level: $level, eventId: $eventId) {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n}\n",{organizationId:e.organizationId,level:e.eventId?et.Organization:et.Event,eventId:s[0]},[]);const c=(!!e.eventId||Zo(s))&&Zo(a);return(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ea,{justify:"center",children:(0,i.jsx)(mj,{color:"primary",icon:"clone"})}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{font:"gray900 textLg medium",textAlign:"center",children:t("copier_les_d_l_43406")}),e.eventId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:t("cela_liera_vos_60643")})]}),(0,i.jsx)(Pa,{height:"7"}),!e.eventId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(dc,{isSearchVisible:!0,label:t("_v_nement_22345"),values:s,onChange:r,children:(d.organization?.events.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Pa,{height:"4"})]}),(e.eventId||Zo(s))&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(dc,{isSearchVisible:!0,label:t("formulaire_ut_59771"),values:a,onChange:l,children:(d.organization?.forms.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{disabled:!c,isLoading:o,onClick:async()=>{const i=(await n({organizationId:e.organizationId,eventId:e.eventId,massMove:{eventId:e.eventId?null:s[0],formId:a[0],selecteds:e.selecteds}})).numberOfDelegations;e.onSuccess(t("_1_d_l_gations_15078",i)),e.onClose()},children:t("copier_75889")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},VO=()=>{const e=Ln(),{eventId:t,massActions:n,onMassEditSuccess:o,organizationId:s,predicates:r,segment:a}=zC(),{showNotification:l}=Yv(),{mutate:d}=js(),{mutate:c}=function(e={}){return Un("mutation DelegationsMassLeadersEdit(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $massLeaders: MassLeadersInput!\n) {\n    numberOfDelegations: delegationsMassLeadersEdit(\n        organizationId: $organizationId\n        eventId: $eventId\n        massLeaders: $massLeaders\n    )\n}\n",e)}(),{mutate:u}=Hr(),[m,g]=(0,F.useState)(!1),[p,f]=(0,F.useState)(!1),[x,_]=(0,F.useState)(!1),[I,v]=(0,F.useState)(!1),[b,j]=(0,F.useState)(!1),C=n.getSelectedsInput(r,null),y=n.isAllSelected?a.count:n.numberOfSelected,k=(0,F.useCallback)(e=>{h(e)&&l(e),o()},[o]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pl,{onClick:()=>{g(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsx)(Od,{icon:"clone",onClick:()=>{f(!0)},children:e(t?"copier_dans_la_91936":"copier_dans_un_20230")}),(0,i.jsx)(Od,{icon:"user-gear",onClick:()=>_(!0),children:e("_diter_les_resp_29588")}),(0,i.jsx)(Od,{icon:"line-columns",onClick:()=>v(!0),children:e("_diter_les_colo_38837")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{j(!0)},children:e("supprimer_43083")})]})]}),m&&(0,i.jsx)(Rk,{eventId:t,mutate:e=>d({organizationId:s,eventId:t,massEdit:e}),organizationId:s,selecteds:C,onClose:()=>{g(!1)},onSuccess:t=>{k(e("_1_d_l_gations_08105",t))}}),p&&(0,i.jsx)(BO,{eventId:t,organizationId:s,selecteds:C,onClose:()=>{f(!1)},onSuccess:o}),x&&(0,i.jsx)(MO,{roles:[],showRoleSelect:!1,onClose:()=>_(!1),onSuccess:async(n,i)=>{const o=(await c({organizationId:s,eventId:t,massLeaders:{leaders:i,strategy:n,selecteds:C}})).numberOfDelegations;k(e("les_responsable_32087",o))}}),I&&(0,i.jsx)(LO,{selecteds:C,onClose:()=>v(!1),onSuccess:k}),b&&(0,i.jsx)(kk,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_34990")],text:e("suppression_de_99024",y),onClose:()=>{j(!1)},onDelete:async()=>{const n=(await u({organizationId:s,eventId:t,selecteds:C})).numberOfDelegations;k(e("_1_d_l_gations_40887",n))}})]})},UO=e=>{const t=Ln(),n=Nn(Hk);return(0,i.jsxs)(Ea,{align:"center",css:{"& > div":{width:"100%"}},gap:"2",width:1,children:[(0,i.jsx)(fr,{children:t("_1_2_membres_04485",e.assignedResources,n.toNumberOrInfinity(e.resources))}),(0,i.jsx)(YA,{percent:e.assignedResources/(e.resources||e.assignedResources)})]})},WO=e=>{const t=(0,F.useMemo)(()=>(e.delegation.children||[]).flatMap(e=>e.event?[{id:e.event.id,color:"gray",icon:null,text:e.event.name}]:[]),[e.delegation]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:t})})},GO=(0,i.jsx)(ul,{});function HO(e){const[t,n]=(0,F.useState)(!0),[i,o]=(0,F.useState)(null);return(0,F.useEffect)(()=>{e().then(e=>{o(e),n(!1)},()=>{n(!1)})},[]),{isLoading:t,loader:t?GO:null,result:i}}const qO=e=>{const{translate:t}=il(),{getCampaigns:n}=DO(),{result:o,isLoading:s}=HO(n);return s?(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(yl,{children:t("tags_79499")}),(0,i.jsx)(qd,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(dc,{isSearchVisible:!0,label:t("Campaigns"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},YO=e=>{const{eventId:t,organizationId:n}=zC(),{mutate:o}=js();return(0,i.jsx)(PC,{column:e.column,initialValue:e.initialValue,mutate:async i=>o({organizationId:n,eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.delegation.id]},slug:e.property,strategy:Je.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},KO=e=>{const t=(0,F.useMemo)(()=>e.delegation.campaigns||[],[e.delegation]),n=(0,F.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(YO,{column:e.column,delegation:e.delegation,initialValue:t.map(e=>e.id),property:ve.Campaigns,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(qO,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(qC,{badges:n})})},ZO=({children:e,isEditMode:t,title:n,updatable:o})=>t&&o?(0,i.jsx)(fr,{css:{ellipsis:!0},font:"gray900 textSm medium",title:n,width:1,children:n}):(0,i.jsx)(i.Fragment,{children:e}),XO=e=>{const{translate:t}=il(),{getDelegationsCategories:n}=DO(),{result:o,isLoading:s}=HO(n);return s?(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(yl,{children:t("Category")}),(0,i.jsx)(qd,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(gu,{label:t("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},JO=e=>{const{params:{organizationId:t,eventId:n}}=il(),{isEditMode:o}=zC();return(0,i.jsx)(YO,{column:e.column,delegation:e.delegation,initialValue:e.delegation.delegationCategory.id,property:ve.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(XO,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(ZO,{isEditMode:o,title:e.delegation.delegationCategory.name,updatable:!0,children:(0,i.jsx)(j_,{to:to.DELEGATION_CATEGORY({organizationId:t,eventId:n,delegationCategoryId:e.delegation.delegationCategory.id}),children:e.delegation.delegationCategory.name})})})},QO=e=>{const t=Ln(),n=Nn($c);return(0,i.jsx)(YO,{column:e.column,delegation:e.delegation,initialValue:e.delegation.deadlineDate,property:ve.DeadlineDate,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(_u,{label:t("date_limite_d_i_79779"),value:e,onChange:n}),renderValue:e.delegation.deadlineDate?n.toLocaleString(e.delegation.deadlineDate,Ho.DateOnly.MonthLong):"-"})},eR=e=>{const{translate:t}=il(),{getCustomDocuments:n}=DO(),{result:o,isLoading:s}=HO(n);return s?(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(yl,{children:t("tags_79499")}),(0,i.jsx)(qd,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(dc,{isSearchVisible:!0,label:t("Documents"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:o.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))})},tR=e=>{const t=(0,F.useMemo)(()=>e.delegation.customDocuments||[],[e.delegation]),n=(0,F.useMemo)(()=>t.map(e=>({id:e.slug,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(YO,{column:e.column,delegation:e.delegation,initialValue:t.map(e=>e.slug),property:ve.Documents,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(eR,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(qC,{badges:n})})},nR=e=>{const t=Ln(),{getForms:n}=DO(),{result:o,isLoading:s}=HO(n);return s?(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(yl,{children:t("Form")}),(0,i.jsx)(qd,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(gu,{label:t("Form"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},iR=e=>(0,i.jsx)(YO,{column:e.column,delegation:e.delegation,initialValue:e.delegation.form.id,property:ve.Form,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(nR,{setValue:t,value:e}),renderValue:e.delegation.form.name}),oR=e=>{const t=Ln();return(0,i.jsx)(YO,{column:e.column,delegation:e.delegation,initialValue:e.delegation.lockedAt?.isValid??!1,property:ve.IsLocked,reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(gu,{label:t("IsLocked"),shouldParseAsBoolean:!0,value:e,onChange:n,children:[(0,i.jsx)("option",{value:"true",children:t("oui_54361")}),(0,i.jsx)("option",{value:"false",children:t("non_33516")})]}),renderValue:e.delegation.lockedAt?.isValid?t("oui_54361"):t("non_33516")})},sR=e=>{const t=(0,F.useMemo)(()=>(0,Zd.A)(e.delegation.leaders,e=>e.nameOrEmail.toLowerCase()).map(e=>({id:e.id,color:"gray",icon:null,text:e.nameOrEmail})),[e.delegation]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:t})})},rR=e=>{const t=Ln(),n=Nn(Hk);return(0,i.jsx)(YO,{column:e.column,delegation:e.delegation,initialValue:e.delegation.maxResources||"",property:ve.MaxResources,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(wl,{label:t("MaxResources"),shouldParseAsInt:!0,value:e,onChange:n}),renderValue:n.toNumberOrInfinity(e.delegation.maxResources)})},aR=e=>{const{translate:t}=il(),{isEditMode:n}=zC(),{getShowPath:o}=DO();return(0,i.jsx)(YO,{column:e.column,delegation:e.delegation,initialValue:e.delegation.name,property:ve.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(wl,{label:t("nom_de_la_d_l_g_28087"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(ZO,{isEditMode:n,title:e.delegation.name,updatable:!0,children:(0,i.jsx)(j_,{to:o(e.delegation.id),children:e.delegation.name})})})},lR=e=>{const t=Ln();return(0,i.jsx)(YO,{column:e.column,delegation:e.delegation,initialValue:e.value,property:e.property,reload:e.reload,renderInput:(n,o)=>(0,i.jsxs)(gu,{label:e.label,shouldParseAsBoolean:!0,value:n,onChange:o,children:[(0,i.jsx)("option",{value:"true",children:t("oui_54361")}),(0,i.jsx)("option",{value:"false",children:t("non_33516")})]}),renderValue:e.value?t("oui_54361"):t("non_33516")})},dR=e=>{const{translate:t}=il(),{getTags:n}=DO(),{result:o,isLoading:s}=HO(n);return s?(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(yl,{children:t("tags_79499")}),(0,i.jsx)(qd,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(dc,{isSearchVisible:!0,label:t("tags_79499"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},cR=e=>{const t=(0,F.useMemo)(()=>e.delegation.tags||[],[e.delegation]),n=(0,F.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(YO,{column:e.column,delegation:e.delegation,initialValue:t.map(e=>e.id),property:ve.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(dR,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(qC,{badges:n})})},uR=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{mutate:s}=js(),r=(0,F.useCallback)((t,n)=>s({organizationId:e.organizationId,eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:n,strategy:Je.Replace,value:t}}),[e.row,s]),a=(0,F.useMemo)(()=>Hm({organizationId:n,eventId:o,delegationId:e.row.id,formId:e.row.form.id}),[e.row]),l=(0,F.useMemo)(()=>Gm(n,to.DELEGATION({organizationId:n,eventId:o,delegationId:e.row.id})),[e.row]);return e.column.slug===TO.Id?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===TO.Name?(0,i.jsx)(aR,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===TO.DelegationCategory?(0,i.jsx)(JO,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===TO.State?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Gd,{...Zb(e.row.state),children:t(e.row.state)})}):e.column.slug===TO.Leaders?(0,i.jsx)(sR,{column:e.column,delegation:e.row}):e.column.slug===TO.Form?(0,i.jsx)(iR,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===TO.FormLink?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(j_,{to:a,children:a})}):e.column.slug===TO.DelegationSpaceLink?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(j_,{to:l,children:l})}):e.column.slug===TO.DeadlineDate?(0,i.jsx)(QO,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===TO.MaxResources?(0,i.jsx)(rR,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===TO.AssignedResources?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UO,{assignedResources:e.row.numberOfResources,resources:e.row.maxResources})}):e.column.slug===TO.Tags?(0,i.jsx)(cR,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===TO.FillingRate?(0,i.jsxs)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===TO.CreatedBy?(0,i.jsx)(V$,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===TO.ShowInDelegation?(0,i.jsx)(lR,{column:e.column,delegation:e.row,label:t("ShowInDelegationSpace"),property:ve.ShowInDelegationSpace,reload:e.reloadRow,value:e.row.showInDelegationSpace}):e.column.slug===TO.CanLeadersAddMembers?(0,i.jsx)(lR,{column:e.column,delegation:e.row,label:t("CanLeadersAddMembers"),property:ve.CanLeadersAddMembers,reload:e.reloadRow,value:e.row.canLeadersAddMembers}):e.column.slug===TO.CanLeadersDeleteMembers?(0,i.jsx)(lR,{column:e.column,delegation:e.row,label:t("CanLeadersDeleteMembers"),property:ve.CanLeadersDeleteMembers,reload:e.reloadRow,value:e.row.canLeadersDeleteMembers}):e.column.slug===TO.CanLeadersEditColumns?(0,i.jsx)(lR,{column:e.column,delegation:e.row,label:t("CanLeadersEditColumns"),property:ve.CanLeadersEditColumns,reload:e.reloadRow,value:e.row.canLeadersEditColumns}):e.column.slug===TO.CanLeadersEditMembers?(0,i.jsx)(lR,{column:e.column,delegation:e.row,label:t("CanLeadersEditMembers"),property:ve.CanLeadersEditMembers,reload:e.reloadRow,value:e.row.canLeadersEditMembers}):e.column.slug===TO.CanLeadersEditCustomFields?(0,i.jsx)(lR,{column:e.column,delegation:e.row,label:t("CanLeadersEditCustomFields"),property:ve.CanLeadersEditCustomFields,reload:e.reloadRow,value:e.row.canLeadersEditCustomFields}):e.column.slug===TO.CanLeadersImportMembers?(0,i.jsx)(lR,{column:e.column,delegation:e.row,label:t("CanLeadersImportMembers"),property:ve.CanLeadersImportMembers,reload:e.reloadRow,value:e.row.canLeadersImportMembers}):e.column.slug===TO.CanLeadersSeeHiddenAccreditationsSlots?(0,i.jsx)(lR,{column:e.column,delegation:e.row,label:t("CanLeadersSeeHiddenAccreditationsSlots"),property:ve.CanLeadersSeeHiddenAccreditationsSlots,reload:e.reloadRow,value:e.row.canLeadersSeeHiddenAccreditationsSlots}):e.column.slug===TO.ShowFormLinkInDelegationSpace?(0,i.jsx)(lR,{column:e.column,delegation:e.row,label:t("afficher_le_lie_05841"),property:ve.ShowFormLinkInDelegationSpace,reload:e.reloadRow,value:e.row.showFormLinkInDelegationSpace}):e.column.slug===TO.IsLocked?(0,i.jsx)(oR,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===TO.CreatedAt?(0,i.jsx)(B$,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===TO.Campaigns?(0,i.jsx)(KO,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===TO.Documents?(0,i.jsx)(tR,{column:e.column,delegation:e.row,reload:e.reloadRow}):"events"===e.column.slug?(0,i.jsx)(WO,{column:e.column,delegation:e.row}):e.column.slug===TO.UsedCustomFieldsFilled?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:t(e.row.usedCustomFieldsFilled?.toString()||"-")}):(0,i.jsx)(JC,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:r,reload:e.reloadRow,updatable:!0})},hR=e=>{const{history:t,translate:n}=il(),{getEditPath:o}=DO(),{mutate:s}=Wr(),[r,a]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(pm,{children:[(0,i.jsx)(Od,{icon:"pen",to:o(e.delegation.id),children:n("_diter_62574")}),(0,i.jsx)(Od,{icon:"clone",onClick:async()=>{const{delegationDuplicate:n}=await s({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegation.id});t.push(o(n.id))},children:n("dupliquer_28256")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:async()=>{a(!0)},children:n("supprimer_43083")})]}),r&&(0,i.jsx)(gw,{delegation:e.delegation,onClose:()=>{a(!1)},onSuccess:e.reload})]})},mR=({columns:e,customFields:t,delegation:n,eventId:o,organizationId:s,state:r,reload:a,reloadDelegation:l,toggleRow:d})=>{const{isOrganizationAdmin:c}=nI(),{isEventAdmin:u}=Uv(),h=c||u,{getEditPath:m}=DO(),g=SC(t),p=(0,F.useCallback)(()=>{l(n.id)},[n,l]);return(0,i.jsxs)(Cc,{css:{background:"checked"===r?"$primary100":"white","&:hover":{background:"checked"===r?"$primary100":"$gray100"}},onMouseLeave:e=>{wd(e.target)},children:[h&&(0,i.jsx)(xc,{justify:"center",width:48,children:(0,i.jsx)(tc,{state:r,onClick:(e,t)=>{Il(t),d(`d${n.id}`,e)}})}),e.map(e=>{const t=g.get(e.slug);return(0,i.jsx)(uR,{column:e,customField:t,eventId:o,organizationId:s,reloadRow:p,row:n},e.slug)}),h&&(0,i.jsxs)(im,{justify:"center",children:[(0,i.jsx)(sm,{children:(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"pen",to:m(n.id)})})})}),(0,i.jsx)(hR,{delegation:n,eventId:o,organizationId:s,reload:a})]})]})},gR=e=>{const{isOrganizationAdmin:t}=nI(),{isEventAdmin:n}=Uv(),o=t||n,{columns:s,columnsSearch:r,limit:a,massActions:l,nameDebounced:d,offset:c,possibleColumns:u,predicates:m,reloadKey:g,rendering:p,setLimit:f,setOffset:x,setSort:_,sort:I}=zC(),v=(0,F.useMemo)(()=>zO(s,p),[s,p]),{data:b,isLoading:j,reload:C}=Gr({...v,organizationId:e.organizationId,level:e.level,eventId:e.eventId,name:h(d)?d:null,columnsSearch:Zo(r)?r:null,predicates:m,limit:a,offset:c,sort:I}),y=(0,F.useMemo)(()=>s.flatMap(e=>(0,Da.A)([u.find(t=>t.slug===e)])),[u,s]),{numberOfPages:k,totalCount:A}=lu(b.data?.rows),[w,S]=(0,F.useState)([]),[E,T]=(0,F.useState)({}),z=(0,F.useCallback)(async t=>{T(e=>({...e,[t]:!0}));const{data:{row:n}}=await(i={...v,organizationId:e.organizationId,id:t},o=await H(),ss("query DelegationsDelegation(\n    $organizationId: OrganizationId!\n    $id: DelegationId!\n    $includeAccreditationsSlots: Boolean!\n    $includeCampaigns: Boolean!\n    $includeChildren: Boolean!\n    $includeCreatedBy: Boolean!\n    $includeDocuments: Boolean!\n    $includeLeaders: Boolean!\n    $includeResources: Boolean!\n    $includeTags: Boolean!\n    $includeUsedCustomFieldsFilled: Boolean!\n) {\n    data: organization(id: $organizationId) {\n        row: delegation(id: $id) {\n            ...DelegationsDelegation\n        }\n    }\n}\n",{variables:i,token:o||void 0,fragments:[Ro.DelegationsDelegationFragment]}));var i,o;S(e=>e.map(e=>e.id===t?n:e)),T(e=>({...e,[t]:!1}))},[v,T,S]);return(0,F.useEffect)(()=>{S(b.data?.rows.nodes??[])},[b.data]),(0,F.useEffect)(()=>{g>1&&C()},[g]),(0,F.useEffect)(()=>{l.setStates(Object.fromEntries((b.data?.rows.nodes??[]).map(e=>[`d${e.id}`,{id:e.id,state:"unchecked"}])))},[b.data,l.setStates]),(0,i.jsx)(Ea,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(nm,{"aria-busy":j,headerRow:(0,i.jsxs)(cc,{children:[o&&(0,i.jsx)(Tc,{justify:"center",width:48,children:(0,i.jsx)(tc,{state:l.selectAllState,onClick:l.toggleSelectAll})}),y.map(e=>e.isSortable?(0,i.jsx)(tm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:_,sort:I,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Tc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),o&&(0,i.jsx)(Tc,{width:100})]}),paginationRow:(0,i.jsx)(yc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(jc,{limit:a,numberOfPages:k,offset:c,setLimit:f,setOffset:x,showLimits:!0,totalCount:A})}),children:j?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{})]}):w.map(t=>E[t.id]?(0,i.jsx)(zc,{},t.id):(0,i.jsx)(mR,{columns:y,customFields:e.customFields,delegation:t,eventId:e.eventId,organizationId:e.organizationId,reload:C,reloadDelegation:z,state:l.states[`d${t.id}`]?.state??"unchecked",toggleRow:l.toggleRow},t.id))})})},pR=()=>{const{history:e,translate:t,params:{organizationId:n}}=il();return(0,i.jsx)(xO,{children:(0,i.jsx)(ub,{rolesTypes:Tv,children:(0,i.jsx)(pl,{onClick:()=>{e.push(So.COMMUNITY_CREATE_DELEGATION(n))},children:t("cr_er_une_d_l_g_23035")})})})},fR=e=>{const{translate:t,params:{organizationId:n}}=il(),{isOrganizationAdmin:o}=nI(),{limit:s,segment:r}=zC();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pR,{}),0===e.numberOfDelegations?(0,i.jsx)(yC,{css:{overflow:"hidden"},children:(0,i.jsx)(Ea,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(rk,{title:t("vous_n_avez_pas_32103")})})}):(0,i.jsxs)(yC,{children:[(0,i.jsx)(fO,{searchRow:(0,i.jsx)(gO,{actions:(0,i.jsx)(VO,{}),searchPlaceholder:t("rechercher_une_31213"),showEditColumns:!0,showEditMode:o,showSearchColumns:!1}),selectSegment:(0,i.jsx)(FO,{pageSelectedText:t("les_1_d_l_gat_27248",s),segmentSelectedText:t("les_1_d_l_gat_04594",r.count,r.name)})}),(0,i.jsx)(gR,{customFields:e.customFields,eventId:null,level:et.Organization,organizationId:n})]})]})},xR=e=>{const{history:t,params:{organizationId:n,segmentId:o},translate:s}=il();Cd(`${s("communaut_20896")} ${s("d_l_gations_78318")}`);const{isOrganizationAdmin:r,localOrganization:a,updateLocalOrganization:l}=nI(),d=Nn($O),c=(0,F.useMemo)(()=>d.getDelegationsFilters(n,null,e.organization.customFields.nodes,e.organization.delegationsCategories.nodes),[e.organization,n]),u=(0,F.useMemo)(()=>d.getDelegationsPossibleColumns(e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(PO,{eventId:null,getEditPath:e=>ri(to.DELEGATION({organizationId:n,delegationId:e})),getShowPath:e=>to.DELEGATION({organizationId:n,delegationId:e}),organizationId:n,children:(0,i.jsx)(uO,{filters:c,filtersButtonText:s("filtrer_les_d_l_04628"),filtersSubtitle:s("appliquer_des_f_65318"),getSegmentPath:e=>So.COMMUNITY_DELEGATIONS_SEGMENT(n,e),hideSegments:0===e.organization.numberOfDelegations,initialLimit:a?.delegationsLimit??_c,initialSegmentsOpen:a?.areDelegationsSegmentsOpen??!0,isAdmin:r,organizationId:n,possibleColumns:u,possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:ft.Delegations,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{l({delegationsLimit:e})},onSegmentClick:e=>{l({delegationsSegmentId:e})},onSegmentDelete:async()=>{await l({delegationsSegmentId:null}),t.replace(So.COMMUNITY_DELEGATIONS(n))},onSegmentsToggle:async e=>{await l({areDelegationsSegmentsOpen:e})},children:(0,i.jsx)(fR,{customFields:e.organization.customFields.nodes,numberOfDelegations:e.organization.numberOfDelegations})})})},_R=()=>{const{history:e,params:{organizationId:t}}=il(),{localOrganization:n}=nI(),{data:o,loader:s,reload:r}=Vn("query CommunityDelegationsSegments($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        numberOfDelegations\n\n        customFields(variety: Delegation) {\n            nodes {\n                ...SegmentCustomField\n            }\n        }\n\n        delegationsCategories(level: Organization) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        segmentsFolders(level: Organization, segmentType: Delegations) {\n            ...SegmentsFoldersSegments\n        }\n    }\n}\n",{organizationId:t},[Ro.SegmentCustomFieldFragment,Ro.SegmentsFoldersSegmentsFragment]),a=(0,F.useMemo)(()=>(o.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[o.organization]);return s||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.COMMUNITY_DELEGATIONS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(xR,{organization:o.organization,reload:r})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{onLoad:()=>{const i=n?.delegationsSegmentId&&a.includes(n.delegationsSegmentId)?n?.delegationsSegmentId:a[0];e.replace(So.COMMUNITY_DELEGATIONS_SEGMENT(t,i))}})})]})},IR=()=>{const{hasFeature:e}=nI();return e(Fe.Delegation)?(0,i.jsx)(_R,{}):(0,i.jsx)(Ea,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(iI,{icon:"people-group"})})},vR=e=>{const t=Ln(),{isLoading:n,copy:o}=sS();return(0,i.jsxs)(fr,{children:[(0,i.jsx)(fr,{color:"gray700",css:e.css,children:e.title}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{gap:"2",children:[(0,i.jsx)(wl,{css:{"& .h-styled-input-container":{background:"white"}},hint:e.hint,state:"disabled",value:e.link,onChange:Bl.A}),(0,i.jsx)(pl,{color:e.buttonColor,isLoading:n,leftIcon:"copy",onClick:()=>o(e.link),children:t("copier_75889")})]})]})},bR=ar("dl",{margin:0,code:{border:"1px solid color-mix(in srgb, $warning50, $warning400 60%)",backgroundColor:"color-mix(in srgb, $warning50, $warning400 10%)",borderRadius:"$1",fontFamily:"inherit",padding:"1px 3px"},dd:{display:"list-item",listStyleType:"disc"},"dd ~ dt":{marginTop:"$3"}}),jR=({isOpen:e,onClose:t,link:n})=>{const o=Ln(),s=Bn();return(0,i.jsx)(nb,{isOpen:e,onClose:t,children:(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"plug-circle-bolt",subtitle:o("exporter_votre_81734"),onClose:t,children:o("export_de_votre_02014")}),(0,i.jsx)(Qv,{children:(0,i.jsxs)(Ea,{direction:"column",gap:"4",children:[(0,i.jsx)(fr,{css:{marginBottom:"$5"},children:(0,i.jsx)(qa.Root,{color:"warning",children:(0,i.jsxs)(qa.Titled,{children:[(0,i.jsx)(qa.Title,{icon:"circle-info",children:o("limites_des_exp_03687")}),(0,i.jsx)(qa.Text,{children:(0,i.jsxs)(bR,{children:[(0,i.jsx)("dt",{children:o("limite_du_nombr_21498")}),(0,i.jsx)("dd",{children:[...s(o("au_del_de_1_41204",10,15,"{4}","{5}"),(0,i.jsx)("code",{children:"Too many requests, please try again later."}))]}),(0,i.jsx)("dt",{children:o("dans_google_she_53260")}),(0,i.jsx)("dd",{children:[...s(o("la_limite_de_1_47408",10,15,"{3}"),(0,i.jsx)("code",{children:"#N/A"}))]}),(0,i.jsx)("dd",{children:[...s(o("_1_appelle_le_11127"),(0,i.jsx)("code",{children:"IMPORTDATA"}))]}),(0,i.jsx)("dd",{children:[...s(o("_1_ne_fonction_68410"),(0,i.jsx)("code",{children:"IMPORTDATA"}),(0,i.jsx)("code",{children:"#N/A"}))]}),(0,i.jsx)("dd",{children:[...s(o("si_l_export_est_28345"),(0,i.jsx)("code",{children:"#N/A"}))]})]})})]})})}),(0,i.jsx)(vR,{buttonColor:"primary",css:{fontWeight:500},link:n,title:o("lien_d_api_pour_98778")}),(0,i.jsx)(vR,{buttonColor:"primary",css:{fontWeight:500},link:`=IMPORTDATA("${n}")`,title:o("import_de_la_vu_17175")})]})})]})})},CR=e=>{const t=Ln(),[n,o]=(0,F.useState)(Pe.Excel),[s,r]=(0,F.useState)("unchecked");return(0,i.jsx)(nb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"file-xls",subtitle:t("exporter_votre_28801"),children:t("exporter_vos_me_10045")}),(0,i.jsxs)(Qv,{gap:"3",children:[(0,i.jsx)(fr,{font:"gray800 textMd medium",children:t("parameters_de_votre_export")}),(0,i.jsxs)(Ea,{direction:"column",gap:"5",children:[(0,i.jsxs)(gu,{label:t("format_de_lexport"),value:n,onChange:o,children:[(0,i.jsx)("option",{value:Pe.Excel,children:"Excel (.xslx)"}),(0,i.jsx)("option",{value:Pe.Csv,children:"CSV (.csv)"})]}),e.showIncludeFiles&&(0,i.jsx)(nc,{state:s,onClick:r,children:t("inclure_dans_l_65554")})]})]}),(0,i.jsx)(Jv,{children:()=>(0,i.jsx)(pl,{onClick:()=>{e.requestExport(n,"checked"===s),e.onClose()},children:t("recevoir_l_expo_53392")})})]})})},yR=({organizationKey:e})=>{const{history:t,translate:n,params:{organizationId:o,segmentId:s}}=il(),{segment:r,columns:a}=zC(),{mutate:l}=function(e={}){return Un("mutation UsersInfosExport(\n    $organizationId: OrganizationId!\n    $segmentId: SegmentId!\n    $format: ExportFormat!\n    $includeFiles: Boolean!\n    $columns: [String!]!\n) {\n    jobId: usersInfosExport(\n        organizationId: $organizationId\n        segmentId: $segmentId\n        format: $format\n        includeFiles: $includeFiles\n        columns: $columns\n    )\n}\n",e)}(),[d,c]=(0,F.useState)(!1),[u,h]=(0,F.useState)(!1),{checkExport:m}=Yv();return(0,i.jsxs)(xO,{children:[(0,i.jsx)(ub,{rolesTypes:Tv,children:(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{children:n("ajouter_un_memb_33261")})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsx)(Od,{icon:"user-plus",onClick:()=>{t.push(kI.CREATE({organizationId:o}))},children:n("ajouter_un_nouv_29283")}),(0,i.jsx)(Od,{icon:"file-import",onClick:()=>{t.push(So.COMMUNITY_VOLUNTEERS_IMPORT(o))},children:n("importer_via_un_61623")})]})]})}),(0,i.jsx)(ub,{rolesTypes:Tv,children:(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsx)(Od,{icon:"merge",onClick:()=>{t.push(So.COMMUNITY_USERS_DUPLICATES(o))},children:n("g_rer_les_doubl_39469")}),(0,i.jsx)(Od,{icon:"plug-circle-bolt",onClick:e=>{wd(e.target),c(!0)},children:n("exporter_via_l_09843")}),(0,i.jsx)(Od,{icon:"file-xls",onClick:e=>{wd(e.target),h(!0)},children:n("exporter_en_exc_51862")}),(0,i.jsx)(Od,{icon:"file-import",onClick:()=>{t.push(So.COMMUNITY_FILES_IMPORT(o))},children:n("importer_des_do_55420")})]})]})}),(0,i.jsx)(jR,{isOpen:d,link:Km({organizationId:o,eventId:void 0,segmentId:s,key:e}),onClose:()=>{c(!1)}}),(0,i.jsx)(CR,{isOpen:u,requestExport:async(e,t)=>{const{jobId:n}=await l({organizationId:o,segmentId:r.id,format:e,includeFiles:t,columns:a});m(o,void 0,n)},showIncludeFiles:!0,onClose:()=>{h(!1)}})]})},kR=e=>{const{translate:t,params:{organizationId:n}}=il(),{isOrganizationAdmin:o}=nI(),s=(0,F.useMemo)(()=>new Map(e.customFields.map(e=>[e.slug,e])),[e.customFields]),r=(0,F.useCallback)(()=>{e.reloadUserInfo(e.userInfo.id)},[e.userInfo,e.reloadUserInfo]);return(0,i.jsxs)(Cc,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},children:[o&&(0,i.jsx)(xc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(tc,{state:e.state,onClick:(t,n)=>{Il(n),e.toggleRow(`ui${e.userInfo.id}`,t)}})}),e.columns.map(t=>{const n=s.get(t.slug);return(0,i.jsx)(pA,{canClickMemberName:!0,column:t,customField:n,reloadRow:r,row:e.userInfo,updatable:!0},t.slug)}),o&&(0,i.jsx)(im,{justify:"center",children:(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"pen",to:So.COMMUNITY_EDIT_USER(n,e.userInfo.id)})})}),(0,i.jsx)(am,{placement:"top",children:t("_diter_62574")})]})})]})},AR=e=>{const{organizationId:t}=Wn(),{isOrganizationAdmin:n}=nI(),{columns:o,columnsSearch:s,massActions:r,nameDebounced:a,limit:l,offset:d,possibleColumns:c,predicates:u,reloadKey:m,setLimit:g,setOffset:p,setSort:f,sort:x}=zC(),_=(0,F.useMemo)(()=>hA(o),[o]),{data:I,isLoading:v,reload:b}=(j={..._,organizationId:t,predicates:u,name:h(a)?a:null,columnsSearch:Zo(s)?s:null,limit:l,offset:d,sort:x},Vn(us,j,[Ro.UserInfoCommunityFragment]));var j;const{numberOfPages:C,totalCount:y}=lu(I.data?.rows);(0,F.useEffect)(()=>{m>1&&b()},[m]);const k=(0,F.useMemo)(()=>o.flatMap(e=>(0,Da.A)([c.find(t=>t.slug===e)])),[c,o]),[A,w]=(0,F.useState)([]),[S,E]=(0,F.useState)({}),T=(0,F.useCallback)(async e=>{E(t=>({...t,[e]:!0}));const{data:{row:n}}=await Ps({..._,organizationId:t,id:e},await H());w(t=>t.map(t=>t.id===e?n:t)),E(t=>({...t,[e]:!1}))},[_,E,w]);return(0,F.useEffect)(()=>{w(I.data?.rows.nodes??[])},[I.data]),(0,F.useEffect)(()=>{r.setStates(Object.fromEntries((I.data?.rows.nodes??[]).map(({id:e})=>[`ui${e}`,{id:e,state:"unchecked"}])))},[I.data,r.setStates]),(0,i.jsx)(Ea,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(nm,{"aria-busy":v,headerRow:(0,i.jsxs)(cc,{children:[n&&(0,i.jsx)(Tc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(tc,{state:r.selectAllState,onClick:r.toggleSelectAll})}),k.map(e=>e.isSortable?(0,i.jsx)(tm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:f,sort:x,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Tc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),n&&(0,i.jsx)(Tc,{width:100})]}),paginationRow:(0,i.jsx)(yc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(jc,{limit:l,numberOfPages:C,offset:d,setLimit:g,setOffset:p,showLimits:!0,totalCount:y})}),children:v?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{})]}):A.map(t=>S[t.id]?(0,i.jsx)(zc,{},t.id):(0,i.jsx)(kR,{columns:k,customFields:e.customFields,reloadUserInfo:T,state:r.states[`ui${t.id}`]?.state??"unchecked",toggleRow:r.toggleRow,userInfo:t},t.id))})})},wR=e=>(0,i.jsx)(fr,{css:{padding:"$2 $3"},font:"gray500 textXs semiBold",children:e.children}),SR=e=>{const t=Ln(),{mutate:n,isLoading:o}=Ws(),{mutate:s,isLoading:r}=ba(),[a,l]=(0,F.useState)([]),[d,c]=(0,F.useState)([]);return(0,F.useEffect)(()=>{(async()=>{if(e.eventId){const t=await qs({eventId:e.eventId},await H());l(t.event.delegations.nodes)}else{const i=await(t={organizationId:e.organizationId},n=await H(),ss("query MassDelegationAddOrganizationDelegations($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        delegations(level: Organization) {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n}\n",{variables:t,token:n||void 0,fragments:[]}));l(i.organization.delegations.nodes)}var t,n})()},[e.organizationId,e.eventId]),(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ea,{justify:"center",children:(0,i.jsx)(mj,{color:"primary",icon:"people-group"})}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{font:"gray900 textLg medium",textAlign:"center",children:t("ajouter_des_mem_60880")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(dc,{isSearchVisible:!0,label:t("Delegation"),values:d,onChange:c,children:a.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{isLoading:o||r,onClick:async()=>{if(Zo(d)){let i=0;const o=a.find(e=>e.id===d[0]);i=e.eventId?(await n({eventId:e.eventId,selecteds:e.selecteds,delegationId:d[0]})).numberOfMembers:(await s({organizationId:e.organizationId,selecteds:e.selecteds,delegationId:d[0]})).numberOfMembers,e.onSuccess(t("_1_membres_ont_51715",i,o.name)),e.onClose()}},children:t("ajouter_97327")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},ER=e=>{const t=Ln(),{mutate:n,isLoading:o}=function(e={}){return Un("mutation VolunteersRegistrationsMassFormAdd(\n    $eventId: EventId!\n    $formId: FormId!\n    $selecteds: MassActionSelectedsInput!\n) {\n    numberOfMembers: volunteersRegistrationsMassFormAdd(\n        eventId: $eventId\n        formId: $formId\n        selecteds: $selecteds\n    )\n}\n",e)}(),{mutate:s,isLoading:r}=function(e={}){return Un("mutation UsersInfosMassFormAdd(\n    $organizationId: OrganizationId!\n    $formId: FormId!\n    $selecteds: MassActionSelectedsInput!\n) {\n    numberOfMembers: usersInfosMassFormAdd(\n        organizationId: $organizationId\n        formId: $formId\n        selecteds: $selecteds\n    )\n}\n",e)}(),{data:a}=Zr({organizationId:e.organizationId,level:e.eventId?et.Event:et.Organization,eventId:e.eventId}),l=(0,F.useMemo)(()=>a.organization?.forms.nodes??[],[a.organization]),[d,c]=(0,F.useState)([]),u=Zo(d);return(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ea,{justify:"center",children:(0,i.jsx)(mj,{color:"primary",icon:"people-group"})}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{font:"gray900 textLg medium",textAlign:"center",children:t("ajouter_des_mem_81812")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(dc,{isSearchVisible:!0,label:t("Form"),values:d,onChange:c,children:l.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{disabled:!u,isLoading:o||r,onClick:async()=>{if(Zo(d)){let i=0;const o=l.find(e=>e.id===d[0]);i=e.eventId?(await n({eventId:e.eventId,selecteds:e.selecteds,formId:d[0]})).numberOfMembers:(await s({organizationId:e.organizationId,selecteds:e.selecteds,formId:d[0]})).numberOfMembers,e.onSuccess(t("le_formulaire_11679",o.name,i)),e.onClose()}},children:t("ajouter_97327")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},TR=e=>{const t=Ln(),{mutate:n,isLoading:o}=function(e={}){return Un("mutation VolunteersRegistrationsMassFormRemove(\n    $eventId: EventId!\n    $formId: FormId!\n    $selecteds: MassActionSelectedsInput!\n) {\n    numberOfMembers: volunteersRegistrationsMassFormRemove(\n        eventId: $eventId\n        formId: $formId\n        selecteds: $selecteds\n    )\n}\n",e)}(),{mutate:s,isLoading:r}=function(e={}){return Un("mutation UsersInfosMassFormRemove(\n    $organizationId: OrganizationId!\n    $formId: FormId!\n    $selecteds: MassActionSelectedsInput!\n) {\n    numberOfMembers: usersInfosMassFormRemove(\n        organizationId: $organizationId\n        formId: $formId\n        selecteds: $selecteds\n    )\n}\n",e)}(),{data:a}=Zr({organizationId:e.organizationId,level:e.eventId?et.Event:et.Organization,eventId:e.eventId}),l=(0,F.useMemo)(()=>a.organization?.forms.nodes??[],[a.organization]),[d,c]=(0,F.useState)([]),u=Zo(d);return(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ea,{justify:"center",children:(0,i.jsx)(mj,{color:"primary",icon:"file-lines"})}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{font:"gray900 textLg medium",textAlign:"center",children:t("marquer_un_form_10633")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(dc,{isSearchVisible:!0,label:t("Form"),values:d,onChange:c,children:l.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Ha,{color:"error",leftIcon:"triangle-exclamation",children:e.eventId?t("cette_action_su_82938"):t("cette_action_su_88097")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{color:"error",disabled:!u,isLoading:o||r,onClick:async()=>{if(Zo(d)){let i=0;const o=l.find(e=>e.id===d[0]);i=e.eventId?(await n({eventId:e.eventId,selecteds:e.selecteds,formId:d[0]})).numberOfMembers:(await s({organizationId:e.organizationId,selecteds:e.selecteds,formId:d[0]})).numberOfMembers,e.onSuccess(t("le_formulaire_87510",o.name,i)),e.onClose()}},children:t("marquer_comme_n_20227")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})};let zR=class extends zl{constructor(e){super(e)}massAddEventInputSchema(){return l.Ik().shape({massAddEvent:l.Ik().shape({eventId:l.ai().required(this.t("l_v_nement_est_88155")).typeError(this.t("l_v_nement_est_88155"))})})}massAddEventSchema(){return l.Ik().shape({eventId:l.ai().required(this.t("l_v_nement_est_88155")).typeError(this.t("l_v_nement_est_88155"))})}};zR=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],zR);const $R=e=>{const t=Ln(),n=Nn(zR),{mutate:o}=function(e={}){return Un("mutation UsersInfosMassAddEvent(\n    $organizationId: OrganizationId!\n    $massAddEvent: MassAddEventInput!\n) {\n    numberOfMembers: usersInfosMassAddEvent(\n        organizationId: $organizationId\n        massAddEvent: $massAddEvent\n    )\n}\n",e)}(),{data:s,isLoading:r}=qr({organizationId:e.organizationId}),[a,l]=(0,F.useState)(""),d=(0,F.useMemo)(()=>h(a)?(s.organization?.events.nodes??[]).filter(e=>e.name.trim().toLowerCase().includes(a.trim().toLowerCase())):s.organization?.events.nodes??[],[s.organization,a]);return(0,i.jsxs)(gj,{buttonText:t("ajouter_le_memb_03343",e.numberOfSelected),icon:"sliders",initialValues:{massAddEvent:{eventId:null,selecteds:e.selecteds}},schema:n.massAddEventInputSchema(),size:"md",title:t("ajouter_les_mem_13940"),onClose:e.onClose,onSubmit:async n=>{const i=d.find(e=>e.id===n.massAddEvent.eventId),s=(await o({organizationId:e.organizationId,massAddEvent:n.massAddEvent})).numberOfMembers;e.onSuccess(t("_1_membres_ont_83814",s,i.name)),e.onClose()},children:[(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_un_40024"),value:a,onChange:l}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray900",fontWeight:"medium",children:t("sur_quel_v_nem_31606")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(Ea,{css:{overflowY:"auto"},direction:"column",gap:"3",children:r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qd,{borderRadius:"$2",height:54}),(0,i.jsx)(qd,{borderRadius:"$2",height:54})]}):d.map(e=>(0,i.jsx)(nO,{label:e.name,name:"massAddEvent.eventId",value:e.id},e.id))})]})},OR=e=>{const t=Ln(),{data:n,loader:o}=Vn("query MergeMembers($organizationId: OrganizationId!, $usersInfosIds: [UsersInfoId!]!) {\n    organization(id: $organizationId) {\n        weezeventOrganizationId\n\n        usersInfos(ids: $usersInfosIds) {\n            nodes {\n                id\n                name\n                email\n                picture {\n                    url\n                }\n\n                volunteersRegistrations {\n                    eventId\n                    event {\n                        name\n                    }\n\n                    accreditationsUsersInfos {\n                        id\n                    }\n\n                    positionsSlotsUsersInfos {\n                        id\n                    }\n                }\n            }\n        }\n    }\n}\n",{organizationId:e.organizationId,usersInfosIds:e.usersInfosIds},[]);const{mutate:s}=Lr(),[r,a]=(0,F.useState)(null);return(0,i.jsxs)(gj,{buttonText:t("fusionner_les_92573",e.numbersOfSelected),icon:"sliders",initialValues:{},size:"md",title:t("fusion_de_membr_34256"),onClose:e.onClose,onSubmit:async()=>{null!==r&&(await s({organizationId:e.organizationId,mainUserInfoId:r,toMergeUsersInfosIds:e.usersInfosIds.filter(e=>e!==r)}),e.onSuccess(t("_1_membres_ont_74574",e.usersInfosIds.length)),e.onClose())},children:[(0,i.jsx)(Ha,{color:"gray",leftIcon:"circle-exclamation",children:t("toutes_les_info_39932",e.numbersOfSelected)}),"number"==typeof n.organization?.weezeventOrganizationId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Ha,{color:"warning",leftIcon:"circle-exclamation",children:t("if_you_merge_me_62641")})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{font:"gray700 textSm medium",children:t("quel_membre_sou_80665")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Ea,{css:{flex:"1"},direction:"column",gap:"4",children:o||n.organization.usersInfos.nodes.map((e,n)=>{const o=e.volunteersRegistrations.flatMap(e=>e.accreditationsUsersInfos.length>0||e.positionsSlotsUsersInfos.length>0?{eventId:e.eventId,eventName:e.event.name,numberOfAccreditations:e.accreditationsUsersInfos.length,numberOfAssignments:e.positionsSlotsUsersInfos.length}:[]);return(0,i.jsxs)(F.Fragment,{children:[0!==n&&(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsxs)(Ea,{align:"center",css:{cursor:"pointer"},gap:"3",onClick:()=>{a(e.id)},children:[(0,i.jsx)(oc,{shouldPreventDefault:!1,state:r===e.id?"checked":"unchecked",onClick:Bl.A}),(0,i.jsx)(Fg,{email:e.email,image:e.picture?.url,name:e.name,size:48}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray800 textSm medium",children:h(e.name)?e.name:"-"}),(0,i.jsx)(fr,{color:"gray500",children:e.email}),(0,i.jsx)(Ea,{gap:"2",children:o.map(e=>(0,i.jsxs)(F.Fragment,{children:[e.numberOfAccreditations>0&&(0,i.jsx)(Gd,{css:{height:"fit-content"},leftIcon:"badge-check",children:t("_1_2_accred_26410",e.eventName,e.numberOfAccreditations)}),e.numberOfAssignments>0&&(0,i.jsx)(Gd,{css:{height:"fit-content"},leftIcon:"location-dot",children:t("_1_2_assign_03225",e.eventName,e.numberOfAssignments)})]},e.eventId))})]})]})]},e.id)})})]})},RR=e=>{const{translate:t,params:{organizationId:n}}=il(),{showNotification:o}=Yv(),{mutate:s}=As(),{mutate:r}=function(e={}){return Un("mutation UsersInfosMassDelete(\n    $organizationId: OrganizationId!\n    $selecteds: MassActionSelectedsInput!\n) {\n    numberOfMembers: usersInfosMassDelete(organizationId: $organizationId, selecteds: $selecteds)\n}\n",e)}(),{hasFeature:a}=nI(),{data:l}=Vn("query UsersActions($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        hasDelegations\n        hasEvents\n        hasForms\n    }\n}\n",{organizationId:n},[]),[d,c]=(0,F.useState)(!1),[u,m]=(0,F.useState)(!1),[g,p]=(0,F.useState)(!1),[f,x]=(0,F.useState)(!1),[_,I]=(0,F.useState)(!1),[v,b]=(0,F.useState)(!1),[j,C]=(0,F.useState)(!1),[y,k]=(0,F.useState)(!1),A=e.massActions.getSelectedsInput(e.predicates,null),w=e.massActions.isAllSelected?e.totalNumberOfMembers:e.massActions.numberOfSelected,S=(0,F.useCallback)(t=>{h(t)&&o(t),e.onMassEditSuccess()},[e.onMassEditSuccess]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pl,{onClick:()=>{c(!0)},children:t("_diter_un_champ_64621")}),!e.showOnlyMassEdit&&(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsx)(wR,{children:t("gestion_des_mem_51660")}),(0,i.jsx)(Od,{icon:"plus",isDisabled:!l.organization?.hasEvents,onClick:()=>{m(!0)},children:t("ajouter_1_membr_25541",w)}),(0,i.jsx)(Od,{icon:"merge",onClick:()=>{p(!0)},children:t("fusionner_les_m_37150")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(wR,{children:t("accr_ditations_39450")}),a(Fe.Delegation)&&(0,i.jsx)(Od,{icon:"people-group",isDisabled:!l.organization?.hasDelegations,onClick:()=>{I(!0)},children:l.organization?.hasDelegations?t("ajouter_1_mem_86218",w):t("cette_organisat_48937")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(wR,{children:t("communication_05277")}),(0,i.jsx)(Od,{icon:"file-lines",isDisabled:!l.organization?.hasForms,onClick:()=>{b(!0)},children:t("ajouter_1_mem_52947",w)}),(0,i.jsx)(Od,{icon:"file-lines",isDisabled:!l.organization?.hasForms,onClick:()=>{C(!0)},children:t("marquer_un_form_10633")}),(0,i.jsx)(Od,{icon:"paper-plane",onClick:()=>{k(!0)},children:t("SendCampaign")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{x(!0)},children:t("supprimer_43083")})]})]}),d&&(0,i.jsx)(Pk,{mutate:e=>s({organizationId:n,massEdit:e}),organizationId:n,selecteds:A,onClose:()=>{c(!1)},onSuccess:e=>{S(t("_1_membres_ont_07596",e))}}),u&&(0,i.jsx)($R,{numberOfSelected:w,organizationId:n,selecteds:A,onClose:()=>{m(!1)},onSuccess:S}),g&&(0,i.jsx)(OR,{numbersOfSelected:w,organizationId:n,usersInfosIds:e.massActions.selectedsIds,onClose:()=>{p(!1)},onSuccess:S}),f&&(0,i.jsx)(kk,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_65177"),t("cette_action_es_45424")],text:t("suppression_de_57689",w),onClose:()=>{x(!1)},onDelete:async()=>{const e=(await r({organizationId:n,selecteds:A})).numberOfMembers;S(t("_1_membres_ont_13170",e))}}),v&&(0,i.jsx)(ER,{eventId:null,organizationId:n,selecteds:A,onClose:()=>{b(!1)},onSuccess:S}),j&&(0,i.jsx)(TR,{eventId:null,organizationId:n,selecteds:A,onClose:()=>{C(!1)},onSuccess:S}),_&&(0,i.jsx)(SR,{eventId:null,organizationId:n,selecteds:A,onClose:()=>{I(!1)},onSuccess:S}),y&&(0,i.jsx)(tA,{eventId:null,organizationId:n,selecteds:A,onClose:()=>{k(!1)},onSuccess:S})]})},PR=({customFields:e,organizationKey:t})=>{const n=Ln(),{isOrganizationAdmin:o}=nI(),{limit:s,massActions:r,onMassEditSuccess:a,predicates:l,reloadKey:d,segment:c,setReloadKey:u}=zC();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yR,{organizationKey:t,reload:()=>{u(d+1)}}),(0,i.jsxs)(yC,{children:[(0,i.jsx)(fO,{searchRow:(0,i.jsx)(gO,{actions:(0,i.jsx)(RR,{massActions:r,predicates:l,showOnlyMassEdit:!1,totalNumberOfMembers:c.count,onMassEditSuccess:a}),searchPlaceholder:n("rechercher_un_m_05904"),showEditColumns:!0,showEditMode:o,showSearchColumns:!0}),selectSegment:(0,i.jsx)(FO,{pageSelectedText:n("les_1_membres_00895",s),segmentSelectedText:n("les_1_membres_56748",c.count,c.name)})}),(0,i.jsx)(AR,{customFields:e})]})]})},DR=e=>{const{history:t,translate:n,params:{organizationId:o,segmentId:s}}=il(),{isOrganizationAdmin:r,localOrganization:a,updateLocalOrganization:l}=nI(),d=Nn(mA),c=(0,F.useMemo)(()=>d.getOrganizationUsersFilters(o,s,e.organization),[e.organization]),u=(0,F.useMemo)(()=>d.getOrganizationUsersPossibleColumns(e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(uO,{filters:c,filtersButtonText:n("filtrer_les_mem_49255"),filtersSubtitle:n("appliquer_des_f_48814"),getSegmentPath:e=>So.COMMUNITY_USERS_SEGMENT(o,e),initialLimit:a?.usersLimit??_c,initialSegmentsOpen:a?.areUsersSegmentsOpen??!0,isAdmin:r,organizationId:o,possibleColumns:u,possibleRenderings:[],reload:e.reload,segmentId:s,segmentType:ft.Volunteers,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{l({usersLimit:e})},onSegmentClick:e=>{l({usersSegmentId:e})},onSegmentDelete:async()=>{await l({usersSegmentId:null}),t.replace(fi.COMMUNITY_USERS({organizationId:o}))},onSegmentsToggle:async e=>{await l({areUsersSegmentsOpen:e})},children:(0,i.jsx)(PR,{customFields:e.organization.customFields.nodes,organizationKey:e.organization.key})})},FR=()=>{const{params:{organizationId:e},translate:t}=il();Cd(`${t("communaut_20896")} ${t("membres_11310")}`);const{localOrganization:n}=nI(),{data:o,loader:s,reload:r}=Vn("query UsersSegments($organizationId: OrganizationId!, $privacy: CustomFieldPrivacy!) {\n    organization(id: $organizationId) {\n        key\n\n        customFields(variety: UserInfo, privacy: $privacy) {\n            nodes {\n                ...SegmentCustomField\n            }\n        }\n\n        segmentsFolders(level: Organization, segmentType: Volunteers) {\n            ...SegmentsFoldersSegments\n        }\n    }\n}\n",{organizationId:e,privacy:fe.All},[Ro.SegmentCustomFieldFragment,Ro.SegmentsFoldersSegmentsFragment]);const a=(0,F.useMemo)(()=>(o.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[o.organization]);return s||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.COMMUNITY_USERS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(DR,{organization:o.organization,reload:r})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.COMMUNITY_USERS_SEGMENT(e,n?.usersSegmentId&&a.includes(n.usersSegmentId)?n?.usersSegmentId:a[0]),replace:!0})})]})},MR=e=>{const{translate:t,params:{organizationId:n}}=il(),o=Nn(vj),{mutate:s,isLoading:r}=Lr(),a=(0,F.useMemo)(()=>Object.fromEntries(e.displayColumns.flatMap(t=>{const n=e.customFields.find(e=>e.slug===t);return n?[[t,n]]:[]})),[e.customFields,e.displayColumns]);return(0,i.jsx)(kc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(pl,{color:"primary",isLoading:r,size:"sm",onClick:async()=>{await s({organizationId:n,mainUserInfoId:e.selectedId,toMergeUsersInfosIds:e.usersInfos.map(({id:e})=>e).filter(t=>t!==e.selectedId)}),e.onSuccess()},children:t("fusionner_04498")})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:t("nom_du_membre_69353")}),e.displayColumns.map(e=>{const n=a[e];return"delegations"===e?(0,i.jsx)(Tc,{children:t("d_l_gations_78318")},e):n?(0,i.jsx)(Tc,{children:n.name},e):null}),(0,i.jsx)(Tc,{children:t("membre_principa_09597")})]}),numberOfPages:0,offset:0,rows:e.usersInfos.map(t=>(0,i.jsxs)(Cc,{css:{cursor:"pointer"},onClick:()=>{e.onSelect(t.id)},children:[(0,i.jsx)(xc,{children:(0,i.jsx)(Eb,{userInfo:t})}),e.displayColumns.map(e=>{const n=a[e];return"delegations"===e?(0,i.jsx)(xc,{gap:"2",wrap:"wrap",children:t.delegations.map(e=>{const t=e.event?`${e.event.name}`:e.name;return(0,i.jsx)(Gd,{children:t},e.id)})},e):n?(0,i.jsx)(xc,{children:o.getValueString(n,t.fields,{fileReturnValue:"name"})},e):null}),(0,i.jsx)(xc,{children:(0,i.jsx)(oc,{shouldPreventDefault:!1,state:e.selectedId===t.id?"checked":"unchecked",onClick:Bl.A})})]},t.id)),setOffset:Bl.A,title:e.usersInfos[0].name,totalCount:0})},NR=e=>{const{translate:t,params:{organizationId:n}}=il(),{localOrganization:o,updateLocalOrganization:s}=nI(),r=e.organization.customFields.nodes,[a,l]=(0,F.useState)(e.organization.possibleDuplicates),[d,c]=(0,F.useState)(Object.fromEntries(a.map(({id:e,usersInfos:t})=>[e,t[0].id]))),[u,m]=(0,F.useState)(!1),g=a.length??0,[p,f]=(0,F.useState)(o?.duplicatesColumns||[]),x=(0,F.useMemo)(()=>(0,Zd.A)(r.map(e=>({name:e.name,slug:e.slug})).concat([{name:t("d_l_gations_78318"),slug:"delegations"}]),e=>e.name),[r]),_=(0,F.useCallback)(async e=>{f(e),await s({duplicatesColumns:e})},[f]),[I,v]=(0,F.useState)(""),b=(0,F.useMemo)(()=>h(I)?a.filter(e=>e.usersInfos.some(e=>e.name.toLowerCase().includes(I.toLowerCase()))):a,[a,I]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(bm,{fallbackClosePath:fi.COMMUNITY_USERS({organizationId:n}),title:t("gestion_des_mem_14016"),children:(0,i.jsxs)(Im,{children:[(0,i.jsx)(Ea,{align:"center",justify:"between",children:(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{font:"gray900 textMd medium",children:t("liste_des_membr_20115")}),g>0&&(0,i.jsx)(Gd,{color:"warning",size:"sm",children:t("_1_doublon_pot_74382",g)})]}),(0,i.jsx)(fr,{color:"gray500",children:t("s_lectionner_le_91896")})]})}),(0,i.jsx)(Pa,{height:"6"}),0===g?(0,i.jsxs)(mc,{children:[(0,i.jsxs)(cc,{children:[(0,i.jsx)(Tc,{children:t("nom_du_membre_69353")}),(0,i.jsx)(Tc,{children:t("membre_principa_09597")})]}),(0,i.jsx)(Cc,{css:{height:"400px"},children:(0,i.jsx)(xc,{css:{height:"100%"},children:(0,i.jsx)(rk,{subtitle:"",title:t("il_n_y_a_pas_de_78722")})})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",justify:"between",children:[(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{placeholder:t("rechercher_un_m_05904"),value:I,onChange:v})}),(0,i.jsx)(pl,{color:"white",leftIcon:"gear",onClick:()=>{m(!0)},children:t("_diter_les_colo_39630")})]}),(0,i.jsx)(Pa,{height:"6"}),b.map(({id:e,usersInfos:t})=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(MR,{customFields:r,displayColumns:p,selectedId:d[e],usersInfos:t,onSelect:t=>{c(n=>({...n,[e]:t}))},onSuccess:()=>{l(t=>t.filter(t=>t.id!==e))}}),(0,i.jsx)(Pa,{height:"4"})]},e))]})]})}),u&&(0,i.jsx)(ru,{columns:x,initialSelectedColumns:p,saveButtonText:t("_diter_62574"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_96096"),title:t("_dition_des_col_70300"),onClose:()=>{m(!1)},onSave:_})]})},LR=()=>{const{params:{organizationId:e}}=il(),{data:t,loader:n}=Vn("query PossibleDuplicates($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        customFields(variety: UserInfo) {\n            nodes {\n                ...CustomFieldWithCondition\n            }\n        }\n\n        possibleDuplicates {\n            id\n\n            usersInfos {\n                id\n                email\n                name\n                fields\n\n                picture {\n                    url\n                }\n\n                delegations(level: Both) {\n                    id\n                    name\n\n                    event {\n                        name\n                    }\n                }\n            }\n        }\n    }\n}\n",{organizationId:e},[Ro.CustomFieldWithConditionFragment]);return n||(0,i.jsx)(NR,{organization:t.organization})},BR=()=>{const{translate:e,params:{organizationId:t}}=il();Cd(e("communaut_20896"));const{hasFeature:n,isOrganizationAdmin:o,isOrganizationReader:s}=nI();return n(Fe.Community)?(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:fi.COMMUNITY_DASHBOARD({organizationId:":organizationId"}),children:(0,i.jsx)(SO,{children:(0,i.jsx)(EO,{})})}),(0,i.jsx)(_r.qh,{path:So.COMMUNITY_USERS_DUPLICATES(":organizationId"),children:(0,i.jsx)(LR,{})}),(0,i.jsx)(_r.qh,{path:[kI.CREATE({organizationId:":organizationId",delegationId:":delegationId"}),kI.CREATE({organizationId:":organizationId"})],children:(0,i.jsx)(_T,{})}),(0,i.jsx)(_r.qh,{path:fi.COMMUNITY_USERS({organizationId:":organizationId"}),children:(0,i.jsx)(SO,{children:(0,i.jsx)(FR,{})})}),(0,i.jsx)(_r.qh,{path:[So.COMMUNITY_EDIT_USER(":organizationId",":userInfoId"),So.COMMUNITY_EDIT_USER_DELEGATION(":organizationId",":delegationId",":userInfoId")],children:(0,i.jsx)(SE,{children:(0,i.jsx)(Bz,{})})}),(0,i.jsx)(_r.qh,{exact:!0,path:rI.CREATE_TEMPLATE({organizationId:":organizationId"}),children:(0,i.jsx)(bb,{isAdmin:o,isTemplate:!0})}),(0,i.jsx)(_r.qh,{exact:!0,path:rI.CREATE({organizationId:":organizationId",options:":options?"}),children:(0,i.jsx)(bb,{isAdmin:o,isTemplate:!1})}),(0,i.jsx)(_r.qh,{path:rI.UPDATE({organizationId:":organizationId",campaignId:":campaignId"}),children:(0,i.jsx)(Cb,{})}),(0,i.jsx)(_r.qh,{path:rI.CAMPAIGNS({organizationId:":organizationId"}),children:(0,i.jsx)(SO,{children:(0,i.jsx)(AO,{})})}),(0,i.jsx)(_r.qh,{path:rI.CAMPAIGN({organizationId:":organizationId",campaignId:":campaignId"}),children:(0,i.jsx)(SO,{children:(0,i.jsx)(Kb,{})})}),(0,i.jsx)(_r.qh,{path:zi.FORMS({organizationId:":organizationId"}),children:(0,i.jsx)(SO,{children:(0,i.jsx)(iS,{})})}),(0,i.jsx)(_r.qh,{path:zi.FORM_ELEMENTS({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(zS,{})}),(0,i.jsx)(_r.qh,{path:zi.FORM_PARAMETERS_GENERAL({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(QS,{})}),(0,i.jsx)(_r.qh,{path:zi.FORM_PARAMETERS_DESIGN({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(KS,{})}),(0,i.jsx)(_r.qh,{path:zi.FORM_PARAMETERS_BROADCAST({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(US,{})}),(0,i.jsx)(_r.qh,{path:zi.FORM_PARAMETERS_STATE({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(nE,{})}),(0,i.jsx)(_r.qh,{path:zi.FORM_INTEGRATION({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(cS,{})}),(0,i.jsx)(_r.qh,{path:zi.FORM_EMAILS({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(PS,{})}),(0,i.jsx)(_r.qh,{path:zi.FORM_PREVIEW({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(uS,{})}),(0,i.jsx)(_r.qh,{path:So.COMMUNITY_VOLUNTEERS_IMPORT(":organizationId"),children:(0,i.jsx)(p$,{})}),(0,i.jsx)(_r.qh,{path:So.COMMUNITY_FILES_IMPORT(":organizationId"),children:(0,i.jsx)(Yw,{})}),(0,i.jsx)(_r.qh,{path:kI.MEMBER({organizationId:":organizationId",userInfoId:":userInfoId"}),children:(0,i.jsx)(SO,{children:(0,i.jsx)(wz,{})})}),n(Fe.Delegation)&&(0,i.jsx)(_r.qh,{path:So.COMMUNITY_CREATE_DELEGATION(":organizationId",":options?"),children:(0,i.jsx)(bC,{})}),n(Fe.Delegation)&&(0,i.jsx)(_r.qh,{path:So.COMMUNITY_EDIT_DELEGATION(":organizationId",":delegationId"),children:(0,i.jsx)(CC,{})}),n(Fe.Delegation)&&(0,i.jsx)(_r.qh,{path:So.COMMUNITY_DELEGATIONS(":organizationId"),children:(0,i.jsx)(SO,{children:(0,i.jsx)(IR,{})})}),n(Fe.Delegation)&&(0,i.jsx)(_r.qh,{path:to.DELEGATION_CATEGORY({organizationId:":organizationId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(SO,{children:(0,i.jsx)(Nw,{isEvent:!1})})}),n(Fe.Delegation)&&(0,i.jsx)(_r.qh,{path:So.COMMUNITY_DELEGATION(":organizationId",":delegationId"),children:(0,i.jsx)(SO,{children:(0,i.jsx)(kw,{})})}),o&&(0,i.jsx)(_r.qh,{path:SI.CREATE({organizationId:":organizationId"}),children:(0,i.jsx)(R$,{})}),s&&(0,i.jsx)(_r.qh,{path:SI.UPDATE({organizationId:":organizationId",workflowId:":workflowId"}),children:(0,i.jsx)(P$,{})}),(0,i.jsx)(_r.qh,{path:SI.WORKFLOWS({organizationId:":organizationId"}),children:(0,i.jsx)(SO,{children:(0,i.jsx)(Y$,{})})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:fi.COMMUNITY_USERS({organizationId:t}),replace:!0})})]}):(0,i.jsx)(SO,{children:(0,i.jsx)(Ea,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(iI,{icon:"crown",subtitle:e("contactez_nous_69860"),title:e("pour_en_profite_62789")})})})};let VR=class extends Xc{constructor(e,t,n){super(e,t,n)}getCustomFieldsFilters(e,t){return[{slug:"name",name:this.t("nom_du_champ_48329"),category:this.t("champs_de_formu_64126"),fieldType:Be.Text,hideEmpty:!0},{slug:"label",name:this.t("label_08243"),category:this.t("champs_de_formu_64126"),fieldType:Be.Text},{slug:"customFieldCategory",name:this.t("cat_gorie_00291"),category:this.t("champs_de_formu_64126"),fieldType:Be.Select,values:t.customFieldsCategories.nodes,hideEmpty:!0},{slug:"fieldType",name:this.t("type_35427"),category:this.t("champs_de_formu_64126"),fieldType:Be.Select,values:sn.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"variety",name:this.t("typologie_34041"),category:this.t("champs_de_formu_64126"),fieldType:Be.Select,values:(0,Zd.A)(Zt.map(e=>({id:e,name:wk(this.t.bind(this),e)})),({name:e})=>e),hideEmpty:!0},{slug:"privacy",name:this.t("Privacy"),category:this.t("champs_de_formu_64126"),fieldType:Be.Checkbox,hideEmpty:!0},{slug:"condition",name:"Condition",category:this.t("champs_de_formu_64126"),fieldType:Be.Select,values:t.customFields.nodes},{slug:"createdBy",name:this.t("cr_e_par_30622"),category:this.t("champs_de_formu_64126"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"createdAt",name:this.t("cr_e_le_02658"),category:this.t("champs_de_formu_64126"),fieldType:Be.Datetime,hideEmpty:!0}]}getCustomFieldsPossibleColumns(){return[{slug:"id",name:this.t("id_51738"),isSortable:!0,sortAttribute:_e.Id,width:100},{slug:"name",name:this.t("nom_du_champ_48329"),isSortable:!0,sortAttribute:_e.Name,minWidth:240},{slug:"label",name:this.t("label_08243"),isSortable:!0,sortAttribute:_e.Label,minWidth:180},{slug:"category",name:this.t("Category"),isSortable:!0,sortAttribute:_e.Category,minWidth:240},{slug:"variety",name:this.t("typologie_34041"),minWidth:180},{slug:"fieldType",name:this.t("type_35427"),isSortable:!0,sortAttribute:_e.Type,width:250},{slug:"numberOfTimesUsed",name:this.t("nombre_d_utilis_58389"),width:200},{slug:"state",name:this.t("Privacy"),isSortable:!0,sortAttribute:_e.Status,width:200},{slug:"values",name:this.t("valeurs_34314"),minWidth:240},{slug:"variable",name:this.t("variable_pour_l_45711"),minWidth:180},{slug:"createdBy",name:this.t("cr_par_41994"),minWidth:180},{slug:"createdAt",name:this.t("cr_le_85046"),isSortable:!0,sortAttribute:_e.CreatedAt,minWidth:180}]}};VR=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hc,$c,Dn])],VR);const UR=()=>{const{translate:e}=il(),{massActions:t,onMassEditSuccess:n,organizationId:o,predicates:s,segment:r}=zC(),{showNotification:a}=Yv(),{mutate:l}=vs(),{mutate:d}=Br(),[c,u]=(0,F.useState)(!1),[m,g]=(0,F.useState)(!1),p=t.getSelectedsInput(s,null),f=t.isAllSelected?r.count:t.numberOfSelected,x=(0,F.useCallback)(e=>{h(e)&&a(e),n()},[n]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pl,{onClick:()=>{u(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(Pd,{placement:"bottom-end",children:(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{g(!0)},children:e("supprimer_43083")})})]}),c&&(0,i.jsx)(Ok,{mutate:e=>l({organizationId:o,massEdit:e}),organizationId:o,selecteds:p,onClose:()=>{u(!1)},onSuccess:t=>{x(e("_1_champs_pers_55120",t))}}),m&&(0,i.jsx)(kk,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_63402")],text:e("suppression_de_98457",f),onClose:()=>{g(!1)},onDelete:async()=>{const t=(await d({organizationId:o,selecteds:p})).numberOfCustomFields;x(e("_1_champs_pers_68086",t))}})]})},WR=()=>{const{history:e,translate:t,params:{organizationId:n}}=il(),{segment:o}=zC();return(0,i.jsx)(xO,{children:(0,i.jsx)(ub,{rolesTypes:Tv,children:(0,i.jsx)(pl,{onClick:()=>{e.push(So.CREATE_CUSTOM_FIELD(n,o.id))},children:t("cr_er_un_champ_31226")})})})},GR=F.createContext({}),HR=e=>{const t=OO(bs,{organizationId:e.organizationId},e=>e.organization.customFieldsCategories.nodes);return(0,i.jsx)(GR.Provider,{value:{getCustomFieldsCategories:t},children:e.children})},qR=e=>{const{translate:t}=il(),{getCustomFieldsCategories:n}=F.useContext(GR),{result:o,isLoading:s}=HO(n);return s?(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(yl,{children:t("Category")}),(0,i.jsx)(qd,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(gu,{label:t("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},YR=e=>{const{params:{organizationId:t}}=il(),{mutate:n}=vs();return(0,i.jsx)(PC,{column:e.column,initialValue:e.initialValue,mutate:async i=>n({organizationId:t,massEdit:{reset:!1,selecteds:{ids:[e.customFieldId]},slug:e.property,strategy:Je.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},KR=e=>(0,i.jsx)(YR,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.category.id,property:xe.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(qR,{setValue:t,value:e}),renderValue:e.customField.category.name}),ZR=e=>{const{translate:t}=il();return(0,i.jsx)(YR,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.label||"",property:xe.Label,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(wl,{name:t("label_08243"),value:e,onChange:n}),renderValue:e.customField.label||""})},XR=e=>{const{translate:t}=il();return(0,i.jsx)(YR,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.name,property:xe.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(wl,{name:t("nom_du_champ_48329"),value:e,onChange:n}),renderValue:()=>(0,i.jsxs)(Ea,{direction:"column",width:1,children:[(0,i.jsx)(fr,{color:"gray800",css:{ellipsis:!0,width:"100%"},title:e.customField.name,children:e.customField.name}),e.customField.conditionCustomField&&(0,i.jsx)(fr,{color:"gray500",css:{ellipsis:!0,width:"100%"},title:e.customField.conditionCustomField.name,children:t("d_pend_de_1_52961",e.customField.conditionCustomField.name)})]})})},JR=e=>{const{translate:t}=il();return(0,i.jsx)(YR,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.isPrivate,property:xe.Privacy,reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(gu,{label:t("Privacy"),shouldParseAsBoolean:!0,value:e,onChange:n,children:[(0,i.jsx)("option",{value:"true",children:t("Private")}),(0,i.jsx)("option",{value:"false",children:t("Public")})]}),renderValue:()=>e.customField.isPrivate?(0,i.jsx)(Gd,{color:"gray",leftIcon:"lock",children:t("Private")}):(0,i.jsx)(Gd,{color:"primary",leftIcon:"globe",children:t("Public")})})},QR=e=>{const{history:t,translate:n}=il();return"id"===e.column.slug?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):"name"===e.column.slug?(0,i.jsx)(XR,{column:e.column,customField:e.row,reload:e.reloadRow}):"label"===e.column.slug?(0,i.jsx)(ZR,{column:e.column,customField:e.row,reload:e.reloadRow}):"category"===e.column.slug?(0,i.jsx)(KR,{column:e.column,customField:e.row,reload:e.reloadRow}):"fieldType"===e.column.slug?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Ea,{children:[(0,i.jsx)(fr,{color:"gray800",css:{width:"18px"},children:(0,i.jsx)(Va,{icon:ez(e.row.fieldType,e.row.fieldProperty)})}),(0,i.jsx)(Pa,{width:"2"}),(0,i.jsx)(fr,{color:"gray800",children:n(e.row.fieldType)})]})}):"numberOfTimesUsed"===e.column.slug?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:0===e.row.numberOfTimesUsed?e.row.numberOfTimesUsed:(0,i.jsx)(fr,{color:"primary700",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{t.push(So.CUSTOM_FIELD_USAGE(e.organizationId,e.segmentId,e.row.id))},children:e.row.numberOfTimesUsed})}):"state"===e.column.slug?(0,i.jsx)(JR,{column:e.column,customField:e.row,reload:e.reloadRow}):"values"===e.column.slug?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.values.map(({value:e})=>e).join(", ")}):"variable"===e.column.slug?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.variety===Ie.UserInfo?`{user.${e.row.slug}}`:""}):"variety"===e.column.slug?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:wk(n,e.row.variety)}):"createdBy"===e.column.slug?(0,i.jsx)(V$,{column:e.column,createdBy:e.row.createdBy}):"createdAt"===e.column.slug?(0,i.jsx)(B$,{column:e.column,insertedAt:e.row.insertedAt}):(0,i.jsx)(xc,{})},eP=e=>{const{history:t,translate:n}=il(),{showNotification:o}=Yv(),[s,r]=(0,F.useState)(!1),{mutate:a}=function(e={}){return Un("mutation CustomFieldDuplicate($organizationId: OrganizationId!, $customFieldId: CustomFieldId!) {\n    customFieldDuplicate(organizationId: $organizationId, customFieldId: $customFieldId) {\n        id\n    }\n}\n",e)}(),{mutate:l}=Br(),[d,c]=(0,F.useState)(!1),u=e.customField.canDelete&&(e.customField.fieldType!==Ne.Select||e.customField.isSelectV2);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(pm,{isOpen:s,onStateChange:r,children:[(0,i.jsx)($d,{onClick:n=>{wd(n.target),t.push(So.EDIT_CUSTOM_FIELD(e.organizationId,e.segmentId,e.customField.id))},children:(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(Va,{icon:"pen"}),n("_diter_62574")]})}),u&&(0,i.jsx)($d,{onClick:async n=>{wd(n.target);const{customFieldDuplicate:{id:i}}=await a({organizationId:e.organizationId,customFieldId:e.customField.id});e.reload(),t.push(So.EDIT_CUSTOM_FIELD(e.organizationId,e.segmentId,i))},children:(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(Va,{icon:"clone"}),n("dupliquer_28256")]})}),e.customField.canDelete&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)($d,{color:"red",onClick:()=>{r(!1),c(!0)},children:(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(Va,{icon:"trash-can"}),n("supprimer_43083")]})})]})]}),d&&(0,i.jsx)(kk,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_96670"),text:n("suppression_de_73669",e.customField.name),onClose:()=>{c(!1)},onDelete:async()=>{await l({organizationId:e.organizationId,selecteds:{ids:[e.customField.id]}}),o(n("le_champ_1_43589",e.customField.name)),e.reload()}})]})},tP=e=>{const{history:t,translate:n}=il(),{isOrganizationAdmin:o}=nI(),s=(0,F.useCallback)(()=>{e.reloadCustomField(e.customField.id)},[e.customField,e.reloadCustomField]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Cc,{css:{"&:hover":{background:"$gray100"}},onMouseLeave:e=>{wd(e.target)},children:[o&&(0,i.jsx)(xc,{justify:"center",width:48,children:(0,i.jsx)(tc,{state:e.state,onClick:(t,n)=>{Il(n),e.toggleRow(`cf${e.customField.id}`,t)}})}),e.columns.map(t=>(0,i.jsx)(QR,{column:t,organizationId:e.organizationId,reloadRow:s,row:e.customField,segmentId:e.segmentId},t.slug)),o&&(0,i.jsxs)(im,{justify:"end",children:[(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"pen",onClick:()=>{t.push(So.EDIT_CUSTOM_FIELD(e.organizationId,e.segmentId,e.customField.id))}})})}),(0,i.jsx)(am,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsx)(eP,{customField:e.customField,organizationId:e.organizationId,reload:e.reload,segmentId:e.segmentId})]})]})})},nP=()=>{const{params:{organizationId:e}}=il(),{isOrganizationAdmin:t}=nI(),{columns:n,limit:o,massActions:s,nameDebounced:r,offset:a,possibleColumns:l,predicates:d,reloadKey:c,segmentId:u,setLimit:m,setOffset:g,setSort:p,sort:f}=zC(),{data:x,isLoading:_,reload:I}=Vn("query CustomFields(\n    $organizationId: OrganizationId!\n    $name: String\n    $predicates: [Predicate!]!\n    $limit: Int\n    $offset: Int\n    $sort: CustomFieldsSort\n) {\n    data: organization(id: $organizationId) {\n        rows: customFields(\n            predicates: $predicates\n            name: $name\n            limit: $limit\n            offset: $offset\n            sort: $sort\n        ) {\n            nodes {\n                ...CustomField\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{organizationId:e,predicates:d,name:h(r)?r:null,limit:o,offset:a,sort:f},[Ro.CustomFieldFragment]);const{numberOfPages:v,totalCount:b}=lu(x.data?.rows),j=(0,F.useMemo)(()=>n.flatMap(e=>(0,Da.A)([l.find(t=>t.slug===e)])),[l,n]),[C,y]=(0,F.useState)([]),[k,A]=(0,F.useState)({}),w=(0,F.useCallback)(async t=>{A(e=>({...e,[t]:!0}));const{data:{row:n}}=await function(e,t){return ss("query CustomField($organizationId: OrganizationId!, $id: CustomFieldId!) {\n    data: organization(id: $organizationId) {\n        row: customField(id: $id) {\n            ...CustomField\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.CustomFieldFragment]})}({organizationId:e,id:t},await H());y(e=>e.map(e=>e.id===t?n:e)),A(e=>({...e,[t]:!1}))},[A,y]);return(0,F.useEffect)(()=>{y(x.data?.rows.nodes??[])},[x.data]),(0,F.useEffect)(()=>{c>1&&I()},[c]),(0,F.useEffect)(()=>{s.setStates(Object.fromEntries((x.data?.rows.nodes??[]).map(e=>[`cf${e.id}`,{id:e.id,state:"unchecked"}])))},[x.data,s.setStates]),(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ea,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(nm,{"aria-busy":_,headerRow:(0,i.jsxs)(cc,{children:[t&&(0,i.jsx)(Tc,{justify:"center",width:48,children:(0,i.jsx)(tc,{state:s.selectAllState,onClick:s.toggleSelectAll})}),j.map(e=>e.isSortable?(0,i.jsx)(tm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:p,sort:f,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Tc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),t&&(0,i.jsx)(Tc,{width:100})]}),paginationRow:(0,i.jsx)(yc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(jc,{limit:o,numberOfPages:v,offset:a,setLimit:m,setOffset:g,showLimits:!0,totalCount:b})}),children:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{})]}):C.map(t=>k[t.id]?(0,i.jsx)(zc,{},t.id):(0,i.jsx)(tP,{columns:j,customField:t,organizationId:e,reload:I,reloadCustomField:w,segmentId:u,state:s.states[`cf${t.id}`]?.state??"unchecked",toggleRow:s.toggleRow},t.id))})})})},iP=()=>{const{history:e,translate:t,params:{organizationId:n,customFieldId:o}}=il(),{data:s,loader:r}=Vn("query CustomFieldUsage($organizationId: OrganizationId!, $customFieldId: CustomFieldId!) {\n    organization(id: $organizationId) {\n        customField(id: $customFieldId) {\n            name\n            fieldProperty\n            fieldType\n\n            positions {\n                id\n                name\n\n                event {\n                    id\n                    name\n                }\n            }\n\n            forms {\n                id\n                name\n\n                event {\n                    id\n                    name\n                }\n\n                organization {\n                    id\n                    name\n                }\n            }\n        }\n    }\n}\n",{organizationId:n,customFieldId:o},[]),a=s.organization?.customField;return(0,i.jsx)(eu,{returnToFallback:So.CUSTOM_FIELDS(n),size:"sm",children:r?(0,i.jsx)(tu,{children:r}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Lb,{children:t("nombre_d_utilis_58389")}),(0,i.jsxs)(tu,{children:[(0,i.jsx)(Pa,{height:"9"}),(0,i.jsxs)(Ea,{align:"center",direction:"column",children:[(0,i.jsx)(Ea,{align:"center",css:{background:"$purple100",borderRadius:"24px",color:"$purple700",fontSize:"$textXl"},height:64,justify:"center",width:64,children:(0,i.jsx)(Va,{icon:ez(a.fieldType,a.fieldProperty)})}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:a.name})]}),(0,i.jsx)(Pa,{height:"9"}),a.positions.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_de_missio_27210",a.positions.length)}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(Ea,{direction:"column",gap:"6",children:a.positions.map(t=>(0,i.jsxs)(fr,{css:{cursor:"pointer"},onClick:()=>{e.push(ao.POSITION({organizationId:n,eventId:t.event.id,positionId:t.id}))},children:[(0,i.jsx)(fr,{color:"gray800",children:t.event.name}),(0,i.jsx)(fr,{color:"gray500",children:t.name})]},t.id))}),(0,i.jsx)(fr,{css:{borderTop:"1px solid $gray200",height:"1px",marginBottom:"$6",marginTop:"$6",width:"100%"}})]}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_formu_84836",a.forms.length)}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(Ea,{direction:"column",gap:"6",children:a.forms.map(n=>{const o=n.event?n.event.name:t("communaut_20896");return(0,i.jsxs)(fr,{css:{cursor:"pointer"},onClick:()=>{e.push(zi.FORM({organizationId:n.organization.id,eventId:n.event?.id,formId:n.id}))},children:[(0,i.jsx)(fr,{color:"gray800",children:o}),(0,i.jsx)(fr,{color:"gray500",children:n.name})]},n.id)})}),(0,i.jsx)(Pa,{height:"9"})]})]})})},oP=()=>{const{history:e,translate:t,params:{organizationId:n}}=il(),{isOrganizationAdmin:o}=nI(),{reloadKey:s,segmentId:r,setReloadKey:a}=zC();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(WR,{}),(0,i.jsxs)(yC,{children:[(0,i.jsx)(fO,{searchRow:(0,i.jsx)(gO,{actions:(0,i.jsx)(UR,{}),searchPlaceholder:t("rechercher_un_c_49598"),showEditColumns:!0,showEditMode:o,showSearchColumns:!1})}),(0,i.jsx)(nP,{}),(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.CUSTOM_FIELD_USAGE(":organizationId",":segmentId",":customFieldId"),children:(0,i.jsx)(iP,{})}),(0,i.jsx)(_r.qh,{path:So.CREATE_CUSTOM_FIELD(":organizationId",":segmentId"),children:(0,i.jsx)(IS,{organizationId:n,onClose:()=>{e.goBack(So.CUSTOM_FIELDS_SEGMENT(n,r))},onSuccess:()=>{a(s+1)}})}),(0,i.jsx)(_r.qh,{path:So.EDIT_CUSTOM_FIELD(":organizationId",":segmentId",":customFieldId"),children:(0,i.jsx)(bS,{onClose:()=>{e.goBack(So.CUSTOM_FIELDS_SEGMENT(n,r))},onSuccess:()=>{a(s+1)}})})]})]})]})},sP=e=>{const{history:t,translate:n,params:{organizationId:o,segmentId:s}}=il();Cd(n("champs_de_formu_64126"));const{isOrganizationAdmin:r,localOrganization:a,updateLocalOrganization:l}=nI(),d=Nn(VR),c=(0,F.useMemo)(()=>d.getCustomFieldsFilters(o,e.organization),[e.organization,o]),u=(0,F.useMemo)(()=>d.getCustomFieldsPossibleColumns(),[]);return(0,i.jsx)(HR,{organizationId:o,children:(0,i.jsx)(uO,{filters:c,filtersButtonText:n("filtrer_les_cha_91574"),filtersSubtitle:n("appliquer_des_f_27562"),getSegmentPath:e=>So.CUSTOM_FIELDS_SEGMENT(o,e),initialLimit:a?.customFieldsLimit??_c,initialSegmentsOpen:a?.areCustomFieldsSegmentsOpen??!0,isAdmin:r,organizationId:o,possibleColumns:u,possibleRenderings:[],reload:e.reload,segmentId:s,segmentType:ft.CustomFields,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{l({customFieldsLimit:e})},onSegmentClick:e=>{l({customFieldsSegmentId:e})},onSegmentDelete:async()=>{await l({customFieldsSegmentId:null}),t.replace(So.CUSTOM_FIELDS(o))},onSegmentsToggle:async e=>{await l({areCustomFieldsSegmentsOpen:e})},children:(0,i.jsx)(oP,{})})})},rP=()=>{const{params:{organizationId:e}}=il(),{localOrganization:t}=nI(),{data:n,loader:o,reload:s}=Vn("query CustomFieldsSegments($organizationId: OrganizationId!, $predicates: [Predicate!]!) {\n    organization(id: $organizationId) {\n        customFields(predicates: $predicates) {\n            nodes {\n                id\n                name\n            }\n        }\n\n        customFieldsCategories {\n            nodes {\n                id\n                name\n            }\n        }\n\n        segmentsFolders(level: Organization, segmentType: CustomFields) {\n            ...SegmentsFoldersSegments\n        }\n    }\n}\n",{organizationId:e,predicates:[{operator:dt.Is,slug:"condition",value:[]}]},[Ro.SegmentsFoldersSegmentsFragment]);const r=(0,F.useMemo)(()=>(n.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[n.organization]);return o||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.CUSTOM_FIELDS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(sP,{organization:n.organization,reload:s})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.CUSTOM_FIELDS_SEGMENT(e,t?.customFieldsSegmentId&&r.includes(t.customFieldsSegmentId)?t.customFieldsSegmentId:r[0]),replace:!0})})]})},aP=e=>{const{translate:t}=il();return(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"invisible",leftIcon:"plus",children:t("lier_un_champ_p_01331")})}),(0,i.jsx)(Pd,{css:{padding:"0"},placement:"top-start",width:400,children:(0,i.jsx)($j,{customFields:e.formCustomFields,selectedCustomFieldsIds:e.selectedCustomFieldsIds,toggle:e.toggle})})]})},lP=e=>{const{translate:t}=il();return(0,i.jsxs)(Ea,{align:"center",css:{background:"$gray50",bd:"gray200 2",padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("aucun_champ_per_72101")}),(0,i.jsx)(aP,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:e.selectedCustomFieldsIds,toggle:e.toggle})]})},dP=e=>{const t=(0,F.useMemo)(()=>Object.fromEntries(e.formCustomFields.map(e=>[e.id,e])),[e.formCustomFields]);return(0,i.jsx)(Qc.JY,{onDragEnd:e.onDragEnd,children:(0,i.jsx)(Qc.gL,{droppableId:"1",children:n=>(0,i.jsxs)(Ea,{css:{bd:!0},direction:"column",width:1,...n.droppableProps,ref:n.innerRef,children:[e.formCustomFieldsValues.map((n,o)=>(0,i.jsx)(yS,{css:{border:"none",borderBottom:"1px solid $gray200",borderRadius:"0",boxShadow:"none","&:last-child":{borderBottom:"none"}},elementId:n.id,field:t[n.customFieldId],index:o,isMandatory:n.isMandatory,showEdit:!1,toggleIsMandatory:e.toggleMandatory,updateCustomField:Bl.A,onDelete:e.onDelete},n.id)),n.placeholder]})})})},cP=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>new Set(e.formCustomFieldsValues.map(({customFieldId:e})=>e)),[e.formCustomFieldsValues]),o=(0,F.useCallback)(t=>{e.change(`${e.prefix}formCustomFields`,t)},[e.prefix,e.change]),s=(0,F.useCallback)(t=>{n.has(t.id)?o(e.formCustomFieldsValues.filter(({customFieldId:e})=>e!==t.id)):o([...e.formCustomFieldsValues,{id:N(),customFieldId:t.id,isMandatory:!0}])},[e.formCustomFieldsValues,n,o]),r=(0,F.useCallback)(({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&o(es(e.formCustomFieldsValues,n.index,i.index))},[e.formCustomFieldsValues,o]),a=(0,F.useCallback)((t,n)=>{o((0,Jc.jM)(e.formCustomFieldsValues,e=>{e[t].isMandatory=n}))},[e.formCustomFieldsValues,o]),l=(0,F.useCallback)(t=>{o((0,Jc.jM)(e.formCustomFieldsValues,e=>{e.splice(t,1)}))},[e.formCustomFieldsValues,o]);return(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsx)(Ea,{width:280,children:(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("champs_personna_17489")})}),(0,i.jsx)(Ea,{css:{flex:"1"},children:Zo(e.formCustomFieldsValues)?(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(dP,{formCustomFields:e.formCustomFields,formCustomFieldsValues:e.formCustomFieldsValues,toggleMandatory:a,onDelete:l,onDragEnd:r}),(0,i.jsx)(aP,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:n,toggle:s})]}):(0,i.jsx)(lP,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:n,toggle:s})})]})},uP=e=>{const{params:{organizationId:t}}=il(),n=(0,F.useMemo)(()=>(0,Zd.A)((0,Ju.A)(e.customFields.map(e=>e.category),e=>e.id),e=>e.name.toLowerCase()),[e.customFields]),o=(0,F.useMemo)(()=>(0,Kd.A)(e.customFields,e=>e.category.id),[e.customFields]);return(0,i.jsxs)(Ea,{direction:"column",children:[n.map((n,s)=>{const r=o[n.id];return(0,i.jsxs)(F.Fragment,{children:[0!==s&&(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsx)(Ea,{width:280,children:(0,i.jsx)(fr,{font:"gray800 textSm medium",children:n.name})}),(0,i.jsx)(Ea,{css:{flex:"1"},direction:"column",gap:"4",children:r.map(n=>(0,i.jsx)(zj,{change:e.change,display:!0,field:n,fileAcl:"public-read",isMandatory:!1,organizationId:t,prefix:`${e.prefix}fields.`},n.id))})]})]},n.id)}),Zo(e.customFields)&&e.showFormCustomFields&&(0,i.jsx)($u,{height:"5"}),e.showFormCustomFields&&(0,i.jsx)(cP,{change:e.change,formCustomFields:e.formCustomFields,formCustomFieldsValues:e.formCustomFieldsValues,prefix:e.prefix})]})},hP=e=>{const{history:t,translate:n,params:{organizationId:o}}=il(),s=Nn(Hc),r=(0,F.useMemo)(()=>O_.map((e,t)=>(0,i.jsx)("option",{value:e,children:e},t)),[]);return(0,i.jsxs)(i.Fragment,{children:[e.showEmailSender&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sm,{isCreateVisible:!0,isSearchVisible:!0,label:n("_metteur_des_e_27849"),name:"event.emailSenderId",onCreateClick:()=>{t.push(So.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(o))},children:e.emailsSenders.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Pa,{height:"4"})]}),(0,i.jsx)(Sr.Yr,{name:"event.languages",children:t=>{!e.hasLanguagesFeature&&t.length>1&&e.change("event.languages",[(0,Vc.A)(t)])}}),(0,i.jsx)(Sm,{label:n("langues_de_l_v_94191"),multiple:!0,name:"event.languages",children:ad.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sm,{isSearchVisible:!0,label:n("fuseau_horaire_14654"),name:"event.timeZone",children:r}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(dv,{label:n("heure_laquell_13491"),name:"event.dayStartTime"}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sm,{isSearchVisible:!0,label:n("Country"),name:"event.country",children:s.getCountriesIdName().map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsxs)(lj,{label:n("fond_de_carte_43822"),name:"event.layer",children:[(0,i.jsx)("option",{value:Xe.Google,children:"Plan"}),(0,i.jsx)("option",{value:Xe.GoogleSatellite,children:"Satellite"}),(0,i.jsx)("option",{value:Xe.IgnPlan,children:"IGN Plan"})]}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsxs)(Ea,{gap:"6",children:[(0,i.jsx)(wm,{label:(0,i.jsx)(nv,{children:n("latitude_par_d_01620")}),name:"event.latitude"}),(0,i.jsx)(wm,{label:(0,i.jsx)(nv,{children:n("longitude_par_d_28326")}),name:"event.longitude"})]}),e.weezeventOrganizationId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(zm,{name:"event.isWeezeventSynchronized",children:"Synchroniser avec Weezevent"})]})]})},mP=e=>{const{history:t,translate:n,params:{organizationId:o}}=il(),s=Nn(M_),r=Nn(za),{hasFeature:a,reload:l}=nI(),d=(0,F.useRef)(null),c=(0,F.useMemo)(()=>({event:e.initialValues}),[e.initialValues]),u=(0,F.useMemo)(()=>e.initialValues.languages.length>1||"number"==typeof e.initialValues.emailSenderId||!e.initialValues.dayStartTime.startsWith("00:00"),[e.initialValues]),m=(0,F.useMemo)(()=>e.isEdit&&Zo(Object.keys(e.initialValues.fields)),[e.isEdit,e.initialValues]),g=(0,F.useMemo)(()=>h(e.initialValues.description),[e.initialValues]),p=(0,F.useMemo)(()=>!!e.isEdit&&Zo(e.initialValues.tagsIds),[e.isEdit,e.initialValues]);return(0,i.jsx)(dl,{customErrorRef:d,height:1,initialValues:c,initialValuesEqual:()=>!0,render:({form:t,handleSubmit:s,values:r})=>(0,i.jsx)(bm,{button:e.isEdit&&(0,i.jsx)(pl,{isLoading:e.isMutateLoading,onClick:s,children:n("mettre_jour_l_28846")}),category:e.organization.name,color:"dark",fallbackClosePath:Pi.EVENTS({organizationId:o}),title:e.isEdit?n("mise_jour_de_17055",e.initialValues.name):n("cr_ation_d_un_94106"),children:(0,i.jsxs)(Im,{ref:d,children:[(0,i.jsx)(sl,{}),(0,i.jsx)(Cm,{hideToggle:!0,initialIsOpen:!0,subtitle:n("param_trer_votr_94121"),title:n("dites_en_nous_u_13238"),children:(0,i.jsx)(W_,{form:t,values:r})}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Cm,{initialIsOpen:u,subtitle:n("param_trer_les_43001"),title:n("options_avanc_e_12396"),children:(0,i.jsx)(hP,{change:t.change,emailsSenders:e.organization.emailsSenders,hasLanguagesFeature:a(Fe.Languages),showEmailSender:!0,weezeventOrganizationId:e.organization.weezeventOrganizationId})}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Cm,{initialIsOpen:m,subtitle:n("ajouter_des_inf_87361"),title:n("champs_de_formu_64126"),onToggle:e=>{e||t.change("event.fields",{})},children:(0,i.jsx)(uP,{change:t.change,customFields:e.eventCustomFields,formCustomFields:[],formCustomFieldsValues:[],prefix:"event.",showFormCustomFields:!1})}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Cm,{initialIsOpen:g,subtitle:n("ajouter_une_des_44242"),title:n("Description"),onToggle:e=>{e||t.change("event.description","")},children:(0,i.jsx)(gv,{label:(0,i.jsx)(nv,{children:n("description_58935")}),name:"event.description"})}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Cm,{initialIsOpen:p,subtitle:n("ajouter_des_tag_23887"),title:n("tags_79499"),onToggle:e=>{e||t.change("event.tagsIds",[])},children:(0,i.jsx)(fj,{change:t.change,name:"event.",organizationId:o,tags:e.organization.tags.nodes,tagsIds:r.event.tagsIds})}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(jm,{children:(0,i.jsx)(pl,{isLoading:e.isMutateLoading,textAlign:"center",onClick:s,children:e.isEdit?n("mettre_jour_l_28846"):n("cr_er_l_v_neme_16731")})})]})}),validate:r.validateForForm(s.createUpdateEventSchema()),width:1,onSubmit:async n=>{const i=await e.mutate({organizationId:o,event:n.event});l(),e.isEdit?t.goBack(Pi.EVENT({organizationId:o,eventId:i})):t.replace(Pi.EVENT({organizationId:o,eventId:i}))}})},gP=()=>{const e=Nn(M_),{params:{organizationId:t},translate:n}=il();Cd(n("cr_er_l_v_neme_16731"));const{data:o,loader:s}=Vn("query EventCreateInfos($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        ...CreateUpdateEventInfos\n    }\n}\n",{organizationId:t},[Ro.CreateUpdateEventInfosFragment]),{mutate:r,isLoading:a}=function(e={}){return Un("mutation CreateEvent($organizationId: OrganizationId!, $event: EventInput!) {\n    eventCreate(organizationId: $organizationId, event: $event) {\n        id\n    }\n}\n",e)}({redirectOnSuccess:!0});return s||(0,i.jsx)(mP,{eventCustomFields:o.organization?.eventCustomFields.nodes??[],initialValues:e.eventInputDefault(),isEdit:!1,isMutateLoading:a,mutate:async e=>{const{eventCreate:{id:t}}=await r(e);return t},organization:o.organization})},pP=()=>{const e=Nn(M_),{params:{organizationId:t,eventId:n},translate:o}=il(),{data:s,loader:r}=Vn("query EventUpdateInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n    organization(id: $organizationId) {\n        ...CreateUpdateEventInfos\n    }\n\n    event(id: $eventId) {\n        name\n        description\n        languages\n        startAt\n        endAt\n        timeZone\n        country\n        layer\n        latitude\n        longitude\n        emailSenderId\n        dayStartTime\n        tagsIds\n        fields\n        isWeezeventSynchronized\n    }\n}\n",{organizationId:t,eventId:n},[Ro.CreateUpdateEventInfosFragment]);Cd(`${o("update_event_09229")}: ${s.event?.name}`);const{mutate:a,isLoading:l}=function(e={}){return Un("mutation EventUpdate($organizationId: OrganizationId!, $eventId: EventId!, $event: EventInput!) {\n    eventUpdate(organizationId: $organizationId, eventId: $eventId, event: $event) {\n        id\n    }\n}\n",e)}({redirectOnSuccess:!0});return r||(0,i.jsx)(mP,{eventCustomFields:s.organization?.eventCustomFields.nodes??[],initialValues:e.eventInputDefault(s.event),isEdit:!0,isMutateLoading:l,mutate:async e=>{const{eventUpdate:{id:t}}=await a({...e,eventId:n});return t},organization:s.organization})};var fP;!function(e){e.Description="description",e.EndAt="endAt",e.Id="id",e.Name="name",e.NumberOfMembers="numberOfMembers",e.NumberOfMembersAccredited="numberOfMembersAccredited",e.NumberOfMembersAssigned="numberOfMembersAssigned",e.StartAt="startAt",e.State="state",e.Tags="tags"}(fP||(fP={}));let xP=class extends Xc{constructor(e,t,n){super(e,t,n)}getEventsFilters(e,t){return[{slug:"name",name:this.t("nom_de_l_v_nem_08711"),category:this.t("Event"),fieldType:Be.Text,hideEmpty:!0},{slug:fP.Description,name:this.t("Description"),category:this.t("Event"),fieldType:Be.Text},{slug:"startAt",name:this.t("date_de_d_but_43380"),category:this.t("Event"),fieldType:Be.Date,hideEmpty:!0},{slug:"endAt",name:this.t("date_de_fin_86920"),category:this.t("Event"),fieldType:Be.Date,hideEmpty:!0},{slug:"state",name:this.t("status_06428"),category:this.t("Event"),fieldType:Be.Select,values:[{id:Re.Ongoing,name:this.t(Re.Ongoing)},{id:Re.Upcoming,name:this.t(Re.Upcoming)},{id:Re.Done,name:this.t(Re.Done)}],hideEmpty:!0},{slug:"tag",name:this.t("Tag"),category:this.t("Event"),fieldType:Be.Select,needLoading:!0,organizationId:e,tagContext:vt.Events},...this.customFieldsToFilters(t)]}getEventPossibleColumns(e){return[{slug:fP.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:Oe.Id,width:100},{slug:fP.Name,name:this.t("nom_de_l_v_nem_08711"),isSearchable:!0,isSortable:!0,sortAttribute:Oe.Name,minWidth:240},{slug:fP.StartAt,name:this.t("date_de_d_but_43380"),isSortable:!0,sortAttribute:Oe.StartAt,minWidth:180},{slug:fP.EndAt,name:this.t("date_de_fin_86920"),isSortable:!0,sortAttribute:Oe.EndAt,minWidth:180},{slug:fP.State,name:this.t("status_06428"),minWidth:180},{slug:fP.Tags,name:this.t("tags_79499"),minWidth:320},{slug:fP.NumberOfMembers,name:this.t("nombre_de_membr_08851"),minWidth:180},{slug:fP.NumberOfMembersAssigned,name:this.t("nombre_de_membr_87779_plural"),minWidth:180},{slug:fP.NumberOfMembersAccredited,name:this.t("nombre_de_membr_25913"),minWidth:180}].concat(this.customFieldsToPossibleColumns(e))}};xP=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hc,$c,Dn])],xP);const _P=e=>{const t=Ln(),n=Nn($c);return(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:200,children:[(0,i.jsx)(fr,{font:"gray500 textXs regular",children:t("date_de_l_v_ne_69973")}),(0,i.jsx)(fr,{font:"gray800 textSm medium",children:C_(n,e.event.startAt,e.event.endAt)})]})},IP=e=>{const t=Ln();return(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:100,children:[(0,i.jsx)(fr,{font:"gray500 textXs regular",children:t("status_06428")}),(0,i.jsx)(Ea,{children:(0,i.jsx)(Gd,{color:y_(e.event.state),children:t(e.event.state)})})]})},vP=e=>{const t=Ln(),{mutate:n}=function(e={}){return Un("mutation EventsMassArchive(\n    $organizationId: OrganizationId!\n    $selecteds: MassActionSelectedsInput!\n) {\n    eventsMassArchive(organizationId: $organizationId, selecteds: $selecteds)\n}\n",e)}(),{reload:o}=nI();return(0,i.jsx)(kk,{buttonText:t("archiver_26131"),subtext:t("_tes_vous_s_r_d_76724"),text:t("archivage_de_31255",e.event.name),onClose:e.onClose,onDelete:async()=>{await n({organizationId:e.organizationId,selecteds:{ids:[e.event.id]}}),o(),e.onSuccess()}})};let bP=class extends zl{constructor(e){super(e)}eventDuplicateInputDefault(e){return{name:this.t("copie_de_1_62900",e.name),startAt:e.startAt,endAt:e.endAt,eventId:null,includeAccreditations:!0,includeCustomDocuments:!0,includeDelegations:!0,includeForms:!0,includePositions:!0,includeSegments:!0,includeTemplates:!0,includeWorkflows:!0}}eventDuplicateSchema(){return l.Ik().shape({name:l.Yj().required(this.t("le_nom_est_requ_61536")),startAt:$m.required(this.t("la_date_d_but_d_30022")).typeError(this.t("la_date_d_but_d_30022")),endAt:$m.required(this.t("la_date_de_fin_45068")).typeError(this.t("la_date_de_fin_45068")).test("after-start-at",this.t("la_date_de_fin_00429"),function(){return Fo.c9.isDateTime(this.parent.startAt)&&this.parent.startAt.isValid&&Fo.c9.isDateTime(this.parent.endAt)&&this.parent.endAt.isValid&&this.parent.endAt>=this.parent.startAt}),includeAccreditations:l.zM(),includeCustomDocuments:l.zM(),includeDelegations:l.zM(),includeForms:l.zM(),includePositions:l.zM(),includeSegments:l.zM(),includeTemplates:l.zM(),includeWorkflows:l.zM()})}};bP=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],bP);const jP=e=>{const t=Ln(),n=Nn(bP),o=Nn(za),{mutate:s,isLoading:r}=function(e={}){return Un("mutation EventDuplicate($eventId: EventId!, $options: EventDuplicateInput!) {\n    eventDuplicate(eventId: $eventId, options: $options) {\n        id\n    }\n}\n",e)}(),{organization:a,reload:l}=nI(),[d,c]=(0,F.useState)(!1),u=(0,F.useMemo)(()=>a.events.nodes.filter(t=>t.id!==e.event.id),[a.events.nodes]),h=e.event.endAt.diff(e.event.startAt,"days").days;return(0,i.jsx)(Oa.lV,{initialValues:{options:n.eventDuplicateInputDefault(e.event)},initialValuesEqual:wr.A,render:({form:n,handleSubmit:o,invalid:s,values:a})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sr.Yr,{name:"options.startAt",children:e=>{const t=e.plus({days:h});t.equals(a.options.endAt)||n.change("options.endAt",t)}}),(0,i.jsx)(Sr.Yr,{name:"options.endAt",children:e=>{const t=e.minus({days:h});t.equals(a.options.startAt)||n.change("options.startAt",t)}}),(0,i.jsx)(eb,{icon:"clone",children:t("dupliquer_l_v_72541",e.event.name)}),(0,i.jsxs)(Qv,{css:{overflowY:"auto"},gap:"5",children:[(0,i.jsx)(su,{value:d,onChange:e=>{c(e),e||n.change("options.eventId",null)},children:t("dupliquer_les_d_77458")}),d?(0,i.jsx)(Sm,{isSearchVisible:!0,label:t("_v_nement_22345"),name:"options.eventId",children:u.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sl,{label:t("nom_du_nouvel_66511"),name:"options.name"}),(0,i.jsxs)(Ea,{gap:"5",children:[(0,i.jsx)(km,{label:t("nouvelle_date_d_75723"),min:Fo.c9.utc(),name:"options.startAt"}),(0,i.jsx)(km,{label:t("nouvelle_date_d_93958"),min:Fo.c9.utc(),name:"options.endAt"})]})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(fr,{font:"gray700 textSm medium",children:t("que_souhaitez_v_40297")}),(0,i.jsxs)(Ea,{direction:"column",gap:"3",children:[(0,i.jsxs)(Ea,{gap:"5",children:[(0,i.jsx)(fr,{width:1,children:(0,i.jsx)(ym,{name:"options.includePositions",children:t("missions_63972")})}),(0,i.jsx)(fr,{width:1,children:(0,i.jsx)(ym,{name:"options.includeAccreditations",children:t("accr_ditations_39450")})})]}),(0,i.jsxs)(Ea,{gap:"5",children:[(0,i.jsx)(fr,{width:1,children:(0,i.jsx)(ym,{name:"options.includeForms",children:t("Form_plural")})}),(0,i.jsx)(fr,{width:1,children:(0,i.jsx)(ym,{name:"options.includeDelegations",children:t("d_l_gations_78318")})})]}),(0,i.jsxs)(Ea,{gap:"5",children:[(0,i.jsx)(fr,{width:1,children:(0,i.jsx)(ym,{name:"options.includeSegments",children:t("vues_personnali_80652")})}),(0,i.jsx)(fr,{width:1,children:(0,i.jsx)(ym,{name:"options.includeCustomDocuments",children:t("documents_perso_87374")})})]}),(0,i.jsxs)(Ea,{gap:"5",children:[(0,i.jsx)(fr,{width:1,children:(0,i.jsx)(ym,{name:"options.includeTemplates",children:t("mod_les_de_camp_58182")})}),(0,i.jsx)(fr,{width:1,children:(0,i.jsx)(ym,{name:"options.includeWorkflows",children:t("automatisations_60045")})})]})]})]})]}),(0,i.jsx)(Jv,{children:(0,i.jsx)(pl,{disabled:s,isLoading:r,onClick:o,children:t("dupliquer_28256")})})]}),validate:e=>o.validateForForm(n.eventDuplicateSchema())(e.options),onSubmit:async t=>{await s({eventId:e.event.id,options:t.options}),l(),e.reload(),e.onClose()}})},CP=e=>{const{params:{organizationId:t},translate:n}=il(),{isOrganizationAdmin:o}=nI(),[s,r]=(0,F.useState)(!1),[a,l]=(0,F.useState)(!1),d=(0,F.useMemo)(()=>e.event.tags.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.event.tags]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",css:{background:"white",bd:!0,padding:"$4 $6"},gap:"4",children:[(0,i.jsx)(Ea,{css:{flex:"1"},children:(0,i.jsx)(j_,{to:So.VOLUNTEERS(t,e.event.id),children:e.event.name})}),(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"hidden"},gap:"8",children:[(0,i.jsx)(_P,{event:e.event}),(0,i.jsx)(IP,{event:e.event}),(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray500 textXs regular",children:n("tags_79499")}),(0,i.jsx)(qC,{badges:d})]})]}),(0,i.jsxs)(Ea,{gap:"3",children:[(0,i.jsx)(pl,{to:So.VOLUNTEERS(t,e.event.id),children:n("voir_l_v_nemen_72358")}),o&&(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsx)(Od,{icon:"pen",to:So.EDIT_EVENT(t,e.event.id),children:n("_diter_62574")}),(0,i.jsx)(Od,{icon:"clone",onClick:e=>{wd(e.target),r(!0)},children:n("dupliquer_28256")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:e=>{wd(e.target),l(!0)},children:n("archiver_26131")})]})]})]})]}),(0,i.jsx)(nb,{isOpen:s,onClose:()=>{r(!1)},children:(0,i.jsx)(tb,{children:(0,i.jsx)(jP,{event:e.event,reload:e.reload,onClose:()=>{r(!1)}})})}),a&&(0,i.jsx)(vP,{event:e.event,organizationId:t,onClose:()=>l(!1),onSuccess:e.reload})]})},yP=()=>{const{translate:e}=il();return(0,i.jsxs)(Ea,{align:"center",css:{background:"white",bd:!0,minHeight:"75px",padding:"$4 $6"},gap:"4",children:[(0,i.jsx)(Ea,{css:{flex:"1"},children:(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1})}),(0,i.jsxs)(Ea,{css:{flex:"1"},gap:"8",children:[(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:200,children:[(0,i.jsx)(fr,{font:"gray500 textXs regular",children:e("date_de_l_v_ne_69973")}),(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:70,children:[(0,i.jsx)(fr,{font:"gray500 textXs regular",children:e("status_06428")}),(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray500 textXs regular",children:e("tags_79499")}),(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1})]})]}),(0,i.jsx)(Ea,{width:200})]})},kP=()=>{const{params:{organizationId:e}}=il(),{nameDebounced:t,predicates:n,limit:o,offset:s,setLimit:r,setOffset:a}=zC(),{data:l,isLoading:d,reload:c}=Yr({organizationId:e,name:h(t)?t:null,predicates:n,limit:o,offset:s,sort:{attribute:Oe.StartAt,direction:_t.Desc},includeNumberOfMembers:!1}),{numberOfPages:u,totalCount:m}=lu(l.data?.rows);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ea,{css:{background:"$gray100",borderLeft:"1px solid $gray200",borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",flex:"1",overflowX:"hidden",overflowY:"auto",padding:"$4"},direction:"column",gap:"3",width:1,children:d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yP,{}),(0,i.jsx)(yP,{}),(0,i.jsx)(yP,{})]}):(l.data?.rows.nodes??[]).map(e=>(0,i.jsx)(CP,{event:e,reload:c},e.id))}),(0,i.jsx)(yc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(jc,{limit:o,numberOfPages:u,offset:s,setLimit:r,setOffset:a,showLimits:!0,totalCount:m})})]})},AP=()=>{const{history:e,translate:t,params:{organizationId:n}}=il(),{isOrganizationAdmin:o}=nI();return(0,i.jsx)(xO,{children:o&&(0,i.jsx)(pl,{onClick:()=>{e.push(So.CREATE_EVENT(n))},children:t("cr_er_un_v_nem_28126")})})},wP=e=>{const{params:{organizationId:t}}=il(),{mutate:n}=ys();return(0,i.jsx)(PC,{column:e.column,initialValue:e.initialValue,mutate:i=>n({organizationId:t,massEdit:{reset:!1,selecteds:{ids:[e.eventId]},slug:e.property,strategy:Je.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:e.updatable})},SP=e=>{const{translate:t}=il(),n=Nn($c);return(0,i.jsx)(wP,{column:e.column,eventId:e.event.id,initialValue:e.event.endAt,property:$e.EndAt,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(_u,{label:t("date_de_fin_86920"),value:e,onChange:n}),renderValue:n.toLocaleString(e.event.endAt,Ho.DateOnly.WeekdayLongMonthLong),updatable:!0})},EP=e=>{const{translate:t,params:{organizationId:n}}=il(),{isEditMode:o}=zC();return(0,i.jsx)(wP,{column:e.column,eventId:e.event.id,initialValue:e.event.name,property:$e.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(wl,{label:t("nom_de_l_v_nem_08711"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(ZO,{isEditMode:o,title:e.event.name,updatable:!0,children:(0,i.jsx)(j_,{to:Pi.EVENT({organizationId:n,eventId:e.event.id}),children:e.event.name})}),updatable:!0})},TP=e=>{const{translate:t}=il(),n=Nn($c);return(0,i.jsx)(wP,{column:e.column,eventId:e.event.id,initialValue:e.event.startAt,property:$e.StartAt,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(_u,{label:t("date_de_d_but_43380"),value:e,onChange:n}),renderValue:n.toLocaleString(e.event.startAt,Ho.DateOnly.WeekdayLongMonthLong),updatable:!0})},zP=F.createContext({}),$P=e=>{const t=OO(Os,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(zP.Provider,{value:{getTags:t},children:e.children})},OP=e=>{const{translate:t}=il(),{getTags:n}=F.useContext(zP),{result:o,isLoading:s}=HO(n);return s?(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(yl,{children:t("tags_79499")}),(0,i.jsx)(qd,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(dc,{isSearchVisible:!0,label:t("tags_79499"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},RP=e=>{const t=(0,F.useMemo)(()=>e.event.tags||[],[e.event]),n=(0,F.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(wP,{column:e.column,eventId:e.event.id,initialValue:t.map(e=>e.id),property:$e.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(OP,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(qC,{badges:n}),updatable:!0})},PP=e=>{const{translate:t}=il(),{mutate:n}=ys(),o=(0,F.useCallback)((t,i)=>n({organizationId:e.organizationId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:i,strategy:Je.Replace,value:t}}),[e.row,n]);return e.column.slug===fP.Id?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===fP.Name?(0,i.jsx)(EP,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===fP.StartAt?(0,i.jsx)(TP,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===fP.EndAt?(0,i.jsx)(SP,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===fP.Tags?(0,i.jsx)(RP,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===fP.State?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Gd,{color:y_(e.row.state),children:t(e.row.state)})}):e.column.slug===fP.NumberOfMembers?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembers}):e.column.slug===fP.NumberOfMembersAccredited?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembersAccredited}):e.column.slug===fP.NumberOfMembersAssigned?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembersAssigned}):(0,i.jsx)(JC,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:o,reload:e.reloadRow,updatable:!0})},DP=e=>{const{translate:t,params:{organizationId:n}}=il(),[o,s]=(0,F.useState)(!1),[r,a]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(pm,{children:[(0,i.jsx)(Od,{icon:"clone",onClick:e=>{wd(e.target),s(!0)},children:t("dupliquer_28256")}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:e=>{wd(e.target),a(!0)},children:t("archiver_26131")})]}),(0,i.jsx)(nb,{isOpen:o,onClose:()=>{s(!1)},children:(0,i.jsx)(tb,{children:(0,i.jsx)(jP,{event:e.event,reload:e.reload,onClose:()=>{s(!1)}})})}),r&&(0,i.jsx)(vP,{event:e.event,organizationId:n,onClose:()=>a(!1),onSuccess:e.reload})]})},FP=e=>{const{translate:t,params:{organizationId:n}}=il(),{isAdmin:o}=zC(),s=SC(e.customFields),r=(0,F.useCallback)(()=>{e.reloadEvent(e.event.id)},[e.event,e.reloadEvent]);return(0,i.jsxs)(Cc,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},onMouseLeave:e=>{wd(e.target)},children:[e.columns.map(t=>{const o=s.get(t.slug);return(0,i.jsx)(PP,{column:t,customField:o,organizationId:n,reloadRow:r,row:e.event},t.slug)}),o&&(0,i.jsxs)(im,{justify:"center",children:[(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"pen",to:So.EDIT_EVENT(n,e.event.id)})})}),(0,i.jsx)(am,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsx)(DP,{event:e.event,reload:e.reload})]})]})},MP=e=>{const{params:{organizationId:t}}=il(),{columns:n,isAdmin:o,limit:s,massActions:r,nameDebounced:a,offset:l,possibleColumns:d,predicates:c,setLimit:u,setOffset:m,setSort:g,sort:p}=zC(),f=(0,F.useMemo)(()=>function(e){return{includeNumberOfMembers:e.includes(fP.NumberOfMembers)||e.includes(fP.NumberOfMembersAccredited)||e.includes(fP.NumberOfMembersAssigned)}}(n),[n]),{data:x,isLoading:_,reload:I}=Yr({...f,organizationId:t,name:h(a)?a:null,predicates:c,limit:s,offset:l,sort:p}),v=(0,F.useMemo)(()=>n.flatMap(e=>(0,Da.A)([d.find(t=>t.slug===e)])),[d,n]),{numberOfPages:b,totalCount:j}=lu(x.data?.rows),[C,y]=(0,F.useState)([]),[k,A]=(0,F.useState)({}),w=(0,F.useCallback)(async e=>{A(t=>({...t,[e]:!0}));const{data:{row:n}}=await(i={...f,organizationId:t,id:e},o=await H(),ss("query EventsEvent(\n    $organizationId: OrganizationId!\n    $id: EventId!\n    $includeNumberOfMembers: Boolean!\n) {\n    data: organization(id: $organizationId) {\n        row: event(id: $id) {\n            ...EventsEvent\n        }\n    }\n}\n",{variables:i,token:o||void 0,fragments:[Ro.EventsEventFragment]}));var i,o;y(t=>t.map(t=>t.id===e?n:t)),A(t=>({...t,[e]:!1}))},[f,A,y]);return(0,F.useEffect)(()=>{y(x.data?.rows.nodes??[])},[x.data]),(0,F.useEffect)(()=>{r.setStates(Object.fromEntries((x.data?.rows.nodes??[]).map(e=>[`e${e.id}`,{id:e.id,state:"unchecked"}])))},[x.data,r.setStates]),(0,i.jsx)(Ea,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(nm,{"aria-busy":_,headerRow:(0,i.jsxs)(cc,{children:[v.map(e=>e.isSortable?(0,i.jsx)(tm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:g,sort:p,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Tc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),o&&(0,i.jsx)(Tc,{width:100})]}),paginationRow:(0,i.jsx)(yc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(jc,{limit:s,numberOfPages:b,offset:l,setLimit:u,setOffset:m,showLimits:!0,totalCount:j})}),children:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{})]}):C.map(t=>k[t.id]?(0,i.jsx)(zc,{},t.id):(0,i.jsx)(FP,{columns:v,customFields:e.customFields,event:t,reload:I,reloadEvent:w,state:r.states[`e${t.id}`]?.state??"unchecked"},t.id))})})},NP=e=>{const{translate:t}=il(),{isOrganizationAdmin:n}=nI(),{rendering:o}=zC(),s=n&&o===jh.List,r=n&&o===jh.List;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(AP,{}),(0,i.jsxs)(yC,{children:[(0,i.jsx)(fO,{searchRow:(0,i.jsx)(gO,{searchPlaceholder:t("rechercher_un_40024"),showEditColumns:s,showEditMode:r,showSearchColumns:!1})}),o===jh.List?(0,i.jsx)(MP,{customFields:e.customFields}):(0,i.jsx)(kP,{})]})]})},LP=e=>{const{history:t,translate:n,params:{organizationId:o,segmentId:s}}=il(),{isOrganizationAdmin:r,localOrganization:a,updateLocalOrganization:l}=nI(),d=Nn(xP),c=(0,F.useMemo)(()=>e.organization.customFields.nodes,[e.organization]),u=(0,F.useMemo)(()=>d.getEventsFilters(o,c),[o,c]),h=(0,F.useMemo)(()=>d.getEventPossibleColumns(c),[c]);return(0,i.jsx)($P,{organizationId:o,children:(0,i.jsx)(uO,{filters:u,filtersButtonText:n("filtrer_les_v_48869"),filtersSubtitle:n("appliquer_des_f_84816"),getSegmentPath:e=>So.EVENTS_SEGMENT(o,e),initialLimit:a?.eventsLimit??_c,initialSegmentsOpen:a?.areEventsSegmentsOpen??!0,isAdmin:r,organizationId:o,possibleColumns:h,possibleRenderings:[jh.Card,jh.List],reload:e.reload,segmentId:s,segmentType:ft.Events,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{l({eventsLimit:e})},onSegmentClick:e=>{l({eventsSegmentId:e})},onSegmentDelete:async()=>{await l({eventsSegmentId:null}),t.replace(Pi.EVENTS({organizationId:o}))},onSegmentsToggle:async e=>{await l({areEventsSegmentsOpen:e})},children:(0,i.jsx)(NP,{customFields:c})})})},BP=()=>{const{params:{organizationId:e},translate:t}=il();Cd(t("events_23531"));const{localOrganization:n}=nI(),{data:o,loader:s,reload:r}=Vn("query EventsSegments($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        customFields(variety: Event) {\n            nodes {\n                ...SegmentCustomField\n            }\n        }\n\n        segmentsFolders(level: Organization, segmentType: Events) {\n            ...SegmentsFoldersSegments\n        }\n    }\n}\n",{organizationId:e},[Ro.SegmentCustomFieldFragment,Ro.SegmentsFoldersSegmentsFragment]),a=(0,F.useMemo)(()=>(o.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[o.organization]);return s||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.EVENTS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(LP,{organization:o.organization,reload:r})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.EVENTS_SEGMENT(e,n?.eventsSegmentId&&a.includes(n.eventsSegmentId)?n.eventsSegmentId:a[0]),replace:!0})})]})},VP=()=>{const{params:{organizationId:e},translate:t}=il(),{loader:n,data:o}=Vn("query EventsMobile($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        events {\n            nodes {\n                id\n            }\n        }\n    }\n}\n",{organizationId:e},[]);return n||(Zo(o.organization.events.nodes)?(0,i.jsx)(Yn,{path:So.DASHBOARD_EVENT_SWITCH(e,o.organization.events.nodes[0].id)}):(0,i.jsx)(fr,{children:t("no_events_found_69870")}))};let UP=class extends zl{constructor(e){super(e)}accreditationsCustomFieldInputSchema(){return l.Ik().shape({customFieldId:l.ai().required(this.t("le_champ_person_80074")),conditionValue:l.gl().required(this.t("la_condition_es_66568"))})}};UP=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],UP);let WP=class extends zl{constructor(e){super(e)}accreditationsSlotInputDefault(){return{name:""}}createAccreditationSlotSchema(){return l.Ik().shape({slot:this.accreditationsSlotInputSchema()})}accreditationsSlotInputSchema(){return l.Ik().shape({name:l.Yj(),maxResources:l.ai().nullable(),date:$m.typeError(this.t("la_date_est_inv_22002")).nullable()})}};WP=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],WP);let GP=class extends zl{accreditationsCustomFieldInput;accreditationsSlotInput;constructor(e,t,n){super(e),this.accreditationsCustomFieldInput=t,this.accreditationsSlotInput=n}createUpdateAccreditationValuesDefault(e,t,n){const i=this.accreditationInputDefault(e,t,n);return{accreditation:i,hasNumberOfDaysLimit:"number"==typeof i.numberOfDaysLimit}}accreditationInputSchema(){return l.Ik().shape({name:l.Yj().required(this.t("le_nom_de_l_acc_82676")),accreditationCategoryId:l.ai().required(this.t("la_cat_gorie_es_14008")).typeError(this.t("la_cat_gorie_es_14008")).min(1,this.t("la_cat_gorie_es_14008")),description:l.Yj(),privateNote:l.Yj(),acronym:l.Yj(),color:l.Yj().required(this.t("la_couleur_est_95740")),icon:l.Yj().required(this.t("l_ic_ne_est_req_15843")).oneOf(ln,this.t("l_ic_ne_est_req_15843")),weezeventIsSynchronized:l.zM().required(),address:l.Yj().nullable(),latitude:l.ai().nullable().typeError(this.t("la_latitude_doi_43118")),longitude:l.ai().nullable().typeError(this.t("la_longitude_do_35170")),zoom:l.ai().required(this.t("le_niveau_de_zo_52687")).min(0,this.t("le_niveau_de_zo_38516")).max(23,this.t("le_niveau_de_zo_38516")),layer:l.Yj().required(this.t("le_fond_de_cart_48524")).oneOf(hn,this.t("le_fond_de_cart_48524")),slots:l.YO().of(this.accreditationsSlotInput.accreditationsSlotInputSchema()),accreditationDisplay:l.Yj().required(this.t("le_type_d_affic_60154")).oneOf(Vt,this.t("le_type_d_affic_60154")).test("calendar-slots",this.t("tous_les_cr_nea_42033"),(e,t)=>e!==ne.Calendar||Zo(t.parent.slots)&&t.parent.slots.every(e=>e.date?.isValid)),numberOfDaysLimit:l.ai().notRequired(),accreditationsCustomFields:l.YO().of(this.accreditationsCustomFieldInput.accreditationsCustomFieldInputSchema()),formCustomFields:l.YO(),tagsIds:l.YO().of(l.ai())})}createUpdateAccreditationSchema(){return l.Ik().shape({accreditation:this.accreditationInputSchema()})}accreditationInputDefault(e,t,n){let i=t?.accreditationCategoryId??n;return Number.isInteger(i)||(i=null),{accreditationCategoryId:i,name:t?.name??"",description:t?.description??"",privateNote:t?.privateNote??"",acronym:t?.acronym??"",color:t?.color??lr.colors.primary700.value,icon:t?.icon??He.BadgeCheck,weezeventIsSynchronized:t?.weezeventIsSynchronized??!0,willAutoAccredit:t?.willAutoAccredit??!1,address:t?.address??null,latitude:t?.latitude??null,longitude:t?.longitude??null,zoom:t?.zoom??yr,layer:t?.layer??e,accreditationDisplay:t?.accreditationDisplay??ne.List,numberOfDaysLimit:t?.numberOfDaysLimit??null,slots:(0,Zd.A)(t?.slots??[],e=>(0,Da.A)([e.date?.toMillis(),e.name])),conditionsOperator:t?.conditionsOperator??ge.And,accreditationsCustomFields:t?.accreditationsCustomFields??[],tagsIds:t?.tagsIds??[],fields:t?.fields??{},formCustomFields:t?.formCustomFields??[]}}};GP=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn,UP,WP])],GP);const HP=e=>{const t=Ln(),n=e.customFields.find(t=>t.id===e.customFieldValue.customFieldId);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sr.Yr,{name:`${e.field}customFieldId`,children:t=>{const n=e.customFields.find(e=>e.id===t);e.change(`${e.field}conditionValue`,n?.fieldType===Ne.Select?[]:"")}}),(0,i.jsxs)(Ea,{css:{background:"white",bd:!0,padding:"$3 $4"},direction:"column",gap:"4",children:[(0,i.jsx)(fr,{css:{textTransform:"uppercase"},font:"gray800 textXs semiBold",children:t("condition_n_1_11603",e.index+1)}),(0,i.jsxs)(Ea,{align:"center",gap:"4",children:[(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsxs)(Sm,{isSearchVisible:!0,label:t("CustomField"),name:`${e.field}customFieldId`,children:[(0,i.jsx)("option",{value:"-1",children:t("s_lectionnez_un_62064")}),e.customFields.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(fr,{color:"gray500",css:{paddingTop:"$6"},fontSize:"textMd",children:(0,i.jsx)(Va,{icon:"arrow-right"})}),(0,i.jsxs)(fr,{css:{flex:"1"},children:[n?.fieldType===Ne.Checkbox&&(0,i.jsxs)(lj,{label:t("accessible_seul_31434"),name:`${e.field}conditionValue`,shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"",children:t("s_lectionnez_un_44130")}),(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]}),n?.fieldType===Ne.Select&&(0,i.jsx)(Sm,{isSearchVisible:!0,label:t("accessible_seul_31434"),multiple:!0,name:`${e.field}conditionValue`,children:n.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))})]}),(0,i.jsx)(fr,{css:{paddingTop:"$6"},children:(0,i.jsx)(pl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.onRemove})})]})]})]})},qP=e=>{const{history:t,translate:n,params:{organizationId:o}}=il();return 0===e.customFields.length?(0,i.jsxs)(Ea,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$7"},direction:"column",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:n("vous_n_avez_pas_62142")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:n("pour_ajouter_de_74432")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(pl,{color:"white",onClick:()=>{t.push(So.CUSTOM_FIELDS(o))},children:n("cr_eer_un_champ_08883")})]}):(0,i.jsxs)(Ea,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$6 $4"},direction:"column",gap:"3",width:1,children:[e.customFieldsValues.map((t,o)=>{const s=o===e.customFieldsValues.length-1,r=`${e.name}[${o}].`;return(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(HP,{change:e.change,customFieldValue:t,customFields:e.customFields,field:r,index:o,onRemove:()=>{e.change(e.name,e.customFieldsValues.filter((e,t)=>t!==o))}}),e.customFieldsValues.length>1&&!s?0===o?(0,i.jsx)(fr,{css:{width:"fit-content"},children:(0,i.jsxs)(lj,{name:`${e.prefix}conditionsOperator`,children:[(0,i.jsx)("option",{value:ge.And,children:n(ge.And)}),(0,i.jsx)("option",{value:ge.Or,children:n(ge.Or)})]})}):(0,i.jsx)(fr,{font:"gray800 textSm medium",children:n(e.conditionsOperator)}):null]},o)}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{color:"invisible",leftIcon:"plus",onClick:()=>{e.change(e.name,[...e.customFieldsValues,{customFieldId:-1,conditionValue:""}])},children:n("ajouter_une_con_66324")})})]})},YP=()=>{const{translate:e}=il();return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(zm,{name:"accreditation.willAutoAccredit",subtext:e("si_la_case_est_44018"),children:e("autoriser_l_acc_50624")})})},KP=e=>{const{mutate:t}=function(e={}){return Un("mutation AccreditationCategoryCreate(\n    $eventId: EventId!\n    $accreditationCategory: AccreditationsCategoryInput!\n) {\n    accreditationCategoryCreate(eventId: $eventId, accreditationCategory: $accreditationCategory) {\n        id\n        name\n    }\n}\n",e)}();return(0,i.jsx)(dC,{initialName:"",isEdit:!1,mutate:async n=>(await t({eventId:e.eventId,accreditationCategory:{name:n}})).accreditationCategoryCreate,onClose:e.onClose,onSuccess:e.onSuccess})},ZP=e=>{const{mutate:t}=function(e={}){return Un("mutation AccreditationCategoryUpdate(\n    $eventId: EventId!\n    $accreditationCategoryId: AccreditationsCategoryId!\n    $accreditationCategory: AccreditationsCategoryInput!\n) {\n    accreditationCategoryUpdate(\n        eventId: $eventId\n        accreditationCategoryId: $accreditationCategoryId\n        accreditationCategory: $accreditationCategory\n    ) {\n        id\n        name\n    }\n}\n",e)}();return(0,i.jsx)(dC,{initialName:e.accreditationCategory.name,isEdit:!0,mutate:async n=>(await t({eventId:e.eventId,accreditationCategoryId:e.accreditationCategory.id,accreditationCategory:{name:n}})).accreditationCategoryUpdate,onClose:e.onClose,onSuccess:e.onSuccess})},XP=e=>{const{translate:t,params:{eventId:n}}=il(),[o,s]=(0,F.useState)(!1),[r,a]=(0,F.useState)(lC(e.event.accreditationsCategories));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sl,{label:t("nom_de_votre_ac_85997"),name:"accreditation.name"}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(Sm,{isCreateVisible:!0,isSearchVisible:!0,label:t("cat_gorie_00291"),name:"accreditation.accreditationCategoryId",onCreateClick:()=>{s(!0)},children:r.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Sl,{label:(0,i.jsx)(nv,{children:t("Acronym")}),name:"accreditation.acronym"})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(nj,{label:t("Color"),name:"accreditation.color"}),(0,i.jsx)(aj,{label:t("ic_ne_55554"),name:"accreditation.icon"})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(gv,{label:(0,i.jsx)(nv,{children:t("description_58935")}),name:"accreditation.description"}),e.event.isWeezeventConnected&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(zm,{name:"accreditation.weezeventIsSynchronized",children:t("WeezeventIsSynchronized")})]}),o&&(0,i.jsx)(KP,{eventId:n,onClose:()=>{s(!1)},onSuccess:t=>{a(lC([...r,t])),e.change("accreditation.accreditationCategoryId",t.id)}})]})},JP=e=>{const t=Ln(),[n,o]=F.useState(Fo.c9.invalid("Invalid")),[s,r]=F.useState(0),a=F.useMemo(()=>e.slots.map((e,t)=>({...e,index:t})),[e.slots]),l=F.useMemo(()=>{const t=Fo.IX.fromDateTimes(n.startOf("day"),n.endOf("day"));return n.isValid?a.filter(i=>e.matchDateFilter(i,n,t)):a},[n,a,e.matchDateFilter]),d=F.useMemo(()=>l.slice(s,10+s),[s,l]),c=F.useMemo(()=>Math.ceil(l.length/10),[l]),u=F.useMemo(()=>l.length,[l]);return(0,i.jsxs)(Ea,{direction:"column",gap:"4",children:[(0,i.jsxs)(Ea,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(fr,{css:{flex:"1"},font:"gray800 textMd medium",children:t("liste_de_vos_cr_37612")}),(0,i.jsx)(fr,{width:200,children:(0,i.jsx)(_u,{max:e.event.endAt,min:e.event.startAt,value:n,onChange:e=>{o(e),r(0)}})})]}),(0,i.jsxs)(Ea,{css:{background:"$gray100",bd:!0,padding:"$6"},direction:"column",gap:"3",children:[d.map(t=>e.renderSlot(t)),(0,i.jsx)(jc,{limit:10,numberOfPages:c,offset:s,setOffset:r,totalCount:u})]}),(0,i.jsxs)(fr,{css:{cursor:"pointer"},font:"primary700 textSm medium",onClick:e.onNewSlot,children:["+ ",t("ajouter_un_cr_n_63607")]})]})},QP=e=>{const t=Ln(),{user:n}=Zn();return(0,i.jsx)(gj,{buttonText:t("r_p_ter_28960"),icon:"sliders",initialValues:{value:1,unit:e.showHours?"hour":"day"},size:"md",title:t("r_p_ter_le_cr_n_68038"),onClose:e.onClose,onSubmit:async t=>{e.onSubmit(t.value,t.unit),e.onClose()},children:(0,i.jsxs)(Ea,{align:"center",gap:"3",wrap:"wrap",children:[(0,i.jsxs)(fr,{children:[t("r_p_ter_pour_le_06048"),It.Fr!==n?.language&&" "+t("prochain_e_s_04262")]}),(0,i.jsx)(fr,{width:100,children:(0,i.jsx)(lj,{name:"value",shouldParseAsInt:!0,children:(0,vc.A)(1,31).map(e=>(0,i.jsx)("option",{value:e,children:e},e))})}),It.Fr===n?.language&&(0,i.jsx)(fr,{children:t("prochain_e_s_04262")}),(0,i.jsx)(fr,{width:120,children:(0,i.jsxs)(lj,{name:"unit",children:[e.showHours&&(0,i.jsx)("option",{value:"hour",children:t("heures_17899")}),(0,i.jsx)("option",{value:"day",children:t("jours_43822")}),(0,i.jsx)("option",{value:"week",children:t("semaines_53228")})]})})]})})},eD=e=>{const t=Ln(),n=Nn(WP);return(0,i.jsx)(gj,{buttonText:t("mettre_jour_l_76289"),icon:"sliders",initialValues:{slot:e.slot},schema:n.createAccreditationSlotSchema(),size:"md",subtitle:t(""),title:t("mise_jour_d_u_86656"),onClose:e.onClose,onSubmit:async t=>{await e.onSuccess((0,Ir.A)(t.slot,["id","name","date","maxResources"])),e.onClose()},children:({form:n})=>(0,i.jsxs)(Ea,{css:{flex:"1",overflowY:"auto"},direction:"column",width:1,children:[(0,i.jsx)(Sl,{label:t("nom_du_cr_neau_54351"),name:"slot.name"}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sl,{label:t("MaxResources"),name:"slot.maxResources",shouldParseAsInt:!0}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(km,{label:t("Date"),max:e.event.endAt,min:e.event.startAt,name:"slot.date",rightIcon:"xmark",onRightIconClick:()=>{n.change("slot.date",null)}})]})})},tD=e=>{const t=Ln(),n=Nn($c),o=(0,F.useMemo)(()=>h(e.slot.name)?e.slot.name:t("cr_neau_n_1_80362",e.index+1),[e.slot.name,e.index]),s=(0,F.useMemo)(()=>{const i=e.slot.date?.isValid?n.toLocaleString(e.slot.date,Ho.DateOnly.WeekdayLongMonthLong):"",o=e.slot.maxResources?t("_1_membre_maxi_51489",e.slot.maxResources):"";return(0,Da.A)([o,i]).join(" - ")||"-"},[e.slot.maxResources,e.slot.date]),[r,a]=(0,F.useState)(e.initialIsEditOpen),[l,d]=(0,F.useState)(!1),c=!e.slot.date?.isValid,u=(e.slot.assignedResources??0)>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray800 textSm semiBold",children:o}),(0,i.jsx)(fr,{color:"gray500",children:s})]}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{a(!0)}})})}),(0,i.jsx)(am,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"clone",size:"sm",onClick:()=>{e.onDuplicate(e.slot)}})})}),(0,i.jsx)(am,{placement:"top",children:t("dupliquer_28256")})]}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",disabled:c,leftIcon:"arrows-repeat",size:"sm",onClick:()=>{d(!0)}})})}),(0,i.jsx)(am,{placement:"top",children:t("r_p_ter_le_cr_n_68038")})]}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",disabled:u,leftIcon:"trash-can",size:"sm",onClick:()=>{e.remove(e.index)}})})}),(0,i.jsx)(am,{placement:"top",children:t(u?"des_membres_son_92320":"supprimer_43083")})]})]}),r&&(0,i.jsx)(eD,{event:e.event,slot:e.slot,onClose:()=>{a(!1)},onSuccess:async t=>{e.updateSlots(t,e.index)}}),l&&(0,i.jsx)(QP,{showHours:!1,onClose:()=>{d(!1)},onSubmit:(t,n)=>{e.onRepeat(e.slot,t,n)}})]})},nD=e=>{const t=Ln(),n=Nn(WP),[o,s]=(0,F.useState)(-1),r=(0,F.useMemo)(()=>e.values.accreditation.slots.some(e=>e.date?.isValid),[e.values.accreditation]),a=(0,F.useCallback)((t,n)=>{const i=[...e.values.accreditation.slots];i[n]=t,e.change("accreditation.slots",i)},[e.values.accreditation.slots,e.change]),l=(0,F.useCallback)((e,t)=>!!e.date?.isValid&&e.date.startOf("day")===t.startOf("day"),[]),d=(0,F.useCallback)(()=>{e.change("accreditation.slots",e.values.accreditation.slots.concat([n.accreditationsSlotInputDefault()])),s(e.values.accreditation.slots.length)},[e.values.accreditation.slots,e.change]),c=(0,F.useCallback)(t=>{e.change("accreditation.slots",[...e.values.accreditation.slots,{name:t.name,date:t.date,maxResources:t.maxResources}])},[e.values.accreditation.slots,e.change]),u=(0,F.useCallback)((t,n,i)=>{const o=function(e,t,n){if(e.date?.isValid)return(0,vc.A)(1,t+1).map(t=>{if("day"===n){const n=e.date.plus({day:t});return{name:e.name,date:n,maxResources:e.maxResources}}if("week"===n){const n=e.date.plus({week:t});return{name:e.name,date:n,maxResources:e.maxResources}}throw new Error("Wrong unit")});throw new Error("Can not repeat slot with wrong date")}(t,n,i);e.change("accreditation.slots",e.values.accreditation.slots.concat(o))},[e.values.accreditation.slots,e.change]),h=(0,F.useCallback)(t=>{e.change("accreditation.slots",ts(e.values.accreditation.slots,t))},[e.values.accreditation.slots,e.change]);return(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(JP,{event:e.event,matchDateFilter:l,renderSlot:t=>(0,i.jsx)(tD,{event:e.event,index:t.index,initialIsEditOpen:t.index===o,remove:h,slot:t,updateSlots:a,onDuplicate:c,onRepeat:u},t.index),slots:e.values.accreditation.slots,onNewSlot:d}),(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{font:"gray900 textMd medium",children:t("type_d_affichag_09962")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("comment_souhait_62602")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(vv,{name:"accreditation.accreditationDisplay",value:ne.List,children:t("afficher_sous_f_71276")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(vv,{name:"accreditation.accreditationDisplay",value:ne.Radio,children:t("afficher_sous_f_61997")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(vv,{name:"accreditation.accreditationDisplay",value:ne.Calendar,children:t("afficher_sous_f_15380")})]}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{font:"gray900 textMd medium",children:t("blocage_de_l_ac_17590")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("est_ce_qu_il_y_67585")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(sc,{state:e.values.hasNumberOfDaysLimit?"unchecked":"checked",onClick:t=>{e.change("hasNumberOfDaysLimit","checked"!==t),e.change("accreditation.numberOfDaysLimit",null)},children:t("non_33516")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(sc,{state:e.values.hasNumberOfDaysLimit?"checked":"unchecked",onClick:t=>{e.change("hasNumberOfDaysLimit","checked"===t)},children:t("oui_54361")}),e.values.hasNumberOfDaysLimit&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsxs)(Ea,{align:"center",css:{paddingLeft:"$6"},gap:"2",children:[(0,i.jsx)(fr,{width:80,children:(0,i.jsx)(Sl,{min:0,name:"accreditation.numberOfDaysLimit",shouldParseAsInt:!0})}),(0,i.jsx)(fr,{children:t("jours_avant_la_74918")})]})]})]})]})]})},iD=e=>(0,i.jsx)(N_,{names:[`${e.prefix}latitude`,`${e.prefix}longitude`,`${e.prefix}zoom`],render:t=>(0,i.jsx)(Tr,{center:e.center,coordinatesFieldsProps:{latitudeProps:t[`${e.prefix}latitude`],longitudeProps:t[`${e.prefix}longitude`],zoomProps:t[`${e.prefix}zoom`]},layer:e.layer,point:e.point,traces:e.traces})}),oD=e=>{const t=Ln();return(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:t("apparence_75510")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsxs)(lj,{label:t("fond_de_carte_43822"),name:`${e.name}layer`,children:[(0,i.jsx)("option",{value:Xe.Google,children:"Plan"}),(0,i.jsx)("option",{value:Xe.GoogleSatellite,children:"Satellite"}),(0,i.jsx)("option",{value:Xe.IgnPlan,children:"IGN Plan"})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(lj,{label:(0,i.jsx)(nv,{children:t("niveau_de_zoom_39369")}),name:`${e.name}zoom`,shouldParseAsInt:!0,children:(0,vc.A)(0,23).map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),e.traces.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Sm,{isSearchVisible:!0,label:(0,i.jsx)(nv,{children:t("trac_s_41454")}),multiple:!0,name:`${e.name}tracesIds`,children:e.traces.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:t("localisation_38416")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(Aj,{addressName:`${e.name}address`,label:(0,i.jsx)(nv,{children:t("adresse_de_la_m_57494")}),latitudeName:`${e.name}latitude`,longitudeName:`${e.name}longitude`}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(wm,{label:(0,i.jsx)(nv,{children:t("latitude_46176")}),name:`${e.name}latitude`}),(0,i.jsx)(wm,{label:(0,i.jsx)(nv,{children:t("longitude_01695")}),name:`${e.name}longitude`})]})]}),(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(iD,{center:(n=e.center,"number"==typeof n?.latitude&&"number"==typeof n?.longitude?{latitude:n.latitude,longitude:n.longitude}:void 0),layer:e.layer,point:kr(e.point),prefix:e.name,traces:e.traces.filter(t=>e.tracesIds.includes(t.id))})})]});var n},sD=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=il(),{showNotification:r}=Yv(),a=Nn(GP),l=Nn(za),d=(0,F.useRef)(null),c=(0,F.useMemo)(()=>e.isEdit?s("mise_jour_de_17055",e.initialValues.accreditation.name):s("cr_ation_d_une_01473"),[e.isEdit,e.initialValues]);Cd(c);const{areSlotsOpen:u,isLocalisationOpen:m,areConditionsOpen:g,areCustomFieldsOpen:p,isPrivateNoteOpen:f,areTagsOpen:x}=(0,F.useMemo)(()=>{const t=e.initialValues.accreditation;return{areSlotsOpen:e.isEdit&&Zo(t.slots),isLocalisationOpen:e.isEdit&&(h(t.address)||"number"==typeof t.latitude||"number"==typeof t.longitude),areConditionsOpen:e.isEdit&&Zo(t.accreditationsCustomFields),areCustomFieldsOpen:e.isEdit&&(Zo(Object.keys(t.fields))||Zo(t.formCustomFields)),isPrivateNoteOpen:e.isEdit&&h(t.privateNote),areTagsOpen:e.isEdit&&Zo(t.tagsIds)}},[e.initialValues,e.isEdit]);return(0,i.jsx)(dl,{customErrorRef:d,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:r,submitting:a,values:l})=>(0,i.jsx)(bm,{button:e.isEdit?(0,i.jsx)(pl,{isLoading:a,onClick:r,children:s("mettre_jour_l_92576")}):null,category:c,color:"dark",fallbackClosePath:Hi.ACCREDITATIONS({organizationId:n,eventId:o}),title:e.isEdit?e.initialValues.accreditation.name:s("nouvelle_accr_d_32707"),children:(0,i.jsxs)(Im,{ref:d,children:[(0,i.jsx)(sl,{}),(0,i.jsx)(Cm,{hideToggle:!0,initialIsOpen:!0,title:s("informations_su_35382"),children:(0,i.jsx)(XP,{change:t.change,event:e.event})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Cm,{hideToggle:!0,initialIsOpen:!0,subtitle:s("attribuer_autom_55909"),title:s("automatisation_47772"),children:(0,i.jsx)(YP,{})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Cm,{initialIsOpen:u,subtitle:s("ajouter_les_dif_76832"),title:s("cr_neaux_33401"),onToggle:e=>{e||t.change("accreditation.slots",[])},children:(0,i.jsx)(nD,{change:t.change,event:e.event,values:l})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Cm,{initialIsOpen:m,subtitle:s("indiquez_la_loc_61935"),title:s("localisation_38416"),onToggle:n=>{n||(t.change("accreditation.layer",e.event.layer),t.change("accreditation.zoom",yr),t.change("accreditation.address",null),t.change("accreditation.latitude",null),t.change("accreditation.longitude",null))},children:(0,i.jsx)(oD,{center:null,layer:l.accreditation.layer,name:"accreditation.",point:l.accreditation,traces:[],tracesIds:[]})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Cm,{initialIsOpen:g,subtitle:s("ajoutez_des_con_94296"),title:s("conditions_77756"),onToggle:e=>{e||t.change("accreditation.accreditationsCustomFields",[])},children:(0,i.jsx)(qP,{change:t.change,conditionsOperator:l.accreditation.conditionsOperator,customFields:e.conditionsCustomFields,customFieldsValues:l.accreditation.accreditationsCustomFields,name:"accreditation.accreditationsCustomFields",prefix:"accreditation."})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Cm,{initialIsOpen:p,subtitle:s("ajouter_des_inf_14221"),title:s("champs_de_formu_64126"),onToggle:e=>{e||(t.change("accreditation.formCustomFields",[]),t.change("accreditation.fields",{}))},children:(0,i.jsx)(uP,{change:t.change,customFields:e.accreditationCustomFields,formCustomFields:e.formCustomFields,formCustomFieldsValues:l.accreditation.formCustomFields,prefix:"accreditation.",showFormCustomFields:!0})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Cm,{initialIsOpen:f,subtitle:s("ajoutez_une_not_89122"),title:s("note_priv_e_06303"),onToggle:e=>{e||t.change("accreditation.privateNote","")},children:(0,i.jsx)(gv,{label:(0,i.jsx)(nv,{children:s("note_priv_e_06303")}),name:"accreditation.privateNote"})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Cm,{initialIsOpen:x,subtitle:s("ajouter_des_tag_77298"),title:s("tags_79499"),onToggle:e=>{e||t.change("accreditation.tagsIds",[])},children:(0,i.jsx)(fj,{change:t.change,name:"accreditation.",organizationId:n,tags:e.tags,tagsIds:l.accreditation.tagsIds})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(jm,{children:(0,i.jsx)(pl,{isLoading:a,onClick:r,children:(0,i.jsx)(fr,{textAlign:"center",children:e.isEdit?s("mettre_jour_l_92576"):s("cr_er_l_accr_di_16123")})})})]})}),validate:l.validateForForm(a.createUpdateAccreditationSchema()),width:1,onSubmit:async i=>{const a=await e.mutate({eventId:o,accreditation:{...i.accreditation,slots:i.accreditation.slots.map(e=>(0,tr.A)(e,["index"]))}});r(e.isEdit?s("l_accr_ditation_24401"):s("l_accr_ditation_25694")),e.isEdit?t.goBack(Hi.ACCREDITATION({organizationId:n,eventId:o,accreditationId:a})):t.replace(Hi.ACCREDITATION({organizationId:n,eventId:o,accreditationId:a}))}})},rD=()=>{const{organizationId:e,eventId:t,options:n}=Wn(),o=Nn(GP),{data:s,loader:r}=Vn("query AccreditationEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n    organization(id: $organizationId) {\n        ...ConditionsCustomFields\n        ...FormCustomFields\n        ...CreatePositionTags\n\n        accreditationCustomFields: customFields(variety: Accreditation, privacy: All) {\n            nodes {\n                ...AttachCustomField\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        ...CreateAccreditationEvent\n    }\n}\n",{organizationId:e,eventId:t},[Ro.ConditionsCustomFieldsFragment,Ro.FormCustomFieldsFragment,Ro.CreatePositionTagsFragment,Ro.AttachCustomFieldFragment,Ro.CreateAccreditationEventFragment]),{mutate:a}=function(e={}){return Un("mutation AccreditationCreate($eventId: EventId!, $accreditation: AccreditationInput!) {\n    accreditationCreate(eventId: $eventId, accreditation: $accreditation) {\n        id\n    }\n}\n",e)}(),l=h(n)?parseInt(n,10):null;return r||(0,i.jsx)(sD,{accreditationCustomFields:s.organization.accreditationCustomFields.nodes,conditionsCustomFields:s.organization.conditionsCustomFields.nodes,event:s.event,formCustomFields:s.organization.formCustomFields.nodes,initialValues:o.createUpdateAccreditationValuesDefault(s.event.layer,null,l),isEdit:!1,mutate:async e=>(await a(e)).accreditationCreate.id,tags:s.organization.tags.nodes})},aD=()=>{const{organizationId:e,eventId:t,accreditationId:n}=Wn(),o=Nn(GP),{data:s,loader:r}=Vn("query AccreditationToEdit(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $accreditationId: AccreditationId!\n) {\n    organization(id: $organizationId) {\n        ...ConditionsCustomFields\n        ...FormCustomFields\n        ...CreatePositionTags\n\n        accreditationCustomFields: customFields(variety: Accreditation, privacy: All) {\n            nodes {\n                ...AttachCustomField\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        ...CreateAccreditationEvent\n\n        accreditation(id: $accreditationId) {\n            name\n            accreditationCategoryId\n            description\n            privateNote\n            acronym\n            color\n            icon\n            weezeventIsSynchronized\n            willAutoAccredit\n            address\n            latitude\n            longitude\n            zoom\n            layer\n            tagsIds\n            accreditationDisplay\n            numberOfDaysLimit\n            conditionsOperator\n            fields\n\n            accreditationsCustomFields {\n                customFieldId\n                conditionValue\n            }\n\n            formCustomFields {\n                id\n                customFieldId\n                isMandatory\n            }\n\n            slots {\n                id\n                name\n                date\n                maxResources\n                assignedResources\n            }\n        }\n    }\n}\n",{organizationId:e,eventId:t,accreditationId:n},[Ro.ConditionsCustomFieldsFragment,Ro.FormCustomFieldsFragment,Ro.CreatePositionTagsFragment,Ro.AttachCustomFieldFragment,Ro.CreateAccreditationEventFragment]),{mutate:a}=function(e={}){return Un("mutation AccreditationUpdate(\n    $eventId: EventId!\n    $accreditationId: AccreditationId!\n    $accreditation: AccreditationInput!\n) {\n    accreditationUpdate(\n        eventId: $eventId\n        accreditationId: $accreditationId\n        accreditation: $accreditation\n    ) {\n        id\n    }\n}\n",e)}();return r||(0,i.jsx)(sD,{accreditationCustomFields:s.organization.accreditationCustomFields.nodes,conditionsCustomFields:s.organization.conditionsCustomFields.nodes,event:s.event,formCustomFields:s.organization.formCustomFields.nodes,initialValues:o.createUpdateAccreditationValuesDefault(s.event.layer,s.event.accreditation,null),isEdit:!0,mutate:async e=>(await a({...e,accreditationId:n})).accreditationUpdate.id,tags:s.organization.tags.nodes})};var lD;!function(e){e.Acronym="acronym",e.Address="address",e.AutoAccredit="autoAccredit",e.Category="category",e.Color="color",e.Conditions="conditions",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.Description="description",e.FillingRate="fillingRate",e.Icon="icon",e.IconColor="iconColor",e.Id="id",e.Index="index",e.Latitude="latitude",e.Longitude="longitude",e.Name="name",e.PrivateNote="privateNote",e.Resources="resources",e.SlotDate="slotDate",e.SlotName="slotName",e.Tags="tags",e.WeezeventChecklistId="weezeventChecklistId",e.WeezeventIsSynchronized="weezeventIsSynchronized"}(lD||(lD={}));let dD=class extends Xc{constructor(e,t,n){super(e,t,n)}getAccreditationsFilters(e,t){return(0,Da.A)([{slug:"name",name:this.t("nom_de_l_accr_d_11908"),category:this.t("accr_ditations_39450"),fieldType:Be.Text,hideEmpty:!0},{slug:"accreditation",name:this.t("Accreditation"),category:this.t("accr_ditations_39450"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:lD.Description,name:this.t("Description"),category:this.t("accr_ditations_39450"),fieldType:Be.Text},{slug:lD.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("accr_ditations_39450"),fieldType:Be.Text},Zo(e.accreditationsCategories)?{slug:"accreditationCategory",name:this.t("cat_gorie_00291"),category:this.t("accr_ditations_39450"),fieldType:Be.Select,values:e.accreditationsCategories,hideEmpty:!0}:null,{slug:"slotName",name:this.t("nom_du_cr_neau_54351"),category:this.t("accr_ditations_39450"),fieldType:Be.Text},{slug:"slotDate",name:this.t("Date"),category:this.t("accr_ditations_39450"),fieldType:Be.Date},{slug:"tag",name:"Tag",category:this.t("accr_ditations_39450"),fieldType:Be.Select,needLoading:!0,organizationId:e.organizationId,eventId:e.id,tagContext:vt.Accreditations},{slug:"accreditationCustomField",name:this.t("condition_61066"),category:this.t("accr_ditations_39450"),fieldType:Be.Select,needLoading:!0,organizationId:e.organizationId},{slug:"acronym",name:this.t("Acronym"),category:this.t("accr_ditations_39450"),fieldType:Be.Text},{slug:"color",name:this.t("Color"),category:this.t("accr_ditations_39450"),fieldType:Be.Text,hideEmpty:!0},{slug:"icon",name:this.t("ic_ne_55554"),category:this.t("accr_ditations_39450"),fieldType:Be.Select,values:ln.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"address",name:this.t("Address"),category:this.t("accr_ditations_39450"),fieldType:Be.Text},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("accr_ditations_39450"),fieldType:Be.Number,hideEmpty:!0},{slug:lD.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("accr_ditations_39450"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,organizationId:e.organizationId,eventId:e.id},{slug:lD.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("accr_ditations_39450"),fieldType:Be.Datetime,hideEmpty:!0},...this.customFieldsToFilters(t)])}getAccreditationsPossibleColumns(e,t){const n=[{slug:lD.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:re.Id,width:100},{slug:lD.Name,name:this.t("nom_de_l_accr_d_11908"),isSearchable:!0,isSortable:!0,sortAttribute:re.Name,minWidth:240},{slug:lD.Category,name:this.t("nom_de_la_cat_g_03860"),isSearchable:!0,isSortable:!0,sortAttribute:re.Category,minWidth:240},{slug:lD.SlotName,name:this.t("nom_du_cr_neau_54351"),isSearchable:!0,minWidth:240},{slug:lD.SlotDate,name:this.t("Date"),minWidth:180},{slug:lD.Resources,name:this.t("membres_11310"),minWidth:320},{slug:lD.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:240},{slug:lD.Conditions,name:this.t("conditions_77756"),minWidth:320},{slug:lD.Address,name:this.t("Address"),isSearchable:!0,minWidth:240},{slug:lD.Latitude,name:this.t("latitude_46176"),isSearchable:!0,minWidth:180},{slug:lD.Longitude,name:this.t("longitude_01695"),isSearchable:!0,minWidth:180},{slug:lD.Acronym,name:this.t("Acronym"),isSearchable:!0,isSortable:!0,sortAttribute:re.Acronym,minWidth:180},{slug:lD.Color,name:this.t("Color"),isSearchable:!0,width:80},{slug:lD.Icon,name:this.t("ic_ne_55554"),width:80},{slug:lD.IconColor,name:this.t("ic_ne_et_couleu_54485"),width:80},{slug:lD.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:lD.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:lD.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:re.CreatedAt,minWidth:180},{slug:lD.AutoAccredit,name:this.t("AutoAccredit"),minWidth:180},{slug:lD.Index,name:this.t("Index"),isSortable:!0,sortAttribute:re.Index,width:200}];return e&&n.push({slug:lD.WeezeventIsSynchronized,name:this.t("WeezeventIsSynchronized"),minWidth:180},{slug:lD.WeezeventChecklistId,name:this.t("WeezeventChecklistId"),minWidth:180}),n.concat(this.customFieldsToPossibleColumns(t))}};dD=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hc,$c,Dn])],dD);const cD=e=>{const{params:{eventId:t}}=il(),{mutate:n}=Is(),o=F.useCallback(async i=>{const o=Ko(e.property);for(const s of o){const r=1===o.length?i:i[s];await n({eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.accreditationId]},slug:s,strategy:Je.Replace,value:r}})}return!0},[e.accreditationId,e.property,n]);return(0,i.jsx)(PC,{column:e.column,initialValue:e.initialValue,mutate:o,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},uD=e=>{const{translate:t}=il();return(0,i.jsx)(cD,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.acronym||"",property:ie.Acronym,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(wl,{label:t("Acronym"),value:e,onChange:n}),renderValue:e.accreditation.acronym||""})},hD=F.createContext({}),mD=e=>{const t=OO(Or,{eventId:e.eventId},e=>e.event.accreditationsCategories),n=OO(Os,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(hD.Provider,{value:{getAccreditationsCategories:t,getTags:n},children:e.children})};function gD(){return F.useContext(hD)}const pD=e=>{const t=Ln(),{getAccreditationsCategories:n}=gD(),{result:o,isLoading:s}=HO(n);return s?(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(yl,{children:t("Category")}),(0,i.jsx)(qd,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(gu,{label:t("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},fD=e=>{const{organizationId:t,eventId:n}=Wn(),{isEditMode:o}=zC(),s=e.accreditationCategory.name;return(0,i.jsx)(cD,{accreditationId:e.accreditationId,column:e.column,initialValue:e.accreditationCategory.id,property:ie.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(pD,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(ZO,{isEditMode:o,title:s,updatable:!0,children:(0,i.jsx)(j_,{to:Hi.ACCREDITATION_CATEGORY({organizationId:t,eventId:n,accreditationCategoryId:e.accreditationCategory.id}),children:s})})})},xD=e=>{const{translate:t}=il();return(0,i.jsx)(cD,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.color,property:ie.Color,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(tj,{label:t("Color"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Ea,{align:"center",gap:"3",width:1,children:(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{css:{background:e.accreditation.color,borderRadius:"2px",height:"24px",width:"24px"},onClick:()=>{oS(e.accreditation.color)}})}),(0,i.jsx)(am,{placement:"top",children:e.accreditation.color})]})})})};function _D(e,t,n){return t.fieldType===Ne.Select?Zo(n)?(0,Da.A)(n.map(e=>t.values.find(t=>t.id===e)?.value)).join(", "):"":e(!0===n?"true":"false")}const ID=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>e.accreditation.accreditationsCustomFields||[],[e.accreditation]),o=(0,F.useMemo)(()=>n.map((e,n)=>({id:n,color:"gray",icon:null,text:`${e.customField.name} : ${_D(t,e.customField,e.conditionValue)}`})),[n]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:o})})},vD=e=>{const{translate:t}=il();return(0,i.jsx)(cD,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.icon,property:ie.Icon,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(rj,{label:t("Icon"),renderOnPortal:!0,value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Va,{icon:Ba(e.accreditation.icon)})})},bD=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>({[ie.Color]:e.accreditation.color,[ie.Icon]:e.accreditation.icon}),[e.accreditation]);return(0,i.jsx)(cD,{accreditationId:e.accreditation.id,column:e.column,initialValue:n,property:[ie.Color,ie.Icon],reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(Ea,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(tj,{label:t("Color"),value:e[ie.Color],onChange:t=>{n({...e,[ie.Color]:t})}}),(0,i.jsx)(rj,{label:t("Icon"),renderOnPortal:!0,value:e[ie.Icon],onChange:t=>{n({...e,[ie.Icon]:t})}})]}),renderValue:()=>(0,i.jsx)(Xj,{color:e.accreditation.color,icon:e.accreditation.icon})})},jD=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{isEditMode:s}=zC(),r=e.accreditation.name;return(0,i.jsx)(cD,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.name,property:ie.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(wl,{label:t("nom_de_l_accr_d_11908"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(ZO,{isEditMode:s,title:r,updatable:!0,children:(0,i.jsx)(j_,{to:Hi.ACCREDITATION({organizationId:n,eventId:o,accreditationId:e.accreditation.id}),children:r})})})},CD=e=>{const{translate:t}=il(),{getTags:n}=gD(),{result:o,isLoading:s}=HO(n);return s?(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(yl,{children:t("tags_79499")}),(0,i.jsx)(qd,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(dc,{isSearchVisible:!0,label:t("tags_79499"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},yD=e=>{const t=(0,F.useMemo)(()=>e.accreditation.tags||[],[e.accreditation]),n=(0,F.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(cD,{accreditationId:e.accreditation.id,column:e.column,initialValue:t.map(e=>e.id),property:ie.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(CD,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(qC,{badges:n})})},kD=e=>{const{translate:t,params:{eventId:n}}=il(),o=Nn($c),{mutate:s}=Pr(),r=(0,F.useMemo)(()=>e.accreditationSlot.date?o.toLocaleString(e.accreditationSlot.date,Ho.DateOnly.WeekdayLongMonthLong):"-",[e.accreditationSlot]),a=(0,F.useMemo)(()=>e.accreditationSlot.date?.isValid?e.accreditationSlot.date:Fo.c9.invalid("Invalid"),[e.accreditationSlot]);return(0,i.jsx)(PC,{column:e.column,initialValue:a,mutate:async t=>s({eventId:n,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:{...(0,Ir.A)(e.accreditationSlot,["id","name","maxResources"]),date:t}}),reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(_u,{label:t("Date"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(fr,{css:{ellipsis:!0,textTransform:"capitalize"},font:"gray900 textSm medium",title:r,width:1,children:r}),updatable:!0})},AD=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{isEditMode:s}=zC(),{mutate:r}=Pr(),a=(0,F.useMemo)(()=>h(e.accreditationSlot.name)?e.accreditationSlot.name:"-",[e.accreditationSlot]);return(0,i.jsx)(PC,{column:e.column,initialValue:e.accreditationSlot.name,mutate:async t=>r({eventId:o,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:{...(0,Ir.A)(e.accreditationSlot,["id","date","maxResources"]),name:t}}),reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(wl,{label:t("nom_du_cr_neau_54351"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(ZO,{isEditMode:s,title:a,updatable:!0,children:(0,i.jsx)(j_,{to:Hi.ACCREDITATION_SLOT({organizationId:n,eventId:o,accreditationId:e.accreditationSlot.accreditation.id,accreditationSlotId:e.accreditationSlot.id}),children:a})}),updatable:!0})},wD=e=>{if("number"==typeof e.weezeventOrganizationId&&"number"==typeof e.accreditationSlot.weezeventChecklistId){const t=Xm(e.weezeventOrganizationId,e.accreditationSlot.weezeventChecklistId);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(j_,{to:t,children:e.accreditationSlot.weezeventChecklistId})})}return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:"-"})},SD=e=>{const{translate:t,params:{eventId:n}}=il(),{isEventAdmin:o}=Uv(),{mutate:s}=Pr(),r=Nn(vj),a=SC(e.customFields),l=(0,F.useCallback)(()=>{e.reloadAccreditationSlot(e.accreditationSlot.id)},[e.accreditationSlot,e.reloadAccreditationSlot]),[d,c]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Cc,{css:{"&:hover":{background:"$gray100"}},children:[e.columns.map(t=>{const n=a.get(t.slug);return t.slug===lD.Id?(0,i.jsx)(xc,{minWidth:t.minWidth,width:t.width,children:e.accreditationSlot.id},t.slug):t.slug===lD.Category?(0,i.jsx)(fD,{accreditationCategory:e.accreditationSlot.accreditationCategory,accreditationId:e.accreditationSlot.accreditation.id,column:t,reload:l},t.slug):t.slug===lD.Name?(0,i.jsx)(jD,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===lD.SlotName?e.accreditationSlot.isHidden?(0,i.jsx)(xc,{minWidth:t.minWidth,width:t.width,children:"-"},t.slug):(0,i.jsx)(AD,{accreditationSlot:e.accreditationSlot,column:t,reload:l},t.slug):t.slug===lD.SlotDate?e.accreditationSlot.isHidden?(0,i.jsx)(xc,{minWidth:t.minWidth,width:t.width,children:"-"},t.slug):(0,i.jsx)(kD,{accreditationSlot:e.accreditationSlot,column:t,reload:l},t.slug):t.slug===lD.Resources?(0,i.jsx)(xc,{minWidth:t.minWidth,width:t.width,children:(0,i.jsx)(UO,{assignedResources:e.accreditationSlot.assignedResources,resources:e.accreditationSlot.maxResources})},t.slug):t.slug===lD.Tags?(0,i.jsx)(yD,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===lD.Conditions?(0,i.jsx)(ID,{accreditation:e.accreditationSlot.accreditation,column:t},t.slug):t.slug===lD.Address?(0,i.jsx)(xc,{minWidth:t.minWidth,width:t.width,children:e.accreditationSlot.accreditation.address},t.slug):t.slug===lD.Latitude?(0,i.jsx)(xc,{minWidth:t.minWidth,width:t.width,children:e.accreditationSlot.accreditation.latitude},t.slug):t.slug===lD.Longitude?(0,i.jsx)(xc,{minWidth:t.minWidth,width:t.width,children:e.accreditationSlot.accreditation.longitude},t.slug):t.slug===lD.Acronym?(0,i.jsx)(uD,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===lD.Color?(0,i.jsx)(xD,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===lD.Icon?(0,i.jsx)(vD,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===lD.IconColor?(0,i.jsx)(bD,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l}):t.slug===lD.FillingRate?(0,i.jsxs)(xc,{minWidth:t.minWidth,width:t.width,children:[e.accreditationSlot.fillingRate,"%"]},t.slug):t.slug===lD.CreatedBy?(0,i.jsx)(V$,{column:t,createdBy:e.accreditationSlot.accreditation.createdBy},t.slug):t.slug===lD.CreatedAt?(0,i.jsx)(B$,{column:t,insertedAt:e.accreditationSlot.insertedAt},t.slug):t.slug===lD.WeezeventChecklistId?(0,i.jsx)(wD,{accreditationSlot:e.accreditationSlot,column:t,weezeventOrganizationId:e.weezeventOrganizationId}):(0,i.jsx)(xc,{minWidth:t.minWidth,width:t.width,children:n?r.getValueString(n,e.accreditationSlot.accreditation.fields,{fileReturnValue:"name"}):""},t.slug)}),o?e.accreditationSlot.isHidden?(0,i.jsx)(xc,{width:100}):(0,i.jsx)(im,{justify:"center",children:(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"pen",onClick:()=>{c(!0)}})})}),(0,i.jsx)(am,{placement:"top",children:t("_diter_62574")})]})}):null]}),d&&(0,i.jsx)(eD,{event:e.event,slot:e.accreditationSlot,onClose:()=>{c(!1)},onSuccess:async t=>{await s({eventId:n,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:t}),l()}})]})},ED=e=>{const{params:{eventId:t}}=il(),{isEventAdmin:n}=Uv(),{columns:o,columnsSearch:s,limit:r,nameDebounced:a,offset:l,possibleColumns:d,predicates:c,reloadKey:u,setLimit:m,setOffset:g,setSort:p,sort:f}=zC(),x=(0,F.useMemo)(()=>({includeConditions:o.includes(lD.Conditions),includeCreatedBy:o.includes(lD.CreatedBy),includeTags:o.includes(lD.Tags)}),[o]),{data:_,isLoading:I,reload:v}=Vn("query AccreditationsSlotsList(\n    $eventId: EventId!\n    $name: String\n    $predicates: [Predicate!]\n    $columnsSearch: [String!]\n    $limit: Int\n    $offset: Int\n    $sort: AccreditationsSlotsSort\n    $includeConditions: Boolean!\n    $includeCreatedBy: Boolean!\n    $includeTags: Boolean!\n) {\n    event(id: $eventId) {\n        startAt\n        endAt\n\n        accreditationsSlots(\n            name: $name\n            predicates: $predicates\n            includeHidden: true\n            columnsSearch: $columnsSearch\n            limit: $limit\n            offset: $offset\n            sort: $sort\n        ) {\n            nodes {\n                ...AccreditationsAccreditationSlot\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{...x,eventId:t,name:h(a)?a:null,columnsSearch:Zo(s)?s:null,predicates:c,limit:r,offset:l,sort:f},[Ro.AccreditationsAccreditationSlotFragment]);const b=(0,F.useMemo)(()=>o.flatMap(e=>(0,Da.A)([d.find(t=>t.slug===e)])),[d,o]),{numberOfPages:j,totalCount:C}=lu(_.event?.accreditationsSlots),[y,k]=(0,F.useState)([]),[A,w]=(0,F.useState)({}),S=(0,F.useCallback)(async e=>{w(t=>({...t,[e]:!0}));const{event:{accreditationSlot:n}}=await function(e,t){return ss("query AccreditationsAccreditationSlot(\n    $eventId: EventId!\n    $id: AccreditationsSlotId!\n    $includeConditions: Boolean!\n    $includeCreatedBy: Boolean!\n    $includeTags: Boolean!\n) {\n    event(id: $eventId) {\n        accreditationSlot(id: $id) {\n            ...AccreditationsAccreditationSlot\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.AccreditationsAccreditationSlotFragment]})}({...x,eventId:t,id:e},await H());k(t=>t.map(t=>t.id===e?n:t)),w(t=>({...t,[e]:!1}))},[x,w,k]);return(0,F.useEffect)(()=>{k(_.event?.accreditationsSlots.nodes??[])},[_.event]),(0,F.useEffect)(()=>{u>1&&v()},[u]),(0,i.jsx)(Ea,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(nm,{"aria-busy":I,headerRow:(0,i.jsxs)(cc,{children:[b.map(e=>e.isSortable?(0,i.jsx)(tm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:p,sort:f,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Tc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),n&&(0,i.jsx)(Tc,{width:100})]}),paginationRow:(0,i.jsx)(yc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(jc,{limit:r,numberOfPages:j,offset:l,setLimit:m,setOffset:g,showLimits:!0,totalCount:C})}),children:I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{})]}):y.map(t=>A[t.id]?(0,i.jsx)(zc,{},t.id):(0,i.jsx)(SD,{accreditationSlot:t,columns:b,customFields:e.customFields,event:_.event,reloadAccreditationSlot:S,weezeventOrganizationId:e.weezeventOrganizationId},t.id))})})},TD=()=>{const e=Ln(),{eventId:t,massActions:n,onMassEditSuccess:o,organizationId:s,predicates:r,segment:a}=zC(),{showNotification:l}=Yv(),{mutate:d}=Is(),{mutate:c}=Rr(),[u,m]=(0,F.useState)(!1),[g,p]=(0,F.useState)(!1),f=n.getSelectedsInput(r,null),x=n.isAllSelected?a.count:n.numberOfSelected,_=(0,F.useCallback)(e=>{h(e)&&l(e),o()},[o]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pl,{onClick:()=>{m(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(Pd,{placement:"bottom-end",children:(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{p(!0)},children:e("supprimer_43083")})})]}),u&&(0,i.jsx)($k,{eventId:t,mutate:e=>d({eventId:t,massEdit:e}),organizationId:s,selecteds:f,onClose:()=>{m(!1)},onSuccess:t=>{_(e("_1_accr_ditati_22872",t))}}),g&&(0,i.jsx)(kk,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_31111")],text:e("suppression_de_42723",x),onClose:()=>{p(!1)},onDelete:async()=>{const n=(await c({eventId:t,selecteds:f})).numberOfAccreditations;_(e("_1_accr_ditati_88237",n))}})]})},zD=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),[s,r]=(0,F.useState)(!1),[a,l]=(0,F.useState)(!1);return(0,i.jsxs)(xO,{children:[(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsx)(pl,{to:So.CREATE_ACCREDITATION(n,o),children:t("cr_er_une_accr_33475")})}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsxs)(Ed,{isOpen:s,onStateChange:r,children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(Pd,{placement:"bottom-end",children:(0,i.jsx)(Od,{icon:"plus",onClick:()=>{r(!1),l(!0)},children:t("cr_er_une_cat_g_20051")})})]})}),a&&(0,i.jsx)(KP,{eventId:o,onClose:()=>{l(!1)},onSuccess:e.reload})]})};function $D(){const{history:e,params:{organizationId:t,eventId:n}}=il(),{mutate:i}=function(e={}){return Un("mutation AccreditationDuplicate($eventId: EventId!, $accreditationId: AccreditationId!) {\n    accreditationDuplicate(eventId: $eventId, accreditationId: $accreditationId) {\n        id\n    }\n}\n",e)}();return(0,F.useCallback)(async o=>{const{accreditationDuplicate:s}=await i({eventId:n,accreditationId:o});e.push(So.EDIT_ACCREDITATION(t,n,s.id))},[t,n,i])}const OD=e=>{const{translate:t,params:{eventId:n}}=il(),{showNotification:o}=Yv(),{mutate:s}=Rr();return(0,i.jsx)(kk,{buttonText:t("supprimer_43083"),subtext:(0,Da.A)([t("_tes_vous_s_r_d_79068"),e.accreditation.assignedResources>0?t("_1_membre_est_95699",e.accreditation.assignedResources):null]),text:t("suppression_de_73669",e.accreditation.name),onClose:e.onClose,onDelete:async()=>{await s({eventId:n,selecteds:{ids:[e.accreditation.id]}}),o(t("l_accr_ditation_25253",e.accreditation.name)),e.onSuccess()}})},RD=e=>{const t=Ln(),n=$D(),[o,s]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(pm,{children:[(0,i.jsx)(Od,{icon:"pen",to:So.EDIT_ACCREDITATION(e.organizationId,e.eventId,e.accreditation.id),children:t("_diter_62574")}),(0,i.jsx)(Od,{icon:"clone",onClick:async()=>{await n(e.accreditation.id)},children:t("dupliquer_28256")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:e=>{s(!0),wd(e.target)},children:t("supprimer_43083")})]}),o&&(0,i.jsx)(OD,{accreditation:e.accreditation,onClose:()=>{s(!1)},onSuccess:e.reload})]})},PD=e=>{const{translate:t}=il();return(0,i.jsx)(cD,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.willAutoAccredit,property:ie.AutoAccredit,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(nc,{state:e?"checked":"unchecked",onClick:e=>{n("checked"===e)},children:t("AutoAccredit")}),renderValue:e.accreditation.willAutoAccredit?t("oui_54361"):t("non_33516")})},DD=e=>(0,i.jsx)(cD,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.index??0,property:ie.Index,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(wl,{min:1,shouldParseAsInt:!0,value:e,onChange:t}),renderValue:e.accreditation.index?.toString(10)??"-"}),FD=e=>{const{translate:t}=il();return(0,i.jsx)(cD,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.weezeventIsSynchronized,property:ie.WeezeventIsSynchronized,reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(gu,{label:t("WeezeventIsSynchronized"),shouldParseAsBoolean:!0,value:e,onChange:n,children:[(0,i.jsx)("option",{value:"true",children:t("oui_54361")}),(0,i.jsx)("option",{value:"false",children:t("non_33516")})]}),renderValue:e.accreditation.weezeventIsSynchronized?t("oui_54361"):t("non_33516")})},MD=e=>{const{mutate:t}=Is(),n=(0,F.useCallback)((n,i)=>t({eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:i,strategy:Je.Replace,value:n}}),[e.row,t]);return e.column.slug===lD.Id?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===lD.Category?(0,i.jsx)(fD,{accreditationCategory:e.row.accreditationCategory,accreditationId:e.row.id,column:e.column,reload:e.reloadRow}):e.column.slug===lD.Name?(0,i.jsx)(jD,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===lD.SlotName||e.column.slug===lD.SlotDate?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===lD.Resources?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UO,{assignedResources:e.row.assignedResources,resources:e.row.maxResources})}):e.column.slug===lD.Tags?(0,i.jsx)(yD,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===lD.Conditions?(0,i.jsx)(ID,{accreditation:e.row,column:e.column}):e.column.slug===lD.Address?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.address}):e.column.slug===lD.Latitude?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.latitude}):e.column.slug===lD.Longitude?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.longitude}):e.column.slug===lD.Acronym?(0,i.jsx)(uD,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===lD.Color?(0,i.jsx)(xD,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===lD.Icon?(0,i.jsx)(vD,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===lD.IconColor?(0,i.jsx)(bD,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===lD.FillingRate?(0,i.jsxs)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===lD.CreatedBy?(0,i.jsx)(V$,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===lD.AutoAccredit?(0,i.jsx)(PD,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===lD.WeezeventIsSynchronized?(0,i.jsx)(FD,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===lD.WeezeventChecklistId?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===lD.CreatedAt?(0,i.jsx)(B$,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===lD.Index?(0,i.jsx)(DD,{accreditation:e.row,column:e.column,reload:e.reloadRow}):(0,i.jsx)(JC,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:n,reload:e.reloadRow,updatable:!0})},ND=e=>{const t=Ln(),{isEventAdmin:n}=Uv(),o=SC(e.customFields),s=(0,F.useCallback)(()=>{e.reloadAccreditation(e.accreditation.id)},[e.accreditation,e.reloadAccreditation]);return(0,i.jsxs)(Cc,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},onMouseLeave:e=>{wd(e.target)},children:[n&&(0,i.jsx)(xc,{justify:"center",width:48,children:(0,i.jsx)(tc,{state:e.state,onClick:t=>e.toggleRow(`a${e.accreditation.id}`,t)})}),e.columns.map(t=>{const n=o.get(t.slug);return(0,i.jsx)(MD,{column:t,customField:n,eventId:e.eventId,reloadRow:s,row:e.accreditation},t.slug)}),n&&(0,i.jsxs)(im,{justify:"center",children:[(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"pen",to:So.EDIT_ACCREDITATION(e.organizationId,e.eventId,e.accreditation.id)})})}),(0,i.jsx)(am,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsx)(RD,{accreditation:e.accreditation,eventId:e.eventId,organizationId:e.organizationId,reload:e.reload})]})]})},LD=e=>{const{params:{organizationId:t,eventId:n}}=il(),{isEventAdmin:o}=Uv(),{columns:s,columnsSearch:r,limit:a,massActions:l,nameDebounced:d,offset:c,possibleColumns:u,predicates:m,reloadKey:g,setLimit:p,setOffset:f,setSort:x,sort:_}=zC(),I=(0,F.useMemo)(()=>({includeConditions:s.includes(lD.Conditions),includeCreatedBy:s.includes(lD.CreatedBy),includeTags:s.includes(lD.Tags)}),[s]),{data:v,isLoading:b,reload:j}=Vn("query Accreditations(\n    $eventId: EventId!\n    $name: String\n    $predicates: [Predicate!]\n    $limit: Int\n    $offset: Int\n    $sort: AccreditationsSort\n    $columnsSearch: [String!]\n    $includeConditions: Boolean!\n    $includeCreatedBy: Boolean!\n    $includeTags: Boolean!\n) {\n    data: event(id: $eventId) {\n        rows: accreditations(\n            name: $name\n            predicates: $predicates\n            columnsSearch: $columnsSearch\n            limit: $limit\n            offset: $offset\n            sort: $sort\n        ) {\n            nodes {\n                ...AccreditationsAccreditation\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{...I,eventId:n,name:h(d)?d:void 0,columnsSearch:Zo(r)?r:void 0,predicates:m,limit:a,offset:c,sort:_},[Ro.AccreditationsAccreditationFragment]);const C=(0,F.useMemo)(()=>s.flatMap(e=>(0,Da.A)([u.find(t=>t.slug===e)])),[u,s]),{numberOfPages:y,totalCount:k}=lu(v.data?.rows),[A,w]=(0,F.useState)([]),[S,E]=(0,F.useState)({}),T=(0,F.useCallback)(async e=>{E(t=>({...t,[e]:!0}));const{data:{row:t}}=await function(e,t){return ss("query AccreditationsAccreditation(\n    $eventId: EventId!\n    $id: AccreditationId!\n    $includeConditions: Boolean!\n    $includeCreatedBy: Boolean!\n    $includeTags: Boolean!\n) {\n    data: event(id: $eventId) {\n        row: accreditation(id: $id) {\n            ...AccreditationsAccreditation\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.AccreditationsAccreditationFragment]})}({...I,eventId:n,id:e},await H());w(n=>n.map(n=>n.id===e?t:n)),E(t=>({...t,[e]:!1}))},[I,E,w]);return(0,F.useEffect)(()=>{w(v.data?.rows.nodes??[])},[v.data]),(0,F.useEffect)(()=>{g>1&&j()},[g]),(0,F.useEffect)(()=>{l.setStates(Object.fromEntries((v.data?.rows.nodes??[]).map(e=>[`a${e.id}`,{id:e.id,state:"unchecked"}])))},[v.data,l.setStates]),(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ea,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(nm,{"aria-busy":b,headerRow:(0,i.jsxs)(cc,{children:[o&&(0,i.jsx)(Tc,{justify:"center",width:48,children:(0,i.jsx)(tc,{state:l.selectAllState,onClick:l.toggleSelectAll})}),C.map(e=>e.isSortable?(0,i.jsx)(tm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:x,sort:_,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Tc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),o&&(0,i.jsx)(Tc,{width:100})]}),paginationRow:(0,i.jsx)(yc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(jc,{limit:a,numberOfPages:y,offset:c,setLimit:p,setOffset:f,showLimits:!0,totalCount:k})}),children:b?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{})]}):A.map(o=>S[o.id]?(0,i.jsx)(zc,{},o.id):(0,i.jsx)(ND,{accreditation:o,columns:C,customFields:e.customFields,eventId:n,organizationId:t,reload:j,reloadAccreditation:T,state:l.states[`a${o.id}`]?.state??"unchecked",toggleRow:l.toggleRow},o.id))})})})},BD=e=>{const t=Ln(),{isEventAdmin:n}=Uv(),{limit:o,reloadKey:s,rendering:r,segment:a,setReloadKey:l}=zC();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zD,{reload:()=>{l(s+1)}}),0===e.numberOfAccreditations?(0,i.jsx)(yC,{css:{overflow:"hidden"},children:(0,i.jsx)(fr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(rk,{subtitle:"",title:t("vous_n_avez_pas_53408")})})}):(0,i.jsxs)(yC,{children:[(0,i.jsx)(fO,{searchRow:(0,i.jsx)(gO,{actions:(0,i.jsx)(TD,{}),searchPlaceholder:t("rechercher_une_65646"),showEditColumns:!0,showEditMode:n,showSearchColumns:!0}),selectSegment:(0,i.jsx)(FO,{pageSelectedText:t("les_1_accr_di_60244",o),segmentSelectedText:t("les_1_accr_di_20650",a.count,a.name)})}),r===vh.SlotsList?(0,i.jsx)(ED,{customFields:e.customFields,weezeventOrganizationId:e.weezeventOrganizationId}):(0,i.jsx)(LD,{customFields:e.customFields})]})]})},VD=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,segmentId:r}}=il(),{isEventAdmin:a,localEvent:l,updateLocalEvent:d}=Uv(),c=Nn(dD),u=(0,F.useMemo)(()=>e.organization?.customFields.nodes??[],[e.organization]),h=(0,F.useMemo)(()=>c.getAccreditationsFilters(e.event,u),[u,e.event]),m=(0,F.useMemo)(()=>c.getAccreditationsPossibleColumns(e.event.isWeezeventConnected,u),[u,e.event]);return(0,i.jsx)(mD,{eventId:s,organizationId:o,children:(0,i.jsx)(uO,{eventId:s,filters:h,filtersButtonText:n("filtrer_les_acc_57840"),filtersSubtitle:n("appliquer_des_f_18351"),getSegmentPath:e=>So.ACCREDITATIONS_SEGMENT(o,s,e),hideSegments:0===e.event.numberOfAccreditations,initialLimit:l?.accreditationsLimit??_c,initialSegmentsOpen:l?.areAccreditationsSegmentsOpen??!0,isAdmin:a,organizationId:o,possibleColumns:m,possibleRenderings:[vh.List,vh.SlotsList],reload:e.reload,segmentId:r,segmentType:ft.Accreditations,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{d({accreditationsLimit:e})},onSegmentClick:e=>{d({accreditationsSegmentId:e})},onSegmentDelete:async()=>{await d({accreditationsSegmentId:null}),t.replace(Hi.ACCREDITATIONS({organizationId:o,eventId:s}))},onSegmentsToggle:async e=>{await d({areAccreditationsSegmentsOpen:e})},children:(0,i.jsx)(BD,{customFields:u,numberOfAccreditations:e.event.numberOfAccreditations,weezeventOrganizationId:e.organization.weezeventOrganizationId})})})},UD=()=>{const{params:{organizationId:e,eventId:t},translate:n}=il(),{event:{name:o},localEvent:s}=Uv();Cd(`${o} ${n("accr_ditations_39450")}`);const{data:r,loader:a,reload:l}=Vn("query AccreditationsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n    organization(id: $organizationId) {\n        weezeventOrganizationId\n\n        customFields(variety: Accreditation) {\n            nodes {\n                ...SegmentCustomField\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        id\n        organizationId\n        numberOfAccreditations\n        isWeezeventConnected\n\n        accreditationsCategories {\n            id\n            name\n        }\n\n        segmentsFolders(segmentType: Accreditations) {\n            ...SegmentsFoldersSegments\n        }\n    }\n}\n",{organizationId:e,eventId:t},[Ro.SegmentCustomFieldFragment,Ro.SegmentsFoldersSegmentsFragment]),d=(0,F.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.ACCREDITATIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(VD,{event:r.event,organization:r.organization,reload:l})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.ACCREDITATIONS_SEGMENT(e,t,s?.accreditationsSegmentId&&d.includes(s.accreditationsSegmentId)?s?.accreditationsSegmentId:d[0]),replace:!0})})]})},WD=()=>{const{hasFeature:e}=nI();return e(Fe.Accreditation)?(0,i.jsx)(UD,{}):(0,i.jsx)(Ea,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(iI,{icon:"badge-check"})})},GD=({accreditation:e})=>{const{history:t,params:{organizationId:n,eventId:o,accreditationId:s},translate:r}=il(),a=$D(),[l,d]=(0,F.useState)(!1);return(0,i.jsxs)(kC,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(yb,{returnPathFallback:Hi.ACCREDITATIONS({organizationId:n,eventId:o})}),(0,i.jsx)(fr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"medium",children:Fj(e)}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsx)(pl,{to:So.EDIT_ACCREDITATION(n,o,s),children:r("_diter_l_accr_d_26424")})}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsx)(Od,{icon:"clone",onClick:async()=>await a(e.id),children:r("dupliquer_28256")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:e=>{wd(e.target),d(!0)},children:r("supprimer_43083")})]})]})}),l&&(0,i.jsx)(OD,{accreditation:e,onClose:()=>d(!1),onSuccess:()=>t.replace(Hi.ACCREDITATIONS({organizationId:n,eventId:o}))})]})},HD=e=>(0,i.jsx)(zu,{color:e.color,css:{display:"none","@tablet":{display:"block"},...e.css},direction:e.direction}),qD=ar("dt",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontWeight:"$regular",gridColumn:1}}),YD=({children:e,...t})=>(0,i.jsx)(qD,{...t,children:e}),KD=ar("dd",{color:"$gray500",marginInline:0,"@tablet":{color:"$gray800",gridColumn:2}}),ZD=({children:e,...t})=>(0,i.jsx)(KD,{...t,children:e}),XD=ar("div",{display:"grid",gridTemplateColumns:"auto",rowGap:"$1","@tablet":{columnGap:"$3",gridTemplateColumns:"auto auto",justifyContent:"space-between"}}),JD=({children:e,...t})=>(0,i.jsx)(XD,{...t,children:e}),QD=ar("dl",{display:"flex",flexDirection:"column",gap:"$4",marginBlock:0,marginInline:0}),eF=({children:e,...t})=>(0,i.jsx)(QD,{...t,children:e}),tF=({accreditationCategoryId:e,accreditationCategoryName:t,accreditationName:n,color:o,customFields:s,fields:r,icon:a})=>{const{params:{organizationId:l,eventId:d,accreditationId:c},translate:u}=il();return(0,i.jsx)(WA,{css:{flex:"2 1"},title:u("param_tres_78420"),children:(0,i.jsx)(Ea,{direction:"column",gap:"4",width:1,children:(0,i.jsxs)(eF,{children:[(0,i.jsxs)(JD,{children:[(0,i.jsx)(YD,{children:u("cat_gorie_00291")}),(0,i.jsx)(ZD,{children:(0,i.jsx)(j_,{to:Hi.ACCREDITATION_CATEGORY({organizationId:l,eventId:d,accreditationCategoryId:e}),children:t})})]}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(HD,{direction:"horizontal"}),(0,i.jsxs)(JD,{children:[(0,i.jsx)(YD,{children:u("Accreditation")}),(0,i.jsx)(ZD,{children:(0,i.jsx)(j_,{to:Hi.ACCREDITATION({organizationId:l,eventId:d,accreditationId:c}),children:n})})]})]}),(0,i.jsx)(HD,{direction:"horizontal"}),(0,i.jsxs)(JD,{children:[(0,i.jsx)(YD,{children:u("Color")}),(0,i.jsx)(ZD,{children:(0,i.jsx)(fr,{css:{background:o,borderRadius:"20px",height:"20px",width:"20px"}})})]}),(0,i.jsx)(HD,{direction:"horizontal"}),(0,i.jsxs)(JD,{children:[(0,i.jsx)(YD,{children:u("ic_ne_55554")}),(0,i.jsx)(ZD,{children:(0,i.jsx)(Va,{icon:Ba(a)})})]}),s.map(e=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsxs)(Ea,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(fr,{color:"gray500",css:{flex:"1"},children:e.name}),(0,i.jsx)(Ea,{justify:"end",width:300,children:(0,i.jsx)(BA,{field:e,fields:r})})]})]},e.slug))]})})})},nF=ar("div",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontWeight:"$regular"}}),iF=ar("div",{color:"$gray500","@tablet":{color:"$gray800",fontWeight:"$medium"}}),oF=({customFields:e})=>{const t=pc(),n=Ln();return(0,i.jsx)(WA,{title:n("conditions_77756"),children:Zo(e)?e.map(({customField:e,conditionValue:o},s)=>(0,i.jsxs)(F.Fragment,{children:[0!==s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"4"}),!t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(Pa,{height:"4"})]})]}),(0,i.jsx)(nF,{children:e.name}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(iF,{children:_D(n,e,o)})]},s)):(0,i.jsx)(fr,{color:"gray500",textAlign:"center",width:1,children:n("aucune_conditio_36491")})})},sF=({assignedResources:e,maxResources:t})=>{const n=Ln();return(0,i.jsx)(WA,{css:{flex:"1 1"},title:n("limite_de_membr_42978"),children:(0,i.jsx)(Ea,{css:{justifyContent:"space-between"},direction:"column",height:"100%",children:(0,i.jsx)(fr,{css:{margin:"auto"},children:(0,i.jsx)(KA,{count:e,total:t??1/0})})})})},rF=({location:e,location:{zoom:t,layer:n,traces:o,address:s}})=>{const r=Ln(),a=mh(e);return(0,i.jsx)(WA,{css:{border:a&&!uh?"none":"1px solid $gray200",overflow:"hidden",padding:a?0:"$4","@tablet":{border:"1px solid $gray200",padding:0,"& .h-detail-box-content":{padding:a?"0":"$6"}}},title:r("localisation_38416"),children:a?(0,i.jsxs)(i.Fragment,{children:[hh(e)&&(0,i.jsx)(fr,{height:380,width:1,children:(0,i.jsx)(Tr,{initialZoom:t,layer:n,point:kr(e),traces:o})}),uh(e)&&(0,i.jsx)(fr,{color:"gray800",css:{padding:"$4","@tablet":{padding:"$7"}},children:s})]}):(0,i.jsx)(fr,{color:"gray500",textAlign:"center",width:1,children:r("aucune_localisa_78216")})})},aF=()=>{const{params:{eventId:e,accreditationId:t}}=il(),{data:n,loader:o}=Vn("query AccreditationChart($eventId: EventId!, $accreditationId: AccreditationId!) {\n    event(id: $eventId) {\n        accreditation(id: $accreditationId) {\n            ...AccreditationChart\n        }\n    }\n}\n",{eventId:e,accreditationId:t},[Ro.AccreditationChartFragment]);return o||(0,i.jsx)(WA,{title:"Reporting",children:(0,i.jsx)(fr,{height:380,width:1,children:(0,i.jsx)(vw,{accreditation:n.event.accreditation,slots:n.event.accreditation.slots})})})},lF="both",dF="delegationAccreditation",cF="slot",uF=({limitSource:e})=>{const t=Ln();return e===dF?(0,i.jsx)(Va,{icon:"people-group",title:t("limite_fix_e_po_87265")}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Va,{icon:"badge-check",title:t("limite_fix_e_po_40573")}),e===lF&&(0,i.jsxs)(i.Fragment,{children:[" + ",(0,i.jsx)(uF,{limitSource:dF})]})]})},hF=(e,t)=>{const n=t?.assignedResources??0,o=t?.wishedResources??0,s=t?.maxResources??1/0,r=e?.assignedResources??0,a=e?.wishedResources??0,l=e?.maxResources??1/0,d=r>=l||n>=s,c=s-n,u=s-o,h=l-r,m=l-a,g=c===h?lF:c{const{history:o,params:{organizationId:s,eventId:r,accreditationId:a},translate:l}=il(),d=Nn($c),c=Nn(Hk),{assignedResources:u,maxResources:m,percent:g}=hF(void 0,t),{mutate:p}=Pr(),{mutate:f}=function(e={}){return Un("mutation AccreditationSlotDelete($eventId: EventId!, $accreditationSlotId: AccreditationsSlotId!) {\n    accreditationSlotDelete(eventId: $eventId, accreditationSlotId: $accreditationSlotId) {\n        id\n    }\n}\n",e)}(),[x,_]=(0,F.useState)(!1),[I,v]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Cc,{css:{cursor:"pointer",userSelect:"none","&:hover":{background:"$gray100"}},onClick:()=>o.push(Hi.ACCREDITATION_SLOT({organizationId:s,eventId:r,accreditationId:a,accreditationSlotId:t.id})),children:[(0,i.jsx)(xc,{children:(0,i.jsx)(fr,{font:"gray900 textSm medium",children:h(t.name)?t.name:"-"})}),(0,i.jsx)(xc,{children:t.date?d.toLocaleString(t.date,Ho.DateOnly.WeekdayLongMonthLong):"-"}),(0,i.jsx)(xc,{children:(0,i.jsxs)(Ea,{align:"center",css:{"& > div":{width:"100%"}},gap:"2",width:1,children:[(0,i.jsx)(fr,{children:l("_1_2_membres_04485",u,c.toNumberOrInfinity(m))}),m&&(0,i.jsx)(YA,{percent:g})]})}),(0,i.jsx)(im,{justify:"end",children:(0,i.jsxs)(pm,{children:[(0,i.jsx)(Od,{icon:"pen",onClick:()=>{_(!0)},children:l("_diter_62574")}),(0,i.jsx)(Od,{color:t.assignedResources>0?"disabled":"red",icon:"trash-can",onClick:()=>{v(!0)},children:l("supprimer_43083")})]})})]}),x&&(0,i.jsx)(eD,{event:e,slot:t,onClose:()=>{_(!1)},onSuccess:async e=>{await p({eventId:r,accreditationSlotId:t.id,accreditationSlot:e}),n()}}),I&&(0,i.jsx)(kk,{buttonText:l("supprimer_43083"),subtext:[l("_tes_vous_s_r_d_48876")],text:l("suppression_de_73669",ph(d,t,"")),onClose:()=>{v(!1)},onDelete:async()=>{await f({eventId:r,accreditationSlotId:t.id}),n()}})]})},gF=()=>{const{translate:e,params:{eventId:t,accreditationId:n}}=il(),[o,s,r]=Ec(""),[a,l]=ET("accreditation.slots.date",Fo.c9.invalid("Invalid"),Qh),[d,c]=(0,F.useState)(0),[u,m]=ET("accreditation.slots.sort",null),{data:g,isLoading:p,reload:f}=Vn("query AccreditationSlots(\n    $eventId: EventId!\n    $accreditationId: AccreditationId!\n    $name: String\n    $date: Date\n    $offset: Int\n    $sort: AccreditationsSlotsSort\n) {\n    event(id: $eventId) {\n        startAt\n        endAt\n\n        accreditationsSlots(\n            accreditationsIds: [$accreditationId]\n            name: $name\n            date: $date\n            limit: 25\n            offset: $offset\n            sort: $sort\n        ) {\n            nodes {\n                id\n                name\n                isHidden\n                date\n                maxResources\n                assignedResources\n                wishedResources\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{eventId:t,accreditationId:n,name:h(s)?s:void 0,date:a?.isValid?a:void 0,offset:d,sort:u},[]);const{numberOfPages:x,totalCount:_}=lu(g.event?.accreditationsSlots),I=(0,F.useCallback)(e=>{m(e),c(0)},[m,c]);return(0,i.jsx)(kc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:o,onChange:r})}),(0,i.jsx)(fr,{width:200,children:(0,i.jsx)(_u,{max:g.event?.endAt,min:g.event?.startAt,value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tm,{attribute:se.Name,setSort:I,sort:u,children:e("nom_du_cr_neau_54351")}),(0,i.jsx)(tm,{attribute:se.Date,setSort:I,sort:u,children:e("Date")}),(0,i.jsx)(Tc,{children:e("remplissage_75916")}),(0,i.jsx)(Tc,{width:100})]}),numberOfPages:x,offset:d,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):g.event.accreditationsSlots.nodes.map(e=>(0,i.jsx)(mF,{event:g.event,reload:f,slot:e},e.id)),setOffset:c,title:e("liste_des_cr_ne_66393"),totalCount:_})},pF=()=>{const{organizationId:e,eventId:t,accreditationId:n}=Wn(),{isEventAdmin:o}=Uv(),{data:s,loader:r,reload:a}=Vn("query AccreditationDashboard(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $accreditationId: AccreditationId!\n) {\n    organization(id: $organizationId) {\n        customFields(variety: Accreditation) {\n            nodes {\n                ...CustomFieldWithCondition\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        accreditation(id: $accreditationId) {\n            id\n            name\n            description\n            privateNote\n            acronym\n            icon\n            color\n            address\n            latitude\n            longitude\n            layer\n            zoom\n            assignedResources\n            maxResources\n            hasSlots\n            hiddenSlotId\n            fields\n\n            accreditationCategory {\n                id\n                name\n            }\n\n            accreditationsCustomFields {\n                customField {\n                    name\n                    fieldType\n\n                    values {\n                        id\n                        value\n                    }\n                }\n\n                conditionValue\n            }\n\n            tags {\n                id\n                name\n            }\n        }\n    }\n}\n",{organizationId:e,eventId:t,accreditationId:n},[Ro.CustomFieldWithConditionFragment]),{mutate:l}=Is();return r||(0,i.jsx)(yC,{children:(0,i.jsxs)(Ea,{direction:"column",gap:"6",children:[(0,i.jsx)(aF,{}),s.event.accreditation.hasSlots&&(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(gF,{})}),(0,i.jsxs)(Ea,{gap:"6",width:1,children:[!s.event.accreditation.hasSlots&&(0,i.jsx)(sF,{assignedResources:s.event.accreditation.assignedResources,maxResources:s.event.accreditation.maxResources}),(0,i.jsx)(tF,{accreditationCategoryId:s.event.accreditation.accreditationCategory.id,accreditationCategoryName:s.event.accreditation.accreditationCategory.name,color:s.event.accreditation.color,customFields:s.organization.customFields.nodes,fields:s.event.accreditation.fields,icon:s.event.accreditation.icon})]}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsxs)(Ea,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(oF,{customFields:s.event.accreditation.accreditationsCustomFields}),(0,i.jsx)(ow,{...o?{associateTags:e=>l({eventId:t,massEdit:{reset:!1,selecteds:{ids:[n]},slug:ie.Tag,strategy:Je.Replace,value:e}}),reload:a}:{},tags:s.event.accreditation.tags}),(0,i.jsx)(ew,{privateNote:s.event.accreditation.privateNote})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(QA,{description:s.event.accreditation.description}),(0,i.jsx)(rF,{location:s.event.accreditation})]})]})]})})},fF=e=>{const{translate:t}=il(),{user:n}=Zn(),{data:o}=Vn("query MassDocumentExportCustomDocuments($eventId: EventId!) {\n    event(id: $eventId) {\n        customDocuments {\n            name\n            slug\n        }\n    }\n}\n",{eventId:e.eventId},[]);const{mutate:s}=Ss(),[r,a]=(0,F.useState)(Se.Assignments),[l,d]=(0,F.useState)(Fo.c9.invalid("Invalid")),[c,u]=(0,F.useState)(!1),[h,m]=(0,F.useState)(!1),g=(0,F.useMemo)(()=>(0,Ju.A)(o.event?.customDocuments??[],e=>e.slug),[o.event]),p=r===Se.Assignments||r===Se.UserHours||r===Se.UserPlanning||r===Se.UserPlanningList;return(0,i.jsx)(nb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"file",children:t("exporter_un_doc_23130")}),(0,i.jsxs)(Qv,{gap:"5",children:[(0,i.jsx)(Ha,{color:"gray",leftIcon:"circle-exclamation",children:t("l_e_mail_peut_m_13253")}),(0,i.jsxs)(dc,{isSearchVisible:!0,label:t("quel_document_v_81798"),renderOnPortal:!0,values:[r],onChange:e=>{Zo(e)&&a(e[0])},children:[g.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),(0,i.jsx)("option",{value:Se.Assignments,children:t("fiche_d_affecta_91461")}),(0,i.jsx)("option",{value:Se.UserPlanning,children:t("UserPlanning")}),(0,i.jsx)("option",{value:Se.UserPlanningList,children:t("UserPlanningList")}),(0,i.jsx)("option",{value:Se.UserPlanningDays,children:t("UserPlanningDays")}),(0,i.jsx)("option",{value:Se.Certificate,children:t("Certificate")}),(0,i.jsx)("option",{value:Se.UserHours,children:t("UserHours")})]}),p&&(0,i.jsx)(_u,{label:t("exportez_vos_do_87332"),value:l,onChange:d}),(0,i.jsx)(nc,{state:c?"checked":"unchecked",onClick:e=>{u("checked"===e)},children:t("fusionner_les_d_64130")})]}),(0,i.jsx)(Jv,{children:(0,i.jsx)(pl,{isLoading:h,onClick:async()=>{m(!0);const t=g.map(e=>e.slug),i=t.includes(r)?Se.UserCustomDocument:r,o=t.includes(r)?r:void 0;await s({eventId:e.eventId,documentsExport:{documentType:i,customDocumentSlug:o,segmentsIds:e.selecteds.segmentId?[e.selecteds.segmentId]:[],ids:e.selecteds.ids,language:n.language,oneFile:c,date:l}}),e.onSuccess(),e.onClose()},children:t("exporter_59120")})})]})})},xF=e=>{const t=Ln(),{mutate:n,isLoading:o}=Vs(),[s,r]=(0,F.useState)(ae.WaitingAccreditation);return(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ea,{justify:"center",children:(0,i.jsx)(mj,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{font:"gray900 textLg medium",textAlign:"center",children:t("mettre_jour_l_44471")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(gu,{label:t("nouveau_statut_57871"),value:s,onChange:e=>{r(e)},children:[(0,i.jsx)("option",{value:ae.NotApplicable,children:t(ae.NotApplicable)}),(0,i.jsx)("option",{value:ae.Refused,children:t(ae.Refused)}),(0,i.jsx)("option",{value:ae.WaitingAccreditation,children:t(ae.WaitingAccreditation)})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{isLoading:o,onClick:async()=>{const i=(await n({eventId:e.eventId,massStateUpdate:{selecteds:e.selecteds,state:s}})).numberOfMembers;e.onSuccess(t("le_statut_d_acc_85658",i,t(s))),e.onClose()},children:t("modifier_le_sta_94473")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})};let _F=class extends zl{translationService;constructor(e){super(e),this.translationService=e}massAssignStep1Schema(){return l.Ik().shape({massAssign:l.Ik().shape({...this.massAssignStep1Fields()})})}massAssignStep2Schema(){return l.Ik().shape({massAssign:l.Ik().shape({...this.massAssignStep2Fields()})})}massAssignSchema(){return l.Ik().shape({...this.massAssignStep1Fields(),...this.massAssignStep2Fields()})}massAssignStep1Fields(){return{strategy:l.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(mn,this.t("la_strat_gie_es_82287"))}}massAssignStep2Fields(){return{positionsSlotsIds:l.YO().of(l.ai()).required(this.t("vous_devez_s_le_28976")).min(1,this.t("vous_devez_s_le_28976"))}}};_F=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],_F);const IF=e=>{const t=Ln();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{font:"gray900 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"massAssign.strategy",value:Je.Add,children:t("ajouter_des_aff_57793")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"massAssign.strategy",value:Je.Replace,children:t("remplacer_les_a_43030")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"massAssign.strategy",value:Je.Delete,children:t("supprimer_des_a_59880")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{onClick:e.handleSubmit,children:t("suivant_affec_68075")})})]})},vF=e=>{const t=Ln(),n=Nn(Ku),o=e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(Cc,{css:{cursor:"pointer"},onClick:()=>{e.change("massAssign.positionsSlotsIds",Jo(e.positionsSlotsIds,e.slot.id,"unchecked"===o))},children:[(0,i.jsx)(xc,{justify:"center",width:48,children:(0,i.jsx)(tc,{shouldPreventDefault:!1,state:o,onClick:Bl.A})}),(0,i.jsx)(xc,{css:{textTransform:"capitalize"},children:n.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}})}),(0,i.jsx)(xc,{children:h(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(xc,{children:(0,i.jsx)(Gd,{color:e.slot.assignedResources>=e.slot.resources?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.slot.assignedResources,e.slot.resources)})})]})},bF=e=>{const t=Ln(),n=(0,F.useMemo)(()=>(0,Zd.A)(e.slots.filter(t=>t.position.id===e.position.id),e=>e.range.start.toMillis()),[e.slots,e.position]),o=(0,F.useMemo)(()=>n.map(e=>e.id),[n]),s=(0,F.useMemo)(()=>{const t=(0,Zu.A)(e.positionsSlotsIds,o);return t.length===o.length?"checked":0===t.length?"unchecked":"indeterminate"},[o,e.positionsSlotsIds]);return(0,i.jsx)(Jj,{accreditation:e.position,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:n.length,children:(0,i.jsxs)(mc,{hideBorder:!0,children:[(0,i.jsxs)(cc,{children:[(0,i.jsx)(Tc,{justify:"center",width:48,children:(0,i.jsx)(tc,{state:s,onClick:t=>{"checked"===t?e.change("massAssign.positionsSlotsIds",(0,Oo.A)(e.positionsSlotsIds.concat(o))):e.change("massAssign.positionsSlotsIds",(0,Jd.A)(e.positionsSlotsIds,o))}})}),(0,i.jsx)(Tc,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(Tc,{children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(Tc,{})]}),n.map(t=>(0,i.jsx)(vF,{change:e.change,positionsSlotsIds:e.positionsSlotsIds,slot:t},t.id))]})})},jF=e=>{const t=(0,F.useMemo)(()=>(0,Zd.A)(e.positions.filter(t=>t.positionCategoryId===e.category.id),e=>e.name.toLowerCase()),[e.category,e.positions]);return(0,i.jsx)(Kj,{category:e.category,children:t.map(t=>(0,i.jsx)(bF,{change:e.change,position:t,positionsSlotsIds:e.positionsSlotsIds,slots:e.slots},t.id))})},CF=e=>{const t=Ln(),[n,o]=(0,F.useState)(!1),[s,r]=(0,F.useState)(e.segmentId),[a,l]=(0,F.useState)(e.excludeFull?"checked":"unchecked"),[d,c]=(0,F.useState)(e.excludePast?"checked":"unchecked"),[u,h]=(0,F.useState)(e.filterAvailabilities?"checked":"unchecked"),[m,g]=(0,F.useState)(e.filterWished?"checked":"unchecked"),p=(e.excludeFull?1:0)+(e.excludePast?1:0)+(e.filterAvailabilities?1:0)+(e.filterWished?1:0)+(-1===e.segmentId?0:1);return(0,i.jsxs)(Ea,{css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"3",children:[(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_une_69998"),value:e.name,onChange:t=>{e.setName(t)}})}),(0,i.jsxs)(Dj,{apply:()=>{e.setExcludeFull("checked"===a),e.setExcludePast("checked"===d),e.setFilterAvailabilities("checked"===u),e.setFilterWished("checked"===m),e.setSegmentId(s),o(!1)},color:"white",isOpen:n,numberOfAppliedFilters:p,reinit:()=>{e.setExcludeFull(!1),l("unchecked"),e.setExcludePast(!1),c("unchecked"),e.setFilterAvailabilities(!1),h("unchecked"),e.setFilterWished(!1),g("unchecked"),e.setSegmentId(-1),r(-1),e.setName(""),o(!1)},showButtons:!0,onStateChange:o,children:[(0,i.jsxs)(gu,{label:"Vues personnalisées",shouldParseAsInt:!0,value:s,onChange:e=>{r(e)},children:[(0,i.jsx)("option",{value:-1,children:t("vue_personnalis_97654")}),e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,i.jsx)(nc,{state:a,onClick:l,children:t("masquer_les_cr_14425")}),(0,i.jsx)(nc,{state:d,onClick:c,children:t("masquer_les_cr_05336")}),(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(fr,{font:"gray900 textSm medium",children:t("filtres_sur_les_73833")}),(0,i.jsx)(nc,{state:u,onClick:h,children:t("filtrer_selon_l_74774")}),(0,i.jsx)(nc,{state:m,onClick:g,children:t("filtrer_selon_l_76350")})]})]})},yF=e=>{const t=Ln(),[n,o,s]=Ec(""),[r,a]=ET("massAssign.filters.segmentId",-1),[l,d]=ET("massAssign.filters.excludeFull",!1),[c,u]=ET("massAssign.filters.excludePast",!1),[m,g]=ET("massAssign.filters.filterAvailabilities",!1),[p,f]=ET("massAssign.filters.filterWished",!1),{data:x,loader:_}=Vn("query MassAssignSlots(\n    $eventId: EventId!\n    $positionName: String\n    $segmentId: SegmentId\n    $excludeFull: Boolean\n    $excludePast: Boolean\n    $filterAvailabilities: Boolean\n    $filterWished: Boolean\n    $selecteds: MassActionSelectedsInput\n) {\n    event(id: $eventId) {\n        segments(segmentType: Positions) {\n            id\n            name\n        }\n\n        positionsSlots(\n            positionName: $positionName\n            segmentId: $segmentId\n            excludeFull: $excludeFull\n            excludePast: $excludePast\n            filterAvailabilities: $filterAvailabilities\n            filterWished: $filterWished\n            selecteds: $selecteds\n        ) {\n            nodes {\n                id\n                name\n                range\n                assignedResources\n                resources\n\n                position {\n                    id\n                    positionCategoryId\n                    name\n                    color\n                    icon\n                }\n\n                positionCategory {\n                    id\n                    name\n                }\n            }\n        }\n    }\n}\n",{eventId:e.eventId,positionName:h(o)?o:void 0,segmentId:-1===r?void 0:r,excludeFull:l,excludePast:c,selecteds:e.selecteds,filterAvailabilities:m,filterWished:p},[]);const I=(0,F.useMemo)(()=>(0,Zd.A)((0,Ju.A)((x.event?.positionsSlots.nodes??[]).map(e=>e.positionCategory),e=>e.id),e=>e.name.toLowerCase()),[x.event]),v=(0,F.useMemo)(()=>(0,Ju.A)((x.event?.positionsSlots.nodes??[]).map(e=>e.position),e=>e.id),[x.event]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(CF,{excludeFull:l,excludePast:c,filterAvailabilities:m,filterWished:p,name:n,segmentId:r,segments:x.event?.segments??[],setExcludeFull:e=>{d(e)},setExcludePast:u,setFilterAvailabilities:g,setFilterWished:f,setName:s,setSegmentId:e=>{a(e)}}),(0,i.jsx)(Pa,{height:"6"}),_||(0,i.jsx)(Yj,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:I.map(t=>(0,i.jsx)(jF,{category:t,change:e.change,positions:v,positionsSlotsIds:e.values.massAssign.positionsSlotsIds,slots:x.event?.positionsSlots.nodes??[]},t.id))}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{isLoading:e.submitting,onClick:e.handleSubmit,children:t("affecter_les_1_56142",e.numberOfSelected)})})]})},kF=e=>{const t=Ln(),n=Nn(_F),{mutate:o}=Us();return(0,i.jsx)(Mk,{children:(0,i.jsx)(bm,{category:t("affectation"),title:t("affecter_les_me_77160"),onClose:e.onClose,children:(0,i.jsx)(Im,{children:(0,i.jsxs)(kv,{initialValues:{massAssign:{selecteds:e.selecteds,strategy:Je.Add,positionsSlotsIds:[]}},isEdit:!1,onSubmit:async n=>{const i=(await o({eventId:e.eventId,massAssign:n.massAssign})).numberOfMembers;e.onSuccess(t("_1_membres_ont_14333",i)),e.onClose()},children:[(0,i.jsx)(yv,{render:({handleSubmit:e})=>(0,i.jsx)(IF,{handleSubmit:e}),schema:n.massAssignStep1Schema(),title:t("initialisation_38640")}),(0,i.jsx)(yv,{render:t=>(0,i.jsx)(yF,{change:t.form.change,eventId:e.eventId,handleSubmit:t.handleSubmit,numberOfSelected:e.numberOfSelected,selecteds:e.selecteds,submitting:t.submitting,values:t.values}),schema:n.massAssignStep2Schema(),title:t("affectation_plural")})]})})})})};let AF=class extends zl{translationService;constructor(e){super(e),this.translationService=e}massPreAssignStep1Schema(){return l.Ik().shape({massPreAssign:l.Ik().shape({...this.massPreAssignStep1Fields()})})}massPreAssignStep2Schema(){return l.Ik().shape({massPreAssign:l.Ik().shape({...this.massPreAssignStep2Fields()})})}massPreAssignSchema(){return l.Ik().shape({...this.massPreAssignStep1Fields(),...this.massPreAssignStep2Fields()})}massPreAssignStep1Fields(){return{strategy:l.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(mn,this.t("la_strat_gie_es_82287")),level:l.Yj().required(this.t("le_niveau_est_r_81100")).oneOf(gn,this.t("le_niveau_est_r_81100"))}}massPreAssignStep2Fields(){return{positionsCategoriesIds:l.YO().of(l.ai()).test("non-empty-categories",this.t("vous_devez_s_le_32044"),function(){return this.parent.level!==Qe.Categories||this.parent.positionsCategoriesIds.length>0}),positionsIds:l.YO().of(l.ai()).test("non-empty-positions",this.t("vous_devez_s_le_89603"),function(){return this.parent.level!==Qe.Positions||this.parent.positionsIds.length>0})}}};AF=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],AF);const wF=e=>{const t=Ln();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{font:"gray900 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"massPreAssign.strategy",value:Je.Add,children:t("ajouter_des_pr_46968")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"massPreAssign.strategy",value:Je.Replace,children:t("remplacer_les_p_59777")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{font:"gray900 textSm medium",children:t("_quel_niveau_s_87878")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"massPreAssign.level",value:Qe.Categories,children:t("pr_affecter_su_68204")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"massPreAssign.level",value:Qe.Positions,children:t("pr_affecter_su_38603")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{onClick:e.handleSubmit,children:t("suivant_pr_a_99182")})})]})},SF=e=>{const t=Ln();return(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(tc,{state:e.positionsCategoriesIds.includes(e.category.id)?"checked":"unchecked",onClick:t=>{e.change("massPreAssign.positionsCategoriesIds",Jo(e.positionsCategoriesIds,e.category.id,"checked"===t))}})}),(0,i.jsx)(xc,{children:e.category.name}),(0,i.jsx)(xc,{children:(0,i.jsx)(Gd,{color:e.category.assignedResources>=e.category.resources?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.category.assignedResources,e.category.resources)})})]})},EF=e=>{const t=Ln(),[n,o,s]=Ec(""),{data:r,isLoading:a}=Vn("query MassPreAssignCategories($eventId: EventId!) {\n    event(id: $eventId) {\n        positionsCategories {\n            id\n            name\n            assignedResources\n            resources\n        }\n    }\n}\n",{eventId:e.eventId},[]);const l=(0,F.useMemo)(()=>h(o)?(r.event?.positionsCategories??[]).filter(e=>e.name.trim().toLowerCase().includes(o.trim().toLowerCase())):r.event?.positionsCategories??[],[r.event?.positionsCategories,o]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_une_66722"),value:n,onChange:s})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{css:{paddingRight:0},width:48}),(0,i.jsx)(Tc,{children:t("nom_de_la_cat_g_03860")}),(0,i.jsx)(Tc,{})]}),numberOfPages:1,offset:0,rows:a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):l.map(t=>(0,i.jsx)(SF,{category:t,change:e.change,positionsCategoriesIds:e.values.massPreAssign.positionsCategoriesIds},t.id)),setOffset:Bl.A,title:(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{children:t("s_lectionner_le_58635")}),(0,i.jsx)(fr,{font:"gray500 textSm regular",children:t("les_membres_s_l_66443")})]}),totalCount:l.length??0}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{onClick:e.handleSubmit,children:t("pr_affecter_le_81533",e.numberOfSelected)})})]})},TF=e=>{const t=Ln();return(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(tc,{state:e.positionsIds.includes(e.position.id)?"checked":"unchecked",onClick:t=>{e.change("massPreAssign.positionsIds",Jo(e.positionsIds,e.position.id,"checked"===t))}})}),(0,i.jsxs)(xc,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(fr,{font:"gray900 textSm medium",children:e.position.name}),(0,i.jsx)(fr,{color:"gray500",children:e.position.positionCategoryName})]}),(0,i.jsx)(xc,{children:(0,i.jsx)(Gd,{color:e.position.assignedResources>=e.position.resources?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.position.assignedResources,e.position.resources)})})]})},zF=e=>{const t=Ln(),[n,o,s]=Ec(""),[r,a]=(0,F.useState)(0),[l,d]=(0,F.useState)(null),{data:c,isLoading:u}=Vn("query MassPreAssignPositions(\n    $eventId: EventId!\n    $name: String\n    $offset: Int\n    $sort: PositionsSort\n) {\n    event(id: $eventId) {\n        positions(name: $name, limit: 25, offset: $offset, sort: $sort) {\n            nodes {\n                id\n                name\n                positionCategoryName\n                assignedResources\n                resources\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{eventId:e.eventId,name:h(o)?o:void 0,offset:r,sort:l},[]);const{numberOfPages:m,totalCount:g}=lu(c.event?.positions);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_une_69998"),value:n,onChange:e=>{a(0),s(e)}})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{css:{paddingRight:0},width:48}),(0,i.jsx)(tm,{attribute:at.Name,setSort:e=>{d(e),a(0)},sort:l,children:t("nom_de_la_missi_64605")}),(0,i.jsx)(Tc,{})]}),numberOfPages:m,offset:r,rows:u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):c.event.positions.nodes.map(t=>(0,i.jsx)(TF,{change:e.change,position:t,positionsIds:e.values.massPreAssign.positionsIds},t.id)),setOffset:a,title:(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{children:t("s_lectionner_le_26300")}),(0,i.jsx)(fr,{font:"gray500 textSm regular",children:t("les_membres_s_l_63510")})]}),totalCount:g}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{onClick:e.handleSubmit,children:t("pr_affecter_le_81533",e.numberOfSelected)})})]})},$F=e=>{const t=Ln(),n=Nn(AF),{mutate:o}=va();return(0,i.jsx)(Mk,{children:(0,i.jsx)(bm,{category:t("pr_affectation_12256"),title:t("pr_affecter_le_71377"),onClose:e.onClose,children:(0,i.jsx)(Im,{children:(0,i.jsxs)(kv,{initialValues:{massPreAssign:{level:Qe.Categories,selecteds:e.selecteds,strategy:Je.Add,positionsIds:[],positionsCategoriesIds:[]}},isEdit:!1,onSubmit:async n=>{const i=(await o({eventId:e.eventId,massPreAssign:n.massPreAssign})).numberOfMembers;e.onSuccess(t("_1_membres_ont_49355",i)),e.onClose()},children:[(0,i.jsx)(yv,{render:({handleSubmit:e})=>(0,i.jsx)(wF,{handleSubmit:e}),schema:n.massPreAssignStep1Schema(),title:t("initialisation_38640")}),(0,i.jsx)(yv,{render:t=>t.values.massPreAssign.level===Qe.Categories?(0,i.jsx)(EF,{change:t.form.change,eventId:e.eventId,handleSubmit:t.handleSubmit,numberOfSelected:e.numberOfSelected,values:t.values}):(0,i.jsx)(zF,{change:t.form.change,eventId:e.eventId,handleSubmit:t.handleSubmit,numberOfSelected:e.numberOfSelected,values:t.values}),schema:n.massPreAssignStep2Schema(),title:t("pr_affectation_68999")})]})})})})},OF=e=>{const t=Ln(),{mutate:n,isLoading:o}=Gs(),[s,r]=(0,F.useState)(Et.WaitingAssignment);return(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ea,{justify:"center",children:(0,i.jsx)(mj,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("mettre_jour_l_82143")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(gu,{label:t("nouveau_statut_57871"),value:s,onChange:e=>{r(e)},children:[(0,i.jsx)("option",{value:Et.NotApplicable,children:t(Et.NotApplicable)}),(0,i.jsx)("option",{value:Et.Refused,children:t(Et.Refused)}),(0,i.jsx)("option",{value:Et.WaitingAssignment,children:t(Et.WaitingAssignment)})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{isLoading:o,onClick:async()=>{const i=(await n({eventId:e.eventId,massStateUpdate:{selecteds:e.selecteds,state:s}})).numberOfMembers;e.onSuccess(t("le_statut_d_aff_39000",i,t(s))),e.onClose()},children:t("modifier_le_sta_94473")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},RF=e=>{const{translate:t,params:{eventId:n}}=il(),{organization:o,hasFeature:s}=nI(),{showNotification:r}=Yv(),{mutate:a}=As(),{mutate:l}=Rs(),{data:d}=Vn("query VolunteerActions($eventId: EventId!) {\n    event(id: $eventId) {\n        hasDelegations\n        hasForms\n    }\n}\n",{eventId:n},[]),[c,u]=(0,F.useState)(!1),[m,g]=(0,F.useState)(!1),[p,f]=(0,F.useState)(!1),[x,_]=(0,F.useState)(!1),[I,v]=(0,F.useState)(!1),[b,j]=(0,F.useState)(!1),[C,y]=(0,F.useState)(!1),[k,A]=(0,F.useState)(!1),[w,S]=(0,F.useState)(!1),[E,T]=(0,F.useState)(!1),[z,$]=(0,F.useState)(!1),[O,R]=(0,F.useState)(!1),[P,D]=(0,F.useState)(!1),M=e.massActions.getSelectedsInput(e.predicates,null),N=e.massActions.isAllSelected?e.totalNumberOfMembers:e.massActions.numberOfSelected,L=(0,F.useCallback)(t=>{h(t)&&r(t),e.onMassEditSuccess()},[e.onMassEditSuccess]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{css:{flex:"1"}}),(0,i.jsx)(pl,{onClick:()=>{u(!0)},children:t("_diter_un_champ_64621")}),!e.showOnlyMassEdit&&(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"wand-magic-sparkles",onClick:()=>{_(!0)}})})}),(0,i.jsx)(am,{placement:"top",children:t("affecter_1_me_24704",N)})]}),!e.showOnlyMassEdit&&s(Fe.Accreditation)&&(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"badge-check",onClick:()=>{v(!0)}})})}),(0,i.jsx)(am,{placement:"top",children:t("accr_diter_1_13773",N)})]}),!e.showOnlyMassEdit&&(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Pd,{maxHeight:400,placement:"bottom-end",children:[(0,i.jsx)(wR,{children:t("gestion_des_mem_51660")}),(0,i.jsx)(Od,{icon:"merge",onClick:()=>{g(!0)},children:t("fusionner_les_m_37150")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(wR,{children:t("affectation_plural")}),(0,i.jsx)(Od,{icon:"wand-magic-sparkles",onClick:()=>{f(!0)},children:t("changer_le_stat_39694")}),(0,i.jsx)(Od,{icon:"wand-magic-sparkles",onClick:()=>{y(!0)},children:t("pr_affecter_1_62649",N)}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(s(Fe.Accreditation)||s(Fe.Delegation))&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wR,{children:t("accr_ditations_39450")}),s(Fe.Accreditation)&&(0,i.jsx)(Od,{icon:"badge-check",onClick:()=>{A(!0)},children:t("changer_le_stat_27596")}),s(Fe.Delegation)&&(0,i.jsx)(Od,{icon:"people-group",isDisabled:!d.event?.hasDelegations,onClick:()=>{S(!0)},children:t("ajouter_1_mem_86218",N)}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"})]}),(0,i.jsx)(wR,{children:t("communication_05277")}),(0,i.jsx)(Od,{icon:"file-lines",isDisabled:!d.event?.hasForms,onClick:()=>{T(!0)},children:t("ajouter_1_mem_52947",N)}),(0,i.jsx)(Od,{icon:"file-lines",isDisabled:!d.event?.hasForms,onClick:()=>{$(!0)},children:t("marquer_un_form_10633")}),(0,i.jsx)(Od,{icon:"paper-plane",onClick:()=>{R(!0)},children:t("SendCampaign")}),(0,i.jsx)(Od,{icon:"file",onClick:()=>D(!0),children:t("exporter_un_doc_23130")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{j(!0)},children:t("d_sinscrire_de_06416")})]})]}),c&&(0,i.jsx)(Pk,{mutate:e=>a({organizationId:o.id,eventId:n,massEdit:e}),organizationId:o.id,selecteds:M,onClose:()=>{u(!1)},onSuccess:e=>{L(t("_1_membres_ont_07596",e))}}),m&&(0,i.jsx)(OR,{numbersOfSelected:N,organizationId:o.id,usersInfosIds:M.ids||[],onClose:()=>g(!1),onSuccess:L}),p&&(0,i.jsx)(OF,{eventId:n,selecteds:M,onClose:()=>{f(!1)},onSuccess:L}),x&&(0,i.jsx)(kF,{eventId:n,numberOfSelected:N,selecteds:M,onClose:()=>{_(!1)},onSuccess:L}),I&&(0,i.jsx)(Qk,{eventId:n,numberOfSelected:N,selecteds:M,onClose:()=>{v(!1)},onSuccess:L}),C&&(0,i.jsx)($F,{eventId:n,numberOfSelected:N,selecteds:M,onClose:()=>{y(!1)},onSuccess:L}),b&&(0,i.jsx)(kk,{buttonText:t("d_sinscrire_27046"),subtext:[t("_tes_vous_s_r_d_46029")],text:t("d_sinscription_66971",N),onClose:()=>{j(!1)},onDelete:async()=>{const e=(await l({eventId:n,selecteds:M})).numberOfMembers;L(t("_1_membres_ont_85190",e))}}),k&&(0,i.jsx)(xF,{eventId:n,selecteds:M,onClose:()=>{A(!1)},onSuccess:L}),E&&(0,i.jsx)(ER,{eventId:n,organizationId:o.id,selecteds:M,onClose:()=>{T(!1)},onSuccess:L}),z&&(0,i.jsx)(TR,{eventId:n,organizationId:o.id,selecteds:M,onClose:()=>{$(!1)},onSuccess:L}),w&&(0,i.jsx)(SR,{eventId:n,organizationId:o.id,selecteds:M,onClose:()=>{S(!1)},onSuccess:L}),O&&(0,i.jsx)(tA,{eventId:n,organizationId:o.id,selecteds:M,onClose:()=>{R(!1)},onSuccess:L}),P&&(0,i.jsx)(fF,{eventId:n,selecteds:M,onClose:()=>D(!1),onSuccess:e.onMassEditSuccess})]})},PF=e=>{const{params:{organizationId:t,eventId:n}}=il(),{hasFeature:o}=nI(),s=Nn(Eh),{isEventAdmin:r}=Uv(),[a,l]=ET("accreditationMembers.columns",[wh.Name,wh.Accreditations]),[d,c]=ET("accreditationMembers.limit",_c),[u,h]=ET("accreditationMembers.predicates",[]),[m,g]=ET("accreditationMembers.sort",null),{data:p}=Hs({organizationId:t,eventId:n,privacy:fe.All,loadForms:!1,loadSegments:!1}),f=(0,F.useMemo)(()=>p.organization?.customFields.nodes??[],[p.organization]),x=SC(f),_=(0,F.useMemo)(()=>p.event?s.getAccreditationMembersFilters(t,n,f,p.event,{hasDelegations:o(Fe.Delegation)}):[],[n,f,p.event]),I=(0,F.useMemo)(()=>s.getAccreditationMembersPossibleColumns(f),[f]);return(0,i.jsx)(yC,{children:(0,i.jsx)(Zh,{columns:a,columnsSearch:[],columnsToIncludes:Sh,eventId:n,filters:_,getMassActionId:e=>e.userInfo.id,limit:d,loadDataList:Xs,loadDataListParams:{accreditationCategoryId:e.accreditationCategoryId,accreditationId:e.accreditationId,accreditationSlotId:e.accreditationSlotId,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:Ks,loadRowParams:{includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:t,possibleColumns:I,predicates:u,renderActions:(e,t,n)=>(0,i.jsx)(RF,{massActions:e,predicates:null,showOnlyMassEdit:!0,totalNumberOfMembers:t,onMassEditSuccess:n}),rendering:yh.List,setColumns:l,setLimit:c,setPredicates:h,setSort:g,showEditColumns:!0,showEditMode:r,showFilters:!0,showMassActions:r,showRowDropdown:r,showRowEdit:r,showSearchColumns:!1,sort:m,children:(0,i.jsx)(cm,{renderCell:(e,t,o)=>(0,i.jsx)(My,{canAccredit:!0,canAssign:!0,canChangeDelegation:!0,canClickMemberName:!0,column:e,customField:x.get(e.slug),eventId:n,reloadRow:o,row:t})})})})},DF=e=>{const{params:{organizationId:t,eventId:n,accreditationId:o},translate:s}=il();Cd(e.event.accreditation.name);const r=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":n,accreditationId:e?":accreditationId":o});return(0,i.jsxs)(AC,{children:[(0,i.jsx)(GD,{accreditation:e.event.accreditation}),(0,i.jsxs)(Vy,{css:{flex:"1"},children:[(0,i.jsxs)(Ly,{css:{px:"$7"},children:[(0,i.jsx)(Ny,{path:Hi.ACCREDITATION_DASHBOARD(r(!1)),children:s("tableau_de_bord_24627")}),(0,i.jsx)(Ny,{path:Hi.ACCREDITATION_MEMBERS(r(!1)),children:s("membres_125561",e.event.volunteersRegistrations.totalCount)})]}),(0,i.jsx)(By,{path:Hi.ACCREDITATION_DASHBOARD(r(!0)),children:(0,i.jsx)(pF,{})}),(0,i.jsx)(By,{path:Hi.ACCREDITATION_MEMBERS(r(!0)),children:(0,i.jsx)(PF,{accreditationId:o})})]})]})},FF=()=>{const{params:{organizationId:e,eventId:t,accreditationId:n}}=il(),{data:o,loader:s}=Vn("query Accreditation($eventId: EventId!, $accreditationId: AccreditationId!) {\n    event(id: $eventId) {\n        accreditation(id: $accreditationId) {\n            id\n            name\n            assignedResources\n            hasSlots\n            acronym\n        }\n\n        volunteersRegistrations(accreditationId: $accreditationId) {\n            totalCount\n        }\n    }\n}\n",{eventId:t,accreditationId:n},[]);return s||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{exact:!0,path:Hi.ACCREDITATION({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId"}),children:(0,i.jsx)(Yn,{path:Hi.ACCREDITATION_DASHBOARD({organizationId:e,eventId:t,accreditationId:n}),replace:!0})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(DF,{event:o.event})})]})},MF=e=>{const t=Ln(),n=e.isEdit?"0px":e.isLeftPanelOpen?"280px":"68px",o=e.isRightPanelOpen?"360px":"68px";return(0,i.jsxs)(Jl,{css:{overflow:"hidden"},gridtemplatecolumns:`${n} 1fr ${o}`,gridtemplaterows:"88px 1fr 72px",height:1,width:1,children:[!e.isEdit&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{css:{borderRight:"1px solid $gray200",gridColumn:"1 / 2",gridRow:"1 / 3"},children:e.isLeftPanelOpen&&e.leftPanel}),(0,i.jsx)(Ea,{align:"center",css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",gridColumn:"1 / 2",gridRow:"3 / 4",padding:e.isLeftPanelOpen?"$4":"0"},justify:e.isLeftPanelOpen?"end":"center",children:(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"sidebar",onClick:()=>{e.setIsLeftPanelOpen(!e.isLeftPanelOpen)}})})}),(0,i.jsx)(am,{placement:"top",children:e.isLeftPanelOpen?t("cacher_la_liste_66205"):t("afficher_la_lis_14277")})]})})]}),(0,i.jsx)(fr,{css:{gridColumn:"2 / 4",gridRow:"1 / 2"},children:e.header}),(0,i.jsx)(fr,{css:{borderTop:"1px solid $gray200",gridColumn:"2 / 3",gridRow:"2 / 3",overflowY:"auto"},children:e.children}),(0,i.jsx)(fr,{css:{gridColumn:"2 / 3",gridRow:"3 / 4"},children:e.buttons}),(0,i.jsx)(fr,{css:{borderLeft:"1px solid $gray200",borderTop:"1px solid $gray200",gridColumn:"3 / 4",gridRow:"2 / 4",overflowY:"auto"},children:e.isRightPanelOpen?e.rightPanel:(0,i.jsx)(Ea,{css:{paddingTop:"$6"},height:1,justify:"center",width:1,children:(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:()=>{e.setIsRightPanelOpen(!0)},children:(0,i.jsx)(Va,{icon:"sidebar"})})}),(0,i.jsx)(am,{placement:"top",children:t("afficher_les_in_82197")})]})})})]})},NF=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,userInfoId:r}}=il(),a=Nn($c),l=(0,F.useMemo)(()=>e.teams.find(t=>t.leaderUserInfoId===e.userInfo.id),[e.teams,e.userInfo]),d=(0,F.useMemo)(()=>e.teams.flatMap(e=>e.members.flatMap(e=>e.userInfo.id===r?[]:[e.userInfo])),[e.teams]);return(0,i.jsxs)(Ea,{align:"center",css:{padding:"$5 $6"},gap:"4",children:[(0,i.jsxs)(fr,{css:{position:"relative"},children:[(0,i.jsx)(Fg,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:32}),(0,i.jsx)(Ea,{align:"center",css:{background:lr.colors[`${e.badgeColorIcon.color}100`].value,border:"2px solid white",borderRadius:"16px",bottom:"-6px",color:lr.colors[`${e.badgeColorIcon.color}700`].value,fontSize:"8px",position:"absolute",right:"-6px"},height:16,justify:"center",width:16,children:(0,i.jsx)(Va,{icon:e.badgeColorIcon.leftIcon})})]}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(La,{to:kI.MEMBER_INFORMATION({organizationId:o,eventId:s,userInfoId:r}),children:(0,i.jsx)(fr,{css:{cursor:"pointer","&:hover":{textDecoration:"underline"}},font:"gray900 textXl medium",children:e.userInfo.name})}),(0,i.jsxs)(fr,{color:"gray500",children:["(",e.userInfo.email,")"]}),e.showTeam&&l&&(0,i.jsx)(Gd,{leftIcon:"shield",children:n("chef_d_quipe_20641")})]}),(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{color:"gray500",children:a.toLocaleString(e.insertedAt,Ho.DateOnly.MonthLong)}),e.showTeam&&Zo(e.teams)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray500",children:"•"}),(0,i.jsx)(fr,{color:"gray500",children:n("_quipe_1_07445",e.teams[0].teamCode)}),(0,i.jsx)(fr,{color:"gray500",children:"•"}),(0,i.jsx)(Oy,{teamMembers:d})]})]})]}),e.showTabs&&(0,i.jsx)(fr,{width:320,children:(0,i.jsxs)(rv,{selectedItem:e.isPreAssign?"preassign":"affect",onChange:n=>{"preassign"!==n||e.isPreAssign?"affect"===n&&e.isPreAssign&&t.replace(So.ASSIGNMENT(o,s,r)):t.replace(So.PRE_ASSIGNMENT(o,s,r))},children:[(0,i.jsx)(av,{item:"affect",children:n("affecter_94255")}),(0,i.jsx)(av,{item:"preassign",children:n("pr_affecter_17434")})]})})]})},LF=e=>{const t=Ln(),n=Nn($c);return(0,i.jsxs)(Ea,{align:"center",css:{background:e.isSelected?"$primary100":"white",borderBottom:e.displayBorder?"1px solid $gray200":"none",cursor:"pointer",padding:"$4","&:hover":{background:"$primary100"}},gap:"3",onClick:e.onClick,children:[(0,i.jsx)(Fg,{email:e.vr.userInfo.email,image:e.vr.userInfo.picture?.url,name:e.vr.userInfo.name,size:40}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray800 textSm semiBold",children:e.vr.userInfo.name}),(0,i.jsx)(fr,{children:t("inscrit_le_1_12018",n.toLocaleString(e.vr.insertedAt,Ho.DateOnly.MonthLong))})]})]})},BF=()=>(0,i.jsxs)(Ea,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4"},gap:"3",children:[(0,i.jsx)(qd,{size:40,variant:"circular"}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1})]})]}),VF=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=il(),r=e.event?.delegations?.nodes??[],a=e.event?.segmentsFolders??[],l=e.event?.volunteersRegistrations.totalCount??0,d=e.event?.volunteersRegistrations.nodes??[];return(0,i.jsxs)(Ea,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ea,{css:{padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(yb,{color:"primary",returnPathFallback:Hi.ACCREDITATIONS({organizationId:n,eventId:o}),children:s("retour_92202")}),(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{font:"gray900 textLg medium",children:s("affectation_plural")}),(0,i.jsx)(Gd,{color:"error",size:"sm",children:s("profil_restant",l)})]})]}),(0,i.jsxs)(Ea,{css:{px:"$4"},gap:"4",children:[(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:s("rechercher_50038"),value:e.name,onChange:e.setName})}),(0,i.jsxs)(Ed,{doNotCloseOnOtherOpen:!0,children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"bars-filter"})}),(0,i.jsx)(Pd,{css:{padding:"0"},placement:"bottom",children:(0,i.jsxs)(Ea,{css:{padding:"$4 $6"},direction:"column",gap:"4",width:320,children:[(0,i.jsx)(fr,{font:"gray800 textMd medium",children:s("liste_des_filtr_75605")}),(0,i.jsxs)(gu,{label:s("date_d_inscript_31369"),value:e.direction,onChange:e.setDirection,children:[(0,i.jsx)("option",{value:_t.Desc,children:s("du_plus_r_cent_76468")}),(0,i.jsx)("option",{value:_t.Asc,children:s("du_plus_ancien_08999")})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(yl,{children:s("vue_personnalis_97654")}),e.isLoading?(0,i.jsx)(qd,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(dc,{isSearchVisible:!0,multiple:!1,renderOnPortal:!0,values:[e.segmentId],onChange:t=>{Zo(t)?e.setSegmentId((0,Vc.A)(t)):e.setSegmentId(-1)},children:a.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})]}),e.showStates&&(0,i.jsxs)(dc,{isSelectAllVisible:!0,label:s("status_d_affect_75769"),multiple:!0,values:e.states,onChange:e.setStates,children:[(0,i.jsx)("option",{value:Et.WaitingAssignment,children:s(Et.WaitingAssignment)}),(0,i.jsx)("option",{value:Et.PreAssigned,children:s(Et.PreAssigned)}),(0,i.jsx)("option",{value:Et.Assigned,children:s(Et.Assigned)})]}),e.showAccreditationStates&&(0,i.jsxs)(dc,{isSelectAllVisible:!0,label:s("statut_d_accr_d_75527"),multiple:!0,values:e.accreditationStates,onChange:e.setAccreditationStates,children:[(0,i.jsx)("option",{value:ae.WaitingAccreditation,children:s(ae.WaitingAccreditation)}),(0,i.jsx)("option",{value:ae.AutoAccredited,children:s(ae.AutoAccredited)}),(0,i.jsx)("option",{value:ae.Accredited,children:s(ae.Accredited)})]}),e.loadDelegations&&(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(yl,{children:s("Delegation")}),e.isLoading?(0,i.jsx)(qd,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(dc,{isSearchVisible:!0,multiple:!1,renderOnPortal:!0,values:e.delegationId?[e.delegationId]:[],onChange:t=>{Zo(t)?e.setDelegationId((0,Vc.A)(t)):e.setDelegationId(null)},children:r.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})]})})]})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(Ea,{css:{flex:"1",overflowY:"auto"},direction:"column",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(BF,{}),(0,i.jsx)(BF,{}),(0,i.jsx)(BF,{})]}):d.map(n=>(0,i.jsx)(LF,{displayBorder:!0,isSelected:n.userInfo.id===e.userInfoId,vr:n,onClick:()=>{t.push(e.getPath(n.userInfo.id))}},n.userInfo.id))})]})},UF=e=>{const[t,n]=F.useState(e.isOpen??!0),o=F.useCallback(t=>{e.setIsOpen?.(t),n(t)},[e.setIsOpen,n]);return F.useEffect(()=>{"boolean"==typeof e.isOpen&&n(e.isOpen)},[e.isOpen]),(0,i.jsxs)(Ea,{css:{borderTop:"1px solid $gray200",padding:"$6",...e.css},direction:"column",gap:"4",children:[(0,i.jsxs)(Ea,{align:"center",css:{cursor:"pointer",userSelect:"none",...e.titleCss},gap:"4",onClick:()=>{o(!t)},children:[(0,i.jsx)(fr,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(Va,{icon:t?"chevron-down":"chevron-right"})}),(0,i.jsx)(Ea,{css:{color:"$gray800",flex:"1",fontWeight:"$semiBold"},children:e.title})]}),t&&e.children]})},WF=e=>{const t=Ln(),n=Nn($c),[o,s]=ET("assignment.rightPanel.areAccreditationsOpen",!0),r=(0,F.useMemo)(()=>function(e,t,n,i){return e.flatMap(e=>e.accreditationsSlots.map(e=>{const o=ph(t,e,e.accreditation.name,{defaultName:"-"});return{name:e.accreditation.name,subtitle:o,path:Hi.ACCREDITATION({organizationId:n,eventId:i,accreditationId:e.accreditation.id})}}))}(e.formsUsersInfos,n,e.organizationId,e.eventId),[e.formsUsersInfos,e.organizationId,e.eventId]);return(0,i.jsx)(UF,{isOpen:o,setIsOpen:s,title:t("accr_ditations_74375"),children:(0,i.jsxs)(mc,{children:[(0,i.jsx)(cc,{children:(0,i.jsx)(Tc,{children:t("accr_ditation_s_00595")})}),r.map((e,t)=>(0,i.jsx)(Cc,{children:(0,i.jsxs)(xc,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(fr,{color:"gray900",fontWeight:"medium",children:e.name}),(0,i.jsx)(fr,{color:"gray500",children:e.subtitle})]})},t))]})})},GF=e=>{const t=Nn($c);return(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsxs)(Ea,{justify:"between",children:[(0,i.jsx)(fr,{font:"gray800 textXs medium",children:e.comment.writtenBy.userInfo.name}),(0,i.jsx)(fr,{font:"gray500 textXs regular",children:t.toLocaleString(e.comment.insertedAt,{...Ho.DateTime,month:"numeric"})})]}),(0,i.jsx)(Ea,{css:{background:"$gray100",bd:!0,borderTopLeftRadius:"0",padding:"$2 $3",whiteSpace:"pre-wrap"},children:e.comment.content})]})},HF=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o}}=il(),{data:s,isLoading:r,reload:a}=fa({organizationId:t,userInfoId:o}),{mutate:l,isLoading:d}=pa(),[c,u]=(0,F.useState)(""),{permissions:[h]}=wy(vy({organizationId:t,eventId:n,userInfoId:o}));return(0,i.jsxs)(Ea,{css:{padding:"0 $6 $4 $6"},direction:"column",gap:"3",children:[r?(0,i.jsx)(qd,{borderRadius:"$1",height:40,variant:"rectangular",width:1}):s.organization.userInfo.comments.map(e=>(0,i.jsx)(GF,{comment:e},e.id)),h&&(0,i.jsxs)(nb,{children:[(0,i.jsx)(ib,{children:(0,i.jsx)(pl,{color:"invisible",leftIcon:"plus",children:e("ajouter_un_comm_27671")})}),(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"message",children:e("ajouter_un_comm_27671")}),(0,i.jsx)(Qv,{children:(0,i.jsx)(Em,{label:e("commentaire_08754"),value:c,onChange:u})}),(0,i.jsx)(Jv,{children:s=>(0,i.jsx)(pl,{disabled:m(c),isLoading:d,onClick:async()=>{await l({organizationId:t,eventId:n,userInfoId:o,comment:{content:c}}),a(),s()},children:e("ajouter_97327")})})]})]})]})},qF=e=>{const t=Ln(),[n,o]=ET("assignment.rightPanel.areInformationsOpen",!0);return(0,i.jsxs)(UF,{isOpen:n,setIsOpen:o,title:e.title,children:[(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(ZT,{children:t("Email")}),(0,i.jsx)(fr,{color:"gray500",css:{ellipsis:!0,fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:e.userInfo.email})]}),e.customFields.map(t=>(0,i.jsx)(XT,{field:t,fields:e.userInfo.fields},t.id)),e.formsIds.map(n=>{const o=JT(n,t);return h(e.userInfo.fields[o.slug])?(0,i.jsx)(XT,{field:o,fields:e.userInfo.fields},o.slug):null})]})},YF=e=>{const t=Ln(),n=Nn(Ku),[o,s]=ET("assignment.rightPanel.arePositionsOpen",!0),r=(0,F.useMemo)(()=>ak(e.formsUsersInfos,n,e.organizationId,e.eventId),[e.formsUsersInfos,e.organizationId,e.eventId]);return(0,i.jsx)(UF,{isOpen:o,setIsOpen:s,title:t("missions_souhai_23225"),children:(0,i.jsxs)(mc,{children:[(0,i.jsx)(cc,{children:(0,i.jsx)(Tc,{children:t("mission_souhait_49168")})}),r.map((e,n)=>(0,i.jsx)(Cc,{children:(0,i.jsxs)(xc,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{color:"gray900",fontWeight:"medium",children:e.name}),e.form.positionRanking===Ue.Ranked&&(0,i.jsx)(Gd,{children:t("choix_n_1_00613",e.rank)})]}),(0,i.jsx)(fr,{color:"gray500",children:e.range})]})},n))]})})},KF=e=>{const t=Ln(),n=Nn($c),o=Nn(Ku),[s,r]=ET("assignment.rightPanel.areAvailabilitiesOpen",!0),a=(0,F.useMemo)(()=>(0,Zd.A)(e.formsUsersInfos.flatMap(e=>e.slots.map(t=>({display:e.form.slotDisplay,slot:t}))),({slot:e})=>e.range.start.toMillis()).map(({display:e,slot:t})=>e===gt.Calendar||e===gt.DisplayDays?n.toLocaleString(t.range.start,Ho.DateOnly.MonthLong):o.toDisplayString(t.range)),[n,o,e.formsUsersInfos]);return(0,i.jsx)(UF,{isOpen:s,setIsOpen:r,title:t("disponibilit_s_49923"),children:(0,i.jsxs)(mc,{children:[(0,i.jsx)(cc,{children:(0,i.jsx)(Tc,{children:t("disponibilit_92461")})}),a.map((e,t)=>(0,i.jsx)(Cc,{children:(0,i.jsx)(xc,{children:(0,i.jsx)(fr,{color:"gray900",fontWeight:"medium",children:e})})},t))]})})},ZF=e=>{const t=Ln(),n=(0,F.useMemo)(()=>e.formsUsersInfos.map(e=>e.form.id),[e.formsUsersInfos]);return(0,i.jsxs)(Ea,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ea,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:e.onCollapse,children:(0,i.jsx)(Va,{icon:"sidebar"})})}),(0,i.jsx)(am,{placement:"top",children:t("cacher_les_info_51832")})]}),(0,i.jsx)(fr,{font:"gray900 textMd semiBold",children:t("_propos_de_1_50761",e.userInfo.name)})]}),(0,i.jsx)(HF,{}),(0,i.jsx)(qF,{customFields:e.customFields,formsIds:n,title:t("informations_22954"),userInfo:e.userInfo}),(0,i.jsx)(KF,{formsUsersInfos:e.formsUsersInfos}),e.showWishedPositions&&(0,i.jsx)(YF,{eventId:e.eventId,formsUsersInfos:e.formsUsersInfos,organizationId:e.organizationId}),e.showWishedAccreditations&&(0,i.jsx)(WF,{eventId:e.eventId,formsUsersInfos:e.formsUsersInfos,organizationId:e.organizationId})]})},XF=F.createContext({}),JF=e=>{const[t,n]=F.useState(e.accreditationsSlotsIds);return(0,i.jsx)(XF.Provider,{value:{accreditationsSlotsIds:t,isEdit:e.isEdit,showNextMember:e.showNextMember,setAccreditationsSlotsIds:n},children:e.children})};function QF(){return F.useContext(XF)}const eM=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=il(),{accreditationsSlotsIds:r,showNextMember:a}=QF(),{mutate:l,isLoading:d}=Vs(),{mutate:c,isLoading:u}=ps(),h=(0,F.useCallback)(()=>{e.isEdit?t.goBack(So.VOLUNTEERS(n,o)):a()},[e.isEdit,a]);return(0,i.jsxs)(Ea,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,justify:"end",width:1,children:[(0,i.jsx)(fr,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{u||d||(await l({eventId:o,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:ae.Refused}}),h())},children:s("refuser_92819")}),(0,i.jsx)(fr,{css:{flex:"1"}}),(0,i.jsx)(pl,{color:"primary",isLoading:u,onClick:async()=>{u||d||(Zo(r)?await c({eventId:o,massAccredit:{accreditationsSlotsIds:r,selecteds:{ids:[e.userInfoId]},strategy:Je.Replace}}):await l({eventId:o,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:ae.WaitingAccreditation}}),h())},children:e.isEdit?s("mettre_jour_l_11622"):s("accr_diter_70543")}),(0,i.jsx)(pl,{color:"white",onClick:h,children:e.isEdit?s("annuler_48254"):s("accr_diter_plus_19053")})]})},tM=({slots:e})=>{const{accreditationsSlotsIds:t,setAccreditationsSlotsIds:n}=QF(),{minDate:o,maxDate:s,numberOfMonths:r}=(0,F.useMemo)(()=>xh(e),[e]),a=(0,F.useMemo)(()=>e.flatMap(e=>e.date?.isValid&&t.includes(e.id)?[e.date]:[]),[e,t]),l=(0,F.useMemo)(()=>e.flatMap(e=>e.isBlocked?[e.date]:[]),[e]);return(0,i.jsx)(Ea,{css:{background:"$gray50",borderTop:"1px solid $gray200",padding:"$4"},gap:"4",wrap:"wrap",children:(0,vc.A)(0,r).map(d=>{const c=o.plus({month:d}).startOf("month"),u=0===d?o:c,h=d===r-1?s:c.endOf("month"),m=a.filter(e=>e.startOf("month").equals(c));return(0,i.jsx)(Uk,{disabledDates:l,firstDayOfMonth:c,max:h,min:u,values:m,onChange:i=>{n(_h(t,e,c,i))}},d)})})},nM=e=>{const t=Nn($c),n=Nn(Hk),{accreditationsSlotsIds:o,setAccreditationsSlotsIds:s}=QF(),r=(0,F.useMemo)(()=>Ih(e.slots),[e.slots]),a=(0,F.useCallback)(t=>{e.isRadio?s([...(0,Xd.A)(o,...r.map(e=>e.id)),t]):s(Qo(o,t))},[e.isRadio,r,o,s]);return(0,i.jsx)(Ea,{direction:"column",children:r.map(s=>{const r=o.includes(s.id)?"checked":"unchecked",l=e.delegationAccreditations?.find(e=>e.accreditationSlotId===s.id),{assignedResources:d,isMaxedOut:c,limitIcon:u,maxResources:h,percent:m}=hF(l,s),g=void 0!==m?(d+(o.includes(s.id)?1:0))/h:void 0;return(0,i.jsxs)(Ea,{css:{borderTop:"1px solid $gray200",padding:"$4 $6"},children:[(0,i.jsx)(fr,{css:{flex:"1"},children:e.isRadio?(0,i.jsx)(sc,{disabled:c&&"unchecked"===r,state:r,onClick:()=>{a(s.id)},children:(0,i.jsx)(fr,{css:{textTransform:"capitalize"},children:ph(t,s,"",{date:{localeFormat:Ho.DateOnly.WeekdayLongMonthLong}})})}):(0,i.jsx)(nc,{disabled:s.isBlocked||c&&"unchecked"===r,state:r,onClick:()=>{a(s.id)},children:(0,i.jsx)(fr,{css:{textTransform:"capitalize"},children:ph(t,s,"",{date:{localeFormat:Ho.DateOnly.WeekdayLongMonthLong}})})})}),(0,i.jsx)(Pa,{width:"2"}),(0,i.jsx)(fr,{color:"gray700",css:{marginBlockStart:"2px"},fontSize:"textXs",children:(0,i.jsx)(Va,{icon:"user-group"})}),(0,i.jsx)(Pa,{width:"1"}),(0,i.jsxs)(fr,{color:"gray700",children:[d+(o.includes(s.id)?1:0),"/",n.toNumberOrInfinity(h)]}),(0,i.jsx)(Pa,{width:"2"}),(0,i.jsx)(fr,{color:"gray400",textAlign:"center",children:h!==1/0&&(0,i.jsxs)(i.Fragment,{children:["[",u,"]"]})}),(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(fr,{css:{marginTop:"auto",marginBottom:"auto"},width:120,children:void 0!==m&&(0,i.jsx)(YA,{percent:m,prospectivePercent:g})}),(0,i.jsx)(Pa,{width:"3"}),(0,i.jsx)(fr,{color:"gray700",textAlign:"end",width:36,children:void 0!==(g??m)&&(0,i.jsxs)(i.Fragment,{children:[Math.min(100,Math.round(100*(g??m))),"%"]})})]},s.id)})})},iM=({accreditation:e,delegationAccreditations:t,slots:n})=>{const{translate:o}=il(),s=Nn(Hk),{accreditationsSlotsIds:r,setAccreditationsSlotsIds:a}=QF(),[l,d]=F.useState(!0),c=F.useMemo(()=>n.map(e=>e.id),[n]),u=F.useMemo(()=>n.every(e=>r.includes(e.id)),[n,r]),h=e.accreditationDisplay,m=e.hasSlots,g=n[0],p=F.useMemo(()=>t?.find(e=>e.accreditationSlotId===g.id),[e,t,g]),{assignedResources:f,isMaxedOut:x,limitIcon:_,maxResources:I,percent:v}=hF(p,g),b=I!==1/0?r.length/I:void 0,j=r.includes(g.id)?"checked":"unchecked",C=F.useCallback(e=>{Il(e),a(u?(0,Jd.A)(r,c):(0,Oo.A)(r.concat(c)))},[c,r,u,a]),y=F.useCallback(e=>{Il(e),a((0,Jd.A)(r,c))},[c,r,a]);return(0,i.jsxs)(Ea,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Ea,{align:"center",css:{cursor:"pointer",padding:"$4 $6",userSelect:"none"},width:1,onClick:()=>{x||(m?d(!l):a(Qo(r,g.id)))},children:[m?(0,i.jsx)(Va,{icon:l?"chevron-down":"chevron-right"}):(0,i.jsx)(tc,{disabled:x,shouldPreventDefault:!1,state:j,onClick:Bl.A}),(0,i.jsx)(Pa,{width:"4"}),(0,i.jsx)(Xj,{color:e.color,icon:e.icon}),(0,i.jsx)(Pa,{width:"3"}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:e.name}),m&&(0,i.jsx)(fr,{color:"gray500",children:o("creneau",n.length)})]}),m?h===ne.List?(0,i.jsx)(pl,{color:"invisible",onClick:C,children:o(u?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")}):h===ne.Radio?(0,i.jsx)(pl,{color:"invisible",onClick:y,children:o("r_initialiser_77538")}):null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{width:"2"}),(0,i.jsx)(fr,{color:"gray700",fontSize:"textXs",children:(0,i.jsx)(Va,{icon:"user-group"})}),(0,i.jsx)(Pa,{width:"2"}),(0,i.jsxs)(fr,{color:"gray700",children:[f+(r.includes(n[0].id)?1:0),"/",s.toNumberOrInfinity(I)]}),(0,i.jsx)(Pa,{width:"2"}),(0,i.jsx)(fr,{color:"gray400",textAlign:"center",children:I!==1/0&&(0,i.jsxs)(i.Fragment,{children:["[",_,"]"]})}),(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(fr,{css:{marginBlock:"auto"},width:120,children:void 0!==v&&(0,i.jsx)(YA,{percent:v||0,prospectivePercent:b})}),(0,i.jsx)(Pa,{width:"3"}),(0,i.jsx)(fr,{color:"gray700",textAlign:"end",width:36,children:void 0!==v&&(0,i.jsxs)(i.Fragment,{children:[Math.min(100,Math.round(100*v)),"%"]})})]})]}),m&&l?e.accreditationDisplay===ne.Calendar?(0,i.jsx)(tM,{slots:n}):(0,i.jsx)(nM,{delegationAccreditations:t?.filter(t=>t.accreditationId===e.id),isRadio:h===ne.Radio,slots:n}):null]})},oM=({delegation:e,slots:t})=>{const n=(0,F.useMemo)(()=>(0,Zd.A)(Object.values((0,Kd.A)(t,e=>e.accreditation.id)),e=>[Bj(e[0].accreditation.index),e[0].accreditation.name.toLowerCase()]),[t]);return(0,i.jsx)(Ea,{css:{background:"$gray100",borderTop:"1px solid ^$gray200",padding:"$4"},direction:"column",gap:"2",children:n.map(t=>{const n=t[0].accreditation,o=e?.accreditationsSlots.filter(e=>e.accreditationSlot.accreditation.id===n.id&&void 0!==e.maxResources);return(0,i.jsx)(iM,{accreditation:n,delegationAccreditations:Zo(o)?o:void 0,slots:t},n.id)})})},sM=({category:e,delegation:t,slots:n})=>{const[o,s]=(0,F.useState)(!0);return(0,i.jsxs)(Ea,{css:{bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Ea,{align:"center",css:{background:"white",cursor:"pointer",padding:"$4",userSelect:"none"},gap:"1",onClick:()=>{s(!o)},children:[(0,i.jsx)(Ea,{align:"center",css:{fontSize:"$textXs"},height:32,justify:"center",width:32,children:(0,i.jsx)(Va,{icon:o?"chevron-down":"chevron-right"})}),(0,i.jsx)(fr,{font:"gray800 textMd medium",children:e.name})]}),o&&(0,i.jsx)(oM,{delegation:t,slots:n})]})},rM=({accreditationsSlots:e,delegation:t})=>{const n=(0,F.useMemo)(()=>(0,Zd.A)(Object.values((0,Kd.A)(e,e=>e.accreditationCategory.id)),e=>e[0].accreditationCategory.name.toLowerCase()),[e]);return(0,i.jsx)(Ea,{direction:"column",gap:"4",width:1,children:n.map(e=>{const n=e[0].accreditationCategory;return(0,i.jsx)(sM,{category:n,delegation:t,slots:e},n.id)})})},aM=e=>{const t=Ln(),n=Nn($c),o=(0,F.useMemo)(()=>(e.accreditationsCategoriesIds||[]).map(t=>e.event.accreditationsCategories.find(e=>e.id===t).name).join(", "),[e.accreditationsCategoriesIds,e.event]),s=(0,F.useMemo)(()=>(e.accreditationsIds||[]).map(t=>e.event.accreditations.nodes.find(e=>e.id===t).name).join(", "),[e.accreditationsIds,e.event]),r=(0,F.useMemo)(()=>e.date?n.toLocaleString(e.date,Ho.DateOnly.MonthLong):"",[e.date]),a=(0,F.useMemo)(()=>e.segmentId?e.event.segments.find(t=>t.id===e.segmentId).name:"",[e.segmentId,e.event]),l=(0,F.useMemo)(()=>(e.tagsIds||[]).map(t=>e.organization.tags.nodes.find(e=>e.id===t).name).join(", "),[e.tagsIds,e.organization]);return h(o)||h(s)||h(r)||h(a)||h(l)||e.excludeFull||e.excludePast?(0,i.jsxs)(Ea,{align:"center",gap:"3",wrap:"wrap",children:[h(o)&&(0,i.jsx)(Gd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setAccreditationsCategoriesIds([])},children:t("cat_gories_1_42029",o)}),h(s)&&(0,i.jsx)(Gd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setAccreditationsIds([])},children:t("accr_ditations_30765",s)}),h(r)&&(0,i.jsx)(Gd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setDate(null)},children:t("date_1_17337",r)}),h(a)&&(0,i.jsx)(Gd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setSegmentId(null)},children:t("vue_1_29260",a)}),h(l)&&(0,i.jsx)(Gd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setTagsIds([])},children:t("tags_1_43158",l)}),e.excludeFull&&(0,i.jsx)(Gd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludeFull(!1)},children:t("cr_neaux_comple_77561")}),e.excludePast&&(0,i.jsx)(Gd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludePast(!1)},children:t("cr_neaux_dans_l_92999")}),(0,i.jsx)(fr,{css:{cursor:"pointer"},font:"gray700 textXs medium",onClick:e.reset,children:t("r_initialiser_l_66835")})]}):null},lM=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.accreditationsCategoriesIds),[s,r]=(0,F.useState)(e.accreditationsIds),[a,l]=(0,F.useState)(e.date),[d,c]=(0,F.useState)(e.tagsIds),[u,h]=(0,F.useState)(e.segmentId?[e.segmentId]:[]),[m,g]=(0,F.useState)(e.excludeFull?"checked":"unchecked"),[p,f]=(0,F.useState)(e.excludePast?"checked":"unchecked");return(0,i.jsxs)(Ea,{direction:"column",onChange:e=>{e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:[(0,i.jsxs)(Ea,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(fr,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),(0,i.jsx)(dc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_97056"),renderOnPortal:!0,values:n||[],onChange:o,children:e.event.accreditationsCategories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(dc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_92029"),renderOnPortal:!0,values:s||[],onChange:r,children:e.event.accreditations.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(_u,{max:e.event.endAt,min:e.event.startAt,placeholder:t("date_du_cr_neau_82295"),value:a,onChange:l}),(0,i.jsx)(dc,{isSearchVisible:!0,placeholder:t("s_lectionnez_un_19794"),renderOnPortal:!0,values:u,onChange:e=>{Zo(e)?h([(0,Vc.A)(e)]):h([])},children:e.event.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(dc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_73255"),renderOnPortal:!0,values:d||[],onChange:c,children:e.organization.tags.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(nc,{state:m,onClick:g,children:t("masquer_les_cr_14425")}),(0,i.jsx)(nc,{state:p,onClick:f,children:t("masquer_les_cr_05336")})]}),(0,i.jsxs)(Ea,{align:"center",css:{brderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(fr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{e.reset(),e.close()},children:t("r_initialiser_77538")}),(0,i.jsx)(pl,{size:"sm",onClick:()=>{e.setAccreditationsCategoriesIds(n),e.setAccreditationsIds(s),e.setDate(a),e.setExcludeFull("checked"===m),e.setExcludePast("checked"===p),e.setSegmentId(Zo(u)?u[0]:null),e.setTagsIds(d),e.close()},children:t("appliquer_05753")})]})]})},dM=e=>{const t=Ln(),[n,o]=(0,F.useState)(!1),s=(0,F.useCallback)(()=>{e.setAccreditationsCategoriesIds([]),e.setAccreditationsIds([]),e.setDate(null),e.setExcludeFull(!1),e.setExcludePast(!1),e.setSegmentId(null),e.setTagsIds([])},[e.setAccreditationsCategoriesIds,e.setAccreditationsIds,e.setDate,e.setExcludeFull,e.setExcludePast,e.setSegmentId,e.setTagsIds]);return(0,i.jsxs)(Ea,{direction:"column",gap:"3",width:1,children:[(0,i.jsxs)(Ea,{gap:"3",children:[(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_une_65646"),value:e.name,onChange:e.setName}),(0,i.jsxs)(Ed,{doNotCloseOnOtherOpen:!0,isOpen:n,onStateChange:o,children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"bars-filter",children:t("filtres_64574")})})}),(0,i.jsx)(Pd,{placement:"bottom-end",width:385,children:(0,i.jsx)(lM,{...e,close:()=>{o(!1)},reset:s})})]})]}),(0,i.jsx)(aM,{...e,reset:s})]})},cM=({event:e,organization:t})=>{const{eventId:n}=Wn(),[o,s,r]=Ec(""),[a,l]=ET("accredit.filters.accreditationsCategoriesIds",null),[d,c]=ET("accredit.filters.accreditationsIds",null),[u,m]=ET("accredit.filters.date",null),[g,p]=ET("accredit.filters.tagsIds",null),[f,x]=ET("accredit.filters.segmentId",null),[_,I]=ET("accredit.filters.excludeFull",!1),[v,b]=ET("accredit.filters.excludePast",!1),{data:j,loader:C}=Vn("query AccreditSlots(\n    $eventId: EventId!\n    $name: String\n    $accreditationCategoriesIds: [AccreditationsCategoryId!]\n    $accreditationsIds: [AccreditationId!]\n    $date: Date\n    $tagsIds: [TagId!]\n    $segmentId: SegmentId\n    $excludeFull: Boolean\n    $excludePast: Boolean\n) {\n    event(id: $eventId) {\n        accreditationsSlots(\n            includeHidden: true\n            accreditationName: $name\n            accreditationsCategoriesIds: $accreditationCategoriesIds\n            accreditationsIds: $accreditationsIds\n            date: $date\n            tagsIds: $tagsIds\n            segmentId: $segmentId\n            excludeFull: $excludeFull\n            excludePast: $excludePast\n        ) {\n            nodes {\n                ...AccreditationsSlot\n            }\n        }\n    }\n}\n",{eventId:n,name:h(s)?s:void 0,accreditationCategoriesIds:Zo(a)?a:void 0,accreditationsIds:Zo(d)?d:void 0,date:u,tagsIds:Zo(g)?g:void 0,segmentId:f,excludeFull:_,excludePast:v},[Ro.AccreditationsSlotFragment]);return(0,i.jsxs)(Ea,{css:{background:"$gray50",minHeight:"100%",padding:"$6 $7"},direction:"column",width:1,children:[(0,i.jsx)(dM,{accreditationsCategoriesIds:a,accreditationsIds:d,date:u,event:e,excludeFull:_,excludePast:v,name:o,organization:t,segmentId:f,setAccreditationsCategoriesIds:l,setAccreditationsIds:c,setDate:m,setExcludeFull:I,setExcludePast:b,setName:r,setSegmentId:x,setTagsIds:p,tagsIds:g}),(0,i.jsx)(Pa,{height:"7"}),C||(0,i.jsx)(rM,{accreditationsSlots:j.event.accreditationsSlots.nodes,delegation:e.volunteerRegistration.delegation})]})},uM=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,userInfoId:r}}=il();Cd(n("accr_ditations_79986",e.event.volunteerRegistration.userInfo.name));const[a,l]=ET("accredit.isLeftPanelOpen",!0),[d,c]=ET("accredit.isRightPanelOpen",!0),[u,m,g]=Ec(""),[p,f]=ET("accredit.leftPanelDirection",_t.Desc),[x,_]=ET("accredit.leftPanelSegmentId",-1),[I,v]=ET("accredit.leftPanelDelegationId",null),[b,j]=ET("accredit.leftPanelStates",[ae.AutoAccredited,ae.WaitingAccreditation]),{data:C,isLoading:y}=gs({eventId:s,accreditationStates:b,name:h(m)?m:void 0,segmentId:-1===x?void 0:x,delegationId:I||void 0,direction:p,loadDelegations:!0}),k=(0,F.useCallback)(()=>{const e=C.event?.volunteersRegistrations.nodes??[],n=e.findIndex(e=>e.userInfo.id===r),i=e[n+1]?.userInfo.id??e[0].userInfo.id;i===r?t.goBack(So.ACCREDIT(o,s,r)):t.replace(So.ACCREDIT(o,s,i))},[o,s,r,C.event]),A=e.event.volunteerRegistration,w=(0,F.useMemo)(()=>[...A.accreditationsUsersInfos.map(({accreditationSlotId:e})=>e),...e.isEdit?[]:A.accreditationsSlots.flatMap(e=>{const t=A.delegation?.accreditationsSlots.find(t=>t.accreditationSlotId===e.id),n=t?.maxResources&&t?.assignedResources>=t?.maxResources;return e?.maxResources&&e?.assignedResources>=e?.maxResources||n?[]:[e.id]})],[A,e.isEdit]);return(0,i.jsx)(JF,{accreditationsSlotsIds:w,isEdit:e.isEdit,showNextMember:k,children:(0,i.jsx)(MF,{buttons:(0,i.jsx)(eM,{isEdit:e.isEdit,userInfoId:A.userInfo.id}),header:(0,i.jsx)(NF,{badgeColorIcon:Pb(A.accreditationState),insertedAt:A.insertedAt,isPreAssign:!1,showTabs:!1,showTeam:!1,teams:[],userInfo:A.userInfo}),isEdit:e.isEdit,isLeftPanelOpen:a,isRightPanelOpen:d,leftPanel:(0,i.jsx)(VF,{accreditationStates:b,delegationId:I,direction:p,event:C.event,getPath:e=>So.ACCREDIT(o,s,e),isLoading:y,loadDelegations:!0,name:u,segmentId:x,setAccreditationStates:j,setDelegationId:v,setDirection:f,setName:g,setSegmentId:_,setStates:Bl.A,showAccreditationStates:!0,showStates:!1,states:[],userInfoId:A.userInfoId}),rightPanel:(0,i.jsx)(ZF,{customFields:e.event.formsCustomsFields,eventId:s,formsUsersInfos:e.organization.userInfo.formsUsersInfos,organizationId:o,showWishedAccreditations:!0,showWishedPositions:!1,userInfo:e.event.volunteerRegistration.userInfo,onCollapse:()=>{c(!1)}}),setIsLeftPanelOpen:l,setIsRightPanelOpen:c,children:(0,i.jsx)(cM,{event:e.event,organization:e.organization})})})},hM=e=>{const{organizationId:t,eventId:n,userInfoId:o}=Wn(),{data:s,loader:r}=Vn("query AccreditInfos(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $userInfoId: UsersInfoId!\n) {\n    organization(id: $organizationId) {\n        tags {\n            nodes {\n                id\n                name\n            }\n        }\n\n        userInfo(id: $userInfoId) {\n            ...FormsUsersInfosWished\n        }\n    }\n\n    event(id: $eventId) {\n        startAt\n        endAt\n\n        formsCustomsFields {\n            ...CustomFieldWithCondition\n        }\n\n        accreditationsCategories {\n            id\n            name\n        }\n\n        accreditations {\n            nodes {\n                id\n                name\n            }\n        }\n\n        segments(segmentType: Accreditations) {\n            id\n            name\n        }\n\n        volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n            id\n            userInfoId\n            accreditationState\n            insertedAt\n\n            accreditationsSlots {\n                id\n                maxResources\n                assignedResources\n            }\n\n            accreditationsUsersInfos {\n                accreditationSlotId\n            }\n\n            delegation {\n                ...DelegationAccreditationsSlots\n            }\n\n            userInfo {\n                id\n                name\n                email\n                fields\n                picture {\n                    url\n                }\n            }\n        }\n    }\n}\n",{organizationId:t,eventId:n,userInfoId:o},[Ro.FormsUsersInfosWishedFragment,Ro.CustomFieldWithConditionFragment,Ro.DelegationAccreditationsSlotsFragment]);return r||(0,i.jsx)(uM,{event:s.event,isEdit:e.isEdit,organization:s.organization})},mM=e=>(0,i.jsxs)(Ea,{css:{background:"white",bd:!0,flex:"1",...e.css},direction:"column",children:[(0,i.jsx)(Ea,{css:{flex:"1",padding:"$6"},direction:"column",gap:"2",children:e.children}),e.button&&(0,i.jsx)(Ea,{css:{borderTop:"1px solid $gray200",padding:"$4 $6"},justify:"end",children:e.button})]}),gM=()=>{const{translate:e,params:{eventId:t}}=il(),[n,o,s]=Ec(""),[r,a]=(0,F.useState)(""),[l,d]=(0,F.useState)(0),{data:c,isLoading:u,reload:m}=Vn("query AccreditationsAssignmentsEmails(\n    $eventId: EventId!\n    $name: String\n    $state: EmailState\n    $offset: Int\n) {\n    event(id: $eventId) {\n        emails(\n            emailTypes: [Accreditations, AccreditationsRefused]\n            name: $name\n            state: $state\n            limit: 25\n            offset: $offset\n        ) {\n            nodes {\n                ...EmailRecipient\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{eventId:t,name:h(o)?o:void 0,state:""!==r?r:void 0,offset:l},[Ro.EmailRecipientFragment]);const g=Ac(),{numberOfPages:p,totalCount:f}=lu(c.event?.emails);return(0,i.jsx)(kc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{width:200,children:(0,i.jsxs)(gu,{value:r,onChange:e=>{a(e),d(0)},children:[(0,i.jsx)("option",{value:"",children:e("tous_les_status_67644")}),g(en.filter(e=>e!==Ee.Queued))]})}),(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:e("rechercher_un_d_02329"),value:n,onChange:e=>{s(e),d(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:e("nom_du_membre_69353")}),(0,i.jsx)(Tc,{children:e("date_d_envoi_74668")}),(0,i.jsx)(Tc,{children:e("status_06428")}),(0,i.jsx)(Tc,{width:100})]}),numberOfPages:p,offset:l,rows:u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):c.event.emails.nodes.map(e=>(0,i.jsx)(zb,{email:e,emailType:ze.Accreditations,reload:m},e.id)),setOffset:d,title:e("liste_des_envoi_14764"),totalCount:f})},pM=e=>{const t=Ln(),{mutate:n,isLoading:o}=function(e={}){return Un("mutation SendAccreditationsEmails(\n    $eventId: EventId!\n    $sendAccreditationsEmails: SendAccreditationsEmailsInput!\n) {\n    eventAccreditationsEmailsSend(\n        eventId: $eventId\n        sendAccreditationsEmails: $sendAccreditationsEmails\n    )\n}\n",e)}();return(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(mj,{color:"warning",css:{margin:"auto"},icon:"triangle-exclamation"}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{font:"gray900 textLg medium",textAlign:"center",children:t("_tes_vous_sur_d_58206",e.numberOfEmails)}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:t("les_membres_pr_09143")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{isLoading:o,onClick:async()=>{await n({eventId:e.eventId,sendAccreditationsEmails:e.sendAccreditationsEmails}),e.reload(),e.onClose()},children:t("confirmer_l_env_08749")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},fM=e=>{const t=Ln(),[n,o,s]=Ec(""),[r,a]=(0,F.useState)([]),{data:l}=Dr({eventId:e.eventId,usersInfosIds:r,name:h(o)?o:void 0}),d=(0,F.useMemo)(()=>(0,Ju.A)((l.event?.volunteersRegistrations.nodes??[]).concat(l.event?.selectedVolunteersRegistrations.nodes??[]),e=>e.id),[l.event]),{mutate:c,isLoading:u}=function(e={}){return Un("mutation AccreditationsEmailsEstimate(\n    $eventId: EventId!\n    $sendAccreditationsEmails: SendAccreditationsEmailsInput!\n) {\n    eventAccreditationsEmailsEstimate(\n        eventId: $eventId\n        sendAccreditationsEmails: $sendAccreditationsEmails\n    )\n}\n",e)}(),[m,g]=(0,F.useState)(oe.Everyone),[p,f]=(0,F.useState)([]),x=m===oe.Everyone||m===oe.Accredited||m===oe.Refused||m===oe.Members&&Zo(r)||m===oe.Segments&&Zo(p),_=!(!e.emailSender||e.emailSender.isValidToSendEmail);return(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(mj,{color:"purple",css:{margin:"auto"},icon:"paper-plane"}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("envoi_des_e_mai_83224")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:t("personnaliser_v_78340")}),(0,i.jsx)(Pa,{height:"7"}),_&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ha,{color:"error",leftIcon:"circle-exclamation",children:t("vous_ne_pouvez_69435")}),(0,i.jsx)(Pa,{height:"4"})]}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:t("que_souhaitez_v_01732")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(sc,{state:m===oe.Everyone?"checked":"unchecked",onClick:()=>{g(oe.Everyone)},children:t("tous_les_e_mail_50843")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:m===oe.Accredited?"checked":"unchecked",onClick:()=>{g(oe.Accredited)},children:t("tous_les_e_mail_02185")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:m===oe.Refused?"checked":"unchecked",onClick:()=>{g(oe.Refused)},children:t("tous_les_e_mail_41162")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:m===oe.Members?"checked":"unchecked",onClick:()=>{g(oe.Members)},children:t("_certains_memb_91094")}),m===oe.Members&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(dc,{isSearchVisible:!0,multiple:!0,searchElement:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:n,onChange:s}),values:r,onChange:a,children:d.map(e=>(0,i.jsx)("option",{value:e.userInfo.id,children:e.userInfo.nameOrEmail},e.userInfo.id))})})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:m===oe.Segments?"checked":"unchecked",onClick:()=>{g(oe.Segments)},children:t("uniquement_ce_54026")}),m===oe.Segments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(dc,{isSearchVisible:!0,multiple:!0,values:p,onChange:f,children:(l.event?.segments??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{disabled:_,isLoading:u,onClick:async()=>{if(x){const t={recipients:m,segmentsIds:p,usersInfosIds:r},{eventAccreditationsEmailsEstimate:n}=await c({eventId:e.eventId,sendAccreditationsEmails:t});e.onSuccess(n,t),e.onClose()}},children:t("envoyer_les_e_m_37846")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},xM=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=il(),{setNumberOfWaitingAccreditations:r}=Uv(),[a,l]=(0,F.useState)(!1),[d,c]=(0,F.useState)(null),[u,h]=(0,F.useState)(0),[m,g]=(0,F.useState)(!1);return(0,F.useEffect)(()=>{r(e.event.waitingAccreditation.totalCount)},[e.event]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(yC,{children:[(0,i.jsxs)(Ea,{gap:"3",children:[(0,i.jsxs)(mM,{button:(0,i.jsx)(pl,{disabled:0===e.event.waitingAccreditation.totalCount,onClick:()=>{e.event.waitingAccreditation.totalCount>0&&t.push(So.ACCREDIT(n,o,e.event.waitingAccreditation.nodes[0].userInfoId))},children:s("accr_diter_les_48281")}),children:[(0,i.jsx)(fr,{color:"gray500",fontWeight:"medium",children:s("membres_en_atte_52995")}),(0,i.jsx)(fr,{font:"gray900 displayMd medium",children:e.event.waitingAccreditation.totalCount})]}),(0,i.jsxs)(mM,{button:(0,i.jsx)(pl,{onClick:()=>{l(!0)},children:s("param_trer_et_e_31095")}),children:[(0,i.jsx)(fr,{color:"gray500",fontWeight:"medium",children:s("e_mail_de_confi_84099_plural")}),(0,i.jsx)(fr,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfWaiting})]})]}),(0,i.jsx)(Pa,{height:"9"}),(0,i.jsx)(fr,{font:"gray900 textLg medium",children:s("historique_des_71419")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsxs)(Ea,{gap:"6",children:[(0,i.jsxs)(mM,{children:[(0,i.jsx)(fr,{color:"gray500",fontWeight:"medium",children:s("nombre_d_envois_95106")}),(0,i.jsx)(fr,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfSent})]}),(0,i.jsxs)(mM,{children:[(0,i.jsx)(fr,{color:"gray500",fontWeight:"medium",children:s("nombre_d_ouvert_84187")}),(0,i.jsx)(fr,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfOpen})]}),(0,i.jsxs)(mM,{children:[(0,i.jsx)(fr,{color:"gray500",fontWeight:"medium",children:s("nombre_de_clics_64232")}),(0,i.jsx)(fr,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfClick})]})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(gM,{})]}),a&&(0,i.jsx)(fM,{emailSender:e.organization.emailTemplate?.emailSender,eventId:o,onClose:()=>{l(!1)},onSuccess:(e,t)=>{h(e),c(t),g(!0)}}),m&&(0,i.jsx)(pM,{eventId:o,numberOfEmails:u,reload:e.reload,sendAccreditationsEmails:d,onClose:()=>{g(!1)}})]})},_M=()=>{const e=Ln();return(0,i.jsxs)(kC,{direction:"column",children:[(0,i.jsx)(fr,{font:"blueGray900 textXl medium",children:e("accr_ditations_39450")}),(0,i.jsx)(fr,{color:"gray500",children:e("accr_diter_vos_35773")})]})},IM=()=>{const{params:{organizationId:e,eventId:t},translate:n}=il(),{event:{name:o},localEvent:s,updateLocalEvent:r}=Uv();Cd(`${o} ${n("accr_ditations_39450")}`);const{data:a,loader:l,reload:d}=Vn('query AccreditationsAssignmentsKpis(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $direction: SortDirection!\n) {\n    organization(id: $organizationId) {\n        emailTemplate(emailType: Accreditations, eventId: $eventId) {\n            emailSender {\n                isValidToSendEmail\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        emailsStats(emailTypes: [Accreditations, AccreditationsRefused]) {\n            numberOfOpen\n            numberOfClick\n            numberOfSent\n            numberOfWaiting\n        }\n\n        waitingAccreditation: volunteersRegistrations(\n            accreditationStates: [AutoAccredited, WaitingAccreditation]\n            limit: 1\n            sort: { attribute: "InsertedAt", direction: $direction }\n        ) {\n            nodes {\n                userInfoId\n            }\n\n            totalCount\n        }\n    }\n}\n',{organizationId:e,eventId:t,direction:s?.["accredit.leftPanelDirection"]??_t.Desc},[]);return(0,F.useEffect)(()=>{(async()=>{await Promise.all([r({"accredit.filters.accreditationsCategoriesIds":null}),r({"accredit.filters.accreditationsIds":null}),r({"accredit.filters.date":null}),r({"accredit.filters.tagsIds":null}),r({"accredit.filters.segmentId":null}),r({"accredit.filters.excludeFull":!1})])})()},[]),l||(0,i.jsxs)(AC,{children:[(0,i.jsx)(_M,{}),(0,i.jsx)(xM,{event:a.event,organization:a.organization,reload:d})]})},vM=e=>{const t=Ln(),{mutate:n}=function(e={}){return Un("mutation AccreditationCategoryDelete(\n    $eventId: EventId!\n    $accreditationCategoryId: AccreditationsCategoryId!\n) {\n    accreditationCategoryDelete(\n        eventId: $eventId\n        accreditationCategoryId: $accreditationCategoryId\n    ) {\n        id\n    }\n}\n",e)}();return(0,i.jsx)(kk,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_50954"),t("cela_supprimera_56396")],text:t("suppression_de_73669",e.accreditationCategory.name),onClose:e.onClose,onDelete:async()=>{await n({eventId:e.eventId,accreditationCategoryId:e.accreditationCategory.id}),e.onSuccess()}})},bM=({category:e,reload:t})=>{const{history:n,params:{organizationId:o,eventId:s},translate:r}=il(),{mutate:a}=function(e={}){return Un("mutation AccreditationCategoryDuplicate(\n    $eventId: EventId!\n    $accreditationCategoryId: AccreditationsCategoryId!\n) {\n    accreditationCategoryDuplicate(\n        eventId: $eventId\n        accreditationCategoryId: $accreditationCategoryId\n    ) {\n        id\n    }\n}\n",e)}(),[l,d]=(0,F.useState)(!1),[c,u]=(0,F.useState)(!1);return(0,i.jsxs)(kC,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(yb,{returnPathFallback:Hi.ACCREDITATIONS({organizationId:o,eventId:s})}),(0,i.jsx)(fr,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.name}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsx)(pl,{color:"white",onClick:()=>u(!0),children:r("_diter_62574")})}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsx)(pl,{onClick:()=>{n.push(So.CREATE_ACCREDITATION(o,s,e.id))},children:r("add_accreditation")})}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsx)(Od,{icon:"copy",onClick:async()=>{const{accreditationCategoryDuplicate:{id:t}}=await a({eventId:s,accreditationCategoryId:e.id});n.push(Hi.ACCREDITATION_CATEGORY({organizationId:o,eventId:s,accreditationCategoryId:t}))},children:r("dupliquer_28256")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{d(!0)},children:r("supprimer_43083")})]})]})}),c&&(0,i.jsx)(ZP,{accreditationCategory:e,eventId:s,onClose:()=>{u(!1)},onSuccess:t}),l&&(0,i.jsx)(vM,{accreditationCategory:e,eventId:s,onClose:()=>{d(!1)},onSuccess:()=>{n.replace(Hi.ACCREDITATIONS({organizationId:o,eventId:s}))}})]})},jM=e=>{const{translate:t,params:{eventId:n,accreditationCategoryId:o}}=il(),{data:s,loader:r}=Vn("query AccreditationsCategoryAccreditationsReorder(\n    $eventId: EventId!\n    $accreditationCategoryId: AccreditationsCategoryId!\n) {\n    event(id: $eventId) {\n        accreditationCategory(id: $accreditationCategoryId) {\n            name\n\n            accreditations {\n                id\n                name\n                index\n            }\n        }\n    }\n}\n",{eventId:n,accreditationCategoryId:o},[]),{mutate:a}=Is(),[l,d]=(0,F.useState)([]),[c,u]=(0,F.useState)(!1),h=(0,F.useCallback)(async()=>{u(!0),await Promise.all(l.map((e,t)=>a({eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:ie.Index,strategy:Je.Replace,value:t}}))),e.onClose(),e.onSuccess(),u(!1)},[n,l,u,a,e.onClose,e.onSuccess]),m=(0,F.useCallback)(({reason:e,source:t,destination:n})=>{"DROP"===e&&n&&t.index!==n.index&&d(es(l,t.index,n.index))},[l,d]);return(0,F.useEffect)(()=>{d(Vj(s.event?.accreditationCategory.accreditations??[]))},[s.event,d]),(0,i.jsx)(bm,{button:(0,i.jsx)(pl,{isLoading:c,onClick:h,children:t("enregistrer_06519")}),category:t("liste_des_accr_02647"),title:t("changer_l_ordre_11550"),onClose:e.onClose,children:r||(0,i.jsxs)(Im,{css:{background:"white "},children:[(0,i.jsx)(fr,{font:"gray900 textLg semiBold",children:t("organisation_de_45058")}),(0,i.jsx)($u,{height:"5"}),(0,i.jsx)(Qc.JY,{onDragEnd:m,children:(0,i.jsxs)(Ea,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$sm",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(Ea,{align:"center",css:{padding:"$4"},gap:"3",children:(0,i.jsx)(fr,{css:{flex:"1"},font:"gray800 textMd medium",children:s.event.accreditationCategory.name})}),(0,i.jsx)(Qc.gL,{droppableId:"main",type:"accreditation",children:e=>(0,i.jsxs)(Ea,{css:{background:"$gray100",padding:"$4"},direction:"column",gap:"2",...e.droppableProps,ref:e.innerRef,children:[l.map((e,t)=>(0,i.jsx)(Qc.sx,{draggableId:`a-${e.id}`,index:t,children:t=>(0,i.jsxs)(Ea,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",padding:"$3"},gap:"3",...t.draggableProps,ref:t.innerRef,align:"center",children:[(0,i.jsx)(fr,{color:"gray300",css:{cursor:"pointer"},...t.dragHandleProps,children:(0,i.jsx)(Va,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(fr,{css:{flex:"1"},font:"gray900 textSm medium",children:e.name})]})},e.id)),e.placeholder]})})]})})]})})},CM=()=>{const{params:{organizationId:e,eventId:t,accreditationCategoryId:n},translate:o}=il(),[s,r,a]=Ec(""),[l,d]=(0,F.useState)(0),[c,u]=(0,F.useState)({direction:_t.Asc,attribute:re.Index}),{data:m,isLoading:g,reload:p}=Vn("query AccreditationsCategoryAccreditations(\n    $eventId: EventId!\n    $accreditationCategoryId: AccreditationsCategoryId\n    $name: String\n    $offset: Int\n    $sort: AccreditationsSort\n) {\n    event(id: $eventId) {\n        accreditations(\n            accreditationCategoryId: $accreditationCategoryId\n            name: $name\n            limit: 25\n            offset: $offset\n            sort: $sort\n        ) {\n            nodes {\n                id\n                name\n                accreditationDisplay\n                numberOfSlots\n                index\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{eventId:t,accreditationCategoryId:n,name:h(r)?r:void 0,offset:l,sort:c},[]);const{numberOfPages:f,totalCount:x}=lu(m.event?.accreditations),[_,I]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kc,{filters:(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:o("rechercher_une_65646"),value:s,onChange:a})}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"gear",onClick:()=>I(!0)})}),(0,i.jsx)(am,{placement:"top",children:o("changer_l_ordre_11550")})]})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tm,{attribute:re.Name,setSort:u,sort:c,children:o("nom_de_l_accr_d_11908")}),(0,i.jsx)(tm,{attribute:re.Index,setSort:u,sort:c,children:o("Index")}),(0,i.jsx)(Tc,{children:o("number_of_slots_92461")}),(0,i.jsx)(Tc,{children:o("type_d_affichag_55093")})]}),numberOfPages:f,offset:l,rows:g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):0===m.event.accreditations.totalCount?(0,i.jsxs)(Ea,{align:"center",css:{border:"1px solid $gray200",borderTop:"none",py:"$8"},direction:"column",gap:"4",children:[(0,i.jsx)(mj,{color:"primary",icon:"user-group"}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:o("no_accreditations")})]}):m.event.accreditations.nodes.map(n=>(0,i.jsxs)(Cc,{css:{userSelect:"none"},children:[(0,i.jsx)(xc,{css:{fontWeight:"$medium"},children:(0,i.jsx)(j_,{to:Hi.ACCREDITATION({organizationId:e,eventId:t,accreditationId:n.id}),children:Fj(n)})}),(0,i.jsx)(xc,{children:n.index??"-"}),(0,i.jsx)(xc,{children:n.numberOfSlots}),(0,i.jsx)(xc,{children:o(n.accreditationDisplay)})]},n.id)),setOffset:d,title:o("liste_des_accr_02647"),totalCount:x}),_&&(0,ee.createPortal)((0,i.jsx)(fr,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"200"},height:1,width:1,children:(0,i.jsx)(jM,{onClose:()=>I(!1),onSuccess:p})}),document.body)]})},yM=()=>{const{translate:e,params:{eventId:t,accreditationCategoryId:n}}=il(),{data:o,loader:s}=Vn("query AccreditationsCategoryChart(\n    $eventId: EventId!\n    $accreditationCategoryId: AccreditationsCategoryId!\n) {\n    event(id: $eventId) {\n        accreditations(accreditationCategoryId: $accreditationCategoryId) {\n            nodes {\n                ...AccreditationChart\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{eventId:t,accreditationCategoryId:n},[Ro.AccreditationChartFragment]),[r,a]=(0,F.useState)(),l=(0,F.useMemo)(()=>o.event?.accreditations?.nodes.find(e=>e.id==r),[r]);return s||(0,i.jsx)(WA,{select:(0,i.jsx)(Ea,{width:.5,children:(0,i.jsxs)(gu,{value:r??-1,onChange:e=>{a(e)},children:[(0,i.jsx)("option",{disabled:!0,value:-1,children:e("s_lectionner_un_96571")}),o.event.accreditations.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:Fj(e)},e.id))]})}),title:e("r_partition_du_55091"),children:(0,i.jsx)(Ea,{gap:"4",width:1,children:(0,i.jsx)(fr,{height:380,width:1,children:r&&l?(0,i.jsx)(vw,{accreditation:l,slots:l.slots}):(0,i.jsx)(rk,{title:e("vous_allez_retr_26787")})})})})},kM=()=>(0,i.jsx)(yC,{children:(0,i.jsxs)(Ea,{direction:"column",gap:"6",children:[(0,i.jsx)(Ea,{width:1,children:(0,i.jsx)(yM,{})}),(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(CM,{})})]})}),AM=({event:e,reload:t})=>{const{params:{organizationId:n,eventId:o,accreditationCategoryId:s},translate:r}=il();Cd(e.accreditationCategory.name);const a=e=>({organizationId:e?":organizationId":n,eventId:e?":eventId":o,accreditationCategoryId:e?":accreditationCategoryId":s});return(0,i.jsxs)(AC,{children:[(0,i.jsx)(bM,{category:e.accreditationCategory,reload:t}),(0,i.jsxs)(Vy,{css:{flex:"1"},children:[(0,i.jsxs)(Ly,{css:{px:"$7"},children:[(0,i.jsx)(Ny,{path:Hi.ACCREDITATION_CATEGORY_DASHBOARD(a(!1)),children:r("tableau_de_bord_24627")}),(0,i.jsx)(Ny,{path:Hi.ACCREDITATION_CATEGORY_MEMBERS(a(!1)),children:r("membres_125561",e.volunteersRegistrations.totalCount)})]}),(0,i.jsx)(By,{path:Hi.ACCREDITATION_CATEGORY_DASHBOARD(a(!0)),children:(0,i.jsx)(kM,{})}),(0,i.jsx)(By,{path:Hi.ACCREDITATION_CATEGORY_MEMBERS(a(!0)),children:(0,i.jsx)(PF,{accreditationCategoryId:s})})]})]})},wM=()=>{const{params:{organizationId:e,eventId:t,accreditationCategoryId:n}}=il(),{data:o,loader:s,reload:r}=Vn("query AccreditationsCategory(\n    $eventId: EventId!\n    $accreditationCategoryId: AccreditationsCategoryId!\n) {\n    event(id: $eventId) {\n        accreditationCategory(id: $accreditationCategoryId) {\n            id\n            name\n            assignedResources\n        }\n\n        volunteersRegistrations(accreditationCategoryId: $accreditationCategoryId) {\n            totalCount\n        }\n    }\n}\n",{eventId:t,accreditationCategoryId:n},[]);return s||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{exact:!0,path:Hi.ACCREDITATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationCategoryId:":accreditationCategoryId"}),children:(0,i.jsx)(Yn,{path:Hi.ACCREDITATION_CATEGORY_DASHBOARD({organizationId:e,eventId:t,accreditationCategoryId:n}),replace:!0})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(AM,{event:o.event,reload:r})})]})},SM=e=>{const{params:{organizationId:t,eventId:n,accreditationId:o},translate:s}=il(),r=Nn($c),a=(0,F.useMemo)(()=>ph(r,e.slot,e.slot.accreditation.name,{accreditation:{includeNameAtEnd:!0},date:{localeFormat:Ho.DateOnly.WeekdayLongMonthLong}}),[e.slot]);return(0,i.jsxs)(kC,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(yb,{returnPathFallback:Hi.ACCREDITATIONS({organizationId:t,eventId:n})}),(0,i.jsxs)(fr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"medium",children:[a,h(e.slot.accreditation.acronym)&&` (${e.slot.accreditation.acronym})`]}),(0,i.jsx)(pl,{to:So.EDIT_ACCREDITATION(t,n,o),children:s("_diter_62574")})]})},EM=e=>{const{params:{organizationId:t,eventId:n,accreditationId:o,accreditationSlotId:s},translate:r}=il();Cd(ph(Nn($c),e.event.accreditationSlot,e.event.accreditationSlot.name));const a=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":n,accreditationId:e?":accreditationId":o,accreditationSlotId:e?":accreditationSlotId":s});return(0,i.jsxs)(AC,{children:[(0,i.jsx)(SM,{slot:e.event.accreditationSlot}),(0,i.jsxs)(Vy,{css:{flex:"1"},children:[(0,i.jsxs)(Ly,{css:{px:"$7"},children:[(0,i.jsx)(Ny,{path:Hi.ACCREDITATION_SLOT_DASHBOARD(a(!1)),children:r("tableau_de_bord_24627")}),(0,i.jsx)(Ny,{path:Hi.ACCREDITATION_SLOT_MEMBERS(a(!1)),children:r("membres_125561",e.event.volunteersRegistrations.totalCount)})]}),(0,i.jsx)(By,{path:Hi.ACCREDITATION_SLOT_DASHBOARD(a(!0)),children:(0,i.jsx)(yC,{children:(0,i.jsxs)(Ea,{direction:"column",gap:"6",children:[(0,i.jsxs)(Ea,{gap:"6",width:1,children:[(0,i.jsx)(sF,{assignedResources:e.event.accreditationSlot.assignedResources,maxResources:e.event.accreditationSlot.maxResources}),(0,i.jsx)(tF,{accreditationCategoryId:e.event.accreditationSlot.accreditation.accreditationCategoryId,accreditationCategoryName:e.event.accreditationSlot.accreditation.accreditationCategoryName,accreditationName:e.event.accreditationSlot.accreditation.name,color:e.event.accreditationSlot.accreditation.color,customFields:e.organization.customFields.nodes,fields:e.event.accreditationSlot.accreditation.fields,icon:e.event.accreditationSlot.accreditation.icon})]}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsxs)(Ea,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(oF,{customFields:e.event.accreditationSlot.accreditation.accreditationsCustomFields}),(0,i.jsx)(ow,{tags:e.event.accreditationSlot.accreditation.tags}),(0,i.jsx)(ew,{privateNote:e.event.accreditationSlot.accreditation.privateNote})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(QA,{description:e.event.accreditationSlot.accreditation.description}),(0,i.jsx)(rF,{location:e.event.accreditationSlot.accreditation})]})]})]})})}),(0,i.jsx)(By,{path:Hi.ACCREDITATION_SLOT_MEMBERS(a(!0)),children:(0,i.jsx)(PF,{accreditationSlotId:s})})]})]})},TM=()=>{const{params:{organizationId:e,eventId:t,accreditationId:n,accreditationSlotId:o}}=il(),{data:s,loader:r}=Vn("query AccreditationsSlot(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $accreditationSlotId: AccreditationsSlotId!\n) {\n    organization(id: $organizationId) {\n        customFields(variety: Accreditation) {\n            nodes {\n                ...CustomFieldWithCondition\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        accreditationSlot(id: $accreditationSlotId) {\n            id\n            name\n            date\n            assignedResources\n            maxResources\n\n            accreditation {\n                name\n                description\n                privateNote\n                acronym\n                icon\n                color\n                address\n                latitude\n                longitude\n                layer\n                zoom\n                accreditationCategoryId\n                accreditationCategoryName\n                fields\n\n                accreditationsCustomFields {\n                    customField {\n                        name\n                        fieldType\n\n                        values {\n                            id\n                            value\n                        }\n                    }\n\n                    conditionValue\n                }\n\n                tags {\n                    id\n                    name\n                }\n            }\n        }\n\n        volunteersRegistrations(accreditationSlotId: $accreditationSlotId) {\n            totalCount\n        }\n    }\n}\n",{organizationId:e,eventId:t,accreditationSlotId:o},[Ro.CustomFieldWithConditionFragment]);return r||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{exact:!0,path:Hi.ACCREDITATION_SLOT({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId",accreditationSlotId:":accreditationSlotId"}),children:(0,i.jsx)(Yn,{path:Hi.ACCREDITATION_SLOT_DASHBOARD({organizationId:e,eventId:t,accreditationId:n,accreditationSlotId:o}),replace:!0})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(EM,{event:s.event,organization:s.organization})})]})},zM=F.createContext({}),$M=e=>{const t=Hn(),[n,o]=F.useState(e.positionsIds),[s,r]=F.useState(e.positionsCategoriesIds),[a,l]=F.useState(e.positionsSlotsIds);return(0,i.jsx)(zM.Provider,{value:{isEdit:e.isEdit,isPreAssign:t.pathname.includes("pre-assignment"),positionsIds:n,positionsCategoriesIds:s,positionsSlotsIds:a,showNextVolunteer:e.showNextVolunteer,setPositionsIds:o,setPositionsCategoriesIds:r,setPositionsSlotsIds:l,teams:e.teams},children:e.children})};function OM(){return F.useContext(zM)}const RM=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=il(),{isPreAssign:r,positionsIds:a,positionsCategoriesIds:l,positionsSlotsIds:d,showNextVolunteer:c}=OM(),{mutate:u,isLoading:h}=Us(),{mutate:m,isLoading:g}=va(),{mutate:p,isLoading:f}=function(e={}){return Un("mutation VolunteerRegistrationAssignmentRefuse(\n    $eventId: EventId!\n    $volunteerRegistrationId: VolunteersRegistrationId!\n) {\n    volunteerRegistrationAssignmentRefuse(\n        eventId: $eventId\n        volunteerRegistrationId: $volunteerRegistrationId\n    ) {\n        id\n    }\n}\n",e)}(),{mutate:x,isLoading:_}=Gs(),I=(0,F.useCallback)(()=>{e.isEdit?t.goBack(So.ASSIGNMENTS(n,o)):c()},[e.isEdit,c]);return(0,i.jsxs)(Ea,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,width:1,children:[(0,i.jsx)(fr,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{h||g||f||_||(await p({eventId:o,volunteerRegistrationId:e.volunteerRegistrationId}),I())},children:s("refuser_92819")}),(0,i.jsx)(fr,{css:{flex:"1"}}),(0,i.jsx)(pl,{color:"primary",isLoading:h||g,onClick:async()=>{r?(!Zo(a)||h||g||f||_||(await m({eventId:o,massPreAssign:{level:Qe.Positions,positionsIds:a,positionsCategoriesIds:[],selecteds:{ids:[e.userInfoId]},strategy:Je.Replace}}),I()),!Zo(l)||h||g||f||_||(await m({eventId:o,massPreAssign:{level:Qe.Categories,positionsIds:[],positionsCategoriesIds:l,selecteds:{ids:[e.userInfoId]},strategy:Je.Replace}}),I())):h||g||f||_||(Zo(d)?await u({eventId:o,massAssign:{positionsSlotsIds:d,selecteds:{ids:[e.userInfoId]},strategy:Je.Replace}}):await x({eventId:o,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:Et.WaitingAssignment}}),I())},children:e.isEdit?s("mettre_jour_l_30423"):s(r?"pr_affecter_17434":"affecter_94255")}),(0,i.jsx)(pl,{color:"white",onClick:I,children:e.isEdit?s("annuler_48254"):s("affecter_plus_t_97778")})]})},PM=e=>{const[t,n]=F.useState(e.initialIsOpen);return(0,i.jsxs)(Ea,{css:{bd:!0,userSelect:"none",...e.css},direction:"column",width:1,children:[(0,i.jsxs)(Ea,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsx)(fr,{css:{flex:"1"},children:e.header}),(0,i.jsx)(pl,{color:"white",leftIcon:t?"chevron-up":"chevron-down",size:"sm",onClick:()=>{n(!t)}})]}),t&&(0,i.jsx)(Ea,{css:{background:"$gray100",padding:"$6"},direction:"column",children:e.children})]})},DM=e=>{const t=Ln(),n=e.assignedResources/e.neededResources;return(0,i.jsxs)(Ea,{css:{background:"white",bd:!0,cursor:"pointer",userSelect:"none"},direction:"column",width:1,onClick:e.onClick,children:[(0,i.jsxs)(Ea,{align:"center",css:{padding:"$3 $5"},width:1,children:[(0,i.jsx)(tc,{shouldPreventDefault:!1,state:e.isSelected?"checked":"unchecked",onClick:Bl.A}),(0,i.jsx)(Pa,{width:"4"}),(0,i.jsx)(Xj,{color:e.color,icon:e.icon}),(0,i.jsx)(Pa,{width:"3"}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[h(e.category)&&(0,i.jsx)(fr,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:e.category}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:e.title}),(0,i.jsx)(fr,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(Pa,{width:"2"}),(0,i.jsx)(fr,{color:"gray700",fontSize:"textXs",children:(0,i.jsx)(Va,{icon:"user-group"})}),(0,i.jsx)(Pa,{width:"2"}),(0,i.jsxs)(fr,{color:"gray700",children:[e.assignedResources,"/",e.neededResources]}),(0,i.jsx)(Pa,{width:"6"}),(0,i.jsx)(fr,{width:120,children:(0,i.jsx)(YA,{percent:n})}),(0,i.jsx)(Pa,{width:"3"}),(0,i.jsxs)(fr,{color:"gray700",textAlign:"end",width:36,children:[Math.min(100,Math.round(100*n)),"%"]})]}),(0,i.jsxs)(Ea,{css:{borderTop:"1px solid $gray200",padding:"$3 $6","&:empty":{display:"none"}},children:[e.overlaps&&(0,i.jsx)(Gd,{color:"warning",leftIcon:"triangle-exclamation",children:t("ce_cr_neau_en_c_55775")}),e.teamMembers]})]})},FM=e=>{const t=Ln(),n=Nn(Ku),{positionsIds:o,positionsCategoriesIds:s,setPositionsIds:r,setPositionsCategoriesIds:a}=OM(),l=()=>{a(Qo(s,e.category.id))};return(0,i.jsx)(PM,{css:{background:"white"},header:(0,i.jsxs)(Ea,{align:"center",children:[(0,i.jsx)(tc,{state:s.includes(e.category.id)?"checked":"unchecked",onClick:l}),(0,i.jsx)(Pa,{width:"3"}),(0,i.jsx)(fr,{color:"gray800",css:{cursor:"pointer"},fontSize:"textMd",fontWeight:"medium",onClick:l,children:e.category.name}),(0,i.jsx)(Pa,{width:"3"}),(0,i.jsx)(Gd,{color:"warning",size:"md",children:t("_1_membre_manq_31014",e.category.resources)}),(0,i.jsx)(Pa,{width:"3"}),(0,i.jsx)(fr,{css:{flex:"1"}})]}),initialIsOpen:!0,children:(0,i.jsx)(Ea,{css:{background:"$gray100"},direction:"column",gap:"2",children:e.category.positions.map(e=>(0,i.jsx)(DM,{assignedResources:e.assignedResources,color:e.color,icon:e.icon,isSelected:o.includes(e.id),neededResources:e.resources,overlaps:!1,subtitle:e.range?n.toDisplayString(e.range):"-",title:e.name,onClick:()=>{r(Qo(o,e.id))}},e.id))})})},MM=e=>{const t=Ln(),n=(0,F.useMemo)(()=>function(e,t,n,i,o,s){const{wishedPositionsSlots:r,possiblePositionsSlots:a,otherPositionsSlots:l}=ah(e,t,n,i,o,s),d=new Set,c=e=>Object.values((0,Kd.A)(e,e=>e.positionCategory.id)).flatMap(e=>{const t=Object.values((0,Kd.A)(e,e=>e.position.id)).flatMap(e=>{const t=e[0].position;return d.has(t.id)?[]:(d.add(t.id),t)});return 0===t.length?[]:[{...e[0].positionCategory,positions:t}]});return{wishedPositionsCategories:c(r),possiblePositionsCategories:c(a),otherPositionsCategories:c(l)}}(e.positionsSlots,e.wishedPositionsCategoriesIds,e.wishedPositionsIds,e.wishedPositionsSlotsIds,e.wishedRanges,e.userInfo.fields),[e.positionsSlots,e.userInfo,e.wishedPositionsCategoriesIds,e.wishedPositionsIds,e.wishedPositionsSlotsIds,e.wishedRanges]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{font:"gray900 textMd medium",children:t("cat_gorie_mis_36044",n.wishedPositionsCategories.length)}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("cat_gories_ou_m_71206")}),(0,i.jsx)(Pa,{height:"3"}),n.wishedPositionsCategories.map(e=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(FM,{category:e}),(0,i.jsx)(Pa,{height:"3"})]},e.id)),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{font:"gray900 textMd medium",children:t("autre_cat_gorie_21569",n.possiblePositionsCategories.length)}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("cat_gories_ou_m_50063")}),(0,i.jsx)(Pa,{height:"3"}),n.possiblePositionsCategories.map(e=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(FM,{category:e}),(0,i.jsx)(Pa,{height:"3"})]},e.id)),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{font:"gray900 textMd medium",children:t("autre_cat_gorie_64824",n.otherPositionsCategories.length)}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("cat_gories_ou_m_74482")}),(0,i.jsx)(Pa,{height:"3"}),n.otherPositionsCategories.map(e=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(FM,{category:e}),(0,i.jsx)(Pa,{height:"3"})]},e.id))]})},NM=e=>{const{translate:t}=il(),{isPreAssign:n,teams:o}=OM(),s=(0,F.useMemo)(()=>!n&&Zo(o)?o.flatMap(t=>t.members.flatMap(t=>t.positionsSlotsUsersInfos.map(e=>e.positionSlotId).includes(e.positionSlotId)?[t.userInfo]:[])):[],[n,o,e.positionSlotId]);return Zo(s)?(0,i.jsxs)(Ea,{align:"center",css:{marginLeft:"auto"},gap:"1",children:[(0,i.jsx)(Oy,{teamMembers:s}),(0,i.jsx)(fr,{font:"gray800 textXs regular",children:t("_1_quipier_es_00024",s.length)})]}):null},LM=(e,t)=>{const n={weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"};return h(t.name)?`${t.name} - ${e.toLocaleString(t.range,void 0,n)}`:e.toLocaleString(t.range,void 0,n)},BM=e=>{const t=Ln(),n=Nn(Ku),{positionsSlotsIds:o,setPositionsSlotsIds:s}=OM(),r=(0,F.useMemo)(()=>e.positionsSlots.filter(t=>e.state===Et.Assigned&&o.includes(t.id)),[e.state]),{wishedPositionsSlots:a,possiblePositionsSlots:l,otherPositionsSlots:d}=(0,F.useMemo)(()=>{const t=ah(e.positionsSlots,e.wishedPositionsCategoriesIds,e.wishedPositionsIds,e.wishedPositionsSlotsIds,e.wishedRanges,e.userInfo.fields),n=r.map(e=>e.id);return{wishedPositionsSlots:t.wishedPositionsSlots.filter(e=>!n.includes(e.id)),possiblePositionsSlots:t.possiblePositionsSlots.filter(e=>!n.includes(e.id)),otherPositionsSlots:t.otherPositionsSlots.filter(e=>!n.includes(e.id))}},[e.positionsSlots,e.userInfo,e.wishedPositionsCategoriesIds,e.wishedPositionsIds,e.wishedPositionsSlotsIds,e.wishedRanges]),c=(0,F.useMemo)(()=>{const e=a.concat(l).concat(d);return o.flatMap(t=>{const n=e.find(e=>e.id===t);return n?[n]:[]})},[a,l,d,o]);return(0,i.jsxs)(i.Fragment,{children:[e.state===Et.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{font:"gray900 textMd medium",children:t("cr_neau_affect_50400",r.length)}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("cr_neaux_sur_le_05515",e.userInfo.name)}),(0,i.jsx)(Pa,{height:"3"}),r.map(e=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(DM,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:o.includes(e.id),neededResources:e.resources,overlaps:oh(e,c),subtitle:LM(n,e),teamMembers:(0,i.jsx)(NM,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{s(Qo(o,e.id))}}),(0,i.jsx)(Pa,{height:"3"})]},e.id)),(0,i.jsx)(Pa,{height:"6"})]}),(0,i.jsx)(fr,{font:"gray900 textMd medium",children:t("creneau_souhaite",a.length)}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("cr_neaux_dont_l_10130")}),(0,i.jsx)(Pa,{height:"3"}),a.map(e=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(DM,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:o.includes(e.id),neededResources:e.resources,overlaps:oh(e,c),subtitle:LM(n,e),teamMembers:(0,i.jsx)(NM,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{s(Qo(o,e.id))}}),(0,i.jsx)(Pa,{height:"3"})]},e.id)),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{font:"gray900 textMd medium",children:t("autre_creneau_possible",l.length)}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("cr_neaux_dont_l_99850")}),(0,i.jsx)(Pa,{height:"3"}),l.map(e=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(DM,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:o.includes(e.id),neededResources:e.resources,overlaps:oh(e,c),subtitle:LM(n,e),teamMembers:(0,i.jsx)(NM,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{s(Qo(o,e.id))}}),(0,i.jsx)(Pa,{height:"3"})]},e.id)),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{font:"gray900 textMd medium",children:t("autre_creneau",d.length)}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("cr_neaux_dont_l_25685")}),(0,i.jsx)(Pa,{height:"3"}),d.map(e=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(DM,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:o.includes(e.id),neededResources:e.resources,overlaps:oh(e,c),subtitle:LM(n,e),teamMembers:(0,i.jsx)(NM,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{s(Qo(o,e.id))}}),(0,i.jsx)(Pa,{height:"3"})]},e.id))]})},VM=e=>{const t=Ln(),n=Nn($c),o=(0,F.useMemo)(()=>(e.positionsCategoriesIds||[]).map(t=>e.event.positionsCategories.find(e=>e.id===t).name).join(", "),[e.positionsCategoriesIds,e.event]),s=(0,F.useMemo)(()=>(e.positionsIds||[]).map(t=>e.event.positions.nodes.find(e=>e.id===t).name).join(", "),[e.positionsIds,e.event]),r=(0,F.useMemo)(()=>e.date?n.toLocaleString(e.date,Ho.DateOnly.MonthLong):"",[e.date]),a=(0,F.useMemo)(()=>e.segmentId?e.event.segments.find(t=>t.id===e.segmentId).name:"",[e.segmentId,e.event]),l=(0,F.useMemo)(()=>(e.tagsIds||[]).map(t=>e.organization.tags.nodes.find(e=>e.id===t).name).join(", "),[e.tagsIds,e.organization]);return h(o)||h(s)||h(r)||h(a)||h(l)||e.excludeFull||e.excludePast?(0,i.jsxs)(Ea,{align:"center",gap:"3",wrap:"wrap",children:[h(o)&&(0,i.jsx)(Gd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setPositionsCategoriesIds(null)},children:t("cat_gories_1_42029",o)}),h(s)&&(0,i.jsx)(Gd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setPositionsIds(null)},children:t("missions_1_62834",s)}),h(r)&&(0,i.jsx)(Gd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setDate(null)},children:t("date_1_17337",r)}),h(a)&&(0,i.jsx)(Gd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setSegmentId(null)},children:t("vue_1_29260",a)}),h(l)&&(0,i.jsx)(Gd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setTagsIds(null)},children:t("tags_1_43158",l)}),e.excludeFull&&(0,i.jsx)(Gd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludeFull(!1)},children:t("cr_neaux_comple_77561")}),e.excludePast&&(0,i.jsx)(Gd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludePast(!1)},children:t("cr_neaux_dans_l_92999")}),(0,i.jsx)(fr,{css:{cursor:"pointer"},font:"gray700 textXs medium",onClick:e.reset,children:t("r_initialiser_l_66835")})]}):null},UM=e=>{const t=Ln(),[n,o]=(0,F.useState)(e.positionsCategoriesIds),[s,r]=(0,F.useState)(e.positionsIds),[a,l]=(0,F.useState)(e.date),[d,c]=(0,F.useState)(e.segmentId?[e.segmentId]:[]),[u,h]=(0,F.useState)(e.tagsIds),[m,g]=(0,F.useState)(e.excludeFull?"checked":"unchecked"),[p,f]=(0,F.useState)(e.excludePast?"checked":"unchecked");return(0,i.jsxs)(Ea,{direction:"column",onChange:Il,children:[(0,i.jsxs)(Ea,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(fr,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),(0,i.jsx)(dc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_97056"),renderOnPortal:!0,values:n||[],onChange:o,children:e.event.positionsCategories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(dc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_71859"),renderOnPortal:!0,values:s||[],onChange:r,children:e.event.positions.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(_u,{max:e.event.endAt,min:e.event.startAt,placeholder:t("date_du_cr_neau_82295"),value:a,onChange:l}),(0,i.jsx)(dc,{isSearchVisible:!0,placeholder:t("s_lectionnez_un_19794"),renderOnPortal:!0,values:d,onChange:e=>{Zo(e)?c([(0,Vc.A)(e)]):c([])},children:e.event.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(dc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_73255"),renderOnPortal:!0,values:u||[],onChange:h,children:e.organization.tags.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(nc,{state:m,onClick:g,children:t("masquer_les_cr_14425")}),(0,i.jsx)(nc,{state:p,onClick:f,children:t("masquer_les_cr_05336")})]}),(0,i.jsxs)(Ea,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(fr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{e.reset(),e.close()},children:t("r_initialiser_77538")}),(0,i.jsx)(pl,{size:"sm",onClick:()=>{e.setDate(a),e.setExcludeFull("checked"===m),e.setExcludePast("checked"===p),e.setPositionsCategoriesIds(n),e.setPositionsIds(s),e.setSegmentId(Zo(d)?d[0]:null),e.setTagsIds(u),e.close()},children:t("appliquer_05753")})]})]})},WM=e=>{const t=Ln(),[n,o]=(0,F.useState)(!1),s=(0,F.useCallback)(()=>{e.setDate(null),e.setExcludeFull(!1),e.setExcludePast(!1),e.setPositionsCategoriesIds(null),e.setPositionsIds(null),e.setSegmentId(null),e.setTagsIds(null)},[e.setDate,e.setExcludeFull,e.setExcludePast,e.setPositionsCategoriesIds,e.setPositionsIds,e.setSegmentId,e.setTagsIds]);return(0,i.jsxs)(Ea,{direction:"column",gap:"3",width:1,children:[(0,i.jsxs)(Ea,{gap:"3",children:[(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_un_p_70410"),value:e.name,onChange:e.setName}),(0,i.jsxs)(Ed,{doNotCloseOnOtherOpen:!0,isOpen:n,onStateChange:o,children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"bars-filter",children:t("filtres_64574")})})}),(0,i.jsx)(Pd,{placement:"bottom-end",width:385,children:(0,i.jsx)(UM,{...e,close:()=>{o(!1)},reset:s})})]})]}),(0,i.jsx)(VM,{...e,reset:s})]})},GM=e=>{const{eventId:t}=Wn(),{isPreAssign:n}=OM(),[o,s,r]=Ec(""),[a,l]=ET("assignment.filters.positionsCategoriesIds",null),[d,c]=ET("assignment.filters.positionsIds",null),[u,m]=ET("assignment.filters.date",null),[g,p]=ET("assignment.filters.tagsIds",null),[f,x]=ET("assignment.filters.segmentId",null),[_,I]=ET("assignment.filters.excludeFull",!1),[v,b]=ET("assignment.filters.excludePast",!1),{data:j,loader:C}=Vn("query AssignmentSlots(\n    $eventId: EventId!\n    $name: String\n    $positionsCategoriesIds: [PositionsCategoryId!]\n    $positionsIds: [PositionId!]\n    $date: Date\n    $tagsIds: [TagId!]\n    $segmentId: SegmentId\n    $excludeFull: Boolean\n    $excludePast: Boolean\n) {\n    event(id: $eventId) {\n        positionsSlots(\n            positionName: $name\n            positionsCategoriesIds: $positionsCategoriesIds\n            positionsIds: $positionsIds\n            date: $date\n            tagsIds: $tagsIds\n            segmentId: $segmentId\n            excludeFull: $excludeFull\n            excludePast: $excludePast\n        ) {\n            nodes {\n                id\n                name\n                range\n                assignedResources\n                resources\n\n                positionCategory {\n                    id\n                    name\n                    resources\n                }\n\n                position {\n                    id\n                    name\n                    color\n                    icon\n                    assignedResources\n                    resources\n                    range\n\n                    ...PositionPositionsCustomFields\n                }\n            }\n        }\n    }\n}\n",{eventId:t,name:h(s)?s:void 0,positionsCategoriesIds:Zo(a)?a:void 0,positionsIds:Zo(d)?d:void 0,date:u,tagsIds:Zo(g)?g:void 0,segmentId:f,excludeFull:_,excludePast:v},[Ro.PositionPositionsCustomFieldsFragment]);return(0,i.jsxs)(Ea,{css:{background:"$gray50",minHeight:"100%",padding:"$6 $7"},direction:"column",width:1,children:[(0,i.jsx)(WM,{date:u,event:e.event,excludeFull:_,excludePast:v,name:o,organization:e.organization,positionsCategoriesIds:a,positionsIds:d,segmentId:f,setDate:m,setExcludeFull:I,setExcludePast:b,setName:r,setPositionsCategoriesIds:l,setPositionsIds:c,setSegmentId:x,setTagsIds:p,tagsIds:g}),(0,i.jsx)(Pa,{height:"7"}),C||(n?(0,i.jsx)(MM,{positionsSlots:j.event?.positionsSlots.nodes??[],userInfo:e.userInfo,wishedPositionsCategoriesIds:e.wishedPositionsCategoriesIds,wishedPositionsIds:e.wishedPositionsIds,wishedPositionsSlotsIds:e.wishedPositionsSlotsIds,wishedRanges:e.wishedRanges}):(0,i.jsx)(BM,{positionsSlots:j.event?.positionsSlots.nodes??[],state:e.state,userInfo:e.userInfo,wishedPositionsCategoriesIds:e.wishedPositionsCategoriesIds,wishedPositionsIds:e.wishedPositionsIds,wishedPositionsSlotsIds:e.wishedPositionsSlotsIds,wishedRanges:e.wishedRanges}))]})},HM=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,userInfoId:r}}=il(),a=Hn().pathname.includes("pre-assignment"),{isEventAdmin:l}=Uv();Cd(n("affectations_1_71402",e.event.volunteerRegistration.userInfo.name));const[d,c]=ET("assignment.isLeftPanelOpen",!0),[u,m]=ET("assignment.isRightPanelOpen",!0),[g,p,f]=Ec(""),[x,_]=ET("assignment.leftPanelDirection",_t.Desc),[I,v]=ET("assignment.leftPanelSegmentId",-1),[b,j]=ET("assignment.leftPanelStates",[Et.WaitingAssignment,Et.PreAssigned]),{data:C,isLoading:y}=gs({eventId:s,states:b,name:h(p)?p:void 0,segmentId:-1===I?void 0:I,direction:x,loadDelegations:!1}),k=(0,F.useCallback)(()=>{const e=C.event?.volunteersRegistrations.nodes??[],n=e.findIndex(e=>e.userInfo.id===r),i=e[n+1]?.userInfo.id??e[0].userInfo.id;i===r?t.goBack(So.ASSIGNMENTS(o,s)):a?t.replace(So.PRE_ASSIGNMENT(o,s,i)):t.replace(So.ASSIGNMENT(o,s,i))},[a,o,s,r,C.event]),A=e.event.volunteerRegistration,w=(0,F.useMemo)(()=>A.positionsSlotsUsersInfos.map(({positionSlotId:e})=>e),[A]),S=(0,F.useMemo)(()=>({wishedPositionsCategoriesIds:A.positionsCategories.map(({id:e})=>e),wishedPositionsIds:A.positions.map(({id:e})=>e),wishedPositionsSlotsIds:A.positionsSlots.map(({id:e})=>e),wishedRanges:A.slots.map(({range:e})=>e)}),[A]);return(0,i.jsx)($M,{isEdit:e.isEdit,positionsCategoriesIds:A.preassignPositionsCategoriesIds,positionsIds:A.preassignPositionsIds,positionsSlotsIds:w,showNextVolunteer:k,teams:A.teams,children:(0,i.jsx)(MF,{buttons:(0,i.jsx)(RM,{isEdit:e.isEdit,userInfoId:A.userInfo.id,volunteerRegistrationId:A.id}),header:(0,i.jsx)(NF,{badgeColorIcon:Rb(A.state),insertedAt:A.insertedAt,isPreAssign:a,showTabs:l,showTeam:!0,teams:A.teams,userInfo:A.userInfo}),isEdit:e.isEdit,isLeftPanelOpen:d,isRightPanelOpen:u,leftPanel:(0,i.jsx)(VF,{accreditationStates:[],delegationId:null,direction:x,event:C.event,getPath:e=>a?So.PRE_ASSIGNMENT(o,s,e):So.ASSIGNMENT(o,s,e),isLoading:y,loadDelegations:!1,name:g,segmentId:I,setAccreditationStates:Bl.A,setDelegationId:Bl.A,setDirection:_,setName:f,setSegmentId:v,setStates:j,showAccreditationStates:!1,showStates:!0,states:b,userInfoId:A.userInfoId}),rightPanel:(0,i.jsx)(ZF,{customFields:e.event.formsCustomsFields,eventId:s,formsUsersInfos:e.organization.userInfo.formsUsersInfos,organizationId:o,showWishedAccreditations:!1,showWishedPositions:!0,userInfo:e.event.volunteerRegistration.userInfo,onCollapse:()=>{m(!1)}}),setIsLeftPanelOpen:c,setIsRightPanelOpen:m,children:(0,i.jsx)(GM,{event:e.event,organization:e.organization,state:A.state,userInfo:A.userInfo,...S})})})},qM=e=>{const{organizationId:t,eventId:n,userInfoId:o}=Wn(),{data:s,loader:r}=Vn("query AssignmentInfos(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $userInfoId: UsersInfoId!\n) {\n    organization(id: $organizationId) {\n        tags {\n            nodes {\n                id\n                name\n            }\n        }\n\n        userInfo(id: $userInfoId) {\n            ...FormsUsersInfosWished\n        }\n    }\n\n    event(id: $eventId) {\n        startAt\n        endAt\n\n        formsCustomsFields {\n            ...CustomFieldWithCondition\n        }\n\n        positionsCategories {\n            id\n            name\n        }\n\n        positions {\n            nodes {\n                id\n                name\n            }\n        }\n\n        segments(segmentType: Positions) {\n            id\n            name\n        }\n\n        volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n            id\n            userInfoId\n            state\n            preassignPositionsIds\n            preassignPositionsCategoriesIds\n            isTeamMember\n            insertedAt\n\n            teams {\n                leaderUserInfoId\n                teamCode\n\n                members {\n                    positionsSlotsUsersInfos {\n                        positionSlotId\n                    }\n\n                    userInfo {\n                        ...UserInfoTeamMember\n                    }\n                }\n            }\n\n            userInfo {\n                id\n                name\n                email\n                fields\n                picture {\n                    url\n                }\n            }\n\n            positionsCategories {\n                id\n            }\n\n            positions {\n                id\n            }\n\n            positionsSlots {\n                id\n            }\n\n            slots: slotsMerged {\n                range\n            }\n\n            positionsSlotsUsersInfos {\n                positionSlotId\n            }\n        }\n    }\n}\n",{organizationId:t,eventId:n,userInfoId:o},[Ro.FormsUsersInfosWishedFragment,Ro.CustomFieldWithConditionFragment,Ro.UserInfoTeamMemberFragment]);return r||(0,i.jsx)(HM,{event:s.event,isEdit:e.isEdit,organization:s.organization})},YM=e=>{const t=Ln(),{mutate:n,isLoading:o}=function(e={}){return Un("mutation SendAssignmentsEmails(\n    $eventId: EventId!\n    $sendAssignmentsEmails: SendAssignmentsEmailsInput!\n) {\n    eventAssignmentsEmailsSend(eventId: $eventId, sendAssignmentsEmails: $sendAssignmentsEmails)\n}\n",e)}();return(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(mj,{color:"warning",css:{margin:"auto"},icon:"triangle-exclamation"}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{font:"gray900 textLg medium",textAlign:"center",children:t("_tes_vous_sur_d_58206",e.numberOfEmails)}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:t("les_membres_pr_53976")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{isLoading:o,onClick:async()=>{await n({eventId:e.eventId,sendAssignmentsEmails:e.sendAssignmentsEmails}),e.reload(),e.onClose()},children:t("confirmer_l_env_08749")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},KM=e=>{const t=Ln(),[n,o,s]=Ec(""),[r,a]=(0,F.useState)([]),{data:l}=Dr({eventId:e.eventId,usersInfosIds:r,name:h(o)?o:void 0}),{mutate:d,isLoading:c}=function(e={}){return Un("mutation AssignmentsEmailsEstimate(\n    $eventId: EventId!\n    $sendAssignmentsEmails: SendAssignmentsEmailsInput!\n) {\n    eventAssignmentsEmailsEstimate(eventId: $eventId, sendAssignmentsEmails: $sendAssignmentsEmails)\n}\n",e)}(),[u,m]=(0,F.useState)(le.Everyone),g=(0,F.useMemo)(()=>(0,Ju.A)((l.event?.volunteersRegistrations.nodes??[]).concat(l.event?.selectedVolunteersRegistrations.nodes??[]),e=>e.id),[l.event]),[p,f]=(0,F.useState)([]),x=u===le.Everyone||u===le.Assigned||u===le.Refused||u===le.Members&&Zo(r)||u===le.Segments&&Zo(p),_=!(!e.emailSender||e.emailSender.isValidToSendEmail);return(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(mj,{color:"purple",css:{margin:"auto"},icon:"paper-plane"}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("envoi_des_e_mai_81363")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:t("personnaliser_v_78340")}),(0,i.jsx)(Pa,{height:"7"}),_&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ha,{color:"error",leftIcon:"circle-exclamation",children:t("vous_ne_pouvez_69435")}),(0,i.jsx)(Pa,{height:"4"})]}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:t("que_souhaitez_v_01732")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(sc,{state:u===le.Everyone?"checked":"unchecked",onClick:()=>{m(le.Everyone)},children:t("tous_les_e_mail_39319")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:u===le.Assigned?"checked":"unchecked",onClick:()=>{m(le.Assigned)},children:t("tous_les_e_mail_42685")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:u===le.Refused?"checked":"unchecked",onClick:()=>{m(le.Refused)},children:t("tous_les_e_mail_41162")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:u===le.Members?"checked":"unchecked",onClick:()=>{m(le.Members)},children:t("_certains_memb_91094")}),u===le.Members&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(dc,{isSearchVisible:!0,multiple:!0,searchElement:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:n,onChange:s}),values:r,onChange:a,children:g.map(e=>(0,i.jsx)("option",{value:e.userInfo.id,children:e.userInfo.nameOrEmail},e.userInfo.id))})})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:u===le.Segments?"checked":"unchecked",onClick:()=>{m(le.Segments)},children:t("uniquement_ce_54026")}),u===le.Segments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(fr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(dc,{isSearchVisible:!0,multiple:!0,values:p,onChange:f,children:(l.event?.segments??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{disabled:_,isLoading:c,onClick:async()=>{if(x){const t={recipients:u,segmentsIds:p,usersInfosIds:r},{eventAssignmentsEmailsEstimate:n}=await d({eventId:e.eventId,sendAssignmentsEmails:t});e.onSuccess(n,t),e.onClose()}},children:t("envoyer_les_e_m_37846")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},ZM=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o}}=il(),{localEvent:s,setNumberOfWaitingAssigments:r}=Uv(),{data:a,loader:l,reload:d}=Vn('query AssignmentsKpis(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $direction: SortDirection!\n) {\n    organization(id: $organizationId) {\n        emailTemplate(emailType: Assignments, eventId: $eventId) {\n            emailSender {\n                isValidToSendEmail\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        hasFormWithTeamsAllowed\n\n        emailsStats(emailTypes: [Assignments, Refused]) {\n            numberOfClick\n            numberOfOpen\n            numberOfSent\n            numberOfWaiting\n        }\n\n        waitingAssignment: volunteersRegistrations(\n            states: [PreAssigned, WaitingAssignment]\n            limit: 1\n            sort: { attribute: "InsertedAt", direction: $direction }\n        ) {\n            nodes {\n                userInfoId\n            }\n\n            totalCount\n        }\n\n        assigned: volunteersRegistrations(\n            states: [Assigned]\n            limit: 1\n            sort: { attribute: "InsertedAt", direction: $direction }\n        ) {\n            totalCount\n        }\n\n        waitingTeams: teams(state: WaitingAssignment, limit: 1) {\n            nodes {\n                teamCode\n            }\n\n            totalCount\n        }\n    }\n}\n',{organizationId:n,eventId:o,direction:s?.["assignment.leftPanelDirection"]??_t.Desc},[]);const c=Ac(),[u,m,g]=Ec(""),[p,f]=(0,F.useState)(""),[x,_]=(0,F.useState)(0),{data:I,isLoading:v,reload:b}=function(e){return Vn("query AssignmentsEmails($eventId: EventId!, $name: String, $state: EmailState, $offset: Int) {\n    event(id: $eventId) {\n        emails(\n            emailTypes: [Assignments, Refused]\n            name: $name\n            state: $state\n            limit: 25\n            offset: $offset\n        ) {\n            nodes {\n                ...EmailRecipient\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",e,[Ro.EmailRecipientFragment])}({eventId:o,name:h(m)?m:void 0,state:""!==p?p:void 0,offset:x}),[j,C]=(0,F.useState)(!1),[y,k]=(0,F.useState)(null),[A,w]=(0,F.useState)(0),[S,E]=(0,F.useState)(!1);return(0,F.useEffect)(()=>{a.event?.waitingAssignment&&r(a.event.waitingAssignment.totalCount)},[a]),l||(0,i.jsxs)(Ea,{css:{padding:"$7"},direction:"column",children:[(0,i.jsx)(fr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("mes_affectation_73224")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"6",children:[(0,i.jsx)(Aw,{button:(0,i.jsxs)(i.Fragment,{children:[a.event.hasFormWithTeamsAllowed&&(0,i.jsx)(pl,{color:"invisible",disabled:0===a.event.waitingTeams.totalCount,onClick:()=>{e.push(So.TEAM_ASSIGNMENT(n,o,a.event.waitingTeams.nodes[0].teamCode))},children:t("affecter_les_q_17322")}),(0,i.jsx)(pl,{disabled:0===a.event.waitingAssignment.totalCount,onClick:()=>{e.push(So.ASSIGNMENT(n,o,a.event.waitingAssignment.nodes[0].userInfoId))},children:t("affecter_les_me_77160")})]}),icon:"arrow-trend-up",iconColor:"success",text:t("membre_en_atten_84228",a.event.waitingAssignment.totalCount),value:a.event.waitingAssignment.totalCount}),(0,i.jsx)(Aw,{button:(0,i.jsx)(pl,{onClick:()=>{C(!0)},children:t("param_trer_et_e_31095")}),icon:"at",iconColor:"success",text:t("e_mail_de_confi_84099",a.event.emailsStats.numberOfWaiting),value:a.event.emailsStats.numberOfWaiting}),(0,i.jsx)(Aw,{button:(0,i.jsx)(pl,{onClick:()=>{e.push(So.VOLUNTEERS(n,o))},children:t("voir_les_membre_27923")}),icon:"user-check",iconColor:"success",text:t("membre_affect_05484",a.event.assigned.totalCount),value:a.event.assigned.totalCount})]}),(0,i.jsx)(Pa,{height:"9"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("historique_des_68195")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsxs)(Ea,{gap:"6",children:[(0,i.jsx)(Aw,{icon:"paper-plane",iconColor:"purple",text:t("nombre_d_envois_95106"),value:a.event.emailsStats.numberOfSent??0}),(0,i.jsx)(Aw,{icon:"eye",iconColor:"success",text:t("nombre_d_ouvert_84187"),value:a.event.emailsStats.numberOfOpen??0}),(0,i.jsx)(Aw,{icon:"hand-pointer",iconColor:"primary",text:t("nombre_de_clics_64232"),value:a.event.emailsStats.numberOfClick??0})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(kc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{width:200,children:(0,i.jsxs)(gu,{value:p,onChange:e=>{f(e),_(0)},children:[(0,i.jsx)("option",{value:"",children:t("tous_les_status_67644")}),c(en.filter(e=>e!==Ee.Queued))]})}),(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_un_d_02329"),value:u,onChange:e=>{g(e),_(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:t("nom_du_membre_69353")}),(0,i.jsx)(Tc,{children:t("date_d_envoi_74668")}),(0,i.jsx)(Tc,{children:t("status_06428")}),(0,i.jsx)(Tc,{width:100})]}),numberOfPages:I.event?.emails.numberOfPages??0,offset:x,rows:v?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):Zo(I.event.emails.nodes)?(0,i.jsx)(i.Fragment,{children:I.event.emails.nodes.map(e=>(0,i.jsx)(zb,{email:e,emailType:ze.Assignments,reload:b},e.id))}):(0,i.jsx)(Uy,{subtitle:t("vous_n_avez_pas_92612"),title:t("aucun_courriel_12121")}),setOffset:_,title:t("liste_des_envoi_52697"),totalCount:I.event?.emails.totalCount??0}),j&&(0,i.jsx)(KM,{emailSender:a.organization.emailTemplate?.emailSender,eventId:o,onClose:()=>{C(!1)},onSuccess:(e,t)=>{w(e),k(t),E(!0)}}),S&&(0,i.jsx)(YM,{eventId:o,numberOfEmails:A,reload:d,sendAssignmentsEmails:y,onClose:()=>{E(!1)}})]})},XM=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o}}=il(),{localEvent:s}=Uv(),{data:r,loader:a}=Vn('query PreAssignmentsKpis($eventId: EventId!, $direction: SortDirection!) {\n    event(id: $eventId) {\n        preAssigneds: volunteersRegistrations(\n            states: [PreAssigned]\n            limit: 1\n            sort: { attribute: "InsertedAt", direction: $direction }\n        ) {\n            nodes {\n                userInfoId\n            }\n\n            totalCount\n        }\n    }\n}\n',{eventId:o,direction:s?.["assignment.leftPanelDirection"]??_t.Desc},[]);return a||(0,i.jsxs)(Ea,{css:{padding:"$7"},direction:"column",children:[(0,i.jsx)(fr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("mes_affectation_73224")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{gap:"6",children:(0,i.jsx)(Aw,{button:(0,i.jsx)(pl,{disabled:0===r.event.preAssigneds.totalCount,onClick:()=>{e.push(So.ASSIGNMENT(n,o,r.event.preAssigneds.nodes[0].userInfoId))},children:t("affecter_les_me_77160")}),icon:"arrow-trend-up",iconColor:"success",text:t("membre_en_atten_84228",r.event.preAssigneds.totalCount),value:r.event.preAssigneds.totalCount})})]})},JM=()=>{const e=Ln(),{event:{name:t},isEventAdmin:n,updateLocalEvent:o}=Uv();return Cd(`${t} ${e("mes_affectation_73224")}`),(0,F.useEffect)(()=>{(async()=>{await Promise.all([o({"assignment.filters.positionsCategoriesIds":null}),o({"assignment.filters.positionsIds":null}),o({"assignment.filters.date":null}),o({"assignment.filters.tagsIds":null}),o({"assignment.filters.segmentId":null}),o({"assignment.filters.excludeFull":!1})])})()},[]),n?(0,i.jsx)(ZM,{}):(0,i.jsx)(XM,{})},QM=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,teamCode:r}}=il(),a=r===e.team.teamCode,[l,d]=(0,F.useState)(a);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",css:{background:a?"$primary100":"white",borderBottom:l?"none":"1px solid $gray200",cursor:"pointer",padding:"$4","&:hover":{background:"$primary100"}},gap:"4",onClick:()=>{t.push(So.TEAM_ASSIGNMENT(o,s,e.team.teamCode))},children:[(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray800 textSm semiBold",children:e.team.teamCode}),(0,i.jsx)(fr,{color:"gray500",children:n("_1_membre_49737",e.team.members.length)})]}),(0,i.jsx)(fr,{color:"gray900",css:{cursor:"pointer",padding:"$2"},fontSize:"textMd",onClick:e=>{Il(e),d(!l)},children:(0,i.jsx)(Va,{icon:l?"chevron-down":"chevron-right"})})]}),l&&e.team.members.map((n,r)=>(0,i.jsx)(LF,{displayBorder:r===e.team.members.length-1,isSelected:a,vr:n,onClick:()=>{t.push(So.TEAM_ASSIGNMENT(o,s,e.team.teamCode))}},n.userInfo.id))]})},eN=e=>{const{params:{organizationId:t,eventId:n,teamCode:o},translate:s}=il(),r=e.event?.teams.totalCount??0,a=e.event?.teams.nodes??[];return(0,i.jsxs)(Ea,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ea,{css:{padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(yb,{color:"primary",returnPathFallback:So.TEAM_ASSIGNMENT(t,n,o),children:s("retour_92202")}),(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{font:"gray900 textLg medium",children:s("affectation_plural")}),(0,i.jsx)(Gd,{color:"error",size:"sm",children:s("_1_quipe_rest_49090",r)})]})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(Ea,{css:{flex:"1",overflowY:"auto"},direction:"column",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(BF,{}),(0,i.jsx)(BF,{}),(0,i.jsx)(BF,{})]}):a.map(e=>(0,i.jsx)(QM,{team:e},e.teamCode))})]})},tN=()=>{const{translate:e,params:{eventId:t,teamCode:n}}=il(),{positionsSlotsIds:o,showNextVolunteer:s}=OM(),{mutate:r,isLoading:a}=function(e={}){return Un("mutation TeamAssignmentRefuse($eventId: EventId!, $teamCode: TeamCode!) {\n    teamAssignmentRefuse(eventId: $eventId, teamCode: $teamCode)\n}\n",e)}(),{mutate:l,isLoading:d}=function(e={}){return Un("mutation TeamAssign($eventId: EventId!, $teamCode: TeamCode!, $assignment: AssignmentInput!) {\n    teamAssign(eventId: $eventId, teamCode: $teamCode, assignment: $assignment)\n}\n",e)}();return(0,i.jsxs)(Ea,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,width:1,children:[(0,i.jsx)(fr,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{d||a||(await r({eventId:t,teamCode:n}),s())},children:e("refuser_l_quip_29246")}),(0,i.jsx)(fr,{css:{flex:"1"}}),(0,i.jsx)(pl,{color:"primary",isLoading:d,onClick:async()=>{d||a||(await l({eventId:t,teamCode:n,assignment:{positionsSlotsIds:o}}),s())},children:e("affecter_l_qui_23291")}),(0,i.jsx)(pl,{color:"white",onClick:s,children:e("affecter_l_qui_37763")})]})},nN=e=>{const t=Ln();return(0,i.jsx)(Ea,{align:"center",css:{padding:"$5 $6"},gap:"4",children:(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(fr,{font:"gray900 textXl medium",children:e.team.teamCode}),(0,i.jsx)(fr,{color:"gray500",children:t("_1_membre_49737",e.team.members.length)})]})})},iN=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),s=(0,F.useMemo)(()=>e.team.leaderUserInfo.formsUsersInfos.filter(t=>t.form.id===e.team.formId),[e.team]);return(0,i.jsxs)(Ea,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ea,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:e.onCollapse,children:(0,i.jsx)(Va,{icon:"sidebar"})})}),(0,i.jsx)(am,{placement:"top",children:t("cacher_les_info_67266")})]}),(0,i.jsx)(fr,{font:"gray900 textMd semiBold",children:t("_propos_de_l_47506")})]}),e.team.members.map(n=>(0,i.jsx)(qF,{customFields:e.customFields,formsIds:[e.team.formId],title:t("informations_de_63884",n.userInfo.nameOrEmail),userInfo:n.userInfo},n.id)),(0,i.jsx)(YF,{eventId:o,formsUsersInfos:s,organizationId:n}),(0,i.jsx)(KF,{formsUsersInfos:s})]})},oN=e=>{const{history:t,params:{organizationId:n,eventId:o,teamCode:s}}=il(),[r,a]=ET("assignment.isLeftPanelOpen",!0),[l,d]=ET("assignment.isRightPanelOpen",!0),{data:c,isLoading:u}=Vn("query TeamAssignmentWaitingTeams($eventId: EventId!) {\n    event(id: $eventId) {\n        teams(state: WaitingAssignment) {\n            nodes {\n                teamCode\n\n                members {\n                    ...VolunteerRegistrationWaitingAssignment\n                }\n            }\n\n            totalCount\n        }\n    }\n}\n",{eventId:o},[Ro.VolunteerRegistrationWaitingAssignmentFragment]),h=(0,F.useCallback)(()=>{const e=c.event?.teams.nodes??[],i=e.findIndex(e=>e.teamCode===s),r=e[i+1]?.teamCode??e[0].teamCode;r===s?t.goBack(So.ASSIGNMENTS(n,o)):t.replace(So.TEAM_ASSIGNMENT(n,o,r))},[n,o,s,c.event]),m=e.event.team,g=(0,F.useMemo)(()=>({wishedPositionsCategoriesIds:m.positionsCategoriesIds,wishedPositionsIds:m.positionsIds,wishedPositionsSlotsIds:m.positionsSlotsIds,wishedRanges:m.slots.map(({range:e})=>e)}),[m]);return(0,i.jsx)($M,{isEdit:!1,positionsCategoriesIds:[],positionsIds:[],positionsSlotsIds:[],showNextVolunteer:h,teams:[],children:(0,i.jsx)(MF,{buttons:(0,i.jsx)(tN,{}),header:(0,i.jsx)(nN,{team:m}),isEdit:!1,isLeftPanelOpen:r,isRightPanelOpen:l,leftPanel:(0,i.jsx)(eN,{event:c.event,isLoading:u}),rightPanel:(0,i.jsx)(iN,{customFields:e.event.formsCustomsFields,team:m,onCollapse:()=>{d(!1)}}),setIsLeftPanelOpen:a,setIsRightPanelOpen:d,children:(0,i.jsx)(GM,{event:e.event,organization:e.organization,state:Et.NotApplicable,userInfo:m.leaderUserInfo,...g})})})},sN=()=>{const{params:{organizationId:e,eventId:t,teamCode:n}}=il(),{data:o,loader:s}=Vn("query TeamAssignmentInfos(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $teamCode: TeamCode!\n) {\n    organization(id: $organizationId) {\n        tags {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        startAt\n        endAt\n\n        formsCustomsFields {\n            ...CustomFieldWithCondition\n        }\n\n        positionsCategories {\n            id\n            name\n        }\n\n        positions {\n            nodes {\n                id\n                name\n            }\n        }\n\n        segments(segmentType: Positions) {\n            id\n            name\n        }\n\n        team(teamCode: $teamCode) {\n            teamCode\n            formId\n\n            leaderUserInfo {\n                name\n                fields\n\n                ...FormsUsersInfosWished\n            }\n\n            members {\n                id\n\n                userInfo {\n                    email\n                    nameOrEmail\n                    fields\n                }\n            }\n\n            positionsCategoriesIds\n            positionsIds\n            positionsSlotsIds\n\n            slots: slotsMerged {\n                range\n            }\n        }\n    }\n}\n",{organizationId:e,eventId:t,teamCode:n},[Ro.CustomFieldWithConditionFragment,Ro.FormsUsersInfosWishedFragment]);return s||(0,i.jsx)(oN,{event:o.event,organization:o.organization})},rN=()=>{const{history:e,params:{organizationId:t,eventId:n},translate:o}=il(),{event:{name:s},isEventAdmin:r}=Uv();Cd(`${s} ${o("Campaigns")}`);const a=Ac(),[l,d]=(0,F.useState)(""),[c,u]=(0,F.useState)(""),m=Sc(e=>{u(e),v()}),[g,p]=(0,F.useState)(""),[f,x]=(0,F.useState)(""),[_,I]=(0,F.useState)(0),v=()=>{I(0)},[b,j]=(0,F.useState)(null),{data:C,isLoading:y,reload:k}=Vn("query Campaigns(\n    $eventId: EventId!\n    $name: String\n    $states: [CampaignState!]\n    $campaignType: CampaignType\n    $offset: Int\n    $sort: CampaignsSort\n) {\n    event(id: $eventId) {\n        campaignsCost\n\n        campaigns(\n            name: $name\n            states: $states\n            campaignType: $campaignType\n            limit: 25\n            offset: $offset\n            sort: $sort\n        ) {\n            nodes {\n                ...CampaignList\n            }\n\n            numberOfPages\n            totalCount\n        }\n\n        doneCampaigns: campaigns(states: [Done]) {\n            totalCount\n        }\n    }\n}\n",{eventId:n,name:h(c)?c:void 0,states:""!==g?[g]:void 0,campaignType:""!==f?f:void 0,offset:_,sort:b},[Ro.CampaignListFragment]);jO(C.event?.campaigns.nodes??[],k);const{hasPositionPermissions:A}=Uv(),[w]=A([db.SEND_CAMPAIGNS]);return(0,i.jsxs)(Ea,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsxs)(Ea,{gap:"4",width:1,children:[(0,i.jsx)(fr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:o("Campaigns")}),r?(0,i.jsx)(gS,{menu:(0,i.jsx)(Od,{icon:"paper-plane",onClick:()=>{e.push(rI.CREATE_TEMPLATE({organizationId:t,eventId:n}))},children:o("cr_er_un_mod_le_20298")}),onClick:()=>{e.push(rI.CREATE({organizationId:t,eventId:n}))},children:o("cr_er_une_campa_96023")}):w?(0,i.jsx)(pl,{to:rI.CREATE({organizationId:t,eventId:n}),children:o("cr_er_une_campa_96023")}):null]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(wb,{content:C.event?.doneCampaigns.totalCount??"-",title:o("nombre_de_campa_52133")}),(0,i.jsx)(wb,{content:C.event?.campaignsCost??"-",title:o("co_t_des_campag_08459")})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Ea,{css:{boxShadow:"$xs"},direction:"column",children:(0,i.jsx)(kc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{width:200,children:(0,i.jsxs)(gu,{value:g,onChange:e=>{p(e),v()},children:[(0,i.jsx)("option",{value:"",children:o("toutes_les_camp_81617")}),a(Gt)]})}),(0,i.jsx)(fr,{width:200,children:(0,i.jsxs)(gu,{value:f,onChange:e=>{x(e),v()},children:[(0,i.jsx)("option",{value:"",children:o("sms_et_e_mail_94587")}),a(Ht)]})}),(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:o("rechercher_une_69554"),value:l,onChange:e=>{d(e),m(e)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tm,{attribute:de.Name,setSort:j,sort:b,children:o("nom_de_la_campa_45063")}),(0,i.jsx)(tm,{attribute:de.Type,css:{flex:"0 150px"},setSort:j,sort:b,children:o("type_35427")}),(0,i.jsx)(Tc,{css:{flex:"0 200px"},children:o("nombre_de_desti_21374")}),(0,i.jsx)(Tc,{css:{flex:"0 150px"},children:o("co_t_68998")}),(0,i.jsx)(tm,{attribute:de.State,css:{flex:"0 150px"},setSort:j,sort:b,children:o("status_06428")}),(0,i.jsx)(Tc,{css:{flex:"0 100px"}})]}),numberOfPages:C.event?.campaigns.numberOfPages??0,offset:_,rows:y?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:Zo(C.event.campaigns.nodes)?(0,i.jsx)(i.Fragment,{children:C.event.campaigns.nodes.map(e=>(0,i.jsx)(bO,{campaign:e,canSendCampaigns:w,eventId:n,organizationId:t,reload:k},e.id))}):(0,i.jsx)(Uy,{title:o("no_campaigns")})}),setOffset:I,title:o("liste_des_campa_60034"),totalCount:C.event?.campaigns.totalCount??0})})]})},aN=({organizationId:e,eventId:t,category:n,clickable:o})=>{const s=Ln();return(0,i.jsx)(Cc,{children:(0,i.jsx)(xc,{children:(0,i.jsxs)(Ea,{direction:"column",gap:"2",width:1,children:[(0,i.jsxs)(Ea,{gap:"3",justify:"between",children:[o?(0,i.jsx)(j_,{to:ao.POSITION_CATEGORY({organizationId:e,eventId:t,positionCategoryId:n.id}),children:n.name}):(0,i.jsx)(fr,{color:"gray700",children:n.name}),(0,i.jsx)(fr,{color:"gray700",children:s("_1_2_membres_04485",n.assignedResources,n.resources)})]}),(0,i.jsx)(fr,{width:1,children:(0,i.jsx)(YA,{percent:n.assignedResources/n.resources})})]})})},n.id)},lN=e=>(0,i.jsx)(Ea,{align:"center",css:{background:"white",bd:!0,cursor:"pointer",padding:"$3 $4"},gap:"3",width:1,children:(0,i.jsxs)(La,{to:e.path,width:1,children:[(0,i.jsx)(Ea,{align:"center",css:{background:e.isDone?"$success100":"",border:e.isDone?"":"1px solid $gray300",borderRadius:"20px",color:"$success700",fontSize:"10px"},height:20,justify:"center",width:20,children:e.isDone&&(0,i.jsx)(Va,{icon:"check"})}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{color:"gray800",css:{textDecoration:e.isDone?"line-through":""},fontWeight:"medium",children:e.title}),(0,i.jsx)(fr,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(fr,{color:"gray900",css:{cursor:"pointer"},children:(0,i.jsx)(Va,{icon:"arrow-right"})})]})}),dN=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o}}=il(),s=Nn(Ng),{isEventAdmin:r}=Uv(),{data:a,loader:l}=Vn("query Dashboard($eventId: EventId!) {\n    event(id: $eventId) {\n        assignedResources\n        numberOfPositions\n        resources\n        volunteerMinutesAssigned\n        volunteerMinutesNeeded\n\n        assignmentsStats {\n            numberOfAssigned\n            numberOfWaitingAssignment\n        }\n\n        onboarding {\n            isFirstCampaignCreated\n            isFirstFormCreated\n            isFirstPositionCreated\n        }\n\n        positionsCategories {\n            id\n            name\n            resources\n            assignedResources\n        }\n    }\n}\n",{eventId:o},[]),d=(0,F.useMemo)(()=>a.event?(0,Zd.A)(a.event.positionsCategories,e=>e.name.toLowerCase()):[],[a.event]),c=!(!r||!a.event||a.event.onboarding.isFirstCampaignCreated&&a.event.onboarding.isFirstFormCreated&&a.event.onboarding.isFirstPositionCreated);return l||(0,i.jsxs)(Ea,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:t("tableau_de_bord_24627")}),(0,i.jsx)(Pa,{height:"7"}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(PM,{header:(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:t("vos_premiers_pa_81169")}),(0,i.jsx)(fr,{color:"gray500",children:t("pour_bien_d_mar_03933")})]}),initialIsOpen:!0,children:(0,i.jsxs)(Ea,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(lN,{isDone:a.event.onboarding.isFirstPositionCreated,path:So.CREATE_POSITION(n,o),subtitle:t("cr_er_une_nouve_43436"),title:t("cr_er_votre_pre_70209")}),(0,i.jsx)(lN,{isDone:a.event.onboarding.isFirstFormCreated,path:zi.FORMS({organizationId:n,eventId:o}),subtitle:t("cr_er_un_formul_31199"),title:t("cr_er_votre_pre_76199")}),(0,i.jsx)(lN,{isDone:a.event.onboarding.isFirstCampaignCreated,path:rI.CREATE({organizationId:n,eventId:o}),subtitle:t("communiquer_fac_26569"),title:t("envoyer_votre_p_47899")})]})}),(0,i.jsx)(Pa,{height:"8"})]}),(0,i.jsxs)(Jl,{gap:"6",gridtemplatecolumns:"1fr 1fr 350px",gridtemplaterows:"1fr 1fr",children:[(0,i.jsx)(fr,{css:{gridColumn:"1 / 2",gridRow:"1 / 2"},children:(0,i.jsx)(Aw,{button:(0,i.jsx)(pl,{to:ao.POSITIONS({organizationId:n,eventId:o}),children:t("voir_les_missio_71964")}),icon:"user-group",iconColor:"primary",text:t("nombre_de_membr_60320",a.event.resources),value:a.event.resources})}),(0,i.jsx)(fr,{css:{gridColumn:"2 / 3",gridRow:"1 / 2"},children:(0,i.jsx)(Aw,{button:(0,i.jsx)(pl,{to:ao.POSITIONS({organizationId:n,eventId:o}),children:t("voir_les_missio_71964")}),icon:"sitemap",iconColor:"purple",text:t("nombre_de_missi_67304",a.event.numberOfPositions),value:a.event.numberOfPositions})}),(0,i.jsx)(fr,{css:{gridColumn:"1 / 2",gridRow:"2 / 3"},children:(0,i.jsx)(Aw,{button:(0,i.jsx)(pl,{onClick:()=>{e.push(So.VOLUNTEERS(n,o))},children:t("voir_les_membre_27923")}),icon:"user-check",iconColor:"success",text:t("nombre_de_membr_87779",a.event.assignmentsStats.numberOfAssigned),value:a.event.assignmentsStats.numberOfAssigned})}),(0,i.jsx)(fr,{css:{gridColumn:"2 / 3",gridRow:"2 / 3"},children:(0,i.jsx)(Aw,{button:(0,i.jsx)(pl,{onClick:()=>{e.push(So.ASSIGNMENTS(n,o))},children:t("voir_mes_affect_10965")}),icon:"wand-magic-sparkles",iconColor:"warning",text:t("nombre_de_membr_63555",a.event.assignmentsStats.numberOfWaitingAssignment),value:a.event.assignmentsStats.numberOfWaitingAssignment})}),(0,i.jsxs)(Ea,{css:{bd:!0,gridColumn:"3 / 4",gridRow:"1 / 3",padding:"$6"},direction:"column",justify:"between",children:[(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(fr,{color:"gray500",children:t("taux_de_remplis_11913")}),(0,i.jsxs)(fr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:[0===a.event.resources?"0":Math.round(a.event.assignedResources/a.event.resources*100),"%"]})]}),(0,i.jsx)(fr,{css:{borderBottom:"1px solid $gray200"},width:1}),(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(fr,{color:"gray500",children:t("temps_de_b_n_vo_87924")}),(0,i.jsx)(fr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:s.minutesToHoursMinutesString(a.event.volunteerMinutesNeeded)})]}),(0,i.jsx)(fr,{css:{borderBottom:"1px solid $gray200"},width:1}),(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(fr,{color:"gray500",children:t("temps_de_b_n_vo_60725")}),(0,i.jsx)(fr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:s.minutesToHoursMinutesString(a.event.volunteerMinutesAssigned)})]})]})]}),(0,i.jsx)(Pa,{height:"8"}),r&&(0,i.jsx)(fr,{css:{boxShadow:"$xs"},children:(0,i.jsx)(kc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Tc,{children:t("cat_gories_24533")})}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:d.length>0?d.map(e=>(0,i.jsx)(aN,{category:e,clickable:!0,eventId:o,organizationId:n},e.id)):(0,i.jsx)(Uy,{subtitle:t("vous_n_avez_pas_59681"),title:t("aucune_cat_gori_21347")})}),setOffset:Bl.A,title:t("liste_des_membr_59735"),totalCount:0})})]})};var cN;let uN=class extends u${static{cN=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...u$.IMPORT_COLUMNS_DEFAULT,CategoryName:"categoryName",Name:"name",FormId:"formId",Deadline:"deadline",MaxResources:"maxResources",LeadersEmails:"leadersEmails",LeadersFirstNames:"leadersFirstnames",LeadersLastNames:"leadersLastnames",PrivateNote:"privateNote",Tags:"tags"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===qe.Update?[cN.IMPORT_COLUMNS_DEFAULT.Id]:[],cN.IMPORT_COLUMNS_DEFAULT.Name,cN.IMPORT_COLUMNS_DEFAULT.FormId];constructor(e,t){super(e,t),this.csvInputService=e}};uN=cN=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hz,Dn])],uN);const hN=()=>{const{params:{organizationId:e,eventId:t},translate:n}=il(),{mutate:o}=function(e={}){return Un("mutation DelegationsImport(\n    $eventId: EventId!\n    $organizationId: OrganizationId!\n    $input: MappableImportInput!\n) {\n    jobId: delegationsImport(eventId: $eventId, organizationId: $organizationId, input: $input)\n}\n",e)}(),{checkDelegationsImport:s}=Yv(),r=(0,F.useCallback)((e,n)=>s(e,t,n),[s,t]),{data:a,loader:l}=Ia({organizationId:e,variety:Ie.Delegation});return l||(0,i.jsx)(l$,{ImportInputService:uN,checkImport:r,closePath:to.DELEGATIONS({organizationId:e,eventId:t}),customFields:a.organization.customFields.nodes,importTagPrefix:"delegations",itemName:{singular:n("team_33516"),plural:n("teams_75559")},localStorageKeyPrefix:"DELEGATIONS_IMPORT",mutate:o,showModeSelection:!1,title:n("import_de_d_l_g_69356")})},mN=e=>{const{translate:t,params:{eventId:n}}=il(),{isEventAdmin:o}=Uv(),[s,r]=(0,F.useState)(e.delegationAccreditationSlot),a=(0,F.useMemo)(()=>Vd(e.accreditationSlot.accreditation.color),[e.accreditationSlot]),l=(0,F.useMemo)(()=>({background:a[50],border:`1px solid ${a[500]}`,color:a[700]}),[a]),d=(0,F.useCallback)(async()=>{const{event:{delegation:t}}=await ws({eventId:n,delegationId:e.delegationId,accreditationSlotId:e.accreditationSlot.id},await H());r(t.accreditationSlot)},[e.accreditationSlot,e.delegationId,r]),[c,u]=(0,F.useState)(!1),h=s.maxResources?`/${s.maxResources}`:"",m=`${s.assignedResources}${h}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{...l,borderRadius:"$1",cursor:o?"pointer":"default",padding:"$2"},direction:"column",gap:"2",height:1,width:1,onClick:()=>{o&&u(!0)},children:[(0,i.jsx)(AA,{background:a[100],count:m,display:"vertical",icon:"badge-check",text:t("attribu_es_48167")}),(0,i.jsx)(AA,{background:a[100],count:s.wishedResources,display:"vertical",icon:"hand-holding-heart",text:t("souhait_es_78101")}),(0,i.jsx)(AA,{background:a[100],count:s.scannedResources,display:"vertical",icon:"scanner-gun",text:t("scann_es_13169")})]}),o&&c&&(0,i.jsx)(kA,{accreditationSlotId:e.accreditationSlot.id,delegationId:e.delegationId,eventId:n,onClose:()=>(u(!1),d())})]})},gN=e=>{const t=(0,F.useMemo)(()=>(e.delegation.accreditationsSlots||[]).find(t=>t.accreditationSlotId===e.accreditationSlot.id),[e.delegation,e.accreditationSlot]);return t?(0,i.jsx)(mN,{accreditationSlot:e.accreditationSlot,delegationAccreditationSlot:t,delegationId:e.delegation.id}):null},pN=e=>(0,i.jsx)(Ea,{css:{borderTop:"1px solid $gray200",height:"$cellHeightXl"},children:e.accreditationsSlots.map(t=>(0,i.jsx)(Ea,{align:"center",css:{borderRight:"1px solid $gray200",padding:"$3 $4"},height:1,width:200,children:(0,i.jsx)(gN,{accreditationSlot:t,delegation:e.delegation})},t.id))}),fN=e=>{const{params:{organizationId:t,eventId:n}}=il(),o=(0,F.useMemo)(()=>oA(e.allAccreditationsSlots),[e.allAccreditationsSlots]),s=(0,F.useMemo)(()=>sA(o,e.selectedSlotsIds),[o,e.selectedSlotsIds]),r=(0,F.useMemo)(()=>rA(s,e.selectedSlotsIds),[s,e.selectedSlotsIds]),a=(0,F.useMemo)(()=>r.map(e=>e.id),[r]),l=(0,F.useCallback)(e=>(0,i.jsx)(Ea,{align:"center",css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",height:"$cellHeightXl",px:"$4"},width:1,children:(0,i.jsx)(j_,{to:to.DELEGATION({organizationId:t,eventId:n,delegationId:e.id}),children:e.name})},e.id),[t,n]),d=(0,F.useCallback)(e=>(0,i.jsx)(pN,{accreditationsSlots:r,delegation:e},e.id),[r,a]);return(0,i.jsx)(Ea,{direction:"column",width:1,children:e.isLoading?(0,i.jsx)(ul,{}):(0,i.jsx)(aA,{allAccreditations:o,cellWidth:200,data:e.delegations,filteredAccreditations:s,limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,renderLeftColumn:l,renderRow:d,selectedSlotsIds:e.selectedSlotsIds,setLimit:e.setLimit,setOffset:e.setOffset,setSelectedSlotsIds:e.setSelectedSlotsIds,slots:r,totalCount:e.totalCount})})},xN=()=>{const{params:{organizationId:e,eventId:t}}=il(),{columns:n,infos:o,limit:s,nameDebounced:r,offset:a,predicates:l,rendering:d,setInfos:c,setLimit:u,setOffset:m}=zC(),g=(0,F.useMemo)(()=>zO(n,d),[n,d]),{data:p,isLoading:f}=Vn("query DelegationsAccreditationsMatrix($eventId: EventId!) {\n    event(id: $eventId) {\n        accreditationsSlots(includeHidden: true, usedInDelegations: true) {\n            nodes {\n                ...AccreditationSlotMatrix\n            }\n        }\n    }\n}\n",{eventId:t},[Ro.AccreditationSlotMatrixFragment]),{data:x,isLoading:_}=Gr({...g,organizationId:e,eventId:t,level:et.Event,predicates:l,name:h(r)?r:null,limit:s,offset:a}),{numberOfPages:I,totalCount:v}=lu(x.data?.rows),b=(0,F.useMemo)(()=>o.delegationsMatrixSelectedSlotsIds||[],[o]),j=(0,F.useCallback)(e=>c({...o,delegationsMatrixSelectedSlotsIds:e}),[o,c]);return(0,i.jsx)(fN,{allAccreditationsSlots:p.event?.accreditationsSlots.nodes??[],delegations:x.data?.rows.nodes??[],isLoading:_||f,limit:s,numberOfPages:I,offset:a,selectedSlotsIds:b,setLimit:u,setOffset:m,setSelectedSlotsIds:j,totalCount:v})},_N=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:r}=il(),{mutate:a,isLoading:l}=_a(),[d,c]=(0,F.useState)(!1),[u,h]=(0,F.useState)([]),[m,g]=(0,F.useState)(!0),p=!d||Zo(u);return(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"user-group",subtitle:r("ajoutez_une_d_l_54234"),children:r("cr_ation_d_une_07120")}),(0,i.jsxs)(Qv,{children:[(0,i.jsx)(fr,{font:"gray800 textSm medium",children:r("que_souhaitez_v_87607")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(tO,{state:d?"unchecked":"checked",onClick:()=>c(!1),children:r("cr_er_une_nouve_45377")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(tO,{state:d?"checked":"unchecked",onClick:()=>c(!0),children:r("cr_er_une_d_l_g_37657")}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(dc,{isSearchVisible:!0,label:r("_quelle_d_l_ga_55758"),multiple:!1,renderOnPortal:!0,values:u,onChange:h,children:e.parentDelegations.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(su,{value:m,onChange:g,children:r("je_souhaite_app_69393")})]})]}),(0,i.jsx)(Jv,{children:(0,i.jsx)(pl,{disabled:!p,isLoading:l,onClick:async()=>{let i;if(d&&Zo(u)){const t=u[0],n=e.parentDelegations.find(e=>e.id===t);Zo(n.leadersIds)&&await a({eventId:o,usersInfosIds:n.leadersIds,sendVolunteerRegistrationEmail:!1}),i=s(JSON.stringify({parentId:t,applyParentSettings:m}))}t.push(So.CREATE_DELEGATION(n,o,i))},children:r("suivant_62774")})})]})},IN=()=>{const{history:e,params:{organizationId:t,eventId:n},translate:o}=il(),{segment:s,columns:r}=zC(),{data:a}=Vn("query ParentDelegations($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        delegations(level: Organization) {\n            nodes {\n                id\n                name\n                leadersIds\n            }\n        }\n    }\n}\n",{organizationId:t},[]),{mutate:l}=function(e={}){return Un("mutation DelegationsExport(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $segmentId: SegmentId!\n    $format: ExportFormat!\n    $columns: [String!]!\n) {\n    jobId: delegationsExport(\n        organizationId: $organizationId\n        eventId: $eventId\n        segmentId: $segmentId\n        format: $format\n        columns: $columns\n    )\n}\n",e)}(),[d,c]=(0,F.useState)(!1),[u,h]=(0,F.useState)(!1),m=Zo(a.organization?.delegations.nodes),{checkExport:g}=Yv();return(0,i.jsxs)(xO,{children:[(0,i.jsx)(ub,{rolesTypes:zv,children:m?(0,i.jsxs)(nb,{children:[(0,i.jsx)(ib,{children:(0,i.jsx)(pl,{children:o("cr_er_une_d_l_g_23035")})}),(0,i.jsx)(_N,{parentDelegations:a.organization.delegations.nodes})]}):(0,i.jsx)(pl,{to:So.CREATE_DELEGATION(t,n),children:o("cr_er_une_d_l_g_23035")})}),(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsxs)(ub,{rolesTypes:zv,children:[(0,i.jsx)(Od,{icon:"plus",onClick:()=>{c(!0)},children:o("cr_er_une_cat_g_20051")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"})]}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsx)(Od,{icon:"file-import",to:So.EVENT_DELEGATIONS_IMPORT(t,n),onClick:e=>wd(e.target),children:o("importer_des_d_05454")})}),(0,i.jsx)(Od,{icon:"file-xls",onClick:e=>{wd(e.target),h(!0)},children:o("exporter_en_exc_51862")})]})]}),(0,i.jsx)(CR,{isOpen:u,requestExport:async e=>{const{jobId:i}=await l({organizationId:t,eventId:n,segmentId:s.id,format:e,columns:r});g(t,n,i)},showIncludeFiles:!1,onClose:()=>{h(!1)}}),d&&(0,i.jsx)(cC,{eventId:n,organizationId:t,onClose:()=>c(!1),onSuccess:i=>{e.push(to.DELEGATION_CATEGORY({organizationId:t,eventId:n,delegationCategoryId:i.id}))}})]})},vN=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{isEventAdmin:s}=Uv(),{limit:r,rendering:a,segment:l}=zC(),d=a===bh.List,c=s&&a===bh.List;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(IN,{}),0===e.numberOfDelegations?(0,i.jsx)(yC,{css:{overflow:"hidden"},children:(0,i.jsx)(fr,{css:{overflow:"hidden"},width:1,children:(0,i.jsx)(rk,{title:t("vous_n_avez_pas_58215")})})}):(0,i.jsxs)(yC,{children:[(0,i.jsx)(fO,{searchRow:(0,i.jsx)(gO,{actions:(0,i.jsx)(VO,{}),searchPlaceholder:t("rechercher_une_31213"),showEditColumns:d,showEditMode:c,showSearchColumns:!0}),selectSegment:(0,i.jsx)(FO,{pageSelectedText:t("les_1_d_l_gat_27248",r),segmentSelectedText:t("les_1_d_l_gat_04594",l.count,l.name)})}),a===bh.AccreditationsMatrix?(0,i.jsx)(xN,{}):(0,i.jsx)(gR,{customFields:e.customFields,eventId:o,level:et.Event,organizationId:n})]})]})},bN=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,segmentId:r}}=il(),{isEventAdmin:a,localEvent:l,updateLocalEvent:d}=Uv(),c=Nn($O),u=(0,F.useMemo)(()=>c.getDelegationsFilters(e.event.organizationId,s,e.organization.customFields.nodes,e.organization.delegationsCategories.nodes),[e.event,e.organization,s]),h=(0,F.useMemo)(()=>c.getDelegationsPossibleColumns(e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(PO,{eventId:s,getEditPath:e=>ri(to.DELEGATION({organizationId:o,eventId:s,delegationId:e})),getShowPath:e=>to.DELEGATION({organizationId:o,eventId:s,delegationId:e}),organizationId:o,children:(0,i.jsx)(uO,{eventId:s,filters:u,filtersButtonText:n("filtrer_les_d_l_04628"),filtersSubtitle:n("appliquer_des_f_65318"),getSegmentPath:e=>So.DELEGATIONS_SEGMENT(o,s,e),hideSegments:0===e.event.numberOfDelegations,initialLimit:l?.delegationsLimit??_c,initialSegmentsOpen:l?.areDelegationsSegmentsOpen??!0,isAdmin:a,organizationId:o,possibleColumns:h,possibleRenderings:[bh.List,bh.AccreditationsMatrix],reload:e.reload,segmentId:r,segmentType:ft.Delegations,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{d({delegationsLimit:e})},onSegmentClick:e=>{d({delegationsSegmentId:e})},onSegmentDelete:async()=>{await d({delegationsSegmentId:null}),t.replace(to.DELEGATIONS({organizationId:o,eventId:s}))},onSegmentsToggle:async e=>{await d({areDelegationsSegmentsOpen:e})},children:(0,i.jsx)(vN,{customFields:e.organization.customFields.nodes,numberOfDelegations:e.event.numberOfDelegations})})})},jN=()=>{const{params:{organizationId:e,eventId:t},translate:n}=il(),{event:{name:o},localEvent:s}=Uv();Cd(`${o} ${n("d_l_gations_78318")}`);const{data:r,loader:a,reload:l}=Vn("query DelegationsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n    organization(id: $organizationId) {\n        customFields(variety: Delegation) {\n            nodes {\n                ...SegmentCustomField\n            }\n        }\n\n        delegationsCategories(level: Event, eventId: $eventId) {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        organizationId\n        numberOfDelegations\n\n        segmentsFolders(segmentType: Delegations) {\n            ...SegmentsFoldersSegments\n        }\n    }\n}\n",{organizationId:e,eventId:t},[Ro.SegmentCustomFieldFragment,Ro.SegmentsFoldersSegmentsFragment]),d=(0,F.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.DELEGATIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(bN,{event:r.event,organization:r.organization,reload:l})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.DELEGATIONS_SEGMENT(e,t,s?.delegationsSegmentId&&d.includes(s.delegationsSegmentId)?s.delegationsSegmentId:d[0]),replace:!0})})]})},CN=()=>{const{hasFeature:e}=nI();return e(Fe.Delegation)?(0,i.jsx)(jN,{}):(0,i.jsx)(Ea,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(iI,{icon:"people-group"})})};let yN=class extends zl{constructor(e){super(e)}customDocumentInputDefault(e){return{name:e?.name??"",slug:e?.slug??"",populationsIds:e?.populationsIds??[],configuration:e?.configuration??this.getConfigurationDefault()}}customDocumentInputSchema(){return l.Ik().shape({name:l.Yj().required(this.t("le_nom_est_requ_61536")),slug:l.Yj().required(this.t("le_nom_de_la_va_15472")).test("is-valid",this.t("le_nom_de_la_va_15472"),e=>null!==e.match(/^[a-z][a-z0-9]*$/))})}getConfigurationDefault(){return{bleed:!1,height:Dm,pages:[this.getPageDefault()],width:Fm}}getPageDefault(){return{id:N(),accreditationsSlotsIds:[],accreditationAcronym:"",conditionsCustomFields:[],elements:[],hasConditions:!1,positionsSlotsIds:[]}}getContainerElementDefault(e,t,n){return{type:"container",id:e,inContainer:t,backgroundColor:"",accreditationsSlotsIds:[],accreditationAcronym:"",align:"start",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,conditionsCustomFields:[],direction:"row",elements:[],gap:0,hasBackground:!1,hasConditions:!1,hasRotate:!1,height:100,isRatioLocked:!1,justify:"start",left:0,name:this.t("conteneur_1_03989",n+1),positionsSlotsIds:[],px:0,py:0,rotateDegree:0,top:0,width:100,zIndex:1}}getImageElementDefault(e,t,n){return{type:"image",id:e,inContainer:t,accreditationsSlotsIds:[],accreditationAcronym:"",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,conditionsCustomFields:[],hasConditions:!1,hasRotate:!1,height:100,isRatioLocked:!1,left:0,name:this.t("image_1_30956",n+1),positionsSlotsIds:[],px:0,py:0,rotateDegree:0,top:0,width:100,zIndex:1}}getTextElementDefault(e,t,n){return{type:"text",id:e,inContainer:t,accreditationsSlotsIds:[],accreditationAcronym:"",align:"start",hasBackground:!1,backgroundColor:"",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,conditionsCustomFields:[],hasConditions:!1,hasRotate:!1,height:20,isRatioLocked:!1,left:0,name:this.t("texte_1_59540",n+1),text:"",color:"#1d2939",fontFamily:"Open Sans",fontSize:14,fontWeight:400,justify:"start",lineHeight:1.4,positionsSlotsIds:[],px:0,py:0,rotateDegree:0,textTransform:"none",top:0,width:100,zIndex:1}}};function kN(e){const t=e=>e.flatMap(e=>"container"===e.type?[e].concat(t(e.elements)):[e]);return e.configuration.pages.flatMap(e=>t(e.elements))}function AN(e,t,n){const i={...e,id:t,name:n};if("container"===i.type){const e=i.elements.map(e=>AN(e,N(),e.name));return{...i,elements:e}}return i}function wN(e,t){return e===Dm&&t===Fm?"a4":e===Mm&&t===Nm?"a6":e===Vm&&t===Um?"cb":"custom"}function SN(e,t,n,i,o){return!e.hasConditions||(Zo(e.accreditationsSlotsIds)?Zo((0,Zu.A)(e.accreditationsSlotsIds,t)):h(e.accreditationAcronym)?n.some(t=>e.accreditationAcronym===t):Zo(e.positionsSlotsIds)?Zo((0,Zu.A)(e.positionsSlotsIds,i)):!Zo(e.conditionsCustomFields)||e.conditionsCustomFields.every(({slug:e,value:t})=>"isEmpty"===t?m(o[e]?.rawValue):"isNotEmpty"===t?h(o[e]?.rawValue):"boolean"==typeof t?o[e]?.rawValue===t:!!Array.isArray(t)&&Zo((0,Zu.A)(Ko(o[e]?.rawValue),t))))}yN=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],yN);const EN=F.createContext({}),TN=e=>{const{translate:t,params:{eventId:n}}=il(),o=Nn($c),s=Nn(Ku),r=Nn(yN),[l,d]=F.useState(e.initialCustomDocument),[c,m]=F.useState(null),[g,p]=F.useState(null),[f,x]=F.useState("parameters"),_=F.useCallback(e=>{d((0,Jc.jM)(t=>{t.name=e}))},[l,d]),I=F.useCallback((e,t)=>{d((0,Jc.jM)(n=>{n.configuration.pages.forEach(n=>{n.id===g&&(n[e]=t)})}))},[g,d]),v=F.useCallback(e=>{d((0,Jc.jM)(t=>{t.populationsIds=e}))},[d]),b=F.useCallback(e=>{d((0,Jc.jM)(t=>{t.slug=u(e,{replacer:a.Empty})}))},[d]),j=F.useCallback(e=>{d((0,Jc.jM)(t=>{t.configuration.bleed=e}))},[l,d]),C=F.useCallback((e,t)=>{d((0,Jc.jM)(n=>{n.configuration.height=e,n.configuration.width=t}))},[l,d]),y=F.useCallback(()=>{m(null),p(null)},[m,p]),k=F.useCallback(()=>kN(l).find(e=>e.id===c)||null,[l,c]),A=F.useCallback(()=>l.configuration.pages.find(e=>e.id===g)||null,[l,g]),w=F.useCallback(()=>{d((0,Jc.jM)(e=>{e.configuration.pages.push(r.getPageDefault())}))},[d]),S=F.useCallback(e=>{d((0,Jc.jM)(t=>{t.configuration.pages=t.configuration.pages.filter(t=>t.id!==e)}))},[d]),E=F.useCallback(e=>{const t=N();d((0,Jc.jM)(n=>{e?kN(n).forEach(n=>{"container"===n.type&&n.id===e.id&&n.elements.push(r.getContainerElementDefault(t,!0,n.elements.length))}):n.configuration.pages.forEach(e=>{e.id===g&&e.elements.push(r.getContainerElementDefault(t,!1,e.elements.length))})})),m(t)},[l,g,d]),T=F.useCallback(e=>{const t=N();d((0,Jc.jM)(n=>{e?kN(n).forEach(n=>{"container"===n.type&&n.id===e.id&&n.elements.push(r.getTextElementDefault(t,!0,n.elements.length))}):n.configuration.pages.forEach(e=>{e.id===g&&e.elements.push(r.getTextElementDefault(t,!1,e.elements.length))})})),m(t)},[l,g,d]),z=F.useCallback(e=>{const t=N();d((0,Jc.jM)(n=>{e?kN(n).forEach(n=>{"container"===n.type&&n.id===e.id&&n.elements.push(r.getImageElementDefault(t,!0,n.elements.length))}):n.configuration.pages.forEach(e=>{e.id===g&&e.elements.push(r.getImageElementDefault(t,!1,e.elements.length))})})),m(t)},[l,g,d,m]),$=F.useCallback(e=>{d((0,Jc.jM)(t=>{t.configuration.pages.forEach(t=>{t.elements=t.elements.filter(t=>t.id!==e)}),kN(t).forEach(t=>{"container"===t.type&&(t.elements=t.elements.filter(t=>t.id!==e))})})),m(null)},[l,d,m]),O=F.useCallback(e=>{const n=N();d((0,Jc.jM)(i=>{kN(i).forEach(i=>{if("container"===i.type){const o=i.elements.find(t=>t.id===e);o&&i.elements.push(AN(o,n,t("copie_de_1_62900",o.name)))}}),i.configuration.pages.forEach(i=>{const o=i.elements.find(t=>t.id===e);o&&i.elements.push(AN(o,n,t("copie_de_1_62900",o.name)))})})),m(n)},[l,d,m]),R=F.useCallback(e=>{const n=N();d((0,Jc.jM)(i=>{const o=i.configuration.pages.find(t=>t.id===e);o&&i.configuration.pages.push(function(e,t,n){return{...e,id:t,name:n,elements:e.elements.map(e=>AN(e,N(),e.name))}}(o,n,h(o.name)?t("copie_de_1_62900",o.name):""))}))},[]),P=F.useCallback((e,t)=>{m(e),p(t)},[l,m,p]),D=F.useCallback(e=>{p(e),m(null),x("design")},[m,p,x]),M=F.useCallback((e,t,n)=>{d((0,Jc.jM)(i=>{const o=kN(i).find(t=>t.id===e);o&&(o[t]=n)}))},[l]),{data:L}=Vn("query CustomDocumentConditions($eventId: EventId!) {\n    event(id: $eventId) {\n        accreditationsSlots(includeHidden: true) {\n            nodes {\n                id\n                name\n                date\n\n                accreditation {\n                    name\n                }\n            }\n        }\n\n        positionsSlots {\n            nodes {\n                id\n                name\n                range\n\n                position {\n                    name\n                }\n            }\n        }\n    }\n}\n",{eventId:n},[]),B=F.useMemo(()=>Ph(o,L.event?.accreditationsSlots.nodes??[]).map(({name:e,values:t},n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))},n)),[L.event]),V=F.useMemo(()=>Rh(s,L.event?.positionsSlots.nodes??[]).map(({name:e,values:t},n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))},n)),[L.event]);return(0,i.jsx)(EN.Provider,{value:{accreditationsOptions:B,addContainerElement:E,addImageElement:z,addPage:w,addTextElement:T,cleanSelecteds:y,customDocument:l,customFields:e.customFields,deleteElement:$,duplicateElement:O,duplicatePage:R,getSelectedElement:k,getSelectedPage:A,population:e.population,positionsOptions:V,removePage:S,selectElement:P,selectPage:D,selectedElementId:c,selectedPageId:g,setBleed:j,setDimensions:C,setName:_,setPopulations:v,setSlug:b,setTab:x,tab:f,updateElementProperty:M,updatePageProperty:I},children:e.children})};function zN(){return F.useContext(EN)}const $N=e=>{const{translate:t}=il(),{addContainerElement:n,addImageElement:o,addTextElement:s}=zN();return(0,i.jsxs)(Ea,{css:{bd:!0},direction:"column",children:[(0,i.jsxs)(Ea,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{s(e.container)},children:[(0,i.jsx)(Ea,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(Va,{icon:"text"})}),(0,i.jsx)(fr,{css:{flex:"1"},font:"gray800 textSm medium",children:t("Text")}),(0,i.jsx)(pl,{color:"white",leftIcon:"plus",size:"sm"})]}),(0,i.jsxs)(Ea,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{o(e.container)},children:[(0,i.jsx)(Ea,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(Va,{icon:"image"})}),(0,i.jsx)(fr,{css:{flex:"1"},font:"gray800 textSm medium",children:t("image_40624")}),(0,i.jsx)(pl,{color:"white",leftIcon:"plus",size:"sm"})]}),(0,i.jsxs)(Ea,{align:"center",css:{cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{n(e.container)},children:[(0,i.jsx)(Ea,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(Va,{icon:"chart-simple"})}),(0,i.jsx)(fr,{css:{flex:"1"},font:"gray800 textSm medium",children:t("conteneur_33078")}),(0,i.jsx)(pl,{color:"white",leftIcon:"plus",size:"sm"})]})]})},ON=e=>{const{translate:t}=il(),{accreditationsOptions:n,customFields:o,positionsOptions:s}=zN(),r=(0,F.useMemo)(()=>o.filter(e=>e.fieldType===Ne.Checkbox||e.fieldType===Ne.Select||e.fieldType===Ne.Text||e.fieldType===Ne.Validation).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),[o]),a=e.element.conditionsCustomFields||[],l=a.map(e=>e.slug),d=(t,n)=>{const i=(0,Jc.jM)(a,e=>{e[n].value=t});e.updateProperty(e.elementId,"conditionsCustomFields",i)},c=o.filter(e=>l.includes(e.slug));return(0,i.jsx)(UF,{css:{padding:"$4 $6"},title:t("condition_d_aff_68185"),children:(0,i.jsxs)(Ea,{direction:"column",gap:"4",children:[(0,i.jsx)(su,{value:e.element.hasConditions,onChange:t=>{t||(e.updateProperty(e.elementId,"accreditationsSlotsIds",[]),e.updateProperty(e.elementId,"accreditationAcronym",""),e.updateProperty(e.elementId,"positionsSlotsIds",[]),e.updateProperty(e.elementId,"conditionsCustomFields",[])),e.updateProperty(e.elementId,"hasConditions",t)},children:t("afficher_en_fon_47208")}),e.element.hasConditions&&(0,i.jsxs)(Ea,{css:{background:"$gray100",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$3 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(dc,{isSearchVisible:!0,label:t("afficher_en_fon_89756"),multiple:!0,values:e.element.accreditationsSlotsIds||[],onChange:t=>{e.updateProperty(e.elementId,"accreditationsSlotsIds",t)},children:n}),(0,i.jsx)(wl,{label:t("afficher_en_fon_78748"),value:e.element.accreditationAcronym||"",onChange:t=>{e.updateProperty(e.elementId,"accreditationAcronym",t)}}),(0,i.jsx)(dc,{isSearchVisible:!0,label:t("afficher_en_fon_19925"),multiple:!0,values:e.element.positionsSlotsIds||[],onChange:t=>{e.updateProperty(e.elementId,"positionsSlotsIds",t)},children:s}),(0,i.jsx)(dc,{isSearchVisible:!0,label:t("afficher_en_fon_56078"),multiple:!0,values:l,onChange:t=>{const n=(0,Jd.A)(t,l),i=o.filter(e=>n.includes(e.slug)),s=(0,Jd.A)(l,t),r=a.filter(e=>!s.includes(e.slug)).concat(i.map(e=>({slug:e.slug,value:e.fieldType===Ne.Checkbox||e.fieldType===Ne.Validation||(e.fieldType===Ne.Text?"isNotEmpty":[])})));e.updateProperty(e.elementId,"conditionsCustomFields",r)},children:r}),c.map((e,n)=>e.fieldType===Ne.Checkbox||e.fieldType===Ne.Validation?(0,i.jsxs)(gu,{label:t("afficher_si_la_42654",e.name),shouldParseAsBoolean:!0,value:a[n].value,onChange:e=>{d(e,n)},children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]},e.id):e.fieldType===Ne.Text?(0,i.jsxs)(gu,{label:t("afficher_si_la_42654",e.name),value:a[n].value,onChange:e=>{d(e,n)},children:[(0,i.jsx)("option",{value:"isEmpty",children:t("est_vide_96759")}),(0,i.jsx)("option",{value:"isNotEmpty",children:t("n_est_pas_vide_45804")})]},e.id):(0,i.jsx)(dc,{isSearchVisible:!0,label:t("afficher_si_la_42654",e.name),multiple:!0,values:a[n].value||[],onChange:e=>{d(e,n)},children:e.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))},e.id))]})]})})},RN=e=>{const{translate:t}=il(),{updateElementProperty:n}=zN();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(UF,{css:{padding:"$4 $6"},title:t("apparence_75510"),children:(0,i.jsxs)(Ea,{direction:"column",gap:"4",children:[(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(wl,{label:t("largeur_54184"),rightText:e.element.width<=1?"%":"px",shouldParseAsInt:!0,value:e.element.width,onChange:t=>{e.element.isRatioLocked&&n(e.element.id,"height",Math.round(e.element.height*t/e.element.width)),n(e.element.id,"width",t)}}),(0,i.jsx)(wl,{label:t("hauteur_56576"),rightText:e.element.height<=1?"%":"px",shouldParseAsInt:!0,value:e.element.height,onChange:t=>{e.element.isRatioLocked&&n(e.element.id,"width",Math.round(e.element.width*t/e.element.height)),n(e.element.id,"height",t)}}),(0,i.jsx)(fr,{css:{alignSelf:"end"},width:40,children:(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(pl,{color:e.element.isRatioLocked?"primary":"white",leftIcon:e.element.isRatioLocked?"lock-keyhole":"lock-keyhole-open",onClick:()=>{n(e.element.id,"isRatioLocked",!e.element.isRatioLocked)}})}),(0,i.jsx)(am,{placement:"top",children:e.element.isRatioLocked?t("ne_pas_pr_serve_68003"):t("pr_server_le_ra_39750")})]})})]}),!e.element.inContainer&&(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(wl,{label:"X",rightText:"px",shouldParseAsInt:!0,value:e.element.left,onChange:t=>{n(e.element.id,"left",t)}}),(0,i.jsx)(wl,{label:"Y",rightText:"px",shouldParseAsInt:!0,value:e.element.top,onChange:t=>{n(e.element.id,"top",t)}})]}),!e.element.inContainer&&(0,i.jsx)(wl,{hint:t("la_position_z_d_29473"),label:t("position_z_du_c_46647"),shouldParseAsInt:!0,value:e.element.zIndex,onChange:t=>{n(e.element.id,"zIndex",t)}}),("image"===e.element.type||"text"===e.element.type)&&!e.element.inContainer&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(su,{value:e.element.hasRotate,onChange:t=>{n(e.element.id,"hasRotate",t)},children:t("faire_pivoter_06431")}),e.element.hasRotate&&(0,i.jsx)(wl,{label:t("degr_79492"),rightText:"deg",shouldParseAsInt:!0,value:e.element.rotateDegree,onChange:t=>{n(e.element.id,"rotateDegree",t)}})]}),("container"===e.element.type||"text"===e.element.type)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(su,{value:e.element.hasBackground,onChange:t=>{n(e.element.id,"hasBackground",t)},children:t("afficher_un_arr_96006")}),e.element.hasBackground&&(0,i.jsx)(tj,{label:t("couleur_de_fond_75677"),value:e.element.backgroundColor,onChange:t=>{n(e.element.id,"backgroundColor",t)}})]}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(wl,{label:t("taille_de_la_bo_84060"),rightText:"px",shouldParseAsInt:!0,value:e.element.borderSize,onChange:t=>{n(e.element.id,"borderSize",t)}}),(0,i.jsx)(tj,{label:t("couleur_de_la_b_84227"),value:e.element.borderColor,onChange:t=>{n(e.element.id,"borderColor",t)}})]}),(0,i.jsx)(wl,{label:t("rayon_de_la_bor_26070"),rightText:"px",shouldParseAsInt:!0,value:e.element.borderRadius,onChange:t=>{n(e.element.id,"borderRadius",t)}}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(wl,{label:t("padding_horizon_14268"),rightText:"px",shouldParseAsInt:!0,value:e.element.px,onChange:t=>{n(e.element.id,"px",t)}}),(0,i.jsx)(wl,{label:t("padding_vertica_78457"),rightText:"px",shouldParseAsInt:!0,value:e.element.py,onChange:t=>{n(e.element.id,"py",t)}})]})]})}),(0,i.jsx)(ON,{element:e.element,elementId:e.element.id,updateProperty:n})]})},PN=e=>{const{translate:t}=il(),{getSelectedPage:n,selectPage:o,updateElementProperty:s}=zN();return(0,i.jsxs)(Ea,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ea,{css:{padding:"$2 $6"},children:(0,i.jsx)(pl,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{o(n().id)},children:t("retour_92202")})}),(0,i.jsxs)(UF,{css:{padding:"$4 $6"},title:t("initialisation_38640"),children:[(0,i.jsx)(wl,{label:t("nom_08311"),value:e.container.name,onChange:t=>{s(e.container.id,"name",t)}}),(0,i.jsx)($N,{container:e.container})]}),(0,i.jsxs)(UF,{css:{padding:"$4 $6"},title:t("conteneur_33078"),children:[(0,i.jsxs)(gu,{label:t("direction_39738"),value:e.container.direction,onChange:t=>{s(e.container.id,"direction",t)},children:[(0,i.jsx)("option",{value:"column",children:t("de_haut_en_bas_72752")}),(0,i.jsx)("option",{value:"row",children:t("de_gauche_dro_21330")})]}),(0,i.jsx)(wl,{label:t("_cart_entre_les_62547"),rightText:"px",shouldParseAsInt:!0,value:e.container.gap,onChange:t=>{s(e.container.id,"gap",t)}}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray700 textSm medium",children:t("alignement_54247")}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsxs)(Ea,{children:[(0,i.jsx)(pl,{color:"start"===e.container.justify?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"align-left",onClick:()=>{s(e.container.id,"justify","start")}}),(0,i.jsx)(pl,{color:"center"===e.container.justify?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"align-center",onClick:()=>{s(e.container.id,"justify","center")}}),(0,i.jsx)(pl,{color:"end"===e.container.justify?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"align-right",onClick:()=>{s(e.container.id,"justify","end")}})]}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(pl,{color:"start"===e.container.align?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"objects-align-top",onClick:()=>{s(e.container.id,"align","start")}}),(0,i.jsx)(pl,{color:"center"===e.container.align?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"objects-align-center-vertical",onClick:()=>{s(e.container.id,"align","center")}}),(0,i.jsx)(pl,{color:"end"===e.container.align?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"objects-align-bottom",onClick:()=>{s(e.container.id,"align","end")}})]})]})]})]}),(0,i.jsx)(RN,{element:e.container})]})},DN=()=>{const{translate:e}=il(),{getSelectedPage:t,updatePageProperty:n}=zN(),o=t();return(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsxs)(UF,{css:{padding:"$4 $6"},title:e("initialisation_38640"),children:[(0,i.jsx)(wl,{label:e("nom_de_la_page_82146"),value:o.name||"",onChange:e=>{n("name",e)}}),(0,i.jsx)($N,{container:null})]}),(0,i.jsx)(ON,{element:o,elementId:o.id,updateProperty:(e,t,i)=>{n(t,i)}})]})},FN=()=>{const{translate:e}=il(),{getSelectedPage:t}=zN();return t()?(0,i.jsx)(DN,{}):(0,i.jsx)(Ea,{css:{px:"$4"},height:1,width:1,children:(0,i.jsxs)(Ea,{align:"center",css:{bd:!0,px:"$9"},direction:"column",gap:"4",height:1,justify:"center",width:1,children:[(0,i.jsx)(Ea,{css:{border:"1px solid $gray200",borderRadius:"10px",padding:"$3"},children:(0,i.jsx)(Va,{icon:"hand-pointer"})}),(0,i.jsx)(fr,{font:"gray800 textMd medium",textAlign:"center",children:e("pour_ajouter_de_11528")})]})})},MN=e=>{const{translate:t,params:{organizationId:n}}=il(),{getSelectedPage:o,selectPage:s,updateElementProperty:r}=zN();return(0,i.jsxs)(Ea,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ea,{css:{padding:"$2 $6"},children:(0,i.jsx)(pl,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{s(o().id)},children:t("retour_92202")})}),(0,i.jsxs)(UF,{css:{padding:"$4 $6"},title:t("initialisation_38640"),children:[(0,i.jsx)(wl,{label:t("nom_08311"),value:e.image.name,onChange:t=>{r(e.image.id,"name",t)}}),(0,i.jsx)(wl,{hint:t("utilisez_user_81685"),label:t("source_16397"),value:e.image.source||"",onChange:t=>{r(e.image.id,"source",t)}}),(0,i.jsx)(tv,{accept:HI.Images,acl:"public-read",label:t("File"),organizationId:n,value:null,onChange:t=>{if(t){const n=`https://${R.HEAVENT_AWS_UPLOADS_BUCKET}.s3.eu-west-1.amazonaws.com/${t.key}`;r(e.image.id,"source",n)}}}),(0,i.jsx)(wl,{label:t("lien_68557"),value:e.image.link||"",onChange:t=>{r(e.image.id,"link",t)}})]}),(0,i.jsx)(RN,{element:e.image})]})},NN=()=>{const{translate:e}=il(),{customDocument:t,population:n,setBleed:o,setDimensions:s,setName:r,setPopulations:a,setSlug:l}=zN(),d=t.configuration.height,c=t.configuration.width,u=wN(d,c),h=(0,F.useMemo)(()=>(0,Zd.A)(n.values,e=>e.value.toLowerCase()),[n]);return(0,i.jsxs)(Ea,{css:{px:"$4"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(wl,{label:e("nom_du_document_73868"),value:t.name,onChange:r}),(0,i.jsxs)(gu,{label:e("format_du_docum_28991"),value:u,onChange:e=>{"a4"===e?s(Dm,Fm):"a6"===e?s(Mm,Nm):"cb"===e?s(Vm,Um):s(0,0)},children:[(0,i.jsx)("option",{value:"a4",children:"A4 (794 * 1123 px) (210 * 297 mm)"}),(0,i.jsx)("option",{value:"a6",children:"A6 (397 * 561 px) (105 * 148 mm)"}),(0,i.jsx)("option",{value:"cb",children:"CB (204 * 325 px) (54 * 86 mm)"}),(0,i.jsx)("option",{value:"custom",children:e("personnalis_40360")})]}),"custom"===u&&(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(wl,{hint:`${br(t.configuration.width)}mm`,label:e("largeur_54184"),rightText:"px",shouldParseAsInt:!0,value:t.configuration.width,onChange:e=>{s(d,e)}}),(0,i.jsx)(wl,{hint:`${br(t.configuration.height)}mm`,label:e("hauteur_56576"),rightText:"px",shouldParseAsInt:!0,value:t.configuration.height,onChange:e=>{s(e,c)}})]}),(0,i.jsx)(nc,{state:t.configuration.bleed?"checked":"unchecked",onClick:e=>{o("checked"===e)},children:e("ajouter_des_fon_73494")}),(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(wl,{hint:e("ne_doit_conteni_53122"),label:e("nom_de_la_varia_81999"),value:t.slug,onChange:l}),(0,i.jsx)(dc,{isSearchVisible:!0,label:e("lier_ce_documen_79055"),multiple:!0,values:t.populationsIds,onChange:a,children:h.map(e=>(0,i.jsx)("option",{value:e.id,children:e.value},e.id))})]})},LN=["Anton","Archivo","Arial","Arimo","Asap","Barlow","Be Vietnam Pro","Bebas Neue","Bricolage Grotesque","Chivo","Fira Sans","Georgia","IBM Plex Sans","Inter","Lato","League Gothic","Merriweather","Montserrat","Noto Sans","Nunito","Open Sans","Oswald","Oxanium","PT Sans","Playfair Display","Poppins","Raleway","Roboto","Rubik","Ubuntu"];function BN(){return(0,F.useMemo)(()=>LN.map(e=>(0,i.jsx)("option",{value:e,children:e},e)),[])}const VN=e=>{const{translate:t}=il(),{customFields:n,getSelectedPage:o,selectPage:s,updateElementProperty:r}=zN(),a=BN(),l=(0,F.useMemo)(()=>(0,Zd.A)(n.concat([{slug:"id",name:t("id_51738")},{slug:"localId",name:t("id_sur_l_v_nem_01171")},{slug:"email",name:t("Email")},{slug:"delegation.name",name:t("nom_de_la_d_l_g_28087")},{slug:"delegation.leader.firstName",name:t("pr_nom_du_respo_22241")},{slug:"delegation.leader.lastName",name:t("nom_du_responsa_44761")},{slug:"delegation.leader.phone",name:t("t_l_hpone_du_re_85143")},{slug:"name",name:t("full_name")},{slug:"ticketId",name:t("TicketId")}]),e=>e.name.toLowerCase()).map(e=>{const t=`{user.${e.slug}}`,n=`${e.name} {user.${e.slug}}`;return(0,i.jsx)("option",{value:t,children:n},e.slug)}),[n]),d=e.text.lineHeight||1.4,c=(0,ob.A)(e.text.fontSize*d,2);return(0,i.jsxs)(Ea,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ea,{css:{padding:"$2 $6"},children:(0,i.jsx)(pl,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{s(o().id)},children:t("retour_92202")})}),(0,i.jsx)(UF,{css:{padding:"$4 $6"},title:t("initialisation_38640"),children:(0,i.jsxs)(Ea,{direction:"column",gap:"4",children:[(0,i.jsx)(wl,{label:t("nom_du_calque_77484"),value:e.text.name,onChange:t=>{r(e.text.id,"name",t)}}),(0,i.jsx)(Em,{label:t("contenu_29668"),value:e.text.text,onChange:t=>{r(e.text.id,"text",t)}}),(0,i.jsx)(dc,{isSearchVisible:!0,label:t("ajouter_une_var_79098"),values:[],onChange:t=>{Zo(t)&&r(e.text.id,"text",`${e.text.text} ${t[0]}`.trim())},children:l})]})}),(0,i.jsx)(UF,{css:{padding:"$4 $6"},title:t("typographie_11343"),children:(0,i.jsxs)(Ea,{direction:"column",gap:"4",children:[(0,i.jsx)(dc,{isSearchVisible:!0,label:"Police",values:[e.text.fontFamily],onChange:t=>{r(e.text.id,"fontFamily",t[0]||"Open Sans")},children:a}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(wl,{label:t("taille_de_la_po_58427"),shouldParseAsInt:!0,value:e.text.fontSize,onChange:t=>{r(e.text.id,"fontSize",t)}}),(0,i.jsx)(Am,{hint:t("soit_1_px_73099",c),label:t("hauteur_de_lign_08120"),value:d,onChange:t=>{r(e.text.id,"lineHeight",t)}})]}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(tj,{label:t("couleur_du_text_32021"),value:e.text.color,onChange:t=>{r(e.text.id,"color",t)}}),(0,i.jsxs)(gu,{label:t("graisse_de_la_p_41139"),shouldParseAsInt:!0,value:e.text.fontWeight,onChange:t=>{r(e.text.id,"fontWeight",t)},children:[(0,i.jsx)("option",{value:"400",children:"400"}),(0,i.jsx)("option",{value:"500",children:"500"}),(0,i.jsx)("option",{value:"600",children:"600"}),(0,i.jsx)("option",{value:"700",children:"700"}),(0,i.jsx)("option",{value:"800",children:"800"}),(0,i.jsx)("option",{value:"900",children:"900"})]})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray700 textSm medium",children:t("alignement_54247")}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsxs)(Ea,{children:[(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(pl,{color:"start"===e.text.justify?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"align-left",onClick:()=>{r(e.text.id,"justify","start")}})}),(0,i.jsx)(am,{placement:"top",children:t("aligner_gauch_04681")})]}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(pl,{color:"center"===e.text.justify?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"align-center",onClick:()=>{r(e.text.id,"justify","center")}})}),(0,i.jsx)(am,{placement:"top",children:t("centrer_39779")})]}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(pl,{color:"end"===e.text.justify?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"align-right",onClick:()=>{r(e.text.id,"justify","end")}})}),(0,i.jsx)(am,{placement:"top",children:t("aligner_droit_73883")})]})]}),(0,i.jsxs)(Ea,{children:[(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(pl,{color:"start"===e.text.align?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"objects-align-top",onClick:()=>{r(e.text.id,"align","start")}})}),(0,i.jsx)(am,{placement:"top",children:t("aligner_en_haut_69916")})]}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(pl,{color:"center"===e.text.align?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"objects-align-center-vertical",onClick:()=>{r(e.text.id,"align","center")}})}),(0,i.jsx)(am,{placement:"top",children:t("centrer_39779")})]}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(pl,{color:"end"===e.text.align?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"objects-align-bottom",onClick:()=>{r(e.text.id,"align","end")}})}),(0,i.jsx)(am,{placement:"top",children:t("aligner_en_bas_42956")})]})]})]})]}),(0,i.jsxs)(gu,{label:t("transformation_09363"),value:e.text.textTransform,onChange:t=>{r(e.text.id,"textTransform",t)},children:[(0,i.jsx)("option",{value:"none",children:t("aucune_76773")}),(0,i.jsx)("option",{value:"capitalize",children:t("capitaliser_76627")}),(0,i.jsx)("option",{value:"uppercase",children:t("majuscules_64521")}),(0,i.jsx)("option",{value:"lowercase",children:t("minuscules_02420")})]})]})}),(0,i.jsx)(RN,{element:e.text})]})},UN=()=>{const{translate:e}=il(),{getSelectedElement:t,tab:n,setTab:o}=zN(),s=t();return"container"===s?.type?(0,i.jsx)(PN,{container:s}):"image"===s?.type?(0,i.jsx)(MN,{image:s}):"text"===s?.type?(0,i.jsx)(VN,{text:s}):(0,i.jsxs)(Ea,{css:{boxShadow:"$sm",overflow:"hidden auto",py:"$6",paddingBottom:"$11"},direction:"column",gap:"6",height:1,width:1,children:[(0,i.jsx)(Ea,{css:{px:"$4"},children:(0,i.jsxs)(rv,{selectedItem:n,onChange:o,children:[(0,i.jsx)(av,{item:"parameters",children:e("param_tres_78420")}),(0,i.jsx)(av,{item:"design",children:e("design_15043")})]})}),"parameters"===n&&(0,i.jsx)(NN,{}),"design"===n&&(0,i.jsx)(FN,{})]})},WN=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{css:{borderTop:"1px solid black",height:"1px",left:"0",position:"absolute",top:"19px",width:"11px"}}),(0,i.jsx)(fr,{css:{borderRight:"1px solid black",height:"11px",left:"19px",position:"absolute",top:"0",width:"1px"}}),(0,i.jsx)(fr,{css:{borderTop:"1px solid black",height:"1px",position:"absolute",right:"0",top:"19px",width:"11px"}}),(0,i.jsx)(fr,{css:{borderRight:"1px solid black",height:"11px",position:"absolute",right:"19px",top:"0",width:"1px"}}),(0,i.jsx)(fr,{css:{borderTop:"1px solid black",bottom:"19px",height:"1px",left:"0",position:"absolute",width:"11px"}}),(0,i.jsx)(fr,{css:{borderRight:"1px solid black",bottom:"0",height:"11px",left:"19px",position:"absolute",width:"1px"}}),(0,i.jsx)(fr,{css:{borderTop:"1px solid black",bottom:"19px",height:"1px",position:"absolute",right:"0",width:"11px"}}),(0,i.jsx)(fr,{css:{borderRight:"1px solid black",bottom:"0",height:"11px",position:"absolute",right:"19px",width:"1px"}})]}),GN=e=>{const{selectedElementId:t,selectElement:n}=zN();return(0,i.jsx)(Ea,{align:e.container.align,css:{backgroundColor:e.container.hasBackground?e.container.backgroundColor:"none",border:e.container.borderSize>0?`${e.container.borderSize}px solid ${e.container.borderColor}`:"",borderRadius:e.container.borderRadius>0?`${e.container.borderRadius}px`:"0",gap:`${e.container.gap}px`,left:`${e.container.left}px`,outline:t===e.container.id?"2px solid $primary700":"",overflow:"hidden",paddingBottom:`${e.container.py||0}px`,paddingLeft:`${e.container.px||0}px`,paddingRight:`${e.container.px||0}px`,paddingTop:`${e.container.py||0}px`,position:e.container.inContainer?"static":"absolute",top:`${e.container.top}px`,zIndex:e.container.zIndex},direction:e.container.direction,height:e.container.height,justify:e.container.justify,width:e.container.width,onClick:t=>{Il(t),n(e.container.id,e.pageId)},children:e.container.elements.map(t=>(0,i.jsx)(KN,{element:t,pageId:e.pageId},t.id))})},HN=e=>{const{selectedElementId:t,selectElement:n}=zN();return(0,i.jsx)(fr,{css:{border:e.image.borderSize>0?`${e.image.borderSize}px solid ${e.image.borderColor}`:"",borderRadius:e.image.borderRadius>0?`${e.image.borderRadius}px`:"0",left:`${e.image.left}px`,outline:t===e.image.id?"2px solid $primary700":"",overflow:"hidden",paddingBottom:`${e.image.py||0}px`,paddingLeft:`${e.image.px||0}px`,paddingRight:`${e.image.px||0}px`,paddingTop:`${e.image.py||0}px`,position:e.image.inContainer?"static":"absolute",top:`${e.image.top}px`,transform:e.image.hasRotate?`rotate(${e.image.rotateDegree}deg)`:void 0,transformOrigin:e.image.hasRotate?"top left":void 0,zIndex:e.image.zIndex},height:e.image.height,width:e.image.width,onClick:t=>{Il(t),n(e.image.id,e.pageId)},children:h(e.image.source)&&(0,i.jsx)("img",{height:"100%",src:(o=e.image.source,"{user.picture}"===o?`${R.HEAVENT_ASSETS_URL}/badges/profile.jpg`:"{user.qrcode}"===o||"{user.skidata}"===o?Ym("https://weezevent.com",{height:360,width:360}):"{user.code39}"===o?Ym("12345678",{barcodeType:qm.Code39,height:28,width:234}):o),width:"100%"})});var o};function qN(e){return e.replace(/\*\*(.+?)\*\*/g,"$1 ").replace(/\+\+(.+?)\+\+/g,"$1 ").replace(/_(.+?)_/g,"$1 ").replace(/~~(.+?)~~/g,"$1 ")}const YN=e=>{const{selectedElementId:t,selectElement:n}=zN(),o=qN(e.text.text);return(0,i.jsx)(Ea,{align:e.text.align,css:{backgroundColor:e.text.hasBackground?e.text.backgroundColor:"none",border:e.text.borderSize>0?`${e.text.borderSize}px solid ${e.text.borderColor}`:"",borderRadius:e.text.borderRadius>0?`${e.text.borderRadius}px`:"0",color:e.text.color,fontFamily:e.text.fontFamily,fontSize:`${e.text.fontSize}px`,fontWeight:e.text.fontWeight,left:`${e.text.left}px`,lineHeight:e.text.lineHeight||1.4,outline:t===e.text.id?"2px solid $primary700":"",overflow:"hidden",paddingBottom:`${e.text.py||0}px`,paddingLeft:`${e.text.px||0}px`,paddingRight:`${e.text.px||0}px`,paddingTop:`${e.text.py||0}px`,position:e.text.inContainer?"static":"absolute",textAlign:e.text.justify,textTransform:e.text.textTransform,top:`${e.text.top}px`,transform:e.text.hasRotate?`rotate(${e.text.rotateDegree}deg)`:void 0,transformOrigin:e.text.hasRotate?"top left":void 0,whiteSpace:"pre-wrap",zIndex:e.text.zIndex,"& em":{fontStyle:"italic"},"& s":{textDecoration:"line-through"},"& strong":{fontWeight:700},"& u":{textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:o},height:e.text.height,justify:e.text.justify,width:e.text.width,onClick:t=>{Il(t),n(e.text.id,e.pageId)}})},KN=e=>"container"===e.element.type?(0,i.jsx)(GN,{container:e.element,pageId:e.pageId}):"image"===e.element.type?(0,i.jsx)(HN,{image:e.element,pageId:e.pageId}):"text"===e.element.type?(0,i.jsx)(YN,{pageId:e.pageId,text:e.element}):null,ZN=e=>{const{translate:t}=il(),{customDocument:n,addPage:o,removePage:s,selectedPageId:r,selectPage:a}=zN(),l=n.configuration.pages.length>1,d=n.configuration.bleed?19:0;return(0,i.jsxs)(Ea,{css:{height:"fit-content",width:"fit-content"},direction:"column",gap:"2",children:[(0,i.jsxs)(Ea,{align:"center",children:[(0,i.jsx)(fr,{css:{cursor:"pointer",flex:"1"},fontWeight:"semiBold",onClick:t=>{Il(t),a(e.page.id)},children:h(e.page.name)?e.page.name:t("page_1_33637",e.index+1)}),(0,i.jsxs)(Ea,{gap:"2",children:[(0,i.jsx)(pl,{color:"white",leftIcon:"plus",size:"sm",onClick:o}),(0,i.jsx)(pl,{color:"white",disabled:!l,leftIcon:"trash-can",size:"sm",onClick:()=>{s(e.page.id)}})]})]}),(0,i.jsxs)(Ea,{css:{background:"white",padding:`${d}px`,position:"relative"},height:2*d+n.configuration.height,width:2*d+n.configuration.width,children:[n.configuration.bleed&&(0,i.jsx)(WN,{}),(0,i.jsx)(Ea,{css:{background:"white",outline:r===e.page.id?"2px solid $primary700":"",position:"relative"},height:n.configuration.height,width:n.configuration.width,onClick:t=>{Il(t),a(e.page.id)},children:e.page.elements.map(t=>(0,i.jsx)(KN,{element:t,pageId:e.page.id},t.id))})]})]})},XN=()=>{const{customDocument:e,cleanSelecteds:t}=zN(),[n,o]=(0,F.useState)(100);return(0,i.jsxs)(fr,{css:{background:"$gray100",position:"relative"},height:1,width:1,children:[(0,i.jsx)(Ea,{align:"center",css:{overflow:"auto",padding:"$9",zoom:`${n}%`},direction:"column",gap:"7",height:1,width:1,onClick:t,children:e.configuration.pages.map((e,t)=>(0,i.jsx)(ZN,{index:t,page:e},e.id))}),(0,i.jsx)(fr,{css:{bottom:"24px",position:"absolute",right:"24px",zIndex:1e3},width:140,children:(0,i.jsxs)(gu,{shouldParseAsInt:!0,value:n,onChange:o,children:[(0,i.jsx)("option",{value:"50",children:"Zoom (50%)"}),(0,i.jsx)("option",{value:"66",children:"Zoom (66%)"}),(0,i.jsx)("option",{value:"80",children:"Zoom (80%)"}),(0,i.jsx)("option",{value:"100",children:"Zoom (100%)"}),(0,i.jsx)("option",{value:"120",children:"Zoom (120%)"}),(0,i.jsx)("option",{value:"150",children:"Zoom (150%)"}),(0,i.jsx)("option",{value:"200",children:"Zoom (200%)"})]})})]})},JN=e=>{const{deleteElement:t,duplicateElement:n,selectedElementId:o,selectElement:s}=zN();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",css:{background:o===e.element.id?"$primary300":"none",borderRadius:"$1",color:o===e.element.id?"$primary700":"$gray800",cursor:"pointer",padding:"$2","& .h-duplicate, & .h-delete":{display:"none"},"&:hover":{background:"$primary300",color:"$primary700","& .h-duplicate, & .h-delete":{display:"block"}}},gap:"3",width:250,onClick:()=>{s(e.element.id,e.pageId)},children:[(0,i.jsx)(fr,{fontSize:"textMd",children:(0,i.jsx)(Va,{icon:(r=e.element,"container"===r.type?"column"===r.direction?"chart-simple-horizontal":"chart-simple":"image"===r.type?"image":"text")})}),(0,i.jsx)(fr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(fr,{css:{ellipsis:!0},fontSize:"textSm",fontWeight:"medium",title:e.element.name,width:1,children:e.element.name})}),(0,i.jsx)(fr,{className:"h-duplicate",onClick:t=>{Il(t),n(e.element.id)},children:(0,i.jsx)(Va,{icon:"copy"})}),(0,i.jsx)(fr,{className:"h-delete",onClick:n=>{Il(n),t(e.element.id)},children:(0,i.jsx)(Va,{icon:"trash-can"})})]}),"container"===e.element.type&&(0,i.jsx)(Ea,{css:{paddingLeft:"$8"},direction:"column",children:e.element.elements.map(t=>(0,i.jsx)(JN,{element:t,pageId:e.pageId},t.id))})]});var r},QN=e=>{const{translate:t}=il(),{duplicatePage:n,selectedPageId:o,selectPage:s}=zN(),r=h(e.page.name)?e.page.name:t("page_1_33637",e.index+1);return(0,i.jsx)(UF,{css:{gap:"0",width:"fit-content"},title:(0,i.jsxs)(Ea,{align:"center",css:{background:o===e.page.id?"$primary300":"",borderRadius:"$1",color:"$gray800",fontWeight:"$medium",padding:"$2","& .h-duplicate":{display:"none"},"&:hover":{background:"$primary300","& .h-duplicate":{display:"block"}}},gap:"3",width:250,onClick:t=>{Il(t),s(e.page.id)},children:[(0,i.jsx)(fr,{fontSize:"textMd",children:(0,i.jsx)(Va,{icon:"frame"})}),(0,i.jsx)(fr,{css:{flex:"1"},children:r}),(0,i.jsx)(fr,{className:"h-duplicate",onClick:t=>{Il(t),n(e.page.id)},children:(0,i.jsx)(Va,{icon:"copy"})})]}),titleCss:{gap:"$2"},children:(0,i.jsx)(Ea,{css:{paddingLeft:"$8"},direction:"column",children:e.page.elements.map(t=>(0,i.jsx)(JN,{element:t,pageId:e.page.id},t.id))})})},eL=()=>{const{customDocument:e}=zN();return(0,i.jsx)(Ea,{css:{overflowY:"auto"},direction:"column",height:1,width:1,children:e.configuration.pages.map((e,t)=>(0,i.jsx)(QN,{index:t,page:e},e.id))})},tL=()=>{const{history:e,params:{organizationId:t,eventId:n,customDocumentId:o},translate:s}=il(),{mutate:r,isLoading:a}=function(e={}){return Un("mutation CustomDocumentUpdate(\n    $eventId: EventId!\n    $customDocumentId: CustomDocumentId!\n    $customDocument: CustomDocumentInput!\n) {\n    customDocumentUpdate(\n        eventId: $eventId\n        customDocumentId: $customDocumentId\n        customDocument: $customDocument\n    ) {\n        id\n    }\n}\n",e)}(),{customDocument:l}=zN(),d=(0,F.useMemo)(()=>JSON.stringify(l),[a]),[c,u]=(0,F.useState)(!1),h=(0,F.useCallback)(()=>{JSON.stringify(l)===d?e.goBack(So.DOCUMENTS(t,n)):u(!0)},[l,d]);return Cd(s("mise_jour_de_17055",l.name)),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(bm,{button:(0,i.jsx)(pl,{isLoading:a,onClick:async()=>{await r({eventId:n,customDocumentId:o,customDocument:l})},children:s("enregistrer_06519")}),category:s("document_person_69340"),color:"dark",title:l.name,onClose:h,children:(0,i.jsxs)(Ea,{height:1,width:1,children:[(0,i.jsx)(fr,{height:1,width:420,children:(0,i.jsx)(UN,{})}),(0,i.jsx)(fr,{css:{flex:"1"},height:1,children:(0,i.jsx)(XN,{})}),(0,i.jsx)(fr,{height:1,width:340,children:(0,i.jsx)(eL,{})})]})}),(0,i.jsx)(hS,{fallbackPath:So.DOCUMENTS(t,n),isOpen:c,onClose:()=>u(!1)})]})},nL=()=>{const{history:e,params:{organizationId:t,eventId:n,customDocumentId:o}}=il(),{data:s,loader:r}=Vn('query CustomDocument(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $customDocumentId: CustomDocumentId!\n) {\n    organization(id: $organizationId) {\n        population: customFieldBySlug(slug: "population") {\n            values {\n                id\n                value\n            }\n        }\n\n        customFields(variety: UserInfo, privacy: All, sort: { attribute: Name, direction: Asc }) {\n            nodes {\n                ...ConditionCustomField\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        customDocument(customDocumentId: $customDocumentId) {\n            name\n            slug\n            populationsIds\n            configuration\n        }\n    }\n}\n',{organizationId:t,eventId:n,customDocumentId:o},[Ro.ConditionCustomFieldFragment]),a=Nn(yN);return r||s.event?.customDocument||e.replace(So.DOCUMENTS(t,n)),r||(0,i.jsx)(TN,{customFields:s.organization.customFields.nodes,initialCustomDocument:a.customDocumentInputDefault(s.event.customDocument),population:s.organization.population,children:(0,i.jsx)(tL,{})})},iL=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o}}=il(),{mutate:s}=function(e={}){return Un("mutation CustomDocumentCreate($eventId :EventId!, $customDocument: CustomDocumentInput!){\n    customDocumentCreate(eventId: $eventId, customDocument: $customDocument){\n        id\n    }\n}\n",e)}(),r=Nn(yN),[l,d]=(0,F.useState)(""),[c,m]=(0,F.useState)(""),[g,p]=(0,F.useState)(!1),f=(0,F.useCallback)(e=>{d(e),g||m(u(e,{replacer:a.Empty}))},[g,d,m]),x=(0,F.useCallback)(e=>{h(e)?(m(u(e,{replacer:a.Empty})),p(!0)):(m(""),p(!1))},[m,p]);return(0,i.jsxs)(nb,{children:[(0,i.jsx)(ib,{children:(0,i.jsx)(pl,{children:t("cr_er_un_docume_92512")})}),(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"file",children:t("nouveau_documen_36722")}),(0,i.jsxs)(Qv,{gap:"5",children:[(0,i.jsx)(wl,{label:t("nom_du_document_22604"),value:l,onChange:f}),(0,i.jsx)(wl,{hint:t("ne_doit_conteni_53122"),label:t("nom_de_la_varia_81999"),value:c,onChange:x})]}),(0,i.jsx)(Jv,{children:(0,i.jsx)(pl,{onClick:async()=>{const{customDocumentCreate:t}=await s({eventId:o,customDocument:{name:l,slug:c,populationsIds:[],configuration:r.getConfigurationDefault()}});e.push(So.EDIT_CUSTOM_DOCUMENT(n,o,t.id))},children:t("cr_er_le_docume_02657")})})]})]})},oL=e=>(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(fr,{font:"gray900 textLg medium",children:e.title}),(0,i.jsx)(Ea,{css:{background:"white",bd:!0,"& > div:last-child":{borderBottom:"none"}},direction:"column",children:e.children})]}),sL=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=il(),{showNotification:r}=Yv(),{mutate:a}=function(e={}){return Un("mutation CustomDocumentDuplicate($eventId: EventId!, $customDocumentId: CustomDocumentId!) {\n    customDocumentDuplicate(eventId: $eventId, customDocumentId: $customDocumentId) {\n        id\n    }\n}\n",e)}(),{mutate:l}=function(e={}){return Un("mutation CustomDocumentDelete($eventId: EventId!, $customDocumentId: CustomDocumentId!) {\n    customDocumentDelete(eventId: $eventId, customDocumentId: $customDocumentId) {\n        id\n    }\n}\n",e)}(),[d,c]=(0,F.useState)(!1),u=wN(e.customDocument.configuration.height,e.customDocument.configuration.width),m=e.customDocument.populations.join(", ");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",css:{borderBottom:"1px solid $gray200",px:"$6"},gap:"4",height:74,width:1,children:[(0,i.jsx)(Ea,{align:"center",css:{background:"$success100",borderRadius:"$3",color:"$success700",fontSize:"$textMd"},height:40,justify:"center",width:40,children:(0,i.jsx)(Va,{icon:"pen-ruler"})}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[e.disabled?(0,i.jsx)(fr,{font:"gray800 textMd medium",children:e.customDocument.name}):(0,i.jsx)(j_,{css:{fontSize:"$textMd"},to:So.DOCUMENTS_USER_CUSTOM_DOCUMENT(o,s,e.userInfoId,e.customDocument.id),children:e.customDocument.name}),(0,i.jsx)(fr,{color:"gray500",children:n("cr_par_1_69201",e.customDocument.createdBy.nameOrEmail)})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:100,children:[(0,i.jsx)(fr,{font:"gray500 textXs regular",children:n("populations_48141")}),(0,i.jsx)(fr,{css:{ellipsis:!0},font:"gray800 textSm medium",title:m,width:1,children:h(m)?m:"-"})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:85,children:[(0,i.jsx)(fr,{font:"gray500 textXs regular",children:n("format_54368")}),(0,i.jsx)(fr,{font:"gray800 textSm medium",children:"custom"===u?n("personnalis_40360"):u.toUpperCase()})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(fr,{font:"gray500 textXs regular",children:n("nom_de_la_varia_81999")}),(0,i.jsx)(fr,{css:{ellipsis:!0},font:"gray800 textSm medium",title:`{user.documents.${e.customDocument.slug}}`,width:1,children:`{user.documents.${e.customDocument.slug}}`})]}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{t.push(So.EDIT_CUSTOM_DOCUMENT(o,s,e.customDocument.id))}})}),(0,i.jsx)(am,{placement:"top",children:n("_diter_62574")})]})}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsx)(Od,{icon:"clone",onClick:async()=>{await a({eventId:s,customDocumentId:e.customDocument.id}),e.reload()},children:n("dupliquer_28256")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{c(!0)},children:n("supprimer_43083")})]})]})})]}),d&&(0,i.jsx)(kk,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_81333"),text:n("suppression_de_73669",e.customDocument.name),onClose:()=>{c(!1)},onDelete:async()=>{await l({eventId:s,customDocumentId:e.customDocument.id}),r(n("le_document_1_14516",e.customDocument.name)),e.reload()}})]})},rL=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>(0,Zd.A)(e.customDocuments,e=>e.name.toLowerCase()),[e.customDocuments]);return(0,i.jsx)(oL,{title:t("documents_perso_87374"),children:n.map(t=>(0,i.jsx)(sL,{customDocument:t,disabled:0===e.numberOfVolunteersRegistrations,reload:e.reload,userInfoId:e.userInfoId},t.id))})},aL=e=>{const{translate:t}=il();return(0,i.jsxs)(Ea,{align:"center",css:{borderBottom:"1px solid $gray200",px:"$6"},gap:"4",height:74,width:1,children:[(0,i.jsx)(Ea,{align:"center",css:{background:lr.colors[`${e.color}100`],borderRadius:"$3",color:lr.colors[`${e.color}700`],fontSize:"$textMd"},height:40,justify:"center",width:40,children:(0,i.jsx)(Va,{icon:e.icon})}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[e.disabled?(0,i.jsx)(fr,{font:"gray800 textMd medium",children:e.title}):(0,i.jsx)(j_,{css:{fontSize:"$textMd"},to:e.path,children:e.title}),e.disabled&&(0,i.jsx)(Gd,{color:"warning",size:"sm",children:t("le_document_n_e_47973")})]}),(0,i.jsx)(fr,{color:"gray500",children:t("cr_par_1_69201","WeezCrew")})]}),h(e.variable)&&(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(fr,{font:"gray500 textXs regular",children:t("nom_de_la_varia_81999")}),(0,i.jsx)(fr,{css:{ellipsis:!0},font:"gray800 textSm medium",title:"",width:1,children:`{user.documents.${e.variable}}`})]}),void 0!==e.count&&!e.disabled&&(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:150,children:[(0,i.jsx)(fr,{font:"gray500 textXs regular",children:e.text}),(0,i.jsx)(fr,{font:"gray800 textSm medium",children:e.count})]})]})},lL=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il();return(0,i.jsxs)(oL,{title:t("_v_nement_22345"),children:[(0,i.jsx)(aL,{color:"pink",icon:"list-ul",path:So.DOCUMENTS_VOLUNTEERS_LISTING(n,o,e.volunteersSegmentId),text:t("nombre_de_membr_87049"),title:t("liste_des_membr_89037")}),(0,i.jsx)(aL,{color:"purple",icon:"calendar-day",path:So.DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING(n,o,e.positionsSegmentId),text:t("nombre_de_missi_56719"),title:t("planning_d_un_g_23684")}),(0,i.jsx)(aL,{color:"purple",icon:"calendar-day",path:So.DOCUMENTS_PLANNING(n,o,e.positionsSegmentId),text:t("nombre_de_missi_56719"),title:t("planning_de_l_96909")}),(0,i.jsx)(aL,{color:"purple",icon:"image",path:So.DOCUMENTS_USERS_PICTURES(n,o,e.volunteersSegmentId),text:"",title:t("trombinoscope_11316")})]})},dL=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{organization:s}=nI();return(0,i.jsxs)(oL,{title:t("membres_11310"),children:[(0,i.jsx)(aL,{color:"pink",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"user",path:So.DOCUMENTS_ASSIGNMENTS(n,o,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("fiche_d_affecta_91461"),variable:"assignments"}),(0,i.jsx)(aL,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:So.DOCUMENTS_USER_PLANNING(n,o,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserPlanning"),variable:"planning"}),(0,i.jsx)(aL,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:So.DOCUMENTS_USER_PLANNING_LIST(n,o,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserPlanningList"),variable:"planningList"}),(0,i.jsx)(aL,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:So.DOCUMENTS_USER_PLANNING_DAYS(n,o,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserPlanningDays"),variable:"planningDays"}),(0,i.jsx)(aL,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"certificate",path:So.DOCUMENTS_CERTIFICATE(n,o,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("Certificate"),variable:"certificate"}),(0,i.jsx)(aL,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"id-card",path:So.DOCUMENTS_BADGE(n,o,e.assignedUserInfoId,"generic"),text:t("nombre_de_membr_87049"),title:t("BadgeCheck"),variable:"badge"}),(0,i.jsx)(aL,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"clock",path:So.DOCUMENTS_HOURS(n,o,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserHours"),variable:"hours"}),s.customBadges.map(s=>(0,i.jsx)(aL,{color:"success",count:e.numberOfVolunteersRegistrations,disabled:!1,icon:"id-card",path:So.DOCUMENTS_BADGE(n,o,e.userInfoId,s),text:t("nombre_de_membr_87049"),title:b_(s),variable:s.toLowerCase()},s))]})},cL=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il();return(0,i.jsxs)(oL,{title:t("missions_63972"),children:[(0,i.jsx)(aL,{color:"blueGray",count:e.numberOfPositions,disabled:0===e.numberOfPositions,icon:"sitemap",path:So.DOCUMENTS_POSITION(n,o,e.positionId),text:t("nombre_de_fiche_03009"),title:t("fiche_de_missio_00324")}),(0,i.jsx)(aL,{color:"purple",count:e.numberOfPositions,disabled:0===e.numberOfPositions,icon:"calendar-day",path:So.DOCUMENTS_POSITION_PLANNING(n,o,e.positionId),text:t("nombre_de_missi_56719"),title:t("planning_d_une_64581")})]})},uL=e=>{const{hasFeature:t}=nI(),n=e.event.volunteersRegistrations.nodes[0]?.userInfoId??-1;return(0,i.jsxs)(Ea,{direction:"column",gap:"7",children:[t(Fe.CustomDocument)&&Zo(e.event.customDocuments)&&(0,i.jsx)(rL,{customDocuments:e.event.customDocuments,numberOfVolunteersRegistrations:e.event.volunteersRegistrations.totalCount,reload:e.reload,userInfoId:n}),(0,i.jsx)(dL,{assignedUserInfoId:e.event.assignedVolunteersRegistrations.nodes[0]?.userInfoId??-1,numberOfAssignedVolunteersRegistrations:e.event.assignedVolunteersRegistrations.totalCount,numberOfVolunteersRegistrations:e.event.volunteersRegistrations.totalCount,userInfoId:n}),(0,i.jsx)(cL,{numberOfPositions:e.event.positions.totalCount,positionId:e.event.positions.nodes[0]?.id??-1}),(0,i.jsx)(lL,{positionsSegmentId:e.event.positionsSegments[0].id,volunteersSegmentId:e.event.volunteersSegments[0].id})]})},hL=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(qd,{borderRadius:"$1",height:25,width:1}),(0,i.jsx)(qd,{borderRadius:"$2",height:74,width:1}),(0,i.jsx)(qd,{borderRadius:"$2",height:74,width:1})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(qd,{borderRadius:"$1",height:25,width:1}),(0,i.jsx)(qd,{borderRadius:"$2",height:74,width:1}),(0,i.jsx)(qd,{borderRadius:"$2",height:74,width:1})]})]}),mL=()=>{const{translate:e,params:{eventId:t}}=il(),{hasFeature:n}=nI(),{isEventAdmin:o,event:{name:s}}=Uv();Cd(`${s} ${e("Documents")}`);const{data:r,isLoading:a,reload:l}=Vn('query Documents($eventId: EventId!) {\n    event(id: $eventId) {\n        customDocuments {\n            id\n            name\n            slug\n            configuration\n            populations\n\n            createdBy {\n                nameOrEmail\n            }\n        }\n\n        positions(limit: 1) {\n            nodes {\n                id\n            }\n\n            totalCount\n        }\n\n        volunteersRegistrations(limit: 1, sort: { attribute: "Name", direction: Asc }) {\n            nodes {\n                userInfoId\n            }\n\n            totalCount\n        }\n\n        assignedVolunteersRegistrations: volunteersRegistrations(\n            states: [Assigned]\n            limit: 1\n            sort: { attribute: "Name", direction: Asc }\n        ) {\n            nodes {\n                userInfoId\n            }\n\n            totalCount\n        }\n\n        volunteersSegments: segments(segmentType: Volunteers) {\n            id\n        }\n\n        positionsSegments: segments(segmentType: Positions) {\n            id\n        }\n    }\n}\n',{eventId:t},[]),d=o&&n(Fe.CustomDocument);return(0,i.jsxs)(AC,{children:[(0,i.jsxs)(kC,{gap:"3",children:[(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("Documents")}),(0,i.jsx)(fr,{color:"gray500",children:e("retrouver_et_pe_99652")})]}),d&&(0,i.jsx)(iL,{})]}),(0,i.jsx)(yC,{children:n(Fe.Documents)?a?(0,i.jsx)(hL,{}):(0,i.jsx)(uL,{event:r.event,reload:l}):(0,i.jsx)(Ea,{align:"center",css:{flex:"1"},direction:"column",justify:"center",children:(0,i.jsx)(iI,{icon:"folders"})})})]})};var gL;function pL(){return pL=Object.assign?Object.assign.bind():function(e){for(var t=1;t div":{alignItems:"center",background:"$success400",borderRadius:"$1",display:"flex",height:"100%",justifyContent:"center",width:"100%","& svg":{height:"50%"}}}),bL=ar(fr,{background:`url(${xL}) no-repeat`,borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100",color:"$gray700",height:"48px",width:"100px"}),jL=ar(fr,{alignItems:"center",borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100",color:"$gray800",display:"flex",height:"48px",padding:"$2",width:"100px","& > div":{alignItems:"center",border:"1px dashed $gray300",borderRadius:"$1",display:"flex",fontSize:"$textXs",height:"100%",justifyContent:"center",width:"100%"}}),CL=e=>{const t=Ln(),n=Nn($c),o=(0,F.useMemo)(()=>Wu(e.slots.map(({range:e})=>e).reduce((e,t)=>e.union(t),e.slots[0].range)),[e.slots]),s=e.slots[0].range.start;return console.log("ok !!!"),(0,i.jsxs)(Ea,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(Ea,{css:{background:"$gray100",padding:"$6"},direction:"column",children:(0,i.jsx)(fr,{font:"gray900 textXl medium",children:t("planning_1_14391",e.position.name)})}),(0,i.jsxs)(Ea,{css:{background:"white",padding:"$6"},direction:"column",width:1,children:[(0,i.jsxs)(Ea,{children:[(0,i.jsx)(_L,{width:200,children:t("jours_88317")}),(0,vc.A)(0,o).map(t=>{const o=s.plus({days:t}),r=sh(o,e.slots);return(0,i.jsx)(_L,{width:100*(r.length||1),children:n.toLocaleString(o,Ho.DateOnly.MonthShort)},t)})]}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(_L,{width:200,children:t("cr_neaux_33401")}),(0,vc.A)(0,o).map(t=>{const n=sh(s.plus({days:t}),e.slots);return 0===n.length||n[0].isAddedSlot?(0,i.jsx)(bL,{},`${t}`):n.map(e=>(0,i.jsx)(_L,{width:100,children:e.range.toFormat("HH:mm",{separator:"-"})},`${t}-${e.id}`))})]}),e.volunteersRegistrations.map(n=>{const r=n.userInfo;return(0,i.jsxs)(Ea,{children:[(0,i.jsxs)(IL,{children:[(0,i.jsx)(Fg,{email:r.email,image:r.picture?.url,name:r.name,size:24}),(0,i.jsx)(fr,{css:{flex:"1",ellipsis:""},title:r.name,children:r.name})]}),(0,vc.A)(0,o).map(o=>{const r=sh(s.plus({days:o}),e.slots);return 0===r.length||r[0].isAddedSlot?(0,i.jsx)(bL,{},`${o}`):r.map(e=>{const s=`${o}-${e.id}`,r=void 0!==n.positionsSlotsUsersInfos.find(({positionSlotId:t})=>t===e.id),a=n.positionsSlotsUsersInfos.some(({positionSlot:t})=>t.range.overlaps(e.range)),l=n.slots.some(t=>t.range.engulfs(e.range));return r?(0,i.jsx)(vL,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(fL,{})})},s):l&&!a?(0,i.jsx)(jL,{children:(0,i.jsx)(fr,{children:t("disponible_69523")})},s):(0,i.jsx)(bL,{},s)})})]},n.id)})]})]})},yL=e=>{const t=Ln(),n=(0,F.useMemo)(()=>(0,Zd.A)(Gu(e.event.position.slots),e=>e.range.start).filter(t=>{if(e.date?.isValid&&e.endDate?.isValid){const n=Fo.IX.fromDateTimes(e.date.startOf("day"),e.endDate.endOf("day"));return t.range.overlaps(n)}return!e.date?.isValid||t.range.start.startOf("day").equals(e.date.startOf("day"))}),[e.event,e.date,e.endDate]),o=(0,F.useMemo)(()=>{if(Zo(n)){const e=Wu(n.map(({range:e})=>e).reduce((e,t)=>e.union(t),n[0].range)),t=n[0].range.start;return(0,vc.A)(0,e).flatMap(e=>{const i=t.plus({days:e}),o=sh(i,n);return Zo(o)?o:[{id:i.toMillis(),range:Fo.IX.fromDateTimes(i.startOf("day"),i.endOf("day")),isAddedSlot:!0}]})}return[]},[n]);return Zo(o)?(0,i.jsx)(i.Fragment,{children:(0,Og.A)(o,8).map((t,n)=>(0,Og.A)(e.event.volunteersRegistrations.nodes,11).map((o,s)=>(0,i.jsx)(CL,{position:e.event.position,slots:t,volunteersRegistrations:o},`${n}-${s}`)))}):(0,i.jsx)(Ea,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:(0,i.jsx)(Ea,{css:{background:"$gray100",padding:"$6"},direction:"column",children:(0,i.jsx)(fr,{font:"gray900 textXl medium",children:t("planning_1_14391",e.event.position.name)})})})},kL=e=>{const{translate:t,params:{eventId:n}}=il(),{user:o}=Zn(),{checkDocumentsExport:s}=Yv(),[r,a]=(0,F.useState)([e.segmentsFolders[0].segments[0].id]),[l,d]=(0,F.useState)(e.languages[0]),[c,u]=(0,F.useState)(Fo.c9.invalid("Invalid")),[h,m]=(0,F.useState)(Ae.OnePerPage),[g,p]=(0,F.useState)(!1),f=(0,F.useMemo)(()=>e.showStrategy&&(!e.badgeType||function(e){try{return function(e,t){switch(e){case pe.Animajeconvention:case pe.Asoassignment:case pe.Cerclestaff:case pe.Cerclelivraison:case pe.Cerclepressandpartenaire:case pe.Cercleopcom:case pe.Delta:case pe.Dfcoa4:case pe.Dfcosmall:throw new Error("Not implemented");case pe.Eurockeennes:return(0,i.jsx)(Vg,{event:t});case pe.Fcg:return(0,i.jsx)(Hg,{event:t});case pe.Garorockplanning:case pe.Goldencoast:case pe.Hbcldc:case pe.Hbclnh:case pe.Lnh:case pe.Moorea:case pe.Nuitssecretes:case pe.Openbrest:case pe.P2nassignment:case pe.P2nassignmentmontagedemontage:case pe.P2nbadge:case pe.Paris20km:case pe.Paris20kmassignment:case pe.Paris20kmcontremarque:case pe.Pastourelle:case pe.Pastourelleexposant:case pe.Pec:case pe.Playground:case pe.Roiarthur:case pe.Rose:case pe.Roseparking:throw new Error("Not implemented");case pe.Salamandre:return(0,i.jsx)(Fx,{event:t});case pe.T24assignment:case pe.Triathlonlarochellebadge:case pe.Utopialesimprimeur:case pe.Utopialesa4:case pe.Vandbcontremarque:case pe.Vannes:case pe.Vannesassignment:case pe.Vendanges:case pe.Vendeeglobebadge:case pe.Vendeeglobecontremarque:throw new Error("Not implemented");default:Za()}}(e,{}),!0}catch(e){return"Not implemented"!==e.message}}(e.badgeType)),[e.badgeType,e.showStrategy]);return(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ea,{justify:"center",children:(0,i.jsx)(Ea,{align:"center",css:{background:"$primary50",borderRadius:"48px",color:"$primary700",height:"48px",fontSize:"20px",width:"48px"},justify:"center",children:(0,i.jsx)(Va,{icon:"envelope"})})}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",textAlign:"center",children:e.title}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",dangerouslySetInnerHTML:{__html:t("en_2_clics_rec_97175")},textAlign:"center"}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ha,{color:"gray",leftIcon:"circle-exclamation",children:t("l_e_mail_peut_m_13253")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{css:{flex:"1",overflowY:"auto"},direction:"column",gap:"4",children:[(0,i.jsx)(dc,{isSearchVisible:!0,label:t("vue_s_personna_35768"),multiple:!0,placeholder:t("s_lectionnez_un_53633"),values:r,onChange:a,children:e.segmentsFolders.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))},e.id))}),e.languages.length>1&&(0,i.jsx)(gu,{label:t("Language"),placeholder:t("Language"),value:l,onChange:e=>{d(e)},children:e.languages.map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),e.showDate&&(0,i.jsx)(_u,{label:t("exportez_vos_do_87332"),max:e.endAt,min:e.startAt,value:c,onChange:u}),f&&(0,i.jsx)(gu,{label:t("strat_gie_44389"),value:h,onChange:e=>m(e),children:Qt.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))}),(0,i.jsx)(nc,{state:g?"checked":"unchecked",onClick:e=>{p("checked"===e)},children:t("fusionner_les_d_64130")}),(0,i.jsx)(wl,{label:t("Email"),state:"disabled",value:o?.email??"",onChange:Bl.A})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{isLoading:e.isSendLoading,onClick:async()=>{const t=await e.onSend(r,l,g,h,c.isValid?c:void 0);s(n,t),e.onClose()},children:t("envoyer_26609")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},AL=e=>{const t=Ln(),{mutate:n,isLoading:o}=Ss(),[s,r]=F.useState(!1);return(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(yb,{returnPathFallback:So.DOCUMENTS(e.organizationId,e.eventId)}),(0,i.jsx)(fr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"medium",children:e.title}),(0,i.jsx)(ub,{rolesTypes:zv,children:e.extraButton}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsx)(pl,{isLoading:o,onClick:()=>{r(!0)},children:t("param_trer_l_ex_83342")})}),s&&(0,i.jsx)(kL,{badgeType:e.badgeType,endAt:e.endAt,isSendLoading:o,languages:e.languages,segmentsFolders:e.segmentsFolders,showDate:e.showDate,showStrategy:e.showStrategy,startAt:e.startAt,title:t("envoi_de_vos_do_32953"),onClose:()=>{r(!1)},onSend:async(t,i,o,s,r)=>{const{eventDocumentsExport:a}=await n({eventId:e.eventId,documentsExport:{documentType:e.documentType,badgeType:e.badgeType,customDocumentSlug:e.customDocumentSlug,segmentsIds:t,language:i,oneFile:o,strategy:s,date:r}});return a}})]})},wL=e=>(0,i.jsx)(Ea,{css:{background:"$gray50",border:"1px solid $gray200",flex:"1",padding:"$7",overflowX:"hidden",overflowY:"auto"},height:1,justify:"center",children:(0,i.jsx)(Ea,{css:{boxShadow:"$md",borderRadius:"$2",height:"fit-content",overflow:"hidden"},direction:"column",width:e.width,children:e.children})});const SL=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,positionId:r}}=il(),[a,l,d]=Ec(""),{positionsOptions:c,isLoading:u}=function({eventId:e,hasSelected:t,nameDebounced:n,organizationId:o,positionsIds:s}){const{data:r,isLoading:a}=(l={organizationId:o,eventId:e,hasSelected:t,name:h(n)?n:void 0,ids:s},Vn(ds,l,[]));var l;const d=F.useMemo(()=>(0,Zd.A)((0,Ju.A)((r.organization?.list.nodes??[]).concat(r.organization?.selected.nodes??[]),e=>e.id),e=>e.name.toLowerCase()),[r.organization]);return{positionsOptions:F.useMemo(()=>d.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[d]),isLoading:a}}({organizationId:o,eventId:s,hasSelected:!0,positionsIds:[r],nameDebounced:l});return(0,i.jsxs)(Ea,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(fr,{font:"gray900 textMd semiBold",children:n("aper_u_pour_la_94895")}),(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(dc,{isSearchLoading:u,isSearchVisible:!0,searchElement:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:n("rechercher_une_69998"),state:"search",value:a,onChange:d}),values:[r],onChange:n=>{Zo(n)&&t.replace(e.getPath(n[0]))},children:c})})]})},EL=()=>{const{translate:e,params:{organizationId:t,eventId:n,positionId:o}}=il(),{event:s}=Uv(),{data:r,loader:a}=Vn("query PositionPlanningDocument($eventId: EventId!, $positionId: PositionId!) {\n    event(id: $eventId) {\n        ...DocumentPositionPlanning\n        ...EventPositionsExport\n    }\n}\n",{eventId:n,positionId:o},[Ro.DocumentPositionPlanningFragment,Ro.EventPositionsExportFragment]);return Cd(`${s.name} ${e("planning_d_une_64581")}`),(0,i.jsxs)(Ea,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(AL,{documentType:Se.PositionPlanning,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,title:e("planning_d_une_64581")}),(0,i.jsx)(Pa,{height:"7"}),a||(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(SL,{getPath:e=>So.DOCUMENTS_POSITION_PLANNING(t,n,e)}),(0,i.jsx)(wL,{children:(0,i.jsx)(yL,{event:r.event})})]})]})},TL=e=>{const t=Ln(),n=h(e.acronym)?`${e.name} (${e.acronym})`:e.name;return(0,i.jsxs)(Ea,{css:{background:"$gray100",padding:"$7 56px"},direction:"column",children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"displayXs",fontWeight:"medium",children:n}),(0,i.jsx)(fr,{color:"gray800",children:t("fiche_de_missio_00324")})]})},zL=e=>{const t=Ln(),n=Nn(vj),o=(0,F.useMemo)(()=>e.slugsToDisplay||[],[e.slugsToDisplay]),s=(0,F.useMemo)(()=>Object.fromEntries(o.flatMap(t=>{const n=e.customFields.find(e=>e.slug===t);return n?[[t,n]]:[]})),[o,e.customFields]),r=(0,F.useMemo)(()=>(0,Zd.A)(e.volunteers,e=>e.userInfo.name),[e.volunteers]);return(0,i.jsxs)(mc,{children:[(0,i.jsx)(cc,{css:{height:"32px"},children:o.map(e=>{const n=s[e];return"email"===e?(0,i.jsx)(Tc,{children:t("Email")},e):"fullName"===e?(0,i.jsx)(Tc,{children:t("full_name")},e):"picture"===e&&n?(0,i.jsx)(Tc,{width:80,children:n.name},e):"teamCode"===e?(0,i.jsx)(Tc,{children:t("code_quipe_14296")},e):n?(0,i.jsx)(Tc,{children:n.name},e):(0,i.jsx)(Tc,{},e)})}),r.map(e=>{const t=e.userInfo;return(0,i.jsx)(Cc,{css:{height:"28px"},children:o.map(o=>{const r=s[o];return"email"===o?(0,i.jsx)(xc,{children:t.email},o):"fullName"===o?(0,i.jsx)(Tc,{css:{color:"$gray800"},children:t.name},o):"picture"===o&&r?(0,i.jsx)(xc,{width:80,children:(0,i.jsx)(Fg,{email:t.email,image:t.picture?.url,name:t.name,size:32})},o):"teamCode"===o?(0,i.jsx)(xc,{children:e.teams.map(e=>e.teamCode).join(", ")},o):r?(0,i.jsx)(xc,{children:n.getValueString(r,t.fields)},o):(0,i.jsx)(xc,{},o)})},t.id)})]})},$L=e=>{const t=Ln(),{isRenamed:n,finalName:o,rangeString:s}=ZE(e.slot);return(0,i.jsx)(i.Fragment,{children:(0,Og.A)(e.volunteers,30).map((r,a)=>(0,i.jsxs)(Ea,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(TL,{acronym:e.positionAcronym,name:e.positionName}),(0,i.jsxs)(Ea,{css:{padding:"$7 56px"},direction:"column",gap:"3",children:[(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsxs)(fr,{font:"gray800 textSm medium",children:[t("membres_pour_le_20317",o)," (",e.volunteers.length,")"]}),n&&(0,i.jsx)(fr,{font:"gray800 textXs medium",children:s})]}),(0,i.jsx)(zL,{customFields:e.customFields,slugsToDisplay:e.slugsToDisplay,volunteers:r})]})]},a))})};function OL(e,t){const n=[];return"both"!==t&&"email"!==t||n.push(e.userInfo.email),h(e.userInfo.name)&&n.unshift(e.userInfo.name),!e.userInfo.phone||"both"!==t&&"phone"!==t||n.push(`${e.userInfo.phone.internationalFormat} `),n.join(" ")}const RL=e=>{const t=Ln(),n=Nn(Ku),o=(0,F.useMemo)(()=>(0,Zd.A)(e.ranges,e=>e.range.start.toMillis()).map(({name:e,range:t})=>(0,Da.A)([h(e)?e:null,n.toDisplayString(t,{formats:{displayWeekday:!0}})]).join(" - ")),[e.ranges]),s=(0,Ju.A)(e.position.leaders.concat(e.position.category.leaders),e=>e.userInfo.id);return(0,i.jsxs)(Ea,{css:{background:"white",padding:"$7 56px"},direction:"column",gap:"6",children:[e.displayPositionName&&(0,i.jsxs)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"medium",children:[e.position.category.name," | ",e.position.name]}),(0,i.jsxs)(Ea,{gap:"9",children:[(0,i.jsx)(fr,{color:"gray500",width:150,children:t("date_de_la_miss_70346")}),(0,i.jsx)(Ea,{css:{flex:"1"},direction:"column",children:o.map((e,t)=>(0,i.jsx)(fr,{color:"gray800",css:{textTransform:"capitalize"},children:e},t))})]}),s.map((n,o)=>(0,i.jsxs)(Ea,{gap:"9",children:[(0,i.jsx)(fr,{color:"gray500",width:150,children:t("reponsable_82458")}),(0,i.jsx)(fr,{color:"gray800",css:{flex:"1"},dangerouslySetInnerHTML:{__html:OL(n,e.leadersData)}})]},o)),h(e.position.description)&&(0,i.jsxs)(Ea,{gap:"9",children:[(0,i.jsx)(fr,{color:"gray500",width:150,children:t("description_58935")}),(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(ng,{text:e.position.description})})]}),mh(e.position)&&(0,i.jsxs)(Ea,{gap:"9",children:[(0,i.jsx)(fr,{color:"gray500",width:150,children:t("localisation_38416")}),(0,i.jsxs)(fr,{color:"gray800",css:{flex:"1"},children:[uh(e.position)&&e.position.address,hh(e.position)&&(0,i.jsx)("a",{href:ig(e.position.latitude,e.position.longitude),children:(0,i.jsx)("img",{alt:"Position map",src:`${R.HEAVENT_API_URL}/image/event/${e.position.eventId}/position/${e.position.id}.png`,width:"100%"})})]})]}),e.showResourcesInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{gap:"9",children:[(0,i.jsx)(fr,{color:"gray500",width:150,children:t("nombre_de_cr_ne_40593")}),(0,i.jsx)(fr,{color:"gray800",css:{flex:"1"},children:e.position.numberOfSlots})]}),(0,i.jsxs)(Ea,{gap:"9",children:[(0,i.jsx)(fr,{color:"gray500",width:150,children:t("nombre_de_membr_08851")}),(0,i.jsx)(fr,{color:"gray800",css:{flex:"1"},children:e.position.assignedResources})]})]})]})},PL=e=>{const{organization:t,event:n}=e.positionDocumentFragment,o=n.position,s=(0,F.useMemo)(()=>o.slots.filter(t=>!e.date?.isValid||t.range.start.startOf("day").equals(e.date.startOf("day"))),[o,e.date]);return(0,i.jsxs)(fr,{css:{background:"white"},width:1,children:[e.options.showPositionData&&(0,i.jsxs)(Ea,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(TL,{acronym:o.acronym,name:o.name}),(0,i.jsx)(RL,{displayPositionName:!1,leadersData:"both",position:o,ranges:o.range?[{name:null,range:o.range}]:[],showResourcesInfos:!0})]}),e.options.showVolunteersLists&&s.map(s=>{const r=(0,Zd.A)(n.volunteersRegistrations.nodes.filter(({positionsSlotsUsersInfos:e})=>e.map(({positionSlotId:e})=>e).includes(s.id)),e=>e.userInfo.name);return(0,i.jsx)($L,{customFields:t.customFields.nodes,positionAcronym:o.acronym,positionName:o.name,slot:s,slugsToDisplay:e.options.slugsToDisplay,volunteers:r},s.id)})]})},DL=e=>{const t=Ln();return(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsxs)(Ea,{css:{border:"1px solid $gray200",borderRadius:"$2",padding:"$6",overflowY:"auto",minWidth:"320px"},direction:"column",width:420,children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:t("param_tres_de_l_11729")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("s_lectionnez_le_59909")}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Ea,{direction:"column",gap:"3",width:1,children:e.children})]})})};function FL(e,t,n,i){const{isEventAdmin:o}=Uv(),{mutate:s}=function(e={}){return Un("mutation EventDocumentUpdate(\n    $eventId: EventId!\n    $id: EventsDocumentId!\n    $eventDocument: EventsDocumentInput!\n) {\n    eventDocumentUpdate(eventId: $eventId, id: $id, eventDocument: $eventDocument) {\n        id\n    }\n}\n",e)}(),[r,a]=F.useState({...t,...e}),[l,d]=F.useState(i.informations2Content||""),[c,u]=F.useState(i.informations2Title||""),[h,m]=F.useState(i.informationsContent||""),[g,p]=F.useState(i.informationsTitle||""),[f,x]=F.useState(i.signature||""),[_,I]=F.useState(i.title||""),v=F.useCallback((0,wc.A)(async(e,t,r,a,l,d,c)=>{o&&await s({eventId:n,id:i.id,eventDocument:{options:e,informations2Content:t,informations2Title:r,informationsContent:a,informationsTitle:l,signature:d,title:c}})},200),[n,i.id,o]);return{eventDocument:{options:e,informations2Content:l,informations2Title:c,informationsContent:h,informationsTitle:g,signature:f,title:_},informations2Content:l,informations2Title:c,informationsContent:h,informationsTitle:g,options:r,signature:f,title:_,setInformations2Content:async t=>{d(t),await v(e,t,c,h,g,f,_)},setInformations2Title:async t=>{u(t),await v(e,l,t,h,g,f,_)},setInformationsContent:async t=>{m(t),await v(e,l,c,t,g,f,_)},setInformationsTitle:async t=>{p(t),await v(e,l,c,h,t,f,_)},setOptions:async e=>{const t={...r,...e};a(t),await v(t,l,c,h,g,f,_)},setSignature:async t=>{x(t),await v(e,l,c,h,g,t,_)},setTitle:async t=>{I(t),await v(e,l,c,h,g,f,t)}}}const ML=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{event:s}=Uv(),{options:r,setOptions:a}=FL(e.data.event.document.options,{format:nt.A4Portrait,showPositionData:!0,showVolunteersLists:!0,slugsToDisplay:["fullName","phone"]},o,{id:e.data.event.document.id});return Cd(`${s.name} ${t("fiche_de_missio_00324")}`),(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(DL,{children:[(0,i.jsxs)(gu,{value:r.format,onChange:e=>{a({format:e})},children:[(0,i.jsx)("option",{value:nt.A4Portrait,children:t("a4_portrait_92125")}),(0,i.jsx)("option",{value:nt.A4Landscape,children:t("a4_paysage_24039")})]}),(0,i.jsx)(nc,{state:r.showPositionData?"checked":"unchecked",onClick:e=>{a({showPositionData:"checked"===e})},children:t("afficher_les_do_85282")}),(0,i.jsx)(nc,{state:r.showVolunteersLists?"checked":"unchecked",onClick:e=>{a({showVolunteersLists:"checked"===e})},children:t("afficher_les_li_18523")}),(0,i.jsxs)(dc,{isSearchVisible:!0,multiple:!0,placeholder:t("champs_affich_17945"),values:r.slugsToDisplay,onChange:e=>{a({slugsToDisplay:e})},children:[(0,i.jsx)("option",{value:"email",children:t("Email")}),(0,i.jsx)("option",{value:"fullName",children:t("nom_complet_05907")}),(0,i.jsx)("option",{value:"teamCode",children:t("code_quipe_14296")}),e.data.organization.customFields.nodes.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id))]})]}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(SL,{getPath:e=>So.DOCUMENTS_POSITION(n,o,e)}),(0,i.jsx)(wL,{width:1,children:(0,i.jsx)(PL,{options:r,positionDocumentFragment:e.data})})]})]})},NL=()=>{const{translate:e,params:{organizationId:t,eventId:n,positionId:o}}=il(),{data:s,loader:r}=Vn("query PositionSheetDocument(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $positionId: PositionId!\n) {\n    ...DocumentPositionSheet\n\n    event(id: $eventId) {\n        ...EventPositionsExport\n    }\n}\n",{organizationId:t,eventId:n,positionId:o},[Ro.DocumentPositionSheetFragment,Ro.EventPositionsExportFragment]);return(0,i.jsxs)(Ea,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(AL,{documentType:Se.Position,eventId:n,languages:s.event?.languages??[],organizationId:t,segmentsFolders:s.event?.segmentsFolders??[],showDate:!0,title:e("fiche_de_missio_61604")}),(0,i.jsx)(Pa,{height:"7"}),r||(0,i.jsx)(ML,{data:s})]})},LL=e=>{const t=Ln();return(0,i.jsx)(Ea,{css:{background:"$gray100",padding:"$6"},direction:"column",children:(0,i.jsx)(fr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",children:t("planning_1_14391",`${e.eventName} - ${e.segmentName}`)})})},BL=e=>{const t=Ln(),n=Nn($c),o=(0,Kd.A)(e.slots,e=>e.positionId);return(0,i.jsxs)(Ea,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[!0!==e.hideHeader&&(0,i.jsx)(LL,{eventName:e.eventName,segmentName:e.segmentName}),(0,i.jsxs)(Ea,{css:{background:"white",padding:"$6",position:"relative"},direction:"column",width:1,children:[(0,i.jsxs)(Ea,{children:[(0,i.jsx)(_L,{width:240,children:t("jour_87026")}),(0,i.jsx)(_L,{width:720,children:n.toLocaleString(e.startDate,Ho.DateOnly.WeekdayLongMonthLong)})]}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(_L,{width:240,children:t("cr_neaux_33401")}),(0,vc.A)(0,6).map(t=>{const n=e.startDate.plus({hour:2*t}),o=n.plus({hour:2}),s=Fo.IX.fromDateTimes(n,o);return(0,i.jsx)(_L,{width:120,children:s.toFormat("HH:mm")},t)})]}),e.positions.map((t,n)=>{const s=o[t.id];return(0,i.jsxs)(F.Fragment,{children:[(0,i.jsxs)(Ea,{children:[(0,i.jsx)(_L,{css:{color:"$gray700",height:"48px"},width:240,children:(0,i.jsx)(fr,{css:{ellipsis:!0},textAlign:"start",width:1,children:t.name})}),(0,vc.A)(0,6).map(e=>(0,i.jsx)(_L,{css:{height:"48px"},width:120},e))]}),s.map(t=>{const o=t.range.start.diff(e.startDate).shiftTo("hours","minutes"),s=t.range.end.diff(t.range.start).shiftTo("hours","minutes"),r=264+60*o.hours+o.minutes,a=112+48*n,l=60*s.hours+s.minutes,d=`${h(t.name)?`${t.name} - `:""}${t.range.toFormat("HH:mm")}`;return(0,i.jsx)(Ea,{align:"center",css:{background:t.position.color,borderRadius:"$1",color:Md(t.position.color),fontSize:"$textXs",height:"32px",left:`${r}px`,position:"absolute",top:`${a}px`,width:`${l}px`},children:(0,i.jsx)(fr,{css:{ellipsis:!0,px:"$1"},textAlign:"center",title:d,width:1,children:d})},t.id)})]},t.id)})]})]})},VL=e=>{const t=(0,F.useMemo)(()=>{const t=Gu(e.event.positionsSlots.nodes);if(Zo(t)){const n=Yu(t.map(e=>e.range));let i;return i=8!==n.startHour||20!==n.endHour?t.flatMap(e=>{const t=e.range;return t.start.hour<12&&t.end.hour>=12?[{...e,range:Fo.IX.fromDateTimes(t.start,t.start.set({hour:12,minute:0}))},{...e,range:Fo.IX.fromDateTimes(t.end.set({hour:12,minute:0}),t.end)}]:[e]}):t,i.filter(t=>!e.date?.isValid||t.range.start.startOf("day").equals(e.date.startOf("day")))}return[]},[e.event,e.date]),n=(0,F.useMemo)(()=>Zo(t)?Yu(t.map(e=>e.range)):null,[t]),o=n&&(8!==n.startHour||20!==n.endHour);return(0,i.jsx)(i.Fragment,{children:n?(0,vc.A)(0,n.numberOfDays).map((s,r)=>(0,vc.A)(0,o?2:1).map((a,l)=>{const d=n.startDate.plus({day:s}).set({hour:o?0===l?0:12:8}),c=o?0===l?d.set({hour:12}):d.plus({day:1}).startOf("day"):d.set({hour:20}),u=Fo.IX.fromDateTimes(d,c),h=t.filter(e=>e.range.overlaps(u)),m=(0,Zd.A)((0,Ju.A)(h.map(e=>e.position),e=>e.id),e=>e.name);return Zo(h)?(0,Og.A)(m,11).map((t,n)=>(0,i.jsx)(BL,{eventName:e.event.name,hideHeader:e.hideHeader,positions:t,segmentName:e.event.segment.name,slots:h,startDate:d},`${r}-${l}-${n}`)):null})):!0!==e.hideHeader?(0,i.jsx)(LL,{eventName:e.event.name,segmentName:e.event.segment.name}):null})},UL=e=>{const{history:t,translate:n,params:{segmentId:o}}=il();return(0,i.jsxs)(Ea,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(fr,{font:"gray900 textMd semiBold",children:n("aper_u_pour_la_43833")}),(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(dc,{isSearchVisible:!0,values:[o],onChange:n=>{Zo(n)&&t.replace(e.getPath(n[0]))},children:e.segmentsFolders.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})}),h(e.downloadPath)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{css:{flex:"1"}}),(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",to:e.downloadPath,children:n("t_l_charger_03283")})})]})]})},WL=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:o}}=il(),{event:s}=Uv(),{data:r,loader:a}=Vn("query PlanningDocument($eventId: EventId!, $segmentId: SegmentId!, $date: Date) {\n    event(id: $eventId) {\n        ...DocumentPositionsPlanning\n        ...EventPositionsExport\n    }\n}\n",{eventId:n,segmentId:o},[Ro.DocumentPositionsPlanningFragment,Ro.EventPositionsExportFragment]);return Cd(`${s.name} ${e("planning_de_l_96909")}`),(0,i.jsxs)(Ea,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(AL,{documentType:Se.Planning,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("planning_de_l_96909")}),(0,i.jsx)(Pa,{height:"7"}),a||(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(UL,{getPath:e=>So.DOCUMENTS_PLANNING(t,n,e),segmentsFolders:r.event.segmentsFolders}),(0,i.jsx)(wL,{width:1,children:(0,i.jsx)(fr,{css:{overflow:"auto"},width:1,children:(0,i.jsx)(VL,{event:r.event})})})]})]})},GL=100,HL=e=>{const t=Ln(),n=Nn($c),o=(0,F.useMemo)(()=>Wu(e.slots.map(({range:e})=>e).reduce((e,t)=>e.union(t),e.slots[0].range)),[e.slots]),s=e.slots[0].range.start,r=t=>(0,Zd.A)(sh(t,e.slots),[e=>e.position.name.toLowerCase(),e=>e.range.start.toMillis()]);return(0,i.jsxs)(Ea,{css:{background:"white",fontSize:"12px",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(LL,{eventName:e.eventName,segmentName:e.segmentName}),(0,i.jsxs)(Ea,{css:{background:"white",padding:"$6"},direction:"column",width:1,children:[(0,i.jsxs)(Ea,{children:[(0,i.jsx)(_L,{width:200,children:t("jours_88317")}),(0,vc.A)(0,o).map(t=>{const o=s.plus({days:t}),r=sh(o,e.slots);return(0,i.jsx)(_L,{width:(r.length||1)*GL,children:n.toLocaleString(o,Ho.DateOnly.MonthShort)},t)})]}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(_L,{width:200,children:t("missions_63972")}),(0,vc.A)(0,o).map(t=>{const n=s.plus({days:t}),o=(0,Zd.A)(Object.values((0,Kd.A)(sh(n,e.slots),e=>e.position.id)).map(e=>({position:e[0].position,numberOfSlots:e.length})),({position:e})=>e.name.toLowerCase());return 0===o.length?(0,i.jsx)(bL,{css:{height:"40px"},width:GL},t):o.map(({position:e,numberOfSlots:n})=>{const o=h(e.acronym)?e.acronym:e.name;return(0,i.jsx)(_L,{width:n*GL,children:(0,i.jsx)(fr,{css:{ellipsis:!0,px:"$1"},textAlign:"center",title:o,width:1,children:o})},`${t}-${e.id}`)})})]}),(0,i.jsxs)(Ea,{children:[(0,i.jsx)(_L,{width:200,children:t("cr_neaux_33401")}),(0,vc.A)(0,o).map(e=>{const t=s.plus({days:e}),n=r(t);return 0===n.length?(0,i.jsx)(bL,{css:{height:"40px"},width:GL},e):n.map(t=>(0,i.jsx)(_L,{width:GL,children:t.range.toFormat("HH:mm",{separator:"-"})},`${e}-${t.id}`))})]}),e.volunteersRegistrations.map(e=>{const t=e.userInfo;return(0,i.jsxs)(Ea,{children:[(0,i.jsxs)(IL,{width:200,children:[(0,i.jsx)(Fg,{email:t.email,image:t.picture?.url,name:t.name,size:24}),(0,i.jsx)(fr,{css:{flex:"1",ellipsis:""},title:t.name,children:t.name})]}),(0,vc.A)(0,o).map(t=>{const n=s.plus({days:t}),o=r(n);return 0===o.length?(0,i.jsx)(bL,{width:GL},t):o.map(n=>{const o=`${t}-${n.id}`;return void 0!==e.positionsSlotsUsersInfos.find(({positionSlotId:e})=>e===n.id)?(0,i.jsx)(vL,{width:GL,children:(0,i.jsx)(fr,{children:(0,i.jsx)(fL,{})})},o):(0,i.jsx)(bL,{width:GL},o)})})]},e.id)})]})]})},qL=e=>{const t=(0,Zd.A)(Gu(e.event.positionsSlots.nodes),e=>e.range.start),n=e.event.volunteersRegistrations.nodes;return(0,i.jsx)(i.Fragment,{children:(0,Og.A)(t,8).map((t,o)=>{const s=t.map(e=>e.id),r=n.filter(e=>{const t=e.positionsSlotsUsersInfos.map(e=>e.positionSlotId);return(0,Zu.A)(s,t).length>0});return(0,Og.A)(r,10).map((n,s)=>(0,i.jsx)(HL,{eventName:e.event.name,segmentName:e.event.segment.name,slots:t,volunteersRegistrations:n},`${o}-${s}`))})})},YL=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:o}}=il(),{event:s}=Uv(),{data:r,loader:a}=Vn("query PositionsVolunteersPlanningDocument($eventId: EventId!, $segmentId: SegmentId!) {\n    event(id: $eventId) {\n        ...DocumentPositionsVolunteersPlanning\n        ...EventPositionsExport\n    }\n}\n",{eventId:n,segmentId:o},[Ro.DocumentPositionsVolunteersPlanningFragment,Ro.EventPositionsExportFragment]);return Cd(`${s.name} ${e("planning_d_un_g_23684")}`),(0,i.jsxs)(Ea,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(AL,{documentType:Se.PositionsVolunteersPlanning,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("planning_d_un_g_23684")}),(0,i.jsx)(Pa,{height:"7"}),a||(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(UL,{getPath:e=>So.DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING(t,n,e),segmentsFolders:r.event.segmentsFolders}),(0,i.jsx)(wL,{children:(0,i.jsx)(fr,{css:{overflow:"auto"},width:1,children:(0,i.jsx)(qL,{event:r.event})})})]})]})};var KL=n(8962),ZL=n.n(KL);const XL=(e,t)=>"base64"===t?new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{t(i.result?.toString()??"")},i.onerror=n,i.readAsDataURL(e)}):new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{const e=new Uint8Array(i.result);t(ZL().detect(e)||"UTF-8")},i.onerror=n,i.readAsArrayBuffer(e)}).then(t=>new Promise((n,i)=>{const o=new FileReader;o.onload=()=>n(o.result?.toString()??""),o.onerror=i,o.readAsText(e,t)})),JL=({css:e,label:t,description:n,icon:o,hint:s,state:r,value:a,placeholder:l,accept:d,format:c,onChange:u,...m})=>{const g=(0,F.useRef)(null),{inputId:p,descId:f,errorId:x}=bl();return(0,i.jsxs)(Ea,{css:e,direction:"column",width:1,children:[(0,i.jsx)(yl,{htmlFor:p,isClickable:!1,children:t}),(0,i.jsx)(jl,{id:f,children:n}),(t||n)&&(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(Al,{cursor:"pointer",icon:o,rightIcon:"file",state:r,onClick:()=>{g.current?.click()},children:(0,i.jsxs)(fr,{color:h(a?.name)?"gray800":"gray500",css:{flex:"1","& input":{display:"none"}},children:[h(a?.name)?a.name:l,(0,i.jsx)("input",{ref:g,accept:KI(d),"aria-describedby":n?f:void 0,"aria-errormessage":"error"===r?x:void 0,"aria-invalid":"error"===r,id:p,type:"file",onChange:async e=>{const t=e.target.files?.[0];t&&u({name:t.name,content:await XL(t,c)})},...m})]})}),(0,i.jsx)(Cl,{id:x,state:r,children:s})]})};function QL(e){return{color:Ud(e.subtitleColor)?e.subtitleColor:"$gray800",fontFamily:e.titleFontFamily||"Open Sans",fontSize:"14px",fontWeight:"700",textTransform:"uppercase"}}const eB=e=>{const t=Ln();return e.options.showInformations?(0,i.jsxs)(Ea,{css:{background:e.isAso?void 0:"white",borderRadius:"$2",px:e.isAso?"0":"$3",py:"$4"},direction:"column",gap:e.isAso?"1":"3",width:1,children:[(0,i.jsx)(fr,{css:{...QL(e.options),textAlign:"center"},width:1,children:h(e.informationsTitle)?e.informationsTitle:t("informations_22954")}),h(e.informationsContent)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fr,{css:{wordBreak:"break-word","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(ng,{text:e.renderText(e.informationsContent)})})})]}):null},tB=e=>(0,i.jsx)(Ea,{css:{paddingTop:e.isAso?"180px":"73px",position:"relative"},direction:"column",gap:"5",width:e.isAso?157:178,children:e.children}),nB=e=>e.options.showQrCode?(0,i.jsxs)(Ea,{align:"center",css:{background:"white",borderRadius:"$2",padding:"$4 $3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(fr,{css:{...QL(e.options),textAlign:"center"},width:1,children:"QR Code"}),(0,i.jsx)(fr,{height:104,width:104,children:(0,i.jsx)("img",{height:"100%",src:Ym(e.ticketId,{height:90,width:90}),width:"100%"})})]}):null,iB=e=>{const t=Ln(),n=e.psuis[0].position,o=e.userInfo,s=168===e.organizationId,r=573===e.organizationId,a=858===e.organizationId,l=306===e.organizationId,d=Ud(e.options.headerColor)?e.options.headerColor:"white",c={color:Ud(e.options.titleColor)?e.options.titleColor:"$gray800",fontFamily:s?"$moonstruck":e.options.titleFontFamily||"Open Sans",fontSize:s?"64px":"24px",fontWeight:s?"500":"800",lineHeight:s?"48px":void 0,textAlign:"center"},u=QL(e.options),m=e.options.showInformations||e.options.showInformations2||e.options.showQrCode,g=(0,Ju.A)(n.leaders.concat(n.category.leaders),e=>e.userInfo.id);return(0,i.jsxs)(Ea,{css:{color:Ud(e.options.textColor)?e.options.textColor:"$gray800",fontFamily:e.options.fontFamily||"Open Sans",fontSize:"12px","@media print":{breakBefore:"page"},"@media screen":{backgroundColor:n.color,backgroundImage:h(e.options.background?.content)?`url(${e.options.background?.content})`:void 0,backgroundRepeat:"repeat-y",backgroundSize:"100% auto",height:`calc-size(auto, round(up, size, ${Dm}px))`,width:`${Fm}px`},"@page":{size:"A4 portrait"}},direction:"column",children:[(0,i.jsx)(fr,{css:{backgroundAttachment:"fixed",backgroundColor:n.color,backgroundImage:h(e.options.background?.content)?`url(${e.options.background?.content})`:void 0,backgroundRepeat:"no-repeat",backgroundSize:"cover",position:"fixed",height:"100%",width:"100%",zIndex:"-1","@media screen":{display:"none"}}}),(0,i.jsxs)(Ea,{align:"center",css:{marginLeft:"210px",marginTop:"51px"},gap:"4",justify:l?"end":"center",width:568,children:[(0,i.jsxs)(Ea,{align:l?"end":"center",css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(fr,{css:{color:d,fontSize:"14px",fontWeight:"700",lineHeight:"18px"},children:h(e.document.title)?e.document.title:t("Assignments")}),(0,i.jsx)(fr,{css:{color:d,fontSize:"28px",fontWeight:"700",lineHeight:"38px"},children:o.name})]}),l&&(0,i.jsx)(fr,{css:{background:`url(${e.userInfo.picture?.url}) no-repeat`,backgroundSize:"contain",borderRadius:"$1",overflowX:"hidden"},height:74,width:74})]}),(0,i.jsx)(Pa,{height:l?"4":"7"}),(0,i.jsxs)(Ea,{css:{paddingBottom:"$6",paddingLeft:a?"46px":"$4",paddingRight:"$4"},gap:"4",width:1,children:[m&&(0,i.jsxs)(tB,{isAso:a,children:[(0,i.jsx)(eB,{informationsContent:e.document.informationsContent,informationsTitle:e.document.informationsTitle,isAso:a,options:e.options,renderText:e.renderText}),e.options.showInformations2&&(0,i.jsxs)(Ea,{css:{background:"white",borderRadius:"$2",padding:"$4 $3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(fr,{css:{...u,textAlign:"center"},width:1,children:h(e.document.informations2Title)?e.document.informations2Title:t("informations_se_69499")}),h(e.document.informations2Content)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fr,{css:{wordBreak:"break-word","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(ng,{text:e.renderText(e.document.informations2Content)})})})]}),(0,i.jsx)(nB,{options:e.options,ticketId:e.volunteerRegistration.ticketId}),a&&e.options.showLeaders&&g[0]&&(0,i.jsxs)(fr,{css:{position:"absolute",top:"450px"},width:1,children:[g[0].userInfo.name,(0,i.jsx)("br",{}),g[0].userInfo.phone?.internationalFormat]})]}),(0,i.jsxs)(Ea,{css:{alignSelf:"start",border:"2px solid transparent",background:a?void 0:"white",borderRadius:"$3",flex:"1",fontSize:"12px",overflowX:"hidden",padding:"32px 40px"},direction:"column",children:[r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{css:{...c,fontSize:"12px",fontWeight:"700"},children:n.category.name}),(0,i.jsx)(Pa,{height:"1"})]}),(0,i.jsx)(fr,{css:c,width:1,children:n.name}),e.children]})]})]})},oB=e=>{const t=Ln(),n=Nn(vj),o=Nn(JA),s=Nn(Dn),r=e.psuis[0].position,a=(0,Zd.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),l=168===e.organizationId,d=573===e.organizationId,c=858===e.organizationId,u=2695===e.organizationId,m=426===e.organizationId,g=QL(e.options),p=(0,Ju.A)(r.leaders.concat(r.category.leaders),e=>e.userInfo.id),f="both"===e.options.leadersData||"email"===e.options.leadersData,x="both"===e.options.leadersData||"phone"===e.options.leadersData,_=t=>o.renderText(t,{userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(iB,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:_,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:[e.options.showLeaders&&!d&&!c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(fr,{css:{color:Ud(e.options.subtitleColor)?e.options.subtitleColor:"$gray800",fontSize:"14px",fontWeight:"700"},textAlign:"center",width:1,children:[t("ton_responsable_16222")," ",p.map(e=>(0,Da.A)([e.userInfo.name,f?e.userInfo.email:"",x?e.userInfo.phone?.internationalFormat??"":""]).join(" ")).join(", ")]})]}),(0,i.jsx)(Pa,{height:"7"}),!c&&(0,i.jsxs)(Ea,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(fr,{css:g,children:u?"Horaire":t("date_de_ta_miss_18706")}),(0,i.jsx)(Ea,{direction:"column",gap:"1",children:a.map((e,t)=>{const n=e.range.start,o=e.range.end,r=n.startOf("day").toMillis()===o.startOf("day").toMillis();return(0,i.jsxs)(fr,{children:[h(e.name)?`${e.name} | `:"",(0,i.jsx)(Pm,{css:{textTransform:"capitalize"},children:n.toFormat("cccc d MMMM yyyy HH:mm",{locale:s.language.toString().toLowerCase()})})," ","-"," ",(0,i.jsx)(Pm,{css:{textTransform:"capitalize"},children:r?o.toFormat("HH:mm"):o.toFormat("cccc d MMMM yyyy HH:mm",{locale:s.language.toString().toLowerCase()})})]},t)})})]}),c&&(0,i.jsxs)(Ea,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(fr,{css:g,children:"Rendez-vous"}),(0,i.jsx)(Ea,{direction:"column",gap:"1",children:a.map((e,t)=>(0,i.jsxs)(fr,{children:[(0,i.jsx)(Pm,{css:{textTransform:"capitalize"},fontWeight:"bold",children:e.range.start.toFormat("cccc d MMMM yyyy à H'h'mm",{locale:"fr"})})," ","(fin de mission estimée à ",e.range.end.toFormat("H'h'mm"),")"]},t))})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(fr,{css:g,children:u?"Consignes du poste":t("description_de_15187")}),(0,i.jsxs)(Ea,{direction:"column",children:[h(r.description)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{css:{"& .h-rich-text > p":{margin:"0"},"& .h-rich-text figure, & .h-rich-text img":{maxWidth:"100%"}},children:(0,i.jsx)(ng,{text:r.description})}),(0,i.jsx)(Pa,{height:"1"})]}),mh(r)&&(0,i.jsxs)(Ea,{css:{"@media print":{breakInside:"avoid",display:"block",overflow:"visible"}},direction:"column",children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{css:g,children:d?"Point de rendez-vous":m?"Lieu du poste":t("lieu_de_rendez_30016")}),uh(r)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{children:r.address})]}),hh(r)&&(d||u)&&(0,i.jsxs)(fr,{children:["Point GPS : ",r.latitude,", ",r.longitude]}),hh(r)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{gap:"3",width:1,children:[(0,i.jsx)(fr,{css:{width:"100%"},height:u?270:180,children:(0,i.jsx)("a",{href:ig(r.latitude,r.longitude),style:{background:`url(${R.HEAVENT_API_URL}/image/event/${e.eventId}/position/${r.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),l&&h(r.fields?.cf44697?.url)&&(0,i.jsx)(fr,{css:{background:`url(${r.fields.cf44697.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204}),d&&h(r.fields?.cf46814?.url)&&(0,i.jsx)(fr,{css:{background:`url(${r.fields.cf46814.url}) no-repeat`,backgroundSize:"contain"},height:180,width:1}),c&&h(r.fields?.cf45815?.url)&&(0,i.jsx)(fr,{css:{background:`url(${r.fields.cf45815.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204})]})]}),d&&h(r.fields?.cf46813)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{children:r.fields.cf46813})]})]})]})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(fr,{css:g,children:"UNE QUESTION OU UN PROBLÈME ?"}),(0,i.jsxs)(fr,{children:["Nous sommes là pour vous aider. Contactez votre responsable de secteur :"," ",(0,i.jsxs)(Pm,{fontWeight:"bold",children:[p[0]?.userInfo.name," :"," ",p[0]?.userInfo.phone?.internationalFormat]})]})]})]}),e.customFields.map(t=>{const o=n.getValueString(t,r.fields,{fileReturnValue:"url"});return e.options.positionCustomFields?.includes(t.id)&&h(o)?(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(fr,{css:g,children:t.name}),t.fieldType===Ne.File?function(e){const{extension:t}=zI(e);return $I.includes(t)}(n.getValueString(t,r.fields,{fileReturnValue:"name"}))?(0,i.jsx)(fr,{css:{background:`url(${o}) no-repeat`,backgroundPosition:"center",backgroundSize:"cover"},height:180,width:1}):(0,i.jsx)(fr,{css:{wordBreak:"break-word","& > a":{color:"inherit"}},children:(0,i.jsx)("a",{href:o,rel:"noreferrer",target:"_blank",children:o})}):(0,i.jsx)(fr,{dangerouslySetInnerHTML:{__html:o.replace(/\n/g," ")}})]})]},t.id):null}),h(e.options.signature)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fr,{css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(ng,{text:_(e.options.signature)})})})]}),c&&h(r.fields?.cf24781?.url)&&(0,i.jsxs)(iB,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:_,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{css:{color:Ud(e.options.titleColor)?e.options.titleColor:"$gray800",fontFamily:e.options.titleFontFamily||"Open Sans",fontSize:"16px",fontWeight:"700",textAlign:"center"},children:"(Annexe)"}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{css:{background:`url(${r.fields.cf24781.url}) no-repeat`,backgroundSize:"contain"},height:1,width:1})]}),u&&(0,i.jsx)(iB,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:_,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsx)(fr,{css:{background:`url(${R.HEAVENT_ASSETS_URL}/badges/velotour/condition.png) no-repeat`,backgroundSize:"cover"},height:601,width:533})})]})},sB=e=>{const t=e.assignmentsInfos.event.volunteerRegistration,n=(0,F.useMemo)(()=>Qm(t.positionsSlotsUsersInfos,e.date,e.endDate).filter(e=>!e.position.tags.find(e=>"mission privée"===e.name.trim().toLowerCase()||"document-assignments-excluded"===e.name.trim().toLowerCase())),[t,e.date,e.endDate]),o=(0,F.useMemo)(()=>(0,Zd.A)(Object.entries((0,Kd.A)(n,e=>e.position.id)),([e,t])=>(0,Xu.A)(t.map(e=>e.positionSlot.range.start.toMillis()))),[n]);return(0,i.jsx)(i.Fragment,{children:o.map(([n,o],s)=>(0,i.jsx)(oB,{customFields:e.assignmentsInfos.organization.customFields.nodes,document:e.eventDocument,eventId:e.assignmentsInfos.event.id,options:e.options,organizationId:e.assignmentsInfos.organization.id,psuis:o,userInfo:e.assignmentsInfos.organization.userInfo,volunteerRegistration:t},s))})},rB=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{eventDocument:s,informations2Content:r,informations2Title:a,informationsContent:l,informationsTitle:d,options:c,signature:u,title:m,setInformations2Content:g,setInformations2Title:p,setInformationsContent:f,setInformationsTitle:x,setOptions:_,setSignature:I,setTitle:v}=FL(e.data.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",informationsContent:"",informationsTitle:"",informationsContent2:"",informationsTitle2:"",leadersData:"phone",positionCustomFields:[],showInformations:!1,showInformations2:!1,showLeaders:!1,showQrCode:!1,signature:"",subtitleColor:"#1d2939",textColor:"#1d2939",title:"",titleColor:"#1d2939",titleFontFamily:"Open Sans"},o,{id:e.data.event.document.id,title:e.data.event.document.title,signature:e.data.event.document.signature,informationsTitle:e.data.event.document.informationsTitle,informationsContent:e.data.event.document.informationsContent,informations2Title:e.data.event.document.informations2Title,informations2Content:e.data.event.document.informations2Content}),b=BN(),j=(0,F.useMemo)(()=>(0,Zd.A)(e.data.organization.customFields.nodes,e=>e.name.toLowerCase()),[e.data]),C=e.data.organization.userInfo;return(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(DL,{children:[(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(JL,{accept:HI.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:c.background,onChange:e=>{_({background:e})}}),h(c.background?.name)&&(0,i.jsx)(fr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{_({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(wl,{label:t("titre_du_docume_33508"),value:m,onChange:e=>{v(e)}}),(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(gu,{label:"Police",value:c.fontFamily,onChange:e=>{_({fontFamily:e})},children:b}),(0,i.jsx)(gu,{label:t("police_des_titr_37497"),value:c.titleFontFamily,onChange:e=>{_({titleFontFamily:e})},children:b}),(0,i.jsx)(tj,{label:t("couleur_du_titr_08509"),value:c.titleColor,onChange:e=>{_({titleColor:e})}}),(0,i.jsx)(tj,{label:t("couleur_des_sou_18968"),value:c.subtitleColor,onChange:e=>{_({subtitleColor:e})}}),(0,i.jsx)(tj,{label:t("couleur_du_text_32021"),value:c.textColor,onChange:e=>{_({textColor:e})}}),(0,i.jsx)(tj,{label:t("couleur_du_cont_17150"),value:c.headerColor,onChange:e=>{_({headerColor:e})}}),(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(su,{value:c.showInformations,onChange:e=>{_({showInformations:e})},children:t("afficher_la_sec_84744")}),c.showInformations&&(0,i.jsxs)(Ea,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(wl,{label:t("titre_de_la_sec_41575"),value:d,onChange:e=>{x(e)}}),(0,i.jsx)(mv,{initialValue:l,label:t("contenu_de_la_s_43102"),onChange:e=>{f(e)}})]}),(0,i.jsx)(su,{value:c.showInformations2,onChange:e=>{_({showInformations2:e})},children:t("afficher_la_sec_67554")}),c.showInformations2&&(0,i.jsxs)(Ea,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(wl,{label:t("titre_de_la_sec_41575"),value:a,onChange:e=>{p(e)}}),(0,i.jsx)(mv,{initialValue:r,label:t("contenu_de_la_s_43102"),onChange:e=>{g(e)}})]}),(0,i.jsx)(su,{value:c.showQrCode,onChange:e=>{_({showQrCode:e})},children:t("afficher_le_qr_15635")}),(0,i.jsx)(su,{value:c.showLeaders,onChange:e=>{_({showLeaders:e})},children:t("afficher_les_re_08705")}),c.showLeaders&&(0,i.jsx)(Ea,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:(0,i.jsxs)(gu,{label:t("donn_es_des_res_45809"),value:c.leadersData,onChange:e=>{_({leadersData:e})},children:[(0,i.jsx)("option",{value:"both",children:t("afficher_le_num_37296")}),(0,i.jsx)("option",{value:"phone",children:t("afficher_unique_41829")}),(0,i.jsx)("option",{value:"email",children:t("afficher_unique_97964")}),(0,i.jsx)("option",{value:"none",children:t("afficher_aucune_38167")})]})}),(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(mv,{initialValue:u,label:t("signature_67521"),onChange:e=>{I(e)}}),Zo(j)&&(0,i.jsx)(dc,{label:t("liste_des_champ_40847"),multiple:!0,values:c.positionCustomFields,onChange:e=>{_({positionCustomFields:e})},children:j.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ob,{downloadPath:Zm(C.links?.userAssignmentsLink??"","pdf",{lang:C.language}),getPath:e=>So.DOCUMENTS_ASSIGNMENTS(n,o,e)}),(0,i.jsx)(wL,{children:(0,i.jsx)(sB,{assignmentsInfos:e.data,eventDocument:s,options:c})})]})]})},aB=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o}}=il(),{event:s}=Uv(),{data:r,loader:a}=Vn("query UserAssignmentsDocument(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $userInfoId: UsersInfoId!\n) {\n    ...DocumentUserAssignments\n\n    event(id: $eventId) {\n        startAt\n        endAt\n\n        ...EventVolunteersExport\n    }\n}\n",{organizationId:t,eventId:n,userInfoId:o},[Ro.DocumentUserAssignmentsFragment,Ro.EventVolunteersExportFragment]);return Cd(`${s.name} ${e("fiche_d_affecta_91461")}`),(0,i.jsxs)(Ea,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(AL,{documentType:Se.Assignments,endAt:r.event?.endAt,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,startAt:r.event?.startAt,title:e("fiches_d_affect_98583")}),(0,i.jsx)(Pa,{height:"7"}),a||(0,i.jsx)(rB,{data:r})]})},lB=e=>{const t=Ln(),n=Nn(Ku),o=e.options.format===nt.A4Portrait?Wm.A4:e.options.format===nt.A5Portrait?Wm.A5:Wm.A6,s=e.badgeDocumentFragment.volunteerRegistration;return(0,i.jsxs)(fr,{width:o.width,children:[(0,i.jsxs)(Ea,{css:{background:`linear-gradient(190deg, ${e.options.color} 40%, white 40%)`},direction:"column",height:o.height,width:1,children:[(0,i.jsx)(fr,{css:{height:"calc(40% - 40px)"}}),(0,i.jsxs)(Ea,{align:"center",direction:"column",width:1,children:[(0,i.jsx)(Fg,{email:s.userInfo.email,image:s.userInfo.picture?.url,name:s.userInfo.name,size:96}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",children:s.userInfo.nameOrEmail}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textLg",children:h(e.options.name)?e.options.name:t("membre_45658")})]}),(0,i.jsx)(fr,{css:{flex:"1"}}),h(e.options.logo?.content)&&(0,i.jsx)(Ea,{height:96,justify:"center",children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content})}),(0,i.jsx)(Pa,{height:"6"})]}),e.showPageSeparator&&(0,i.jsx)(fr,{css:{background:"transparent",height:"$space$6"}}),(0,i.jsxs)(Ea,{css:{background:"white",pageBreakBefore:"always",padding:"$4 $6"},direction:"column",height:o.height,width:1,children:[h(e.options.logo?.content)&&(0,i.jsx)(Ea,{height:32,justify:"center",children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content})}),(0,i.jsx)(Pa,{height:"6"}),!1!==e.options.showAssignments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray900",fontWeight:"medium",children:t("affectation_plural")}),(0,i.jsx)(Pa,{height:"2"}),s.positionsSlotsUsersInfos.map(({position:e,positionSlot:o},s)=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(fr,{color:"gray500",fontSize:"textXs",children:t("affectation_n_78121",s+1)}),(0,i.jsxs)(fr,{color:"gray800",children:[e.name," :"," ",n.toDisplayString(o.range)]}),(0,i.jsx)(Pa,{height:"2"})]},s))]}),h(e.options.infos)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray500",fontSize:"textXs",children:t("renseigements_c_00093")}),(0,i.jsx)(fr,{color:"gray800",css:{whiteSpace:"pre-wrap"},children:e.options.infos})]})]})]})},dB=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{options:s,setOptions:r}=FL(e.data.event.document.options,{format:nt.A6Portrait,logo:{name:"",content:""},color:lr.colors.gray900.value,name:"",infos:"",showAssignments:!0},o,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(DL,{children:[(0,i.jsxs)(gu,{label:"Format",value:s.format,onChange:e=>{r({format:e})},children:[(0,i.jsx)("option",{value:nt.A4Portrait,children:"A4"}),(0,i.jsx)("option",{value:nt.A5Portrait,children:"A5"}),(0,i.jsx)("option",{value:nt.A6Portrait,children:"A6"})]}),(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(JL,{accept:HI.Images,format:"base64",label:t("logo_18191"),placeholder:t("logo_18191"),value:s.logo,onChange:e=>{r({logo:e})}}),h(s.logo?.name)&&(0,i.jsx)(fr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({logo:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(tj,{label:t("couleur_de_fond_75677"),value:s.color,onChange:e=>{r({color:e})}}),(0,i.jsx)(wl,{hint:t("ce_nom_sera_sit_11616"),label:t("nom_du_badge_36141"),placeholder:t("membre_45658"),value:s.name,onChange:e=>{r({name:e})}}),(0,i.jsx)(Em,{label:t("renseigements_c_00093"),placeholder:t("ex_contact_d_11070"),value:s.infos,onChange:e=>{r({infos:e})}}),(0,i.jsx)(nc,{state:s.showAssignments?"checked":"unchecked",onClick:e=>{r({showAssignments:"checked"===e})},children:t("afficher_les_af_46643")})]}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ob,{downloadPath:Zm(a.links?.userBadgeLink??"","pdf",{lang:a.language}),getPath:e=>So.DOCUMENTS_BADGE(n,o,e,"generic")}),(0,i.jsx)(wL,{children:(0,i.jsx)(lB,{badgeDocumentFragment:e.data.event,options:s,showPageSeparator:!0})})]})]})},cB=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o}}=il(),{event:s}=Uv(),{data:r,loader:a}=Vn("query UserBadgeDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n    event(id: $eventId) {\n        ...DocumentUserBadge\n        ...EventVolunteersExport\n    }\n}\n",{eventId:n,userInfoId:o},[Ro.DocumentUserBadgeFragment,Ro.EventVolunteersExportFragment]);return Cd(`${s.name} ${e("BadgeCheck")}`),(0,i.jsxs)(Ea,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(AL,{documentType:Se.Badge,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("badges_37586")}),(0,i.jsx)(Pa,{height:"7"}),a||(0,i.jsx)(dB,{data:r})]})},uB=e=>{const t=Ln(),n=Nn($c),o=Nn(Ku),s=(0,F.useMemo)(()=>(0,Zd.A)(e.certificateDocumentFragment.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.certificateDocumentFragment.volunteerRegistration]),r=Fo.c9.local(),a=e.certificateDocumentFragment.volunteerRegistration.userInfo;return(0,i.jsxs)(Ea,{css:{background:"white",padding:"$7 56px"},direction:"column",gap:"5",width:1,children:[h(e.options.header.content)&&(0,i.jsx)(fr,{css:{borderRadius:"$1",boxShadow:"$xs",overflow:"hidden"},height:260,children:(0,i.jsx)("img",{height:"100%",src:e.options.header.content,width:"100%"})}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textXl",fontWeight:"semiBold",textAlign:"center",children:t("attestation_de_92734")}),(0,i.jsxs)(Ea,{css:{bd:!0,padding:"$4"},direction:"column",gap:"6",children:[(0,i.jsxs)(fr,{color:"gray800",fontWeight:"semiBold",children:[t("je_soussign_e_04371",e.options.name)," ",(0,i.jsx)("br",{}),e.options.title]}),(0,i.jsxs)(fr,{css:{"& > span":{fontWeight:"$semiBold"}},children:[t("certifie_que_13123")," ",(0,i.jsx)("span",{children:a.name}),(0,i.jsx)("br",{}),t("n_e_le_14393")," ",(0,i.jsx)("span",{children:h(a.dateOfBirth)?n.toLocaleString(Fo.c9.fromISO(a.dateOfBirth),Ho.DateOnly.MonthLong):""}),(0,i.jsx)("br",{}),t("demeurant_78485")," ",(0,i.jsx)("span",{children:h(a.street)?a.street:""}),(0,i.jsx)("br",{}),t("commune_48881")," ",(0,i.jsx)("span",{children:h(a.city)?a.city:""}),(0,i.jsx)("br",{}),t("code_postal_74563")," ",(0,i.jsx)("span",{children:h(a.postalCode)?a.postalCode:""})]}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"semiBold",children:t("a_t_b_n_vole_58773")}),(0,i.jsx)(fr,{dangerouslySetInnerHTML:{__html:s.map(({position:e,positionSlot:t})=>`${e.name} : ${o.toDisplayString(t.range)}`).join(" ")}}),(0,i.jsxs)(fr,{color:"gray800",css:{whiteSpace:"pre-wrap","& > span":{fontWeight:"$semiBold"}},children:[(0,i.jsx)("span",{children:t("nom_et_adresse_96441")}),(0,i.jsx)("br",{}),e.options.address]}),h(e.options.infos)&&(0,i.jsx)(fr,{color:"gray800",css:{whiteSpace:"pre-wrap"},children:e.options.infos})]}),(0,i.jsx)(fr,{color:"gray800",children:t("atteste_sur_l_h_37408")}),(0,i.jsxs)(Jl,{gap:"6",gridtemplatecolumns:"repeat(3, 1fr)",children:[(0,i.jsxs)(Ea,{direction:"column",gap:"3",children:[(0,i.jsx)(fr,{color:"gray800",children:t("signature_67521")}),h(e.options.signature.content)&&(0,i.jsx)(fr,{width:1,children:(0,i.jsx)("img",{src:e.options.signature.content,width:"100%"})})]}),(0,i.jsx)(fr,{color:"gray800",children:t("fait_1_39349",e.options.place)}),(0,i.jsx)(fr,{color:"gray800",children:n.toLocaleString(r,Ho.DateOnly.MonthLong)})]})]})},hB=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{options:s,setOptions:r}=FL(e.data.event.document.options,function(e){return{address:`${e.name}\n${e.street||""}\n${e.postalCode||""}\n${e.city||""}`.trim(),header:{name:"",content:""},infos:"",name:e.adminName||"",place:"Montpellier",signature:{name:"",content:""},title:`Président de ${e.name}`}}(e.data.organization),o,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(DL,{children:[(0,i.jsx)(wl,{label:t("full_name"),placeholder:"Antoine Dupont",value:s.name,onChange:e=>{r({name:e})}}),(0,i.jsx)(wl,{label:t("fonction_68322"),placeholder:t("pr_sident_30600"),value:s.title,onChange:e=>{r({title:e})}}),(0,i.jsx)(Em,{label:t("nom_et_adresse_81953"),value:s.address,onChange:e=>{r({address:e})}}),(0,i.jsx)(Em,{label:t("informations_su_09057"),value:s.infos,onChange:e=>{r({infos:e})}}),(0,i.jsx)(wl,{label:t("lieu_de_l_attes_84804"),placeholder:"Montpellier",value:s.place,onChange:e=>{r({place:e})}}),(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(JL,{accept:HI.Images,format:"base64",hint:t("taille_de_l_ima_12660","682x260px"),label:t("en_t_te_11987"),placeholder:t("en_t_te_11987"),value:s.header,onChange:e=>{r({header:e})}}),h(s.header?.name)&&(0,i.jsx)(fr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({header:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(JL,{accept:HI.Images,format:"base64",label:t("signature_67521"),placeholder:t("signature_67521"),value:s.signature,onChange:e=>{r({signature:e})}}),h(s.signature?.name)&&(0,i.jsx)(fr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({signature:{name:"",content:""}})},children:t("r_initialiser_77538")})]})]}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ob,{downloadPath:Zm(a.links?.userCertificateLink??"","pdf",{lang:a.language}),getPath:e=>So.DOCUMENTS_CERTIFICATE(n,o,e)}),(0,i.jsx)(wL,{children:(0,i.jsx)(uB,{certificateDocumentFragment:e.data.event,options:s})})]})]})},mB=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o}}=il(),{event:s}=Uv(),{data:r,loader:a}=Vn("query UserCertificateDocument(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $userInfoId: UsersInfoId!\n) {\n    organization(id: $organizationId) {\n        ...OrganizationCertificateDefault\n    }\n\n    event(id: $eventId) {\n        ...DocumentUserCertificate\n        ...EventVolunteersExport\n    }\n}\n",{organizationId:t,eventId:n,userInfoId:o},[Ro.OrganizationCertificateDefaultFragment,Ro.DocumentUserCertificateFragment,Ro.EventVolunteersExportFragment]);return Cd(`${s.name} ${e("Certificate")}`),(0,i.jsxs)(Ea,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(AL,{documentType:Se.Certificate,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("attestations_98371")}),(0,i.jsx)(Pa,{height:"7"}),a||(0,i.jsx)(hB,{data:r})]})},gB=e=>{const{translate:t,params:{organizationId:n,eventId:o,badgeType:s}}=il(),{options:r,setOptions:a}=FL(e.event.document.options,s===pe.Pec?{header:{name:"",content:""}}:s===pe.T24assignment?{logo:{name:"",content:""}}:{habits:""},o,{id:e.event.document.id}),l=e.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[s===pe.Asoassignment&&(0,i.jsx)(DL,{children:(0,i.jsx)(mv,{initialValue:r.habits,label:"Habitudes",onChange:e=>{a({habits:e})}})}),s===pe.Pec&&(0,i.jsx)(DL,{children:(0,i.jsx)(JL,{accept:HI.Images,format:"base64",label:t("banni_re_86634"),placeholder:t("banni_re_86634"),value:r.header,onChange:e=>{a({header:e})}})}),s===pe.T24assignment&&(0,i.jsx)(DL,{children:(0,i.jsx)(JL,{accept:HI.Images,format:"base64",label:t("logo_18191"),placeholder:t("logo_18191"),value:r.logo,onChange:e=>{a({logo:e})}})}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ob,{downloadPath:Zm(l.links?.userCustomBadgeLinks?.[s]||"","pdf",{lang:l.fields?.language?.rawValue}),getPath:e=>So.DOCUMENTS_BADGE(n,o,e,s)}),(0,i.jsx)(wL,{children:v_(s,e.event,r,null)})]})]})},pB=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o,badgeType:s}}=il(),{data:r,loader:a}=Vn("query UserCustomBadgeDocument(\n    $eventId: EventId!\n    $userInfoId: UsersInfoId!\n    $customBadge: CustomBadge!\n) {\n    event(id: $eventId) {\n        ...DocumentUserCustomBadge\n        ...EventVolunteersExport\n    }\n}\n",{eventId:n,userInfoId:o,customBadge:s},[Ro.DocumentUserCustomBadgeFragment,Ro.EventVolunteersExportFragment]);return(0,i.jsxs)(Ea,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(AL,{badgeType:s,documentType:Se.CustomBadge,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:s===pe.Paris20kmassignment,showStrategy:!0,title:e("badge_1_89709",b_(s))}),(0,i.jsx)(Pa,{height:"7"}),a||(0,i.jsx)(gB,{event:r.event})]})},fB=(e,t)=>{if("{user.picture}"===e)return t.userInfo.fields?.picture?.url||"";if("{user.skidata}"===e){const e=t.utid||"";return Ym(e,{height:100,width:100})}if("{user.qrcode}"===e){const e=t.ticketId;return Ym(e,{height:100,width:100})}if("{user.code39}"===e){const e=t.ticketId;return Ym(e,{barcodeType:qm.Code39,height:28,width:234})}return e},xB=e=>{const t=h(e.element.source)&&h(fB(e.element.source,e.vr))?(0,i.jsx)("img",{height:"100%",src:fB(e.element.source,e.vr),width:"100%"}):null;return(0,i.jsx)(fr,{css:{border:e.element.borderSize>0?`${e.element.borderSize}px solid ${e.element.borderColor}`:"",borderRadius:e.element.borderRadius>0?`${e.element.borderRadius}px`:"0",left:`${e.element.left}px`,overflow:"hidden",paddingBottom:`${e.element.py||0}px`,paddingLeft:`${e.element.px||0}px`,paddingRight:`${e.element.px||0}px`,paddingTop:`${e.element.py||0}px`,position:e.element.inContainer?"static":"absolute",top:`${e.element.top}px`,transform:e.element.hasRotate?`rotate(${e.element.rotateDegree}deg)`:void 0,transformOrigin:e.element.hasRotate?"top left":void 0,zIndex:e.element.zIndex},height:e.element.height,width:e.element.width,children:h(e.element.link)?(0,i.jsx)("a",{href:e.element.link,rel:"noreferrer",target:"_blank",children:t}):t})};var _B=n(1184);const IB=e=>{const t=Nn($c),n=Nn(JA),o=qN((0,_B.A)(n.renderText(e.element.text,{userInfo:e.vr.userInfo,event:e.event,customFields:e.customFields,volunteerRegistration:e.vr,extraInfos:{...eg(t,e.vr.positionsSlotsUsersInfos)}}),{target:"_blank"}));return(0,i.jsx)(Ea,{align:e.element.align,css:{backgroundColor:e.element.hasBackground?e.element.backgroundColor:"none",border:e.element.borderSize>0?`${e.element.borderSize}px solid ${e.element.borderColor}`:"",borderRadius:e.element.borderRadius>0?`${e.element.borderRadius}px`:"0",color:e.element.color,fontFamily:e.element.fontFamily,fontSize:`${e.element.fontSize}px`,fontWeight:e.element.fontWeight,left:`${e.element.left}px`,lineHeight:e.element.lineHeight||1.4,overflow:"hidden",paddingBottom:`${e.element.py||0}px`,paddingLeft:`${e.element.px||0}px`,paddingRight:`${e.element.px||0}px`,paddingTop:`${e.element.py||0}px`,position:e.element.inContainer?"static":"absolute",textAlign:e.element.justify,textTransform:e.element.textTransform,top:`${e.element.top}px`,transform:e.element.hasRotate?`rotate(${e.element.rotateDegree}deg)`:void 0,transformOrigin:e.element.hasRotate?"top left":void 0,whiteSpace:"pre-wrap",zIndex:e.element.zIndex,"& a":{color:"inherit"},"& em":{fontStyle:"italic"},"& s":{textDecoration:"line-through"},"& strong":{fontWeight:700},"& u":{textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:o},height:e.element.height,justify:e.element.justify,width:e.element.width})},vB=e=>SN(e.element,e.accreditationsSlotsIds,e.accreditationsAcronyms,e.positionsSlotsIds,e.vr.userInfo.fields)?"container"===e.element.type?(0,i.jsx)(Ea,{align:e.element.align,css:{backgroundColor:e.element.hasBackground?e.element.backgroundColor:"none",border:e.element.borderSize>0?`${e.element.borderSize}px solid ${e.element.borderColor}`:"",borderRadius:e.element.borderRadius>0?`${e.element.borderRadius}px`:"0",gap:`${e.element.gap}px`,left:`${e.element.left}px`,overflow:"hidden",paddingBottom:`${e.element.py||0}px`,paddingLeft:`${e.element.px||0}px`,paddingRight:`${e.element.px||0}px`,paddingTop:`${e.element.py||0}px`,position:e.element.inContainer?"static":"absolute",top:`${e.element.top}px`,transform:e.element.hasRotate?`rotate(${e.element.rotateDegree}deg)`:void 0,transformOrigin:e.element.hasRotate?"top left":void 0,whiteSpace:"pre-wrap",zIndex:e.element.zIndex},direction:e.element.direction,height:e.element.height,justify:e.element.justify,width:e.element.width,children:e.element.elements.map(t=>(0,i.jsx)(vB,{accreditationsAcronyms:e.accreditationsAcronyms,accreditationsSlotsIds:e.accreditationsSlotsIds,customFields:e.customFields,element:t,event:e.event,positionsSlotsIds:e.positionsSlotsIds,vr:e.vr},t.id))}):"image"===e.element.type?(0,i.jsx)(xB,{element:e.element,vr:e.vr}):"text"===e.element.type?(0,i.jsx)(IB,{customFields:e.customFields,element:e.element,event:e.event,vr:e.vr}):null:null,bB=e=>{const t=e.customDocument.configuration,n=e.volunteerRegistration.accreditationsUsersInfos.map(e=>e.accreditationSlot.id),o=e.volunteerRegistration.accreditationsUsersInfos.flatMap(e=>h(e.accreditation.acronym)?[e.accreditation.acronym]:[]),s=e.volunteerRegistration.positionsSlotsUsersInfos.map(e=>e.positionSlot.id),r=t.bleed?19:0;return(0,i.jsx)(i.Fragment,{children:t.pages.map(a=>SN(a,n,o,s,e.volunteerRegistration.userInfo.fields)?(0,i.jsxs)(Ea,{css:{background:"white",padding:`${r}px`,position:"relative"},height:2*r+t.height,width:2*r+t.width,children:[t.bleed&&(0,i.jsx)(WN,{}),(0,i.jsx)(Ea,{css:{background:"white",pageBreakBefore:"always",position:"relative"},height:t.height,width:t.width,children:a.elements.map(t=>(0,i.jsx)(vB,{accreditationsAcronyms:o,accreditationsSlotsIds:n,customFields:e.customFields,element:t,event:e.event,positionsSlotsIds:s,vr:e.volunteerRegistration},t.id))})]},a.id):null)})},jB=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,userInfoId:s,customDocumentId:r}}=il(),{event:a}=Uv(),{data:l,loader:d}=Vn("query UserCustomDocumentExport(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $userInfoId: UsersInfoId!\n    $customDocumentId: CustomDocumentId!\n) {\n    organization(id: $organizationId) {\n        customFields {\n            nodes {\n                ...CustomFieldWithCondition\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        ...EventVolunteersExport\n\n        id\n        name\n        organizationId\n        startAt\n        endAt\n\n        customDocument(customDocumentId: $customDocumentId) {\n            name\n            slug\n            configuration\n            populationsIds\n        }\n\n        volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n            ...CustomBadgeVolunteerRegistration\n        }\n    }\n}\n",{organizationId:n,eventId:o,userInfoId:s,customDocumentId:r},[Ro.CustomFieldWithConditionFragment,Ro.EventVolunteersExportFragment,Ro.CustomBadgeVolunteerRegistrationFragment]),c=(0,F.useMemo)(()=>{if(l.event){const e=l.event.customDocument,t=l.event.volunteerRegistration.userInfo.links;return Zm(t?.userCustomDocumentLinks[e?.slug||""]||"","pdf",{lang:l.event.volunteerRegistration.userInfo.fields?.language?.rawValue})}return""},[l.event]);return Cd(`${a.name} ${l.event?.customDocument?.name??""}`),(0,i.jsxs)(Ea,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(AL,{customDocumentSlug:l.event?.customDocument?.slug,documentType:Se.UserCustomDocument,eventId:o,extraButton:(0,i.jsx)(pl,{color:"white",onClick:()=>{e.push(So.EDIT_CUSTOM_DOCUMENT(n,o,r))},children:t("_diter_le_docum_83590")}),languages:l.event?.languages??[],organizationId:n,segmentsFolders:l.event?.segmentsFolders??[],title:l.event?.customDocument?.name??""}),(0,i.jsx)(Pa,{height:"7"}),d||(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(Ob,{downloadPath:c,getPath:e=>So.DOCUMENTS_USER_CUSTOM_DOCUMENT(n,o,e,r),populationsIds:Zo(l.event?.customDocument?.populationsIds)?l.event.customDocument.populationsIds:void 0}),(0,i.jsx)(wL,{children:(0,i.jsx)(bB,{customDocument:l.event.customDocument,customFields:l.organization.customFields.nodes,event:l.event,volunteerRegistration:l.event.volunteerRegistration})})]})]})},CB=e=>{const t=Ud(e.options.headerColor)?e.options.headerColor:"white";return(0,i.jsxs)(Ea,{css:{color:Ud(e.options.textColor)?e.options.textColor:"$gray800",background:h(e.options.background?.content)?`url(${e.options.background?.content})`:"#5230a1",backgroundRepeat:"no-repeat",backgroundSize:"cover",fontFamily:e.options.fontFamily||"Open Sans",fontSize:"12px",minHeight:`${Dm}px`,pageBreakBefore:"always"},direction:"column",width:Fm,children:[(0,i.jsxs)(Ea,{align:"end",css:{marginTop:"51px",px:"16px"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{css:{color:t,fontSize:"13px",fontWeight:"700",lineHeight:"18px"},children:e.headerTitle1}),(0,i.jsx)(fr,{css:{color:t,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:e.headerTitle2})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{css:{minHeight:"971px",paddingBottom:"$6",paddingLeft:"$4",paddingRight:"$4"},gap:"4",width:1,children:(0,i.jsx)(Ea,{css:{background:"white",borderRadius:"$3",flex:"1",fontSize:"12px",overflowX:"hidden",padding:"$4"},direction:"column",children:e.children})})]})},yB=e=>{const t=Ln(),n=Nn($c),o=Nn(Ng),s=(0,F.useMemo)(()=>e.psuis.filter(t=>t.positionSlot.range.start.startOf("day").toMillis()===e.day.toMillis()),[e.day,e.psuis]),r=(0,F.useMemo)(()=>(0,Av.A)(s,e=>e.timeDifferenceMinutes),[s]);return(0,i.jsxs)(Ea,{css:{bd:!0,overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(fr,{css:{padding:"$3 $4",textTransform:"capitalize"},font:"gray800 textSm semiBold",children:n.toLocaleString(e.day,Ho.DateOnly.WeekdayLongMonthLong)}),(0,i.jsxs)(mc,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(cc,{css:{height:"32px"},children:[(0,i.jsx)(Tc,{children:t("nom_de_la_missi_64605")}),(0,i.jsxs)(Tc,{align:"start",direction:"column",width:120,children:[(0,i.jsx)(fr,{children:t("d_but_41840")}),(0,i.jsx)(fr,{css:{fontSize:"8px"},children:t("_point_missi_66864")})]}),(0,i.jsxs)(Tc,{align:"start",direction:"column",width:120,children:[(0,i.jsx)(fr,{children:t("fin_60104")}),(0,i.jsx)(fr,{css:{fontSize:"8px"},children:t("_point_missi_66864")})]}),(0,i.jsx)(Tc,{width:120,children:t("pause_46709")}),(0,i.jsx)(Tc,{width:120,children:t("total_07173")})]}),s.map((t,s)=>(0,i.jsxs)(Cc,{css:{height:"32px"},children:[(0,i.jsx)(xc,{children:(0,i.jsx)(fr,{font:"gray800 textXs medium",children:t.position.name})}),(0,i.jsxs)(xc,{align:"start",css:{color:"$gray500"},direction:"column",width:120,children:[(0,i.jsx)(fr,{children:t.checkInAt?.isValid?n.toLocaleString(t.checkInAt.setZone(e.timeZone),Ho.TimeOnly):"-"}),(0,i.jsx)(fr,{css:{fontSize:"8px"},children:n.toLocaleString(t.positionSlot.range.start,Ho.TimeOnly)})]}),(0,i.jsxs)(xc,{align:"start",css:{color:"$gray500"},direction:"column",width:120,children:[(0,i.jsx)(fr,{children:t.checkOutAt?.isValid?n.toLocaleString(t.checkOutAt.setZone(e.timeZone),Ho.TimeOnly):"-"}),(0,i.jsx)(fr,{css:{fontSize:"8px"},children:n.toLocaleString(t.positionSlot.range.end,Ho.TimeOnly)})]}),(0,i.jsx)(xc,{css:{color:"$gray500"},width:120,children:t.breakTime>0?o.minutesToHoursMinutesString(t.breakTime):"-"}),(0,i.jsx)(xc,{css:{color:"$gray500"},justify:"end",width:120,children:o.minutesToHoursMinutesString(t.timeDifferenceMinutes)})]},s)),(0,i.jsxs)(cc,{css:{borderBottom:"none",height:"32px"},children:[(0,i.jsx)(Tc,{children:(0,i.jsx)(fr,{font:"gray800 textXs semiBold",children:t("total_de_la_jou_73634")})}),(0,i.jsx)(Tc,{justify:"end",width:120,children:(0,i.jsx)(fr,{font:"gray800 textXs semiBold",children:o.minutesToHoursMinutesString(r)})})]})]})]})},kB=e=>{const t=Ln(),n=Nn(Ng),o=e.event.volunteerRegistration,s=o.userInfo,r=(0,F.useMemo)(()=>Qm(o.positionsSlotsUsersInfos,e.date,null),[o.positionsSlotsUsersInfos]),a=(0,F.useMemo)(()=>(0,Zd.A)((0,Ju.A)(r.map(e=>e.positionSlot.range.start.startOf("day")),e=>e.toMillis()),e=>e.toMillis()),[r]),l=(0,F.useMemo)(()=>(0,Av.A)(r,e=>e.timeDifferenceMinutes),[r]);return(0,i.jsx)(CB,{headerTitle1:`${h(e.eventDocument.title)?e.eventDocument.title:t("UserHours")} ${s.name}`,headerTitle2:t("total_d_heures_11826",n.minutesToHoursMinutesString(l)),options:e.options,children:(0,i.jsx)(Ea,{direction:"column",gap:"4",width:1,children:a.map(t=>(0,i.jsx)(yB,{day:t,psuis:r,timeZone:e.event.timeZone},t.toMillis()))})})},AB=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{eventDocument:s,options:r,title:a,setOptions:l,setTitle:d}=FL(e.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",textColor:"#1d2939",title:""},o,{id:e.event.document.id}),c=BN(),u=e.event.volunteerRegistration.userInfo,m=u.links?.userHoursLink??"";return(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(DL,{children:[(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(JL,{accept:HI.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:r.background,onChange:e=>{l({background:e})}}),h(r.background?.name)&&(0,i.jsx)(fr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{l({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(wl,{label:t("titre_du_docume_33508"),value:a,onChange:e=>{d(e)}}),(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(gu,{label:"Police",value:r.fontFamily,onChange:e=>{l({fontFamily:e})},children:c}),(0,i.jsx)(tj,{label:t("couleur_du_cont_17150"),value:r.headerColor,onChange:e=>{l({headerColor:e})}})]}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ob,{downloadPath:Zm(m,"pdf",{lang:u.language}),getPath:e=>So.DOCUMENTS_HOURS(n,o,e)}),(0,i.jsx)(wL,{children:(0,i.jsx)(kB,{event:e.event,eventDocument:s,options:r})})]})]})},wB=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o}}=il(),{event:s}=Uv(),{data:r,loader:a}=Vn("query UserHoursDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n    event(id: $eventId) {\n        ...DocumentUsersHours\n        ...EventVolunteersExport\n    }\n}\n",{eventId:n,userInfoId:o},[Ro.DocumentUsersHoursFragment,Ro.EventVolunteersExportFragment]);return Cd(`${s.name} ${e("UserHours")}`),(0,i.jsxs)(Ea,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(AL,{documentType:Se.UserHours,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,title:e("UserHours")}),(0,i.jsx)(Pa,{height:"7"}),a||(0,i.jsx)(AB,{event:r.event})]})},SB=e=>{const t=Ln(),n=Nn($c),o=e.event.volunteerRegistration,s=o.userInfo,r=(0,F.useMemo)(()=>(0,Lu.A)(o.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.start)),[o.positionsSlotsUsersInfos]),a=(0,F.useMemo)(()=>(0,Bu.A)(o.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.end)),[o.positionsSlotsUsersInfos]),l=(0,F.useMemo)(()=>(0,Zd.A)(Object.entries((0,Kd.A)(o.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.startOf("day").toMillis())),([e,t])=>t[0].positionSlot.range.start.startOf("day").toMillis()).map(([e,t])=>{const i=t[0],o=(0,Zd.A)(Object.values((0,Kd.A)(t,e=>e.position.id)),e=>(0,Xu.A)(e.map(e=>e.positionSlot.range.start.toMillis()))).map(e=>{const t=e[0].position,n=(0,Zd.A)(e.map(({positionSlot:e})=>e.range),e=>e.start.toMillis()).map(e=>`${e.start.toFormat("H'h'mm")}-${e.end.toFormat("H'h'mm")}`).join(" | "),i=1504===t.organizationId&&h(t.address)?` (${t.address})`:"";return`${t.name} : ${n}${i}`});return[n.toLocaleString(i.positionSlot.range.start.startOf("day"),Ho.DateOnly.WeekdayLongMonthLong),o]}),[o.positionsSlotsUsersInfos]);return(0,i.jsxs)(Ea,{css:{background:"$gray100",padding:"32px 45px 50px 45px"},direction:"column",width:1,children:[h(e.options.logo?.content)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{height:56,textAlign:"center",width:1,children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"auto"})}),(0,i.jsx)(Pa,{height:"7"})]}),(0,i.jsxs)(Ea,{css:{background:"white",borderRadius:"16px",padding:"32px"},direction:"column",height:1,width:1,children:[(0,i.jsx)(fr,{font:"primary800 displayXs semiBold",children:s.nameOrEmail}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray800",children:t("p_riode_du_1_89633",n.toLocaleString(r,Ho.DateTime),n.toLocaleString(a,Ho.DateTime))}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Ea,{direction:"column",gap:"4",children:l.map(([e,t],n)=>(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{css:{textTransform:"capitalize"},font:"gray800 textSm bold",children:e}),(0,i.jsx)(Ea,{direction:"column",children:t.map((e,t)=>(0,i.jsx)(fr,{children:e},t))})]},n))})]})]})},EB=e=>{const t=Ln(),n=e.event.volunteerRegistration,o=n.userInfo;return Zo(n.positionsSlotsUsersInfos)?(0,i.jsx)(SB,{...e}):(0,i.jsxs)(Ea,{css:{background:"$gray100",padding:"32px 45px 50px 45px"},direction:"column",width:1,children:[h(e.options.logo?.content)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{height:56,textAlign:"center",width:1,children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"auto"})}),(0,i.jsx)(Pa,{height:"7"})]}),(0,i.jsxs)(Ea,{css:{background:"white",borderRadius:"16px",padding:"32px"},direction:"column",height:1,width:1,children:[(0,i.jsx)(fr,{font:"primary800 displayXs semiBold",children:o.nameOrEmail}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray800",children:t("aucune_affectat_04761")})]})]})},TB=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{options:s,setOptions:r}=FL(e.data.event.document.options,{logo:{name:"",content:""}},o,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsx)(DL,{children:(0,i.jsx)(JL,{accept:HI.Images,format:"base64",label:t("logo_18191"),placeholder:t("logo_18191"),value:s.logo,onChange:e=>{r({logo:e})}})}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ob,{downloadPath:Zm(a.links?.userPlanningDaysLink??"","pdf",{lang:a.language}),getPath:e=>So.DOCUMENTS_USER_PLANNING_DAYS(n,o,e)}),(0,i.jsx)(wL,{children:(0,i.jsx)(EB,{event:e.data.event,options:s})})]})]})},zB=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o}}=il(),{event:s}=Uv(),{data:r,loader:a}=Vn("query UserPlanningDaysDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n    event(id: $eventId) {\n        ...DocumentUserPlanningDays\n        ...EventVolunteersExport\n    }\n}\n",{eventId:n,userInfoId:o},[Ro.DocumentUserPlanningDaysFragment,Ro.EventVolunteersExportFragment]);return Cd(`${s.name} ${e("UserPlanningDays")}`),(0,i.jsxs)(Ea,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(AL,{documentType:Se.UserPlanningDays,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("plannings_indiv_39650")}),(0,i.jsx)(Pa,{height:"7"}),a||(0,i.jsx)(TB,{data:r})]})};var $B=n(3514);const OB=e=>{const t=Ln(),n=Nn($c),o=e.event.volunteerRegistration,s=o.userInfo,r=e.startDate?Fo.c9.max(e.startDate,e.event.startAt):e.event.startAt,a=e.startDate?Fo.c9.min(e.startDate.plus({week:1}).minus({day:1}),e.event.endAt):e.event.endAt,l=Ud(e.options.headerColor)?e.options.headerColor:"white",d=e.options.showInformations||e.options.showQrCode;return(0,i.jsxs)(Ea,{css:{color:Ud(e.options.textColor)?e.options.textColor:"$gray800",background:h(e.options.background?.content)?`url(${e.options.background?.content})`:"#5230a1",backgroundRepeat:"no-repeat",backgroundSize:"cover",fontFamily:e.options.fontFamily||"Open Sans",fontSize:"12px",pageBreakBefore:"always",position:"relative"},height:Fm,width:Dm,children:[(0,i.jsxs)(Ea,{align:"end",css:{position:"absolute",right:"16px",top:"69px"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{css:{color:l,fontSize:"13px",fontWeight:"700",lineHeight:"18px"},children:t("planning_indivi_05075",s.nameOrEmail)}),(0,i.jsx)(fr,{css:{color:l,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:t("du_1_au_2_12974",n.toLocaleString(r,Ho.DateOnly.MonthLong),n.toLocaleString(a,Ho.DateOnly.MonthLong))})]}),(0,i.jsxs)(Ea,{css:{px:"$4",position:"absolute",top:"140px"},gap:"5",height:635,width:1,children:[d&&(0,i.jsxs)(tB,{children:[(0,i.jsx)(eB,{informationsContent:e.document.informationsContent,informationsTitle:e.document.informationsTitle,options:e.options,renderText:e.renderText}),(0,i.jsx)(nB,{options:e.options,ticketId:o.ticketId})]}),(0,i.jsx)(Ea,{css:{background:"white",borderRadius:"$3",flex:"1",fontSize:"12px",padding:"$6 $5"},height:1,children:(0,i.jsx)(fr,{width:1,children:e.children})})]})]})},RB=e=>{const t=Ln(),n=Nn(Ku),o=(0,F.useMemo)(()=>{const t=Vd(e.psui.position.color);return{background:t[50],color:t[700]}},[e.psui]),s=(0,F.useMemo)(()=>"number"==typeof e.startHour&&e.startHour>0&&e.psui.positionSlot.range.start.hour{const i=e.psui.positionSlot.range.start.day===e.psui.positionSlot.range.end.day,o=ih(n,e.psui.positionSlot,"",{interval:{options:i?{hideDate:!0}:{formats:{localeFormat:{day:"numeric",month:"numeric"}}}},slot:{includeRange:!0}});return s?`${o} ${t("j_1_51317")}`:o},[e.psui,s]);return(0,i.jsxs)(Ea,{css:{...o,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsx)(fr,{css:{fontSize:"10px"},children:r}),(0,i.jsx)(fr,{fontSize:"textXs",fontWeight:"medium",children:e.psui.position.name})]})},PB=e=>(0,i.jsx)(OB,{document:e.document,event:e.event,options:e.options,renderText:e.renderText,startDate:e.startDate,children:(0,i.jsx)(bA,{css:{border:"1px solid $gray200",borderRadius:"$2",height:"100%",overflow:"hidden","& .h-calendar-events-container":{height:"100% !important"}},date:e.startDate,display:"week",maxDate:e.event.endAt,minDate:e.event.startAt,children:e.assignments.map(t=>(0,i.jsx)(vA,{endAt:t.range.start,startAt:t.range.start,startHour:e.startHour,children:(0,i.jsx)(RB,{psui:t,startHour:e.startHour})},t.id))})}),DB=e=>{const{minDate:t,numberOfWeeks:n}=(0,F.useMemo)(()=>{const t=(0,Xu.A)(e.assignments.map(e=>e.positionSlot.range.start)).startOf("week"),n=(0,$B.A)(e.assignments.map(e=>e.positionSlot.range.end)).endOf("week");return{minDate:t,numberOfWeeks:Math.ceil(n.diff(t,"weeks").weeks)}},[e.assignments]);return(0,i.jsx)(i.Fragment,{children:(0,vc.A)(0,n).map(n=>(0,i.jsx)(PB,{assignments:e.assignments,document:e.eventDocument,event:e.event,options:e.options,renderText:e.renderText,startDate:t.plus({week:n}),startHour:e.startHour},n))})},FB=e=>{const t=Nn(JA),[n]=(0,F.useMemo)(()=>nh(e.event.dayStartTime),[e.event.dayStartTime]),o=(0,F.useMemo)(()=>{const t=Hu(e.event.volunteerRegistration.positionsSlotsUsersInfos.map(e=>({...e,range:e.positionSlot.range})),e.event.startAt,e.event.endAt,n);return(0,Zd.A)(Qm(t,e.date,e.endDate),e=>e.positionSlot.range.start.toMillis())},[e.event,n]),s=n=>t.renderText(n,{userInfo:e.event.volunteerRegistration.userInfo,volunteerRegistration:e.event.volunteerRegistration});return Xo(o)?(0,i.jsx)(OB,{document:e.eventDocument,event:e.event,options:e.options,renderText:s}):(0,i.jsx)(DB,{assignments:o,event:e.event,eventDocument:e.eventDocument,options:e.options,renderText:s,startHour:n})},MB=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{eventDocument:s,informationsTitle:r,informationsContent:a,options:l,setOptions:d,setInformationsTitle:c,setInformationsContent:u}=FL(e.data.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",informationsContent:"",informationsTitle:"",showInformations:!1,showQrCode:!1,subtitleColor:"#1d2939",textColor:"#1d2939",titleFontFamily:"Open Sans"},o,{id:e.data.event.document.id,informationsTitle:e.data.event.document.informationsTitle,informationsContent:e.data.event.document.informationsContent}),m=BN(),g=e.data.event?.volunteerRegistration.userInfo,p=g.links?.userPlanningLink??"";return(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(DL,{children:[(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(JL,{accept:HI.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:l.background,onChange:e=>{d({background:e})}}),h(l.background?.name)&&(0,i.jsx)(fr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{d({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(gu,{label:"Police",value:l.fontFamily,onChange:e=>{d({fontFamily:e})},children:m}),(0,i.jsx)(gu,{label:t("police_des_titr_37497"),value:l.titleFontFamily,onChange:e=>{d({titleFontFamily:e})},children:m}),(0,i.jsx)(tj,{label:t("couleur_des_sou_18968"),value:l.subtitleColor,onChange:e=>{d({subtitleColor:e})}}),(0,i.jsx)(tj,{label:t("couleur_du_text_32021"),value:l.textColor,onChange:e=>{d({textColor:e})}}),(0,i.jsx)(tj,{label:t("couleur_du_cont_17150"),value:l.headerColor,onChange:e=>{d({headerColor:e})}}),(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(su,{value:l.showInformations,onChange:e=>{d({showInformations:e})},children:t("afficher_la_sec_84744")}),l.showInformations&&(0,i.jsxs)(Ea,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(wl,{label:t("titre_de_la_sec_41575"),value:r,onChange:e=>{c(e)}}),(0,i.jsx)(mv,{initialValue:a,label:t("contenu_de_la_s_43102"),onChange:e=>{u(e)}})]}),(0,i.jsx)(su,{value:l.showQrCode,onChange:e=>{d({showQrCode:e})},children:t("afficher_le_qr_15635")})]}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ob,{downloadPath:Zm(p,"pdf",{lang:g?.language}),getPath:e=>So.DOCUMENTS_USER_PLANNING(n,o,e)}),(0,i.jsx)(wL,{children:(0,i.jsx)(FB,{event:e.data.event,eventDocument:s,options:l})})]})]})},NB=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o}}=il(),{event:s}=Uv(),{data:r,loader:a}=Vn("query UserPlanningDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n    event(id: $eventId) {\n        ...DocumentUserPlanning\n        ...EventVolunteersExport\n\n        startAt\n        endAt\n    }\n}\n",{eventId:n,userInfoId:o},[Ro.DocumentUserPlanningFragment,Ro.EventVolunteersExportFragment]);return Cd(`${s.name} ${e("UserPlanning")}`),(0,i.jsxs)(Ea,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(AL,{documentType:Se.UserPlanning,endAt:r.event?.endAt,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,startAt:r.event?.startAt,title:e("plannings_indiv_80073")}),(0,i.jsx)(Pa,{height:"7"}),a||(0,i.jsx)(MB,{data:r})]})},LB=e=>{const t=Ln(),n=Nn(Ku);return(0,i.jsxs)(Ea,{css:{background:"$gray100",padding:"$4 56px"},direction:"column",gap:"2",children:[(0,i.jsx)(fr,{font:"gray900 textXl semiBold",children:t("planning_1_14391",e.nameOrEmail)}),e.interval&&(0,i.jsxs)(Ea,{gap:"1",children:[(0,i.jsx)(fr,{color:"gray800",children:t("plage_de_dates_08875")}),(0,i.jsx)(fr,{color:"gray500",children:n.toDisplayString(e.interval,{formats:{displayWeekday:!0},hideTime:!0})})]}),(0,i.jsxs)(Ea,{gap:"1",children:[(0,i.jsx)(fr,{color:"gray800",children:t("nombre_d_affect_01587")}),(0,i.jsx)(fr,{color:"gray500",children:e.numberOfAssignments})]})]})},BB=e=>{const t=Ln(),n=Nn($c),o=Nn(Ng);return(0,i.jsx)(Ea,{css:{padding:"$6 $8"},children:(0,i.jsxs)(mc,{children:[(0,i.jsxs)(cc,{children:[(0,i.jsx)(Tc,{css:{px:"$3"},children:t("nom_de_la_missi_64605")}),(0,i.jsx)(Tc,{css:{px:"$3"},width:380,children:t("Date")}),e.showHours&&(0,i.jsx)(Tc,{css:{px:"$3"},width:120,children:t("total_07173")})]}),e.assignments.map((t,s)=>{const r=Zo(t.slotsNames),a=(0,Pg.A)(t.ranges.map(e=>e.toDuration("minutes").minutes));return(0,i.jsxs)(Cc,{css:{height:r?"54px":"44px"},children:[(0,i.jsx)(xc,{align:"center",css:{px:"$3"},children:(0,i.jsx)(fr,{css:{clamp:"2"},font:"gray900 textSm medium",title:t.name,width:1,children:t.name})}),(0,i.jsxs)(xc,{css:{px:"$3"},direction:"column",gap:"1",justify:"center",width:380,children:[r&&(0,i.jsx)(fr,{color:"gray900",width:1,children:t.slotsNames.join(", ")}),(0,i.jsxs)(fr,{width:1,children:[(0,rd.A)(n.toLocaleString(t.ranges[0].start,Ho.DateOnly.WeekdayShortMonthLong))," ",t.ranges.map(e=>`${e.start.toFormat("HH:mm")}-${e.end.toFormat("HH:mm")}`).join(" | ")]})]}),e.showHours&&(0,i.jsx)(xc,{css:{px:"$3"},width:120,children:o.minutesToHoursMinutesString(a)})]},s)})]})})},VB=e=>{const t=(0,F.useMemo)(()=>Rg(Qm(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,e.endDate)),[e.event.volunteerRegistration,e.date]);return(0,i.jsx)(i.Fragment,{children:(0,Og.A)(t,20).map((t,n)=>{const o=t.flatMap(e=>e.ranges),s=(0,Lu.A)(o.map(e=>e.start),e=>e.toMillis()),r=(0,Bu.A)(o.map(e=>e.end),e=>e.toMillis()),a=Fo.IX.fromDateTimes(s,r);return(0,i.jsxs)(Ea,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(LB,{interval:a,nameOrEmail:e.event.volunteerRegistration.userInfo.nameOrEmail,numberOfAssignments:t.flatMap(e=>e.ranges).length}),(0,i.jsx)(BB,{assignments:t,showHours:e.options.showHours})]},n)})})},UB=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{options:s,setOptions:r}=FL(e.data.event.document.options,{showHours:!0},o,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsx)(DL,{children:(0,i.jsx)(nc,{state:s.showHours?"checked":"unchecked",onClick:e=>{r({showHours:"checked"===e})},children:t("afficher_le_tot_23855")})}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ob,{downloadPath:Zm(a.links?.userPlanningListLink??"","pdf",{lang:a.language}),getPath:e=>So.DOCUMENTS_USER_PLANNING_LIST(n,o,e)}),(0,i.jsx)(wL,{width:1,children:(0,i.jsx)(VB,{event:e.data.event,options:s})})]})]})},WB=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o}}=il(),{event:s}=Uv(),{data:r,loader:a}=Vn("query UserPlanningListDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n    event(id: $eventId) {\n        ...DocumentUserPlanningList\n        ...EventVolunteersExport\n\n        startAt\n        endAt\n    }\n}\n",{eventId:n,userInfoId:o},[Ro.DocumentUserPlanningListFragment,Ro.EventVolunteersExportFragment]);return Cd(`${s.name} ${e("UserPlanningList")}`),(0,i.jsxs)(Ea,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(AL,{documentType:Se.UserPlanningList,endAt:r.event?.endAt,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,startAt:r.event?.startAt,title:e("plannings_indiv_97766")}),(0,i.jsx)(Pa,{height:"7"}),a||(0,i.jsx)(UB,{data:r})]})},GB=e=>{const t=Ln(),n=e.documentUsersListing.organization.customFields.nodes,o=(0,F.useMemo)(()=>(0,Zd.A)(e.documentUsersListing.event.volunteersRegistrations.nodes,e=>e.userInfo.name),[e.documentUsersListing.event.volunteersRegistrations.nodes]),s=(0,F.useMemo)(()=>(0,Og.A)(o,30),[o]),r=e.documentUsersListing.event.segment;return Zo(o)?(0,i.jsx)(i.Fragment,{children:s.map((s,a)=>(0,i.jsx)(CB,{headerTitle1:h(e.eventDocument.title)?e.eventDocument.title:t("liste_des_membr_89037"),headerTitle2:`${r.name} (${o.length})`,options:e.options,children:(0,i.jsx)(Ea,{css:{background:"white"},direction:"column",width:1,children:(0,i.jsx)(zL,{customFields:n,slugsToDisplay:e.options.slugsToDisplay,volunteers:s})})},a))}):(0,i.jsx)(CB,{headerTitle1:h(e.eventDocument.title)?e.eventDocument.title:t("liste_des_membr_89037"),headerTitle2:r.name,options:e.options})},HB=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{user:s}=Zn(),{eventDocument:r,options:a,title:l,setOptions:d,setTitle:c}=FL(e.data.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",slugsToDisplay:["fullName","phone"],textColor:"#1d2939",title:""},e.eventId,{id:e.data.event.document.id}),u=BN();return(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(DL,{children:[(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(JL,{accept:HI.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:a.background,onChange:e=>{d({background:e})}}),h(a.background?.name)&&(0,i.jsx)(fr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{d({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(wl,{label:t("titre_du_docume_33508"),value:l,onChange:e=>{c(e)}}),(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(gu,{label:"Police",value:a.fontFamily,onChange:e=>{d({fontFamily:e})},children:u}),(0,i.jsx)(tj,{label:t("couleur_du_cont_17150"),value:a.headerColor,onChange:e=>{d({headerColor:e})}}),(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsxs)(dc,{isSearchVisible:!0,label:t("champs_affich_17945"),multiple:!0,placeholder:t("champs_affich_17945"),values:a.slugsToDisplay,onChange:e=>{d({slugsToDisplay:e})},children:[(0,i.jsx)("option",{value:"email",children:t("Email")}),(0,i.jsx)("option",{value:"fullName",children:t("nom_complet_05907")}),(0,i.jsx)("option",{value:"teamCode",children:t("code_quipe_14296")}),e.data.organization.customFields.nodes.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id))]})]}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(UL,{downloadPath:Zm(e.data.event.segment.links.usersListingLink,"pdf",{lang:s?.language}),getPath:e=>So.DOCUMENTS_VOLUNTEERS_LISTING(n,o,e),segmentsFolders:e.data.event.segmentsFolders}),(0,i.jsx)(wL,{width:1,children:(0,i.jsx)(GB,{documentUsersListing:e.data,eventDocument:r,options:a})})]})]})},qB=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:o}}=il(),{event:s}=Uv(),{data:r,loader:a}=Vn("query UsersListingDocument(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $segmentId: SegmentId!\n) {\n    ...DocumentUsersListing\n\n    event(id: $eventId) {\n        ...EventVolunteersExport\n    }\n}\n",{organizationId:t,eventId:n,segmentId:o},[Ro.DocumentUsersListingFragment,Ro.EventVolunteersExportFragment]);return Cd(`${s.name} ${e("liste_des_membr_89037")}`),(0,i.jsxs)(Ea,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(AL,{documentType:Se.VolunteersListing,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("liste_des_membr_89037")}),(0,i.jsx)(Pa,{height:"7"}),a||(0,i.jsx)(HB,{data:r,eventId:n})]})},YB=e=>(0,i.jsx)(Ea,{css:{columnGap:"$2",rowGap:"$3"},wrap:"wrap",children:e.vrs.map(t=>{const n=t.userInfo,o=gg(n.name,n.email);return(0,i.jsxs)(Ea,{direction:"column",gap:"2",width:84,children:[(0,i.jsx)(fr,{css:{borderRadius:"$1",overflow:"hidden"},height:84,width:84,children:h(n.picture?.url)?(0,i.jsx)("img",{height:"100%",src:n.picture.url,width:"100%"}):(0,i.jsx)(Ea,{align:"center",css:{background:fg(o)},height:1,justify:"center",width:1,children:(0,i.jsx)(fr,{font:"white displaySm medium",children:o})})}),(0,i.jsxs)(Ea,{direction:"column",width:1,children:[(0,i.jsx)(fr,{css:{ellipsis:!0},font:"gray900 textXs medium",title:n.lastName,children:(n.lastName||"").toUpperCase()}),(0,i.jsx)(fr,{css:{ellipsis:!0},font:"gray900 textXs medium",title:n.firstName,children:n.firstName}),e.options.showPhone&&(0,i.jsx)(fr,{color:"gray500",css:{ellipsis:!0,fontSize:"10px"},title:n.phone?.internationalFormat||"-",children:n.phone?.internationalFormat||"-"})]})]},n.id)})}),KB=e=>{const t=Ln(),n=e.documentUsersPictures.event.volunteersRegistrations.nodes,o=(0,F.useMemo)(()=>(0,Og.A)(n,48),[n]),s=e.documentUsersPictures.event.segment;return Zo(n)?(0,i.jsx)(i.Fragment,{children:o.map((o,r)=>(0,i.jsx)(CB,{headerTitle1:h(e.eventDocument.title)?e.eventDocument.title:t("trombinoscope_11316"),headerTitle2:`${s.name} (${n.length})`,options:e.options,children:(0,i.jsx)(YB,{options:e.options,vrs:o})},r))}):(0,i.jsx)(CB,{headerTitle1:h(e.eventDocument.title)?e.eventDocument.title:t("trombinoscope_11316"),headerTitle2:s.name,options:e.options})},ZB=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{user:s}=Zn(),{eventDocument:r,options:a,title:l,setOptions:d,setTitle:c}=FL(e.data.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",showPhone:!0,textColor:"#1d2939",title:""},o,{id:e.data.event.document.id,title:e.data.event.document.title}),u=BN();return(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(DL,{children:[(0,i.jsxs)(Ea,{align:"center",gap:"3",children:[(0,i.jsx)(JL,{accept:HI.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:a.background,onChange:e=>{d({background:e})}}),h(a.background?.name)&&(0,i.jsx)(fr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{d({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(wl,{label:t("titre_du_docume_33508"),value:l,onChange:e=>{c(e)}}),(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(gu,{label:"Police",value:a.fontFamily,onChange:e=>{d({fontFamily:e})},children:u}),(0,i.jsx)(tj,{label:t("couleur_du_cont_17150"),value:a.headerColor,onChange:e=>{d({headerColor:e})}}),(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(su,{value:a.showPhone,onChange:e=>{d({showPhone:e})},children:t("afficher_le_num_37843")})]}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(UL,{downloadPath:Zm(e.data.event.segment.links.usersPicturesLink,"pdf",{lang:s?.language}),getPath:e=>So.DOCUMENTS_USERS_PICTURES(n,o,e),segmentsFolders:e.data.event.segmentsFolders}),(0,i.jsx)(wL,{children:(0,i.jsx)(KB,{documentUsersPictures:e.data,eventDocument:r,options:a})})]})]})},XB=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:o}}=il(),{event:s}=Uv(),{data:r,loader:a}=Vn("query UsersPicturesDocument($eventId: EventId!, $segmentId: SegmentId!) {\n    ...DocumentUsersPictures\n\n    event(id: $eventId) {\n        ...EventVolunteersExport\n    }\n}\n",{eventId:n,segmentId:o},[Ro.DocumentUsersPicturesFragment,Ro.EventVolunteersExportFragment]);return Cd(`${s.name} ${e("trombinoscope_11316")}`),(0,i.jsxs)(Ea,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(AL,{documentType:Se.UsersPictures,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("trombinoscope_11316")}),(0,i.jsx)(Pa,{height:"7"}),a||(0,i.jsx)(ZB,{data:r})]})},JB=e=>{const{history:t,translate:n}=il(),{data:o,loader:s}=Vn("query EmailsTemplates($eventId: EventId!) {\n    event(id: $eventId) {\n        emailSender {\n            ... on EmailsSender {\n                domainStatus\n            }\n        }\n    }\n}\n",{eventId:e.eventId},[]);const[r,a]=(0,F.useState)(ze.Assignments);return s||(0,i.jsxs)(i.Fragment,{children:[(!o.event.emailSender||o.event.emailSender.domainStatus!==ke.Success)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{gap:"4",width:1,children:[o.event.emailSender&&o.event.emailSender.domainStatus!==ke.Success&&(0,i.jsx)(Ha,{color:"error",leftIcon:"circle-exclamation",width:1,children:(0,i.jsxs)(Ea,{css:{fontWeight:"$medium"},direction:"column",gap:"3",children:[(0,i.jsx)(fr,{children:n("vos_entr_es_dns_68834")}),(0,i.jsxs)(Ea,{align:"center",css:{cursor:"pointer"},gap:"3",onClick:()=>{t.push(So.ORGANIZATION_PARAMETERS_EMAILS_DNS(e.organizationId))},children:[(0,i.jsx)(fr,{children:n("configurer_les_65453")}),(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"arrow-right"})})]})]})}),!o.event.emailSender&&(0,i.jsx)(Ha,{color:"warning",leftIcon:"triangle-exclamation",width:1,children:(0,i.jsxs)(Ea,{css:{fontWeight:"$medium"},direction:"column",gap:"3",children:[(0,i.jsx)(fr,{children:n("aucun_metteur_26635",R.EMAIL_FROM)}),(0,i.jsxs)(Ea,{align:"center",css:{cursor:"pointer"},gap:"3",onClick:()=>{t.push(So.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:[(0,i.jsx)(fr,{children:n("configurer_les_56837")}),(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"arrow-right"})})]})]})})]}),(0,i.jsx)(Pa,{height:"6"})]}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsxs)(Ea,{css:{flex:"1",py:"$3"},direction:"column",children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:n("liste_des_e_mai_73508")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(mc,{children:[(0,i.jsx)(cc,{children:(0,i.jsx)(Tc,{children:n("type_d_e_mail_06577")})}),(0,i.jsx)($S,{isSelected:r===ze.VolunteerRegistration,subtitle:n("cet_e_mail_est_75023"),title:n("UserInfoAdminCreate"),onClick:()=>a(ze.VolunteerRegistration)}),(0,i.jsx)($S,{isSelected:r===ze.Assignments,subtitle:n("cet_e_mail_cont_98777"),title:n("affectation_u_11128"),onClick:()=>a(ze.Assignments)}),(0,i.jsx)($S,{isSelected:r===ze.Refused,subtitle:n("cet_e_mail_est_69069"),title:n("refus_d_affecta_71455"),onClick:()=>a(ze.Refused)}),(0,i.jsx)($S,{isSelected:r===ze.Accreditations,subtitle:n("cet_e_mail_cont_75798"),title:n("affectation_u_39802"),onClick:()=>a(ze.Accreditations)}),(0,i.jsx)($S,{isSelected:r===ze.AccreditationsRefused,subtitle:n("cet_e_mail_est_69069"),title:n("refus_d_accr_di_89997"),onClick:()=>a(ze.AccreditationsRefused)}),(0,i.jsx)($S,{isSelected:r===ze.DelegationCategoryLeaderAssign,subtitle:n("cet_e_mail_est_67392"),title:n("nomination_en_t_77654"),onClick:()=>a(ze.DelegationCategoryLeaderAssign)}),(0,i.jsx)($S,{isSelected:r===ze.DelegationLeaderAssign,subtitle:n("email_sent_when_appointing_team_manager"),title:n("appointment_as_team_manager"),onClick:()=>a(ze.DelegationLeaderAssign)}),(0,i.jsx)($S,{isSelected:r===ze.DelegationFormInvite,subtitle:n("cet_e_mail_est_19547"),title:n("envoi_du_formul_09434"),onClick:()=>a(ze.DelegationFormInvite)}),(0,i.jsx)($S,{isSelected:r===ze.PositionLeaderAssign,subtitle:n("cet_e_mail_est_82173"),title:n("nomination_en_t_06971"),onClick:()=>a(ze.PositionLeaderAssign)}),(0,i.jsx)($S,{isSelected:r===ze.PositionCategoryLeaderAssign,subtitle:n("cet_e_mail_est_70420"),title:n("nomination_en_t_02948"),onClick:()=>a(ze.PositionCategoryLeaderAssign)}),(0,i.jsx)($S,{isSelected:r===ze.NotifyLeaders,subtitle:n("cet_e_mail_est_90425"),title:n("un_responsable_88525"),onClick:()=>a(ze.NotifyLeaders)}),(0,i.jsx)($S,{isSelected:r===ze.Code,subtitle:n("cet_e_mail_est_49663"),title:n("code_20843"),onClick:()=>a(ze.Code)})]})]}),(0,i.jsx)(fr,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Ea,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(RS,{emailType:r,eventId:e.eventId,formId:null,organizationId:e.organizationId,source:null})})]})]})},QB=()=>{const e=Ln(),{event:{name:t}}=Uv();Cd(`${t} ${e("e_mails_09850")}`);const{organizationId:n,eventId:o}=Wn();return(0,i.jsxs)(Ea,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("mod_les_e_mail_91257")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(JB,{eventId:o,organizationId:n})]})};let eV=class extends zl{constructor(e){super(e)}formParametersAccreditationsInputDefault(e){return{accreditationDisplay:e?.accreditationDisplay||ct.None,accreditationFilter:e?.accreditationFilter||mt.None,hiddenAccreditationsCategoriesIds:e?.hiddenAccreditationsCategoriesIds||[],hiddenAccreditationsIds:e?.hiddenAccreditationsIds||[],hiddenAccreditationsSlotsIds:e?.hiddenAccreditationsSlotsIds||[],displayedAccreditationsCategoriesIds:e?.displayedAccreditationsCategoriesIds||[],displayedAccreditationsIds:e?.displayedAccreditationsIds||[],displayedAccreditationsSlotsIds:e?.displayedAccreditationsSlotsIds||[],showFullAccreditation:e?.showFullAccreditation??!0,showAccreditationDescription:e?.showAccreditationDescription??!1,accreditationTitle:e?.accreditationTitle||"",accreditationSubtitle:e?.accreditationSubtitle||""}}formParametersAccreditationsInputSchema(){return l.Ik().shape({accreditationDisplay:l.Yj().required(this.t("la_strat_gie_d_70458")).oneOf(xn,this.t("la_strat_gie_d_70458")),accreditationFilter:l.Yj().required(this.t("la_strat_gie_de_28051")).oneOf(vn,this.t("la_strat_gie_de_28051")),hiddenAccreditationsIds:l.YO().of(l.ai()),showFullAccreditation:l.zM().required(),showAccreditationDescription:l.zM().required(),accreditationTitle:l.Yj(),accreditationSubtitle:l.Yj()})}updateFormParametersAccreditationsSchema(){return l.Ik().shape({form:this.formParametersAccreditationsInputSchema()})}};eV=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],eV);const tV=e=>{const t=Ln(),{data:n,loader:o}=Vn("query FormParametersAccreditationsHiddenDisplayed($eventId: EventId!) {\n    event(id: $eventId) {\n        accreditationsCategories {\n            id\n            name\n\n            accreditations {\n                id\n                name\n                index\n\n                slots(includeHidden: true) {\n                    id\n                    name\n                    date\n                }\n            }\n        }\n    }\n}\n",{eventId:e.eventId},[]);const s=Nn($c),[r,a]=(0,F.useState)(Zo(e.values.form.hiddenAccreditationsCategoriesIds)||Zo(e.values.form.hiddenAccreditationsIds)||Zo(e.values.form.hiddenAccreditationsSlotsIds)?"hidden":"displayed"),[l,d]=(0,F.useState)(Zo(e.values.form.hiddenAccreditationsCategoriesIds)?"checked":"unchecked"),[c,u]=(0,F.useState)(Zo(e.values.form.hiddenAccreditationsIds)?"checked":"unchecked"),[h,m]=(0,F.useState)(Zo(e.values.form.hiddenAccreditationsSlotsIds)?"checked":"unchecked"),[g,p]=(0,F.useState)(Zo(e.values.form.displayedAccreditationsCategoriesIds)?"checked":"unchecked"),[f,x]=(0,F.useState)(Zo(e.values.form.displayedAccreditationsIds)?"checked":"unchecked"),[_,I]=(0,F.useState)(Zo(e.values.form.displayedAccreditationsSlotsIds)?"checked":"unchecked"),v=(0,F.useMemo)(()=>(0,Zd.A)(n.event?.accreditationsCategories??[],e=>e.name.toLowerCase()),[n.event]),b=(0,F.useMemo)(()=>v.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[v]),j=(0,F.useMemo)(()=>v.map(e=>{const t=Vj(e.accreditations);return(0,i.jsx)("optgroup",{label:e.name,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)}),[n.event]),C=(0,F.useMemo)(()=>v.flatMap(e=>Vj(e.accreditations).map(e=>{const t=Ih(e.slots).map(t=>({id:t.id,name:ph(s,t,e.name,{accreditation:{includeNameAtEnd:!0},date:{localeFormat:Ho.DateOnly.MonthLong}})}));return(0,i.jsx)("optgroup",{label:e.name,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)})),[v]);return(0,i.jsx)(Ea,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:o||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{font:"gray800 textSm semiBold",children:t("pr_f_rences_d_a_19371")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"hidden"===r?"checked":"unchecked",onClick:t=>{"checked"===t&&(a("hidden"),e.change("form.displayedAccreditationsCategoriesIds",[]),e.change("form.displayedAccreditationsIds",[]),e.change("form.displayedAccreditationsSlotsIds",[]))},children:t("cacher_des_cat_43848")}),(0,i.jsx)(Pa,{height:"3"}),"hidden"===r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(nc,{state:l,onClick:t=>{d(t),"unchecked"===t&&e.change("form.hiddenAccreditationsCategoriesIds",[])},children:t("cacher_certaine_12220")}),"checked"===l&&(0,i.jsxs)(Ea,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsCategoriesIds",children:b})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(nc,{state:c,onClick:t=>{u(t),"unchecked"===t&&e.change("form.hiddenAccreditationsIds",[])},children:t("cacher_certaine_08734")}),"checked"===c&&(0,i.jsxs)(Ea,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsIds",children:j})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(nc,{state:h,onClick:t=>{m(t),"unchecked"===t&&e.change("form.hiddenAccreditationsSlotsIds",[])},children:t("cacher_certains_02997")}),"checked"===h&&(0,i.jsxs)(Ea,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsSlotsIds",children:C})]})]}),(0,i.jsx)(Pa,{height:"5"})]}),(0,i.jsx)(sc,{state:"displayed"===r?"checked":"unchecked",onClick:t=>{a("displayed"),"checked"===t&&(e.change("form.hiddenAccreditationsCategoriesIds",[]),e.change("form.hiddenAccreditationsIds",[]),e.change("form.hiddenAccreditationsSlotsIds",[]))},children:t("afficher_des_ca_68243")}),(0,i.jsx)(Pa,{height:"3"}),"displayed"===r&&(0,i.jsxs)(Ea,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(nc,{state:g,onClick:t=>{p(t),"unchecked"===t&&e.change("form.displayedAccreditationsCategoriesIds",[])},children:t("afficher_certai_88457")}),"checked"===g&&(0,i.jsxs)(Ea,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsCategoriesIds",children:b})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(nc,{state:f,onClick:t=>{x(t),"unchecked"===t&&e.change("form.displayedAccreditationsIds",[])},children:t("afficher_certai_29161")}),"checked"===f&&(0,i.jsxs)(Ea,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsIds",children:j})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(nc,{state:_,onClick:t=>{I(t),"unchecked"===t&&e.change("form.displayedAccreditationsSlotsIds",[])},children:t("afficher_certai_38724")}),"checked"===_&&(0,i.jsxs)(Ea,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsSlotsIds",children:C})]})]})]})})},nV=e=>{const t=Ln(),[n,o]=(0,F.useState)(Zo(e.values.form.hiddenAccreditationsCategoriesIds)||Zo(e.values.form.hiddenAccreditationsIds)||Zo(e.values.form.hiddenAccreditationsSlotsIds)||Zo(e.values.form.displayedAccreditationsCategoriesIds)||Zo(e.values.form.displayedAccreditationsIds)||Zo(e.values.form.displayedAccreditationsSlotsIds));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(su,{value:n,onChange:t=>{o(t),t||(e.change("form.hiddenAccreditationsCategoriesIds",[]),e.change("form.hiddenAccreditationsIds",[]),e.change("form.hiddenAccreditationsSlotsIds",[]),e.change("form.displayedAccreditationsCategoriesIds",[]),e.change("form.displayedAccreditationsIds",[]),e.change("form.displayedAccreditationsSlotsIds",[]))},children:t("afficher_masq_37398")}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(tV,{change:e.change,eventId:e.eventId,values:e.values})]})]})},iV=e=>{const t=Ln(),{isNotSavedModalOpen:n,onClose:o,onNotSavedClose:s,onSave:r}=LS(e.initialValues,e.values,e.handleSubmit),a=e.slotDisplay!==gt.Hide;return(0,i.jsx)(dS,{button:(0,i.jsx)(pl,{isLoading:e.isMutateLoading,onClick:r,children:t("enregistrer_06519")}),title:e.name,onClose:o,children:(0,i.jsx)(NS,{isNotSavedOpen:n,onNotSavedClose:s,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{font:"gray800 textMd semiBold",children:t("param_tres_des_90955")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:t("comment_souhait_18471")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(vv,{name:"form.accreditationDisplay",value:ct.Accreditation,children:t("afficher_les_ac_56952")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"form.accreditationDisplay",value:ct.None,children:t("ne_rien_affiche_81467")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:t("personnalisatio_86385")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(zm,{name:"form.showFullAccreditation",children:t("afficher_les_ac_56062")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(nV,{change:e.change,eventId:e.eventId,values:e.values}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:t("affichage_des_d_57491")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(ym,{name:"form.showAccreditationDescription",children:t("afficher_la_des_94587")}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($u,{height:"7"}),(0,i.jsx)(fr,{font:"gray800 textMd semiBold",children:t("filtrer_les_acc_57840")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("d_cider_si_le_c_31187")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(vv,{name:"form.accreditationFilter",value:mt.FilterWithSlots,children:t("filtrer_les_acc_66152")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"form.accreditationFilter",value:mt.None,children:t("ne_pas_filtrer_97321")})]}),(0,i.jsx)($u,{height:"7"}),(0,i.jsx)(fr,{font:"gray800 textMd semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("personnaliser_l_44808")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sl,{label:t("nom_de_l_tape_85862"),name:"form.accreditationTitle"}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(gv,{label:t("description_58935"),name:"form.accreditationSubtitle"})]})})})},oV=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=il(),{data:o,loader:s}=Vn("query FormParametersAccreditations($organizationId: OrganizationId!, $formId: FormId!) {\n    organization(id: $organizationId) {\n        form(id: $formId) {\n            name\n            slotDisplay\n            accreditationDisplay\n            hiddenAccreditationsCategoriesIds\n            hiddenAccreditationsIds\n            hiddenAccreditationsSlotsIds\n            displayedAccreditationsCategoriesIds\n            displayedAccreditationsIds\n            displayedAccreditationsSlotsIds\n            showFullAccreditation\n            showAccreditationDescription\n            accreditationTitle\n            accreditationSubtitle\n            accreditationFilter\n        }\n    }\n}\n",{organizationId:e,formId:n},[]);Cd(o.organization?.form.name??"");const r=Nn(za),a=Nn(eV),{mutate:l,isLoading:d}=function(e={}){return Un("mutation FormParametersAccreditationsUpdate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $formId: FormId!\n    $form: FormParametersAccreditationsInput!\n) {\n    formParametersAccreditationsUpdate(\n        organizationId: $organizationId\n        eventId: $eventId\n        formId: $formId\n        form: $form\n    ) {\n        id\n    }\n}\n",e)}(),c=F.useMemo(()=>({form:a.formParametersAccreditationsInputDefault(o.organization?.form)}),[o.organization]);return(0,i.jsx)(dl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:n,values:r})=>(0,i.jsx)(iV,{change:e.change,eventId:t,handleSubmit:n,initialValues:c,isMutateLoading:d,loader:s,name:o.organization?.form.name??"",slotDisplay:o.organization?.form.slotDisplay||gt.Hide,values:r}),validate:r.validateForForm(a.updateFormParametersAccreditationsSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:i.form})})},sV=({children:e,description:t,role:n,title:o})=>{const{descId:s}=bl();return(0,i.jsxs)(Ea,{"aria-describedby":s,as:"fieldset",direction:"column",role:n,style:{border:"inherit",margin:"inherit"},children:[(0,i.jsx)(fr,{as:"legend",color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",id:s,children:t}),(0,i.jsx)(fr,{css:{paddingBlockStart:"$5"},children:e})]})};class rV extends zl{constructor(e){super(e)}customSlotInputDefault(){return{name:"",startTime:"",endTime:""}}customSlotInputSchema(){return l.Ik().shape({name:l.Yj().required(this.t("le_nom_du_cr_ne_97703")),startTime:l.Yj().required(this.t("le_d_but_du_cr_40745")),endTime:l.Yj().required(this.t("la_fin_du_cr_ne_90351"))})}}let aV=class extends zl{customSlotInputService;constructor(e,t){super(e),this.customSlotInputService=t}customSlotPeriodInputDefault(){return{name:"",customSlots:[this.customSlotInputService.customSlotInputDefault()],hideNameDates:!1,displayAsCalendar:!1}}};aV=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn,rV])],aV);let lV=class extends zl{constructor(e){super(e)}formParametersAvailabilitiesInputDefault(e){return{slotDisplay:e?.slotDisplay||gt.Hide,daysDisplay:e?.daysDisplay||ut.AllDays,customSlotsPeriods:e?.customSlotsPeriods??[],slotTitle:e?.slotTitle||"",slotSubtitle:e?.slotSubtitle||""}}formParametersAvailabilitiesInputSchema(){return l.Ik().shape({slotDisplay:l.Yj().required(this.t("la_strat_gie_d_34961")).oneOf(bn,this.t("la_strat_gie_d_34961")),daysDisplay:l.Yj().required(this.t("la_strat_gie_de_56435")).oneOf(_n,this.t("la_strat_gie_de_56435"))})}updateFormParametersAvailabilitiesSchema(){return l.Ik().shape({form:this.formParametersAvailabilitiesInputSchema()})}};lV=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],lV);const dV=e=>{const t=Ln(),n=Nn(rV);return(0,i.jsx)(gj,{buttonText:t("mettre_jour_l_81276"),icon:"sliders",initialValues:{customSlotPeriod:e.customSlotPeriod},size:"md",subtitle:t("param_trer_les_33935"),title:t("mise_jour_de_14984"),onClose:e.onClose,onSubmit:async t=>{await e.onSuccess(t.customSlotPeriod),e.onClose()},children:({form:o,values:s})=>(0,i.jsxs)(Ea,{css:{flex:"1",overflowY:"auto"},direction:"column",width:1,children:[(0,i.jsx)(Sl,{hint:t("le_nom_de_la_p_49293"),label:(0,i.jsx)(nv,{children:t("nom_de_la_p_rio_89140")}),name:"customSlotPeriod.name"}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(km,{label:(0,i.jsx)(nv,{children:t("date_de_d_but_43380")}),max:e.event.endAt,min:e.event.startAt,name:"customSlotPeriod.startDate"}),(0,i.jsx)(km,{label:(0,i.jsx)(nv,{children:t("date_de_fin_86920")}),max:e.event.endAt,min:e.event.startAt,name:"customSlotPeriod.endDate"})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{font:"gray800 textSm semiBold",children:t("param_trer_les_28991")}),(0,i.jsx)(Pa,{height:"4"}),s.customSlotPeriod.customSlots.map((e,n)=>{const r=`customSlotPeriod.customSlots[${n}].`;return(0,i.jsxs)(F.Fragment,{children:[(0,i.jsxs)(Ea,{align:"end",gap:"4",children:[(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(Sl,{label:t("nom_du_cr_neau_54351"),name:`${r}name`})}),(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(dv,{label:t("SlotStart"),name:`${r}startTime`})}),(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(dv,{label:t("SlotEnd"),name:`${r}endTime`})}),(0,i.jsx)(pl,{color:"white",leftIcon:"trash-can",onClick:()=>{o.change("customSlotPeriod.customSlots",ts(s.customSlotPeriod.customSlots,n))}})]}),(0,i.jsx)(Pa,{height:"4"})]},n)}),(0,i.jsxs)(fr,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{o.change("customSlotPeriod.customSlots",[...s.customSlotPeriod.customSlots,n.customSlotInputDefault()])},children:["+ ",t("ajouter_un_cr_n_63607")]}),s.customSlotPeriod.customSlots.length<2&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("options_d_affic_10797")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(zm,{name:"customSlotPeriod.hideNameDates",children:t("masquer_les_inf_78021")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(zm,{name:"customSlotPeriod.displayAsCalendar",children:t("afficher_les_di_90328")})]})]})})},cV=e=>{const t=Ln(),n=Nn($c),[o,s]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray900 textSm semiBold",children:h(e.customSlotPeriod.name)?e.customSlotPeriod.name:t("p_riode_de_l_v_78032")}),(0,i.jsxs)(fr,{color:"gray500",children:[e.customSlotPeriod.startDate?n.toLocaleString(e.customSlotPeriod.startDate,Ho.DateOnly.WeekdayLongMonthLong):t("d_but_le_l_v_n_58366")," ","-"," ",e.customSlotPeriod.endDate?n.toLocaleString(e.customSlotPeriod.endDate,Ho.DateOnly.WeekdayLongMonthLong):t("fin_de_l_v_nem_88380")," ","- ",t("creneau",e.customSlotPeriod.customSlots.length)]})]}),(0,i.jsx)(pl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{s(!0)}}),(0,i.jsx)(pl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})]}),o&&(0,i.jsx)(dV,{customSlotPeriod:e.customSlotPeriod,event:e.event,onClose:()=>{s(!1)},onSuccess:async t=>{e.updateCustomSlotPeriod(t,e.index)}})]})},uV=e=>{const t=Ln();return(0,i.jsxs)(Ea,{css:{background:"$gray50",borderRadius:"$1",marginLeft:"$6",padding:"$6"},direction:"column",gap:"3",width:1,children:[e.customSlotsPeriods.map((t,n)=>(0,i.jsx)(cV,{customSlotPeriod:t,event:e.event,index:n,remove:()=>{e.remove(n)},updateCustomSlotPeriod:e.updateCustomSlotPeriod},n)),(0,i.jsxs)(Ea,{align:"center",css:{color:"$primary700",cursor:"pointer"},gap:"3",onClick:e.add,children:[(0,i.jsx)(Va,{icon:"plus"}),(0,i.jsx)(fr,{children:t("ajouter_une_p_r_04249")})]})]})},hV=e=>{const t=Ln(),n=Nn(aV),{isNotSavedModalOpen:o,onClose:s,onNotSavedClose:r,onSave:a}=LS(e.initialValues,e.values,e.handleSubmit),l=F.useCallback(()=>{e.form.change("form.customSlotsPeriods",[...e.values.form.customSlotsPeriods,n.customSlotPeriodInputDefault()])},[e.values.form.customSlotsPeriods,e.form.change]),d=F.useCallback(t=>{e.form.change("form.customSlotsPeriods",ts(e.values.form.customSlotsPeriods,t))},[e.values.form.customSlotsPeriods,e.form.change]),c=F.useCallback((t,n)=>{const i=[...e.values.form.customSlotsPeriods];i[n]=t,e.form.change("form.customSlotsPeriods",i)},[e.values.form.customSlotsPeriods,e.form.change]),u=e.values.form.slotDisplay===gt.Custom,h=e.values.form.slotDisplay===gt.DisplayDays||e.values.form.slotDisplay===gt.Calendar||e.values.form.slotDisplay===gt.Custom;return(0,i.jsx)(dS,{button:(0,i.jsx)(pl,{isLoading:e.isMutateLoading,onClick:a,children:t("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(NS,{isNotSavedOpen:o,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(sV,{description:t("personnaliser_l_64536"),role:"radiogroup",title:t("affichage_des_d_20852"),children:[(0,i.jsx)(vv,{name:"form.slotDisplay",value:gt.Display,children:t("demander_au_mem_07520")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"form.slotDisplay",value:gt.DisplayDays,children:t("demander_au_mem_50067")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"form.slotDisplay",value:gt.Calendar,children:t("demander_au_mem_60083")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"form.slotDisplay",value:gt.Custom,children:t("demander_au_mem_31132")}),u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(uV,{add:l,customSlotsPeriods:e.values.form.customSlotsPeriods,event:e.event,remove:d,updateCustomSlotPeriod:c})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"form.slotDisplay",value:gt.Hide,children:t("ne_pas_demander_46686")})]}),h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($u,{height:"7"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("filtrer_les_dis_80634")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("d_cider_de_filt_81078")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(vv,{name:"form.daysDisplay",value:ut.AllDays,children:t("afficher_l_ense_11531")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"form.daysDisplay",value:ut.DaysWithSlots,children:t("filtrer_les_jou_51154")})]}),e.values.form.slotDisplay!==gt.Hide&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($u,{height:"7"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("personnaliser_l_44808")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sl,{label:t("nom_de_l_tape_85862"),name:"form.slotTitle"}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(gv,{label:t("description_58935"),name:"form.slotSubtitle"})]})]})})})},mV=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=il(),{data:o,loader:s}=Vn("query FormParametersAvailabilities(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $formId: FormId!\n) {\n    organization(id: $organizationId) {\n        form(id: $formId) {\n            name\n            ...FormSlotsOptions\n\n            customSlotsPeriods {\n                ...FormRegisterCustomSlotPeriod\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        startAt\n        endAt\n    }\n}\n",{organizationId:e,eventId:t,formId:n},[Ro.FormSlotsOptionsFragment,Ro.FormRegisterCustomSlotPeriodFragment]);Cd(o.organization?.form.name??"");const r=Nn(za),a=Nn(lV),{mutate:l,isLoading:d}=function(e={}){return Un("mutation FormParametersAvailabilitiesUpdate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $formId: FormId!\n    $form: FormParametersAvailabilitiesInput!\n) {\n    formParametersAvailabilitiesUpdate(\n        organizationId: $organizationId\n        eventId: $eventId\n        formId: $formId\n        form: $form\n    ) {\n        id\n    }\n}\n",e)}(),c=F.useMemo(()=>({form:a.formParametersAvailabilitiesInputDefault(o.organization?.form)}),[o.organization]);return(0,i.jsx)(dl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(hV,{event:o.event,form:e,handleSubmit:t,initialValues:c,isMutateLoading:d,loader:s,name:o.organization?.form.name??"",values:n}),validate:r.validateForForm(a.updateFormParametersAvailabilitiesSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:i.form})})};let gV=class extends zl{constructor(e){super(e)}formParametersMissionsInputDefault(e){return{positionDisplay:e?.positionDisplay||ht.None,positionFilter:e?.positionFilter||mt.FilterWithSlots,positionRanking:e?.positionRanking||Ue.Unranked,positionLimit:e?.positionLimit||3,hiddenPositionsCategoriesIds:e?.hiddenPositionsCategoriesIds||[],hiddenPositionsIds:e?.hiddenPositionsIds||[],hiddenPositionsSlotsIds:e?.hiddenPositionsSlotsIds||[],displayedPositionsCategoriesIds:e?.displayedPositionsCategoriesIds||[],displayedPositionsIds:e?.displayedPositionsIds||[],displayedPositionsSlotsIds:e?.displayedPositionsSlotsIds||[],showFullPosition:e?.showFullPosition??!0,showPositionCategoryDescription:e?.showPositionCategoryDescription??!1,showPositionDescription:e?.showPositionDescription??!1,positionTitle:e?.positionTitle||"",positionSubtitle:e?.positionSubtitle||"",willAutoAssign:e?.willAutoAssign??!1}}formParametersMissionsInputSchema(){return l.Ik().shape({positionDisplay:l.Yj().required(this.t("la_strat_gie_d_44170")).oneOf(In,this.t("la_strat_gie_d_44170")),positionFilter:l.Yj().required(this.t("la_strat_gie_de_13294")).oneOf(vn,this.t("la_strat_gie_de_13294")),positionRanking:l.Yj().required(this.t("le_type_de_clas_66819")).oneOf(rn,this.t("le_type_de_clas_66819")),positionLimit:l.ai().required(this.t("le_nombre_maxim_38249")).min(1,this.t("le_nombre_de_ch_27910")),hiddenPositionsCategoriesIds:l.YO().of(l.ai()),hiddenPositionsIds:l.YO().of(l.ai()),hiddenPositionsSlotsIds:l.YO().of(l.ai()),displayedPositionsCategoriesIds:l.YO().of(l.ai()),displayedPositionsIds:l.YO().of(l.ai()),displayedPositionsSlotsIds:l.YO().of(l.ai()),showFullPosition:l.zM().required(),showPositionCategoryDescription:l.zM().required(),showPositionDescription:l.zM().required(),positionTitle:l.Yj(),positionSubtitle:l.Yj(),willAutoAssign:l.zM().required()})}updateFormParametersMissionsSchema(){return l.Ik().shape({form:this.formParametersMissionsInputSchema()})}};gV=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],gV);const pV=e=>(0,i.jsxs)(Ea,{css:{cursor:"pointer",position:"relative"},direction:"column",gap:"1",onClick:e.onSelect,children:[e.isSelected&&(0,i.jsx)(Ea,{align:"center",css:{background:"$primary700",borderRadius:"20px",color:"white",fontSize:"$textMd",position:"absolute",right:"-10px",top:"-10px"},height:20,justify:"center",width:20,children:(0,i.jsx)(Va,{icon:"check"})}),(0,i.jsx)(fr,{css:{background:"$gray100",border:e.isSelected?"2px solid $primary700":"2px solid $gray100",borderRadius:"$1",padding:"$6",paddingBottom:"0"},height:135,width:240,children:(0,i.jsx)("img",{height:"107px",src:e.src,width:"188px"})}),(0,i.jsx)(fr,{font:"gray800 textSm semiBold",children:e.name})]}),fV=e=>{const t=Ln(),{data:n,loader:o}=Vn("query FormParametersMissionsHiddenDisplayed($eventId: EventId!) {\n    event(id: $eventId) {\n        positionsCategories {\n            id\n            name\n\n            positions {\n                id\n                name\n\n                slots {\n                    id\n                    name\n                    range\n                }\n            }\n        }\n    }\n}\n",{eventId:e.eventId},[]);const s=Nn(Ku),[r,a]=(0,F.useState)(Zo(e.values.form.hiddenPositionsCategoriesIds)||Zo(e.values.form.hiddenPositionsIds)||Zo(e.values.form.hiddenPositionsSlotsIds)?"hidden":"displayed"),[l,d]=(0,F.useState)(Zo(e.values.form.hiddenPositionsCategoriesIds)?"checked":"unchecked"),[c,u]=(0,F.useState)(Zo(e.values.form.hiddenPositionsIds)?"checked":"unchecked"),[m,g]=(0,F.useState)(Zo(e.values.form.hiddenPositionsSlotsIds)?"checked":"unchecked"),[p,f]=(0,F.useState)(Zo(e.values.form.displayedPositionsCategoriesIds)?"checked":"unchecked"),[x,_]=(0,F.useState)(Zo(e.values.form.displayedPositionsIds)?"checked":"unchecked"),[I,v]=(0,F.useState)(Zo(e.values.form.displayedPositionsSlotsIds)?"checked":"unchecked"),b=(0,F.useMemo)(()=>(0,Zd.A)(n.event?.positionsCategories??[],e=>e.name.toLowerCase()),[n.event]),j=(0,F.useMemo)(()=>b.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.positions.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[b]),C=(0,F.useMemo)(()=>(0,Zd.A)(b.flatMap(e=>e.positions),e=>e.name.toLowerCase()).map(e=>{const t=(0,Zd.A)(e.slots.map(t=>{const n=h(t.name)?`${t.name} - `:"",i=s.toDisplayString(t.range,{formats:{displayWeekday:!0}});return{id:t.id,name:`${n}${i} - ${e.name}`,startTime:t.range.start.toMillis()}}),e=>e.startTime);return(0,i.jsx)("optgroup",{label:e.name,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)}),[b]);return(0,i.jsx)(Ea,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:o||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{font:"gray800 textSm semiBold",children:t("pr_f_rences_d_a_19371")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:"hidden"===r?"checked":"unchecked",onClick:t=>{"checked"===t&&(a("hidden"),e.change("form.displayedPositionsCategoriesIds",[]),e.change("form.displayedPositionsIds",[]),e.change("form.displayedPositionsSlotsIds",[]))},children:t("cacher_des_cat_31908")}),(0,i.jsx)(Pa,{height:"3"}),"hidden"===r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(nc,{state:l,onClick:t=>{d(t),"unchecked"===t&&e.change("form.hiddenPositionsCategoriesIds",[])},children:t("cacher_certaine_12220")}),"checked"===l&&(0,i.jsxs)(Ea,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsCategoriesIds",children:b.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(nc,{state:c,onClick:t=>{u(t),"unchecked"===t&&e.change("form.hiddenPositionsIds",[])},children:t("cacher_certaine_19933")}),"checked"===c&&(0,i.jsxs)(Ea,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsIds",children:j})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(nc,{state:m,onClick:t=>{g(t),"unchecked"===t&&e.change("form.hiddenPositionsSlotsIds",[])},children:t("cacher_certains_02997")}),"checked"===m&&(0,i.jsxs)(Ea,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsSlotsIds",children:C})]})]}),(0,i.jsx)(Pa,{height:"5"})]}),(0,i.jsx)(sc,{state:"displayed"===r?"checked":"unchecked",onClick:t=>{a("displayed"),"checked"===t&&(e.change("form.hiddenPositionsCategoriesIds",[]),e.change("form.hiddenPositionsIds",[]),e.change("form.hiddenPositionsSlotsIds",[]))},children:t("afficher_des_ca_37473")}),(0,i.jsx)(Pa,{height:"3"}),"displayed"===r&&(0,i.jsxs)(Ea,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(nc,{state:p,onClick:t=>{f(t),"unchecked"===t&&e.change("form.displayedPositionsCategoriesIds",[])},children:t("afficher_certai_88457")}),"checked"===p&&(0,i.jsxs)(Ea,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsCategoriesIds",children:b.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(nc,{state:x,onClick:t=>{_(t),"unchecked"===t&&e.change("form.displayedPositionsIds",[])},children:t("affficher_certa_32341")}),"checked"===x&&(0,i.jsxs)(Ea,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsIds",children:j})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(nc,{state:I,onClick:t=>{v(t),"unchecked"===t&&e.change("form.displayedPositionsSlotsIds",[])},children:t("afficher_certai_38724")}),"checked"===I&&(0,i.jsxs)(Ea,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Sm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsSlotsIds",children:C})]})]})]})})},xV=e=>{const t=Ln(),[n,o]=(0,F.useState)(Zo(e.values.form.hiddenPositionsCategoriesIds)||Zo(e.values.form.hiddenPositionsIds)||Zo(e.values.form.hiddenPositionsSlotsIds)||Zo(e.values.form.displayedPositionsCategoriesIds)||Zo(e.values.form.displayedPositionsIds)||Zo(e.values.form.displayedPositionsSlotsIds));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(su,{value:n,onChange:t=>{o(t),t||(e.change("form.hiddenPositionsCategoriesIds",[]),e.change("form.hiddenPositionsIds",[]),e.change("form.hiddenPositionsSlotsIds",[]),e.change("form.displayedPositionsCategoriesIds",[]),e.change("form.displayedPositionsIds",[]),e.change("form.displayedPositionsSlotsIds",[]))},children:t("afficher_masq_74825")}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fV,{change:e.change,eventId:e.eventId,values:e.values})]})]})},_V=e=>{const{translate:t,params:{eventId:n}}=il(),{isNotSavedModalOpen:o,onClose:s,onNotSavedClose:r,onSave:a}=LS(e.initialValues,e.values,e.handleSubmit),l=e.slotDisplay!==gt.Hide&&e.values.form.positionDisplay!==ht.None;return(0,i.jsx)(dS,{button:(0,i.jsx)(pl,{isLoading:e.isMutateLoading,onClick:a,children:t("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(NS,{isNotSavedOpen:o,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("param_tres_des_93365")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("d_cider_du_type_01830")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{gap:"8",children:[(0,i.jsx)(pV,{isSelected:e.values.form.positionRanking===Ue.Unranked,name:t("choix_illimit_s_72460"),src:od.FormPositionUnranked,onSelect:()=>{e.change("form.positionRanking",Ue.Unranked)}}),(0,i.jsx)(pV,{isSelected:e.values.form.positionRanking===Ue.Ranked,name:t("classement_des_43897"),src:od.FormPositionRanked,onSelect:()=>{e.change("form.positionRanking",Ue.Ranked),e.values.form.positionDisplay!==ht.None&&e.values.form.positionDisplay!==ht.Slot||e.change("form.positionDisplay",ht.Position)}})]}),e.values.form.positionRanking===Ue.Ranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Sl,{label:t("nombre_de_choix_19811"),name:"form.positionLimit",shouldParseAsInt:!0})]}),(0,i.jsx)($u,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("affichage_des_m_65982")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("personnaliser_l_26207")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:t("comment_souhait_23788")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(vv,{name:"form.positionDisplay",value:ht.Category,children:t("afficher_les_ca_26287")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"form.positionDisplay",value:ht.Position,children:t("afficher_les_mi_31841")}),e.values.form.positionRanking===Ue.Unranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"form.positionDisplay",value:ht.Slot,children:t("afficher_les_cr_32311")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"form.positionDisplay",value:ht.None,children:t("ne_rien_affiche_81467")})]}),e.values.form.positionDisplay!==ht.None&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:t("personnalisatio_94071")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(zm,{name:"form.showFullPosition",children:t("afficher_les_mi_35510")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(xV,{change:e.change,eventId:n,values:e.values}),e.values.form.positionRanking!==Ue.Ranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:t("affichage_des_d_57491")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(ym,{name:"form.showPositionCategoryDescription",children:t("afficher_la_des_67852")}),e.values.form.positionDisplay!==ht.Category&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(ym,{name:"form.showPositionDescription",children:t("afficher_la_des_21998")})]})]}),(0,i.jsx)($u,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("automatisation_49411")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("d_cider_si_l_af_60345")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(zm,{name:"form.willAutoAssign",children:e.values.form.positionDisplay===ht.Category?t("la_pr_affectat_61978"):e.values.form.positionDisplay===ht.Position?t("la_pr_affectat_20431"):t("l_affectation_s_68435")})]}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($u,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("filtrer_les_cat_63783")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("d_cider_si_le_c_98644")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(vv,{name:"form.positionFilter",value:mt.FilterWithSlots,children:t("filtrer_les_cat_52780")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(vv,{name:"form.positionFilter",value:mt.None,children:t("ne_pas_filtrer_73952")})]}),e.values.form.positionDisplay!==ht.None&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($u,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",children:t("personnaliser_l_44808")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sl,{label:t("nom_de_l_tape_85862"),name:"form.positionTitle"}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(gv,{label:t("description_58935"),name:"form.positionSubtitle"})]})]})})})},IV=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=il(),{data:o,loader:s}=Vn("query FormParametersMissions($organizationId: OrganizationId!, $formId: FormId!) {\n    organization(id: $organizationId) {\n        form(id: $formId) {\n            name\n            slotDisplay\n            positionDisplay\n            positionFilter\n            positionRanking\n            positionLimit\n            hiddenPositionsCategoriesIds\n            hiddenPositionsIds\n            hiddenPositionsSlotsIds\n            displayedPositionsCategoriesIds\n            displayedPositionsIds\n            displayedPositionsSlotsIds\n            showFullPosition\n            showPositionCategoryDescription\n            showPositionDescription\n            positionTitle\n            positionSubtitle\n            willAutoAssign\n        }\n    }\n}\n",{organizationId:e,formId:n},[]);Cd(o.organization?.form.name??"");const r=Nn(za),a=Nn(gV),{mutate:l,isLoading:d}=function(e={}){return Un("mutation FormParametersMissionsUpdate(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $formId: FormId!\n    $form: FormParametersMissionsInput!\n) {\n    formParametersMissionsUpdate(\n        organizationId: $organizationId\n        eventId: $eventId\n        formId: $formId\n        form: $form\n    ) {\n        id\n    }\n}\n",e)}(),c=F.useMemo(()=>({form:a.formParametersMissionsInputDefault(o.organization?.form)}),[o.organization]);return(0,i.jsx)(dl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(_V,{change:e.change,handleSubmit:t,initialValues:c,isMutateLoading:d,loader:s,name:o.organization?.form.name??"",slotDisplay:o.organization?.form.slotDisplay??gt.Hide,values:n}),validate:r.validateForForm(a.updateFormParametersMissionsSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:i.form})})},vV=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{user:s}=Zn(),{hasFeature:r}=nI(),a=`${R.HEAVENT_API_URL}/export/organization/${n}/event/${o}`,l=t=>`${a}/${t}?key=${e.eventKey}&lang=${s?.language}`;return(0,i.jsxs)(Ea,{direction:"column",width:1,children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("liste_des_api_d_94349")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(vR,{hint:t("param_tres_disp_37413"),link:l("assignments"),title:t("api_pour_les_af_45788")}),(0,i.jsx)(Pa,{height:"6"}),r(Fe.Accreditation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vR,{hint:t("param_tres_disp_76489"),link:l("accreditations"),title:t("api_pour_les_ac_97802")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(vR,{hint:t("param_tres_disp_49170"),link:l("accreditations-matrix"),title:t("api_pour_les_ac_69006")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(vR,{hint:t("param_tres_disp_45950"),link:l("accreditations-slots"),title:t("api_pour_les_cr_99061")}),(0,i.jsx)(Pa,{height:"6"})]}),(0,i.jsx)(vR,{hint:t("param_tres_disp_45950"),link:l("positions"),title:t("api_pour_la_lis_89027")}),(0,i.jsx)(Pa,{height:"6"}),r(Fe.Delegation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vR,{hint:t("param_tres_disp_83198"),link:l("delegations-matrix"),title:t("api_pour_les_d_32713")}),(0,i.jsx)(Pa,{height:"6"})]}),(0,i.jsx)(vR,{link:`=IMPORTDATA("${l("assignments")}")`,title:t("import_des_affe_58949")}),(0,i.jsx)(Pa,{height:"6"}),r(Fe.Accreditation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vR,{link:`=IMPORTDATA("${l("accreditations")}")`,title:t("import_des_accr_52173")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(vR,{link:`=IMPORTDATA("${l("accreditations-matrix")}")`,title:t("import_des_accr_49559")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(vR,{link:`=IMPORTDATA("${l("accreditations-slots")}")`,title:t("import_des_cr_n_78532")}),(0,i.jsx)(Pa,{height:"6"})]}),(0,i.jsx)(vR,{link:`=IMPORTDATA("${l("positions")}")`,title:t("import_de_la_li_00747")}),(0,i.jsx)(Pa,{height:"6"}),r(Fe.Delegation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vR,{link:`=IMPORTDATA("${l("delegations-matrix")}")`,title:t("api_pour_les_d_32713")}),(0,i.jsx)(Pa,{height:"6"})]}),(0,i.jsx)(Pa,{height:"1"})]})},bV=()=>{const{translate:e,params:{eventId:t}}=il(),{event:{name:n}}=Uv();Cd(`${n} API`);const{hasFeature:o}=nI(),{data:s,loader:r}=Vn("query EventKey($eventId: EventId!) {\n    event(id: $eventId) {\n        key\n    }\n}\n",{eventId:t},[]);return r||(0,i.jsxs)(AC,{children:[(0,i.jsx)(kC,{children:(0,i.jsx)(fr,{font:"gray900 displayXs medium",children:"API"})}),(0,i.jsxs)(yC,{children:[(0,i.jsx)(Ha,{leftIcon:"circle-exclamation",children:e("l_api_permet_de_66672",cd)}),(0,i.jsx)(Pa,{height:"7"}),o(Fe.Api)?(0,i.jsx)(vV,{eventKey:s.event.key}):(0,i.jsx)(Ea,{align:"center",css:{flex:"1"},height:1,justify:"center",width:1,children:(0,i.jsx)(iI,{icon:"code-branch"})})]})]})},jV=[Me.Eid,Me.FirstName,Me.LastName,Me.Picture,Me.Population],CV=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=il(),{event:o}=Uv();Cd(`${o.name} Weezevent`);const{data:s}=Vn("query WeezeventV2Infos($organizationId: OrganizationId!, $eventId: EventId!) {\n    organization(id: $organizationId) {\n        customFields(privacy: All, variety: UserInfo) {\n            nodes {\n                slug\n                name\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        weezevent\n\n        accreditationsCategories {\n            id\n            name\n\n            accreditations {\n                id\n                name\n            }\n        }\n\n        segmentsFolders(segmentType: Volunteers) {\n            id\n            name\n\n            segments {\n                id\n                name\n            }\n        }\n    }\n}\n",{organizationId:t,eventId:n},[]),{mutate:r}=function(e={}){return Un("mutation EventWeezeventUpdate($eventId: EventId!, $weezevent: EventWeezeventInput!) {\n    eventWeezeventUpdate(eventId: $eventId, weezevent: $weezevent) {\n        id\n    }\n}\n",e)}(),a=(0,F.useMemo)(()=>(0,Zd.A)(s.organization?.customFields.nodes??[],e=>e.name).filter(e=>!jV.includes(e.slug)).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),[s]),l=(0,F.useMemo)(()=>(s.event?.segmentsFolders??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[s]),d=(0,F.useMemo)(()=>(0,Zd.A)(s.event?.accreditationsCategories??[],e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,Zd.A)(e.accreditations,e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[s]);return(0,i.jsxs)(AC,{children:[(0,i.jsx)(kC,{children:(0,i.jsx)(fr,{font:"gray900 displayXs medium",children:"Weezevent"})}),(0,i.jsx)(yC,{children:(0,i.jsx)(dl,{initialValues:{accreditationsIds:s.event?.weezevent?.accreditationsIds||[],customFieldsSlugs:s.event?.weezevent?.customFieldsSlugs||[],segmentsIds:s.event?.weezevent?.segmentsIds||[]},render:({handleSubmit:t,submitting:n})=>(0,i.jsxs)(Ea,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(Sm,{isSearchVisible:!0,label:e("liste_des_champ_73852"),multiple:!0,name:"customFieldsSlugs",children:a}),(0,i.jsx)(Sm,{isSearchVisible:!0,label:e("liste_des_vues_82829"),multiple:!0,name:"segmentsIds",children:l}),(0,i.jsx)(Sm,{hint:e("toutes_les_accr_55233"),isSearchVisible:!0,label:e("liste_des_accr_50214"),multiple:!0,name:"accreditationsIds",children:d}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{isLoading:n,onClick:t,children:e("enregistrer_06519")})})})]}),onSubmit:e=>r({eventId:n,weezevent:e})})})]})};let yV=class{positionsCustomFieldInputSchema(){return l.Ik().shape({customFieldId:l.ai().required(),conditionValue:l.gl().required()})}};yV=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)()],yV);let kV=class extends zl{constructor(e){super(e)}positionsSlotInputDefault(e,t){return{id:t?.id,name:t?.name??"",startDate:t?.startDate??e,startTime:t?.startTime??e.toFormat("HH:mm"),endDate:t?.endDate??e,endTime:t?.endTime??e.plus({hour:1}).toFormat("HH:mm"),resources:t?.resources??1,assignedResources:t?.assignedResources}}createPositionSlotSchema(){return l.Ik().shape({slot:this.positionsSlotInputSchema()})}positionsSlotInputSchema(){return l.Ik().shape({name:l.Yj(),startDate:$m.required(this.t("la_date_de_d_bu_05030")).typeError(this.t("la_date_de_d_bu_05030")),startTime:l.Yj().required(this.t("heure_de_d_but_90785")),endDate:$m.required(this.t("la_date_de_fin_32246")).typeError(this.t("la_date_de_fin_32246")).test("after-start-date",this.t("la_date_de_fin_00429"),(e,t)=>Fo.c9.isDateTime(t.parent.startDate)&&t.parent.startDate.isValid&&Fo.c9.isDateTime(t.parent.endDate)&&t.parent.endDate.isValid&&t.parent.endDate>=t.parent.startDate),endTime:l.Yj().required(this.t("l_heure_de_fin_78626")).test("after-start-time",this.t("la_date_de_fin_00429"),(e,t)=>{const n=Fo.c9.isDateTime(t.parent.startDate)&&t.parent.startDate.isValid,i=th(t.parent.startTime),o=Fo.c9.isDateTime(t.parent.endDate)&&t.parent.endDate.isValid,s=th(t.parent.endTime);if(n&&i&&o&&s){const[e,n]=nh(t.parent.startTime),[i,o]=nh(t.parent.endTime);return t.parent.startDate.set({hours:e,minutes:n})=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],kV);let AV=class extends zl{positionsCustomFieldInputService;positionsSlotInputService;constructor(e,t,n){super(n),this.positionsCustomFieldInputService=e,this.positionsSlotInputService=t}positionInputDefault(e,{positionCategoryId:t,layer:n,latitude:i,longitude:o,startAt:s}){let r=e?.category.id??t;return Number.isInteger(r)||(r=null),{name:e?.name??"",positionCategoryId:r,description:e?.description??"",acronym:e?.acronym??"",color:e?.color??lr.colors.primary700.value,icon:e?.icon??He.LocationDot,privateNote:e?.privateNote??"",address:e?.address??null,latitude:e?.latitude??i??null,longitude:e?.longitude??o??null,zoom:e?.zoom??yr,layer:e?.layer??n,tracesIds:e?.tracesIds??[],slots:e?.slots??[this.positionsSlotInputService.positionsSlotInputDefault(s)],conditionsOperator:e?.conditionsOperator??ge.And,positionsCustomFields:e?.positionsCustomFields??[],tagsIds:e?.tagsIds??[],fields:e?.fields??{},leadersIds:e?.fields??[]}}createUpdatePositionSchema(){return l.Ik().shape({position:this.positionInputSchema()})}positionInputSchema(){return l.Ik().shape({name:l.Yj().required(this.t("le_nom_de_la_mi_74207")),positionCategoryId:l.ai().required(this.t("la_cat_gorie_es_14008")).typeError(this.t("la_cat_gorie_es_14008")).min(1,this.t("la_cat_gorie_es_14008")),acronym:l.Yj(),color:l.Yj().required(this.t("la_couleur_est_95740")),icon:l.Yj().required(this.t("l_ic_ne_est_req_15843")).oneOf(ln,this.t("l_ic_ne_est_req_15843")),description:l.Yj(),privateNote:l.Yj(),address:l.Yj().nullable(),latitude:l.ai().nullable().typeError(this.t("la_latitude_doi_43118")),longitude:l.ai().nullable().typeError(this.t("la_longitude_do_35170")),traces:l.YO().of(l.ai()),slots:l.YO().of(this.positionsSlotInputService.positionsSlotInputSchema()).required(this.t("vous_devez_avoi_26563")).min(1,this.t("vous_devez_avoi_26563")),positionsCustomFields:l.YO().of(this.positionsCustomFieldInputService.positionsCustomFieldInputSchema()),tagsIds:l.YO().of(l.ai())})}};AV=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[yV,kV,Dn])],AV);const wV=e=>{const{mutate:t}=function(e={}){return Un("mutation PositionCategoryCreate($eventId: EventId!, $positionCategory: PositionsCategoryInput!) {\n    positionCategoryCreate(eventId: $eventId, positionCategory: $positionCategory) {\n        id\n        name\n    }\n}\n",e)}();return(0,i.jsx)(dC,{initialName:"",isEdit:!1,mutate:async n=>{const{positionCategoryCreate:i}=await t({eventId:e.eventId,positionCategory:{name:n}});return i},onClose:e.onClose,onSuccess:e.onSuccess})},SV=e=>{const{mutate:t}=function(e={}){return Un("mutation PositionCategoryUpdate(\n    $eventId: EventId!\n    $positionCategoryId: PositionsCategoryId!\n    $positionCategory: PositionsCategoryInput!\n) {\n    positionCategoryUpdate(\n        eventId: $eventId\n        positionCategoryId: $positionCategoryId\n        positionCategory: $positionCategory\n    ) {\n        id\n        name\n    }\n}\n",e)}();return(0,i.jsx)(dC,{initialName:e.positionCategoryName,isEdit:!0,mutate:async n=>{const{positionCategoryUpdate:i}=await t({eventId:e.eventId,positionCategoryId:e.positionCategoryId,positionCategory:{name:n}});return i},onClose:e.onClose,onSuccess:e.onSuccess})},EV=(0,F.memo)(function(e){const{params:{eventId:t},translate:n}=il(),[o,s]=(0,F.useState)(lC(e.event.positionsCategories)),{isEventAdmin:r}=Uv(),[a,l]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sl,{label:n("nom_de_la_missi_64605"),name:"position.name"}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(Sm,{createText:n("cr_er_une_nouve_72722"),isCreateVisible:r,isSearchVisible:!0,label:n("cat_gorie_00291"),name:"position.positionCategoryId",placeholder:n("rechercher_ou_c_16469"),onCreateClick:()=>{l(!0)},children:o.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Sl,{label:(0,i.jsx)(nv,{children:n("Acronym")}),name:"position.acronym"})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(nj,{label:n("Color"),name:"position.color"}),(0,i.jsx)(aj,{label:n("ic_ne_55554"),name:"position.icon"})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(gv,{label:(0,i.jsx)(nv,{children:n("description_58935")}),name:"position.description"}),a&&(0,i.jsx)(wV,{eventId:t,onClose:()=>{l(!1)},onSuccess:t=>{s(lC([...o,t])),e.change("position.positionCategoryId",t.id)}})]})}),TV=()=>{const e=Ln();return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(gv,{label:(0,i.jsx)(nv,{children:e("note_priv_e_06303")}),name:"position.privateNote"})})},zV=e=>{const t=Ln(),n=Nn(kV);return(0,i.jsx)(gj,{buttonText:t("mettre_jour_l_76289"),icon:"sliders",initialValues:{slot:e.slot},schema:n.createPositionSlotSchema(),size:"md",subtitle:t("param_trer_les_00874"),title:t("mise_jour_d_u_86656"),onClose:e.onClose,onSubmit:async t=>{await e.onSuccess((0,Ir.A)(t.slot,["id","name","startDate","startTime","endDate","endTime","resources"])),e.onClose()},children:({form:n,values:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sr.Yr,{name:"slot.startDate",children:e=>{e>o.slot.endDate&&n.change("slot.endDate",e)}}),(0,i.jsxs)(Ea,{css:{flex:"1",overflowY:"auto"},direction:"column",width:1,children:[(0,i.jsx)(Sl,{hint:t("vous_pouvez_per_94218"),label:(0,i.jsx)(nv,{children:t("nom_du_cr_neau_54351")}),name:"slot.name"}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(km,{label:t("date_de_d_but_43380"),max:e.event.endAt,min:e.event.startAt,name:"slot.startDate"}),(0,i.jsx)(dv,{label:t("horaire_de_d_bu_02380"),name:"slot.startTime"})]}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(km,{label:t("date_de_fin_86920"),max:e.event.endAt,min:e.event.startAt,name:"slot.endDate"}),(0,i.jsx)(dv,{label:t("horaire_de_fin_10624"),name:"slot.endTime"})]}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(Sl,{label:t("nombre_de_membr_08851"),name:"slot.resources",shouldParseAsInt:!0})]})]})})},$V=e=>{const t=Ln(),n=Nn($c),o=(0,F.useMemo)(()=>h(e.slot.name)?e.slot.name:t("cr_neau_n_1_80362",e.index+1),[e.slot.name,e.index]),s=(0,F.useMemo)(()=>{const i=n.toLocaleString(e.slot.startDate,Ho.DateOnly.WeekdayLongMonthLong),o=n.toLocaleString(e.slot.endDate,Ho.DateOnly.WeekdayLongMonthLong);return`${i} ${e.slot.startTime.substring(0,5)} - ${o} ${e.slot.endTime.substring(0,5)} - ${t("_1_membre_49737",e.slot.resources)}`},[e.slot.startDate,e.slot.startTime,e.slot.endDate,e.slot.endTime,e.slot.resources]),[r,a]=(0,F.useState)(e.initialIsEditOpen),[l,d]=(0,F.useState)(!1),c=(e.slot.assignedResources??0)>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray800 textSm semiBold",children:o}),(0,i.jsx)(fr,{color:"gray500",children:s})]}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{a(!0)}})})}),(0,i.jsx)(am,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"arrows-repeat",size:"sm",onClick:()=>{d(!0)}})})}),(0,i.jsx)(am,{placement:"top",children:t("r_p_ter_le_cr_n_68038")})]}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",disabled:c,leftIcon:"trash-can",size:"sm",onClick:()=>{e.remove(e.index)}})})}),(0,i.jsx)(am,{placement:"top",children:t(c?"des_membres_son_92320":"supprimer_43083")})]})]}),r&&(0,i.jsx)(zV,{event:e.event,slot:e.slot,onClose:()=>{a(!1)},onSuccess:async t=>{e.updateSlots(t,e.index)}}),l&&(0,i.jsx)(QP,{showHours:!0,onClose:()=>{d(!1)},onSubmit:(t,n)=>{e.onRepeat(e.slot,t,n)}})]})},OV=e=>{const t=Nn(kV),[n,o]=(0,F.useState)(-1),s=(0,F.useCallback)((t,n)=>{const i=[...e.values.position.slots];i[n]=t,e.change("position.slots",i)},[e.values.position.slots,e.change]),r=(0,F.useCallback)((e,t,n)=>Vo(e).overlaps(n),[]),a=(0,F.useCallback)(()=>{e.change("position.slots",e.values.position.slots.concat([t.positionsSlotInputDefault(e.event.startAt)])),o(e.values.position.slots.length)},[e.values.position.slots,e.change]),l=(0,F.useCallback)((t,n,i)=>{const o=function(e,t,n){const i=nh(e.startTime);let o=e.startDate;i&&(o=o.set({hour:i[0],minute:i[1]}));const s=nh(e.endTime);let r=e.endDate;return s&&(r=r.set({hour:s[0],minute:s[1]})),(0,vc.A)(1,t+1).map(t=>{if("hour"===n){const n=o.plus({hour:t}),i=r.plus({hour:t});return{name:e.name,startDate:n,startTime:n.toFormat("HH:mm"),endDate:i,endTime:i.toFormat("HH:mm"),resources:e.resources}}if("day"===n){const n=o.plus({day:t}),i=r.plus({day:t});return{name:e.name,startDate:n,startTime:n.toFormat("HH:mm"),endDate:i,endTime:i.toFormat("HH:mm"),resources:e.resources}}if("week"===n){const n=o.plus({week:t}),i=r.plus({week:t});return{name:e.name,startDate:n,startTime:n.toFormat("HH:mm"),endDate:i,endTime:i.toFormat("HH:mm"),resources:e.resources}}throw new Error("Wrong unit")})}(t,n,i);e.change("position.slots",e.values.position.slots.concat(o))},[e.values.position.slots,e.change]),d=(0,F.useCallback)(t=>{e.change("position.slots",ts(e.values.position.slots,t))},[e.values.position.slots,e.change]);return(0,i.jsx)(JP,{event:e.event,matchDateFilter:r,renderSlot:t=>(0,i.jsx)($V,{event:e.event,index:t.index,initialIsEditOpen:t.index===n,remove:d,slot:t,updateSlots:s,onRepeat:l},t.index),slots:e.values.position.slots,onNewSlot:a})},RV=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=il(),{showNotification:r}=Yv(),a=Nn(AV),l=Nn(za),d=(0,F.useRef)(null),c=(0,F.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.position.name):n("cr_ation_d_une_10675"),[e.isEdit,e.initialValues]);Cd(c);const u=(0,F.useMemo)(()=>Zo(e.initialValues.position.tracesIds)||h(e.initialValues.position.address)||"number"==typeof e.initialValues.position.latitude||"number"==typeof e.initialValues.position.longitude,[e.isEdit,e.initialValues]),m=(0,F.useMemo)(()=>!!e.isEdit&&Zo(e.initialValues.position.positionsCustomFields),[e.isEdit,e.initialValues]),g=(0,F.useMemo)(()=>!!e.isEdit&&Zo(Object.keys(e.initialValues.position.fields)),[e.isEdit,e.initialValues]),p=(0,F.useMemo)(()=>!!e.isEdit&&h(e.initialValues.position.privateNote),[e.isEdit,e.initialValues]),f=(0,F.useMemo)(()=>!!e.isEdit&&Zo(e.initialValues.position.tagsIds),[e.isEdit,e.initialValues]);return(0,i.jsx)(dl,{customErrorRef:d,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:r,submitting:a,values:l})=>(0,i.jsx)(bm,{button:e.isEdit&&(0,i.jsx)(pl,{isLoading:a,onClick:r,children:n("mettre_jour_l_19061")}),category:c,color:"dark",fallbackClosePath:ao.POSITIONS({organizationId:o,eventId:s}),title:e.isEdit?e.initialValues.position.name:n("nouvelle_missio_60727"),children:(0,i.jsxs)(Im,{ref:d,children:[(0,i.jsx)(sl,{}),(0,i.jsx)(Cm,{hideToggle:!0,initialIsOpen:!0,title:n("informations_su_61022"),children:(0,i.jsx)(EV,{change:t.change,event:e.event})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Cm,{hideToggle:!0,initialIsOpen:!0,subtitle:n("ajouter_les_dif_22779"),title:n("cr_neaux_horair_62996"),children:(0,i.jsx)(OV,{change:t.change,event:e.event,values:l})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Cm,{initialIsOpen:u,subtitle:n("localiser_le_li_46319"),title:n("localisation_38416"),onToggle:n=>{n||(t.change("position.layer",e.event.layer),t.change("position.zoom",yr),t.change("position.tracesIds",[]),t.change("position.address",null),t.change("position.latitude",null),t.change("position.longitude",null))},children:(0,i.jsx)(oD,{center:e.event,layer:l.position.layer,name:"position.",point:l.position,traces:e.event.traces,tracesIds:l.position.tracesIds})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Cm,{initialIsOpen:m,subtitle:n("ajouter_des_con_75357"),title:n("conditions_77756"),onToggle:e=>{e||t.change("position.positionsCustomFields",[])},children:(0,i.jsx)(qP,{change:t.change,conditionsOperator:l.position.conditionsOperator,customFields:e.conditionsCustomFields,customFieldsValues:l.position.positionsCustomFields,name:"position.positionsCustomFields",prefix:"position."})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Cm,{initialIsOpen:g,subtitle:n("ajouter_des_inf_14340"),title:n("champs_de_formu_64126"),onToggle:e=>{e||t.change("position.fields",{})},children:(0,i.jsx)(uP,{change:t.change,customFields:e.positionCustomFields,formCustomFields:[],formCustomFieldsValues:[],prefix:"position.",showFormCustomFields:!1})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Cm,{initialIsOpen:p,subtitle:n("ajouter_une_not_81707"),title:n("note_priv_e_06303"),onToggle:e=>{e||t.change("position.privateNote","")},children:(0,i.jsx)(TV,{})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Cm,{initialIsOpen:f,subtitle:n("ajouter_des_tag_64526"),title:n("tags_79499"),onToggle:e=>{e||t.change("position.tagsIds",[])},children:(0,i.jsx)(fj,{change:t.change,name:"position.",organizationId:o,tags:e.tags,tagsIds:l.position.tagsIds})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(jm,{children:(0,i.jsx)(pl,{isLoading:a,textAlign:"center",onClick:r,children:e.isEdit?n("mettre_jour_l_19061"):n("cr_er_la_missio_82644")})})]})}),validate:l.validateForForm(a.createUpdatePositionSchema()),width:1,onSubmit:async i=>{const a=await e.mutate({eventId:s,position:{...i.position,slots:i.position.slots.map(e=>(0,tr.A)(e,["index"]))}});r(e.isEdit?n("la_mission_a_t_79916"):n("la_mission_a_t_14808")),e.isEdit?t.goBack(ao.POSITION({organizationId:o,eventId:s,positionId:a})):t.replace(ao.POSITION({organizationId:o,eventId:s,positionId:a}))}})},PV=()=>{const e=Nn(AV),{organizationId:t,eventId:n,options:o}=Wn(),{data:s,loader:r}=Vn("query PositionEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n    organization(id: $organizationId) {\n        ...ConditionsCustomFields\n        ...CreatePositionTags\n\n        positionCustomFields: customFields(variety: Position, privacy: All) {\n            nodes {\n                ...AttachCustomField\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        ...CreatePositionEvent\n    }\n}\n",{organizationId:t,eventId:n},[Ro.ConditionsCustomFieldsFragment,Ro.CreatePositionTagsFragment,Ro.AttachCustomFieldFragment,Ro.CreatePositionEventFragment]),{mutate:a}=function(e={}){return Un("mutation PositionCreate($eventId: EventId!, $position: PositionInput!) {\n    positionCreate(eventId: $eventId, position: $position) {\n        id\n    }\n}\n",e)}({redirectOnSuccess:!0}),{positionCategoryId:l,latitude:d,longitude:c}=(e=>{const[t,n]=(e??"").split(",");return h(t)&&h(n)?{latitude:parseFloat(t),longitude:parseFloat(n)}:h(e)?{positionCategoryId:parseInt(e,10)}:{}})(o);return r||(0,i.jsx)(RV,{conditionsCustomFields:s.organization.conditionsCustomFields.nodes,event:s.event,initialValues:{position:e.positionInputDefault(null,{layer:s.event.layer,startAt:s.event.startAt,positionCategoryId:l,latitude:d,longitude:c})},isEdit:!1,mutate:async e=>{const{positionCreate:{id:t}}=await a(e);return t},positionCustomFields:s.organization.positionCustomFields.nodes,tags:s.organization.tags.nodes})},DV=()=>{const{organizationId:e,eventId:t,positionId:n}=Wn(),{data:o,loader:s}=Vn("query PositionToEdit(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $positionId: PositionId!\n) {\n    organization(id: $organizationId) {\n        ...ConditionsCustomFields\n        ...CreatePositionTags\n\n        positionCustomFields: customFields(variety: Position, privacy: All) {\n            nodes {\n                ...AttachCustomField\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        ...CreatePositionEvent\n\n        position(id: $positionId) {\n            name\n            description\n            acronym\n            color\n            icon\n            privateNote\n            address\n            latitude\n            longitude\n            layer\n            zoom\n            tracesIds\n            tagsIds\n            fields\n            conditionsOperator\n\n            category {\n                id\n            }\n\n            slots {\n                id\n                name\n                startDate\n                startTime\n                endDate\n                endTime\n                resources\n                assignedResources\n            }\n\n            positionsCustomFields {\n                customFieldId\n                conditionValue\n            }\n        }\n    }\n}\n",{organizationId:e,eventId:t,positionId:n},[Ro.ConditionsCustomFieldsFragment,Ro.CreatePositionTagsFragment,Ro.AttachCustomFieldFragment,Ro.CreatePositionEventFragment]),r=Nn(AV),{mutate:a}=function(e={}){return Un("mutation PositionUpdate($eventId: EventId!, $positionId: PositionId!, $position: PositionInput!) {\n    positionUpdate(eventId: $eventId, positionId: $positionId, position: $position) {\n        id\n    }\n}\n",e)}({redirectOnSuccess:!0});return s||(0,i.jsx)(RV,{conditionsCustomFields:o.organization.conditionsCustomFields.nodes,event:o.event,initialValues:{position:r.positionInputDefault(o.event.position,{layer:o.event.layer,startAt:o.event.startAt})},isEdit:!0,mutate:async e=>{const{positionUpdate:{id:t}}=await a({...e,positionId:n});return t},positionCustomFields:o.organization.positionCustomFields.nodes,tags:o.organization.tags.nodes})};var FV;let MV=class extends u${static{FV=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...u$.IMPORT_COLUMNS_DEFAULT,PositionName:"positionName",PositionCategoryName:"positionCategoryName",SlotStart:"slotStart",SlotEnd:"slotEnd",MaxResources:"slotMaxResources",SlotName:"slotName",Acronym:"acronym",Color:"color",Icon:"icon",Description:"description",Address:"address",Latitude:"latitude",Longitude:"longitude",MapLayer:"mapLayer",MapZoom:"mapZoom",LeadersEmails:"leadersEmails",LeadersFirstNames:"leadersFirstnames",LeadersLastNames:"leadersLastnames",PrivateNote:"privateNote",Tags:"tags"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===qe.Update?[FV.IMPORT_COLUMNS_DEFAULT.Id]:[],FV.IMPORT_COLUMNS_DEFAULT.SlotStart,FV.IMPORT_COLUMNS_DEFAULT.SlotEnd,FV.IMPORT_COLUMNS_DEFAULT.MaxResources,FV.IMPORT_COLUMNS_DEFAULT.PositionName,FV.IMPORT_COLUMNS_DEFAULT.PositionCategoryName];constructor(e,t){super(e,t),this.csvInputService=e}};MV=FV=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hz,Dn])],MV);const NV=()=>{const{params:{organizationId:e,eventId:t},translate:n}=il(),{mutate:o}=function(e={}){return Un("mutation PositionsImport(\n    $eventId: EventId!\n    $organizationId: OrganizationId!\n    $input: MappableImportInput!\n) {\n    jobId: positionsImport(eventId: $eventId, organizationId: $organizationId, input: $input)\n}\n",e)}(),{checkPositionsImport:s}=Yv(),{data:r,loader:a}=Ia({organizationId:e,variety:Ie.Position});return a||(0,i.jsx)(l$,{ImportInputService:MV,checkImport:s,closePath:ao.POSITIONS({organizationId:e,eventId:t}),customFields:r.organization.customFields.nodes,importTagPrefix:"positions",itemName:{singular:n("task_24074"),plural:n("tasks_06050")},localStorageKeyPrefix:"POSITIONS_IMPORT",mutate:o,showModeSelection:!1,title:n("importing_tasks_31757")})};var LV;!function(e){e.Acronym="acronym",e.Address="address",e.Category="category",e.CategoryLeaders="categoryLeaders",e.CheckedInRate="checkedInRate",e.Color="color",e.Conditions="conditions",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.Description="description",e.FillingRate="fillingRate",e.Icon="icon",e.IconColor="iconColor",e.Id="id",e.Latitude="latitude",e.Leaders="leaders",e.Longitude="longitude",e.Name="name",e.PrivateNote="privateNote",e.Resources="resources",e.Slot="slot",e.SlotName="slotName",e.State="state",e.Tags="tags"}(LV||(LV={}));let BV=class extends Xc{constructor(e,t,n){super(e,t,n)}getPositionsFilters(e,t){return(0,Da.A)([{slug:LV.Name,name:this.t("nom_de_la_missi_64605"),category:this.t("missions_63972"),fieldType:Be.Text,hideEmpty:!0},{slug:"position",name:this.t("Position"),category:this.t("missions_63972"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:LV.Description,name:this.t("Description"),category:this.t("missions_63972"),fieldType:Be.Text},{slug:LV.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("missions_63972"),fieldType:Be.Text},Zo(e.positionsCategories)?{slug:"positionCategory",name:this.t("cat_gorie_00291"),category:this.t("missions_63972"),fieldType:Be.Select,values:e.positionsCategories,hideEmpty:!0}:null,{slug:"positionSlot",name:this.t("cr_neau_11117"),category:this.t("missions_63972"),fieldType:Be.DateTimeRange,startAt:e.startAt,endAt:e.endAt},{slug:"positionSlotName",name:this.t("nom_du_cr_neau_54351"),category:this.t("missions_63972"),fieldType:Be.Text},{slug:"tag",name:this.t("Tag"),category:this.t("missions_63972"),fieldType:Be.Select,needLoading:!0,organizationId:e.organizationId,eventId:e.id,tagContext:vt.Positions},{slug:"positionCustomField",name:this.t("condition_61066"),category:this.t("missions_63972"),fieldType:Be.Select,needLoading:!0,organizationId:e.organizationId},{slug:"acronym",name:this.t("Acronym"),category:this.t("missions_63972"),fieldType:Be.Text},{slug:"color",name:this.t("Color"),category:this.t("missions_63972"),fieldType:Be.Text,hideEmpty:!0},{slug:"icon",name:this.t("ic_ne_55554"),category:this.t("missions_63972"),fieldType:Be.Select,values:ln.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"address",name:this.t("Address"),category:this.t("missions_63972"),fieldType:Be.Text},{slug:"latitude",name:this.t("Latitude"),category:this.t("missions_63972"),fieldType:Be.Number},{slug:"longitude",name:this.t("Longitude"),category:this.t("missions_63972"),fieldType:Be.Number},{slug:"state",name:this.t("statut_des_ress_73550"),category:this.t("missions_63972"),fieldType:Be.Select,hideEmpty:!0,values:fn.map(e=>({id:e,name:this.t(e)}))},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("missions_63972"),fieldType:Be.Number,hideEmpty:!0},{slug:"checkedInRate",name:this.t("taux_de_pointag_87285"),category:this.t("missions_63972"),fieldType:Be.Number,hideEmpty:!0},{slug:LV.Leaders,name:this.t("nombre_de_respo_19772"),category:this.t("missions_63972"),fieldType:Be.Number,hideEmpty:!0},{slug:LV.CategoryLeaders,name:this.t("nombre_de_respo_01994"),category:this.t("missions_63972"),fieldType:Be.Number,hideEmpty:!0},{slug:LV.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("missions_63972"),fieldType:Be.Select,hideEmpty:!0,needLoading:!0,organizationId:e.organizationId,eventId:e.id},{slug:LV.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("missions_63972"),fieldType:Be.Datetime,hideEmpty:!0},...this.customFieldsToFilters(t)])}getPositionsPossibleColumns(e){return[{slug:LV.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:at.Id,width:100},{slug:LV.Name,name:this.t("nom_de_la_missi_64605"),isSearchable:!0,isSortable:!0,sortAttribute:at.Name,minWidth:120},{slug:LV.Category,name:this.t("cat_gorie_00291"),isSearchable:!0,isSortable:!0,sortAttribute:at.Category,minWidth:240},{slug:LV.SlotName,name:this.t("nom_du_cr_neau_54351"),isSearchable:!0,minWidth:180},{slug:LV.Slot,name:this.t("cr_neau_11117"),isSortable:!0,sortAttribute:at.Slot,minWidth:240},{slug:LV.Resources,name:this.t("membres_11310"),minWidth:320},{slug:LV.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:LV.Conditions,name:this.t("conditions_77756"),minWidth:320},{slug:LV.Address,name:this.t("Address"),isSearchable:!0,minWidth:240},{slug:LV.Latitude,name:this.t("latitude_46176"),isSearchable:!0,minWidth:180},{slug:LV.Longitude,name:this.t("longitude_01695"),isSearchable:!0,minWidth:180},{slug:LV.Acronym,name:this.t("Acronym"),isSearchable:!0,minWidth:180},{slug:LV.Color,name:this.t("Color"),isSearchable:!0,width:80},{slug:LV.Icon,name:this.t("ic_ne_55554"),width:80},{slug:LV.IconColor,name:this.t("ic_ne_et_couleu_54485"),width:80},{slug:LV.State,name:this.t("statut_des_ress_73550"),minWidth:240},{slug:LV.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:LV.CheckedInRate,name:this.t("taux_de_pointag_87285"),minWidth:240},{slug:LV.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:LV.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:at.CreatedAt,minWidth:180},{slug:LV.Leaders,name:this.t("responsables_de_54941"),isSearchable:!0,minWidth:320},{slug:LV.CategoryLeaders,name:this.t("responsables_de_22220"),isSearchable:!0,minWidth:320}].concat(this.customFieldsToPossibleColumns(e))}};BV=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Hc,$c,Dn])],BV);const VV=e=>{const{params:{eventId:t}}=il(),{mutate:n}=ks(),o=F.useCallback(async i=>{const o=Ko(e.property);for(const s of o){const r=1===o.length?i:i[s];await n({eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.positionId]},slug:s,strategy:Je.Replace,value:r}})}},[e.positionId,e.property,n]);return(0,i.jsx)(PC,{column:e.column,initialValue:e.initialValue,mutate:o,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:e.updatable})},UV=e=>{const{translate:t}=il();return(0,i.jsx)(VV,{column:e.column,initialValue:e.position.acronym||"",positionId:e.position.id,property:it.Acronym,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(wl,{label:t("Acronym"),value:e,onChange:n}),renderValue:e.position.acronym||"",updatable:e.updatable})},WV=F.createContext({}),GV=e=>{const[t,n]=F.useState(),o=OO(sa,{eventId:e.eventId},e=>e.event.positionsCategories),s=OO(Os,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(WV.Provider,{value:{newPositionLatLng:t,getPositionsCategories:o,getTags:s,setNewPositionLatLng:n},children:e.children})};function HV(){return F.useContext(WV)}const qV=e=>{const t=Ln(),{getPositionsCategories:n}=HV(),{result:o,isLoading:s}=HO(n);return s?(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(yl,{children:t("Category")}),(0,i.jsx)(qd,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(gu,{label:t("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},YV=e=>{const{params:{organizationId:t,eventId:n}}=il(),{isEditMode:o}=zC();return(0,i.jsx)(VV,{column:e.column,initialValue:e.positionCategory.id,positionId:e.positionId,property:it.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(qV,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(ZO,{isEditMode:o,title:e.positionCategory.name,updatable:e.updatable,children:(0,i.jsx)(j_,{to:ao.POSITION_CATEGORY({organizationId:t,eventId:n,positionCategoryId:e.positionCategory.id}),children:e.positionCategory.name})}),updatable:e.updatable})},KV=e=>{const{translate:t}=il();return(0,i.jsx)(VV,{column:e.column,initialValue:e.position.color,positionId:e.position.id,property:it.Color,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(tj,{label:t("Color"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Ea,{align:"center",gap:"3",width:1,children:(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{css:{background:e.position.color,borderRadius:"2px",height:"24px",width:"24px"},onClick:()=>{oS(e.position.color)}})}),(0,i.jsx)(am,{placement:"top",children:e.position.color})]})}),updatable:e.updatable})},ZV=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>e.position.positionsCustomFields||[],[e.position]),o=(0,F.useMemo)(()=>n.map((e,n)=>({id:n,color:"gray",icon:null,text:`${e.customField.name} : ${_D(t,e.customField,e.conditionValue)}`})),[n]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:o})})},XV=e=>{const{translate:t}=il();return(0,i.jsx)(VV,{column:e.column,initialValue:e.position.icon,positionId:e.position.id,property:it.Icon,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(rj,{label:t("Icon"),renderOnPortal:!0,value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Va,{icon:Ba(e.position.icon)}),updatable:e.updatable})},JV=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>({[it.Color]:e.position.color,[it.Icon]:e.position.icon}),[e.position]);return(0,i.jsx)(VV,{column:e.column,initialValue:n,positionId:e.position.id,property:[it.Color,it.Icon],reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(Ea,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(tj,{label:t("Color"),value:e[ie.Color],onChange:t=>{n({...e,[ie.Color]:t})}}),(0,i.jsx)(rj,{label:t("Icon"),renderOnPortal:!0,value:e[ie.Icon],onChange:t=>{n({...e,[ie.Icon]:t})}})]}),renderValue:()=>(0,i.jsx)(Xj,{color:e.position.color,icon:e.position.icon}),updatable:e.updatable})},QV=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{isEditMode:s}=zC();return(0,i.jsx)(VV,{column:e.column,initialValue:e.position.name,positionId:e.position.id,property:it.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(wl,{label:t("nom_de_la_missi_64605"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(ZO,{isEditMode:s,title:e.position.name,updatable:e.updatable,children:(0,i.jsx)(j_,{to:ao.POSITION({organizationId:n,eventId:o,positionId:e.position.id}),children:e.position.name})}),updatable:e.updatable})},eU=e=>{const{translate:t}=il(),{getTags:n}=HV(),{result:o,isLoading:s}=HO(n);return s?(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(yl,{children:t("tags_79499")}),(0,i.jsx)(qd,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(dc,{isSearchVisible:!0,label:t("tags_79499"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},tU=e=>{const t=(0,F.useMemo)(()=>e.position.tags||[],[e.position]),n=(0,F.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(VV,{column:e.column,initialValue:t.map(e=>e.id),positionId:e.position.id,property:it.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(eU,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(qC,{badges:n}),updatable:e.updatable})},nU=e=>{const{translate:t,params:{eventId:n}}=il(),{mutate:o}=ha(),s=(0,F.useMemo)(()=>h(e.positionSlot.name)?e.positionSlot.name:"-",[e.positionSlot]);return(0,i.jsx)(PC,{column:e.column,initialValue:e.positionSlot.name,mutate:async t=>o({eventId:n,positionId:e.positionSlot.position.id,positionSlotId:e.positionSlot.id,positionSlot:{...(0,Ir.A)(e.positionSlot,["id","startDate","startTime","endDate","endTime","resources"]),name:t}}),reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(wl,{label:t("nom_du_cr_neau_54351"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(fr,{css:{ellipsis:!0},font:"gray900 textSm medium",title:s,width:1,children:s}),updatable:e.updatable})},iU=e=>{const{translate:t,params:{eventId:n}}=il(),{isEventAdmin:o}=Uv(),s=Nn(Ku),r=Nn(vj),{mutate:a}=ha(),l=SC(e.customFields),d=(0,F.useCallback)(()=>{e.reloadPositionSlot(e.positionSlot.id)},[e.positionSlot,e.reloadPositionSlot]),[c,u]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Cc,{css:{"&:hover":{background:"$gray100"}},children:[e.columns.map(n=>{const a=l.get(n.slug);return n.slug===LV.Id?(0,i.jsx)(xc,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.id},n.slug):n.slug===LV.Category?(0,i.jsx)(YV,{column:n,positionCategory:e.positionSlot.positionCategory,positionId:e.positionSlot.position.id,reload:d,updatable:o},n.slug):n.slug===LV.Name?(0,i.jsx)(QV,{column:n,position:e.positionSlot.position,reload:d,updatable:o},n.slug):n.slug===LV.Slot?(0,i.jsx)(xc,{minWidth:n.minWidth,width:n.width,children:s.toDisplayString(e.positionSlot.range)},n.slug):n.slug===LV.SlotName?(0,i.jsx)(nU,{column:n,positionSlot:e.positionSlot,reload:d,updatable:o},n.slug):n.slug===LV.Resources?(0,i.jsx)(xc,{minWidth:n.minWidth,width:n.width,children:(0,i.jsx)(UO,{assignedResources:e.positionSlot.assignedResources,resources:e.positionSlot.resources})},n.slug):n.slug===LV.Tags?(0,i.jsx)(tU,{column:n,position:e.positionSlot.position,reload:d,updatable:o},n.slug):n.slug===LV.Conditions?(0,i.jsx)(ZV,{column:n,position:e.positionSlot.position},n.slug):n.slug===LV.Address?(0,i.jsx)(xc,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.position.address},n.slug):n.slug===LV.Latitude?(0,i.jsx)(xc,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.position.latitude},n.slug):n.slug===LV.Longitude?(0,i.jsx)(xc,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.position.longitude},n.slug):n.slug===LV.Acronym?(0,i.jsx)(UV,{column:n,position:e.positionSlot.position,reload:d,updatable:o},n.slug):n.slug===LV.Color?(0,i.jsx)(KV,{column:n,position:e.positionSlot.position,reload:d,updatable:o},n.slug):n.slug===LV.Icon?(0,i.jsx)(XV,{column:n,position:e.positionSlot.position,reload:d,updatable:o},n.slug):n.slug===LV.IconColor?(0,i.jsx)(JV,{column:n,position:e.positionSlot.position,reload:d,updatable:o},n.slug):n.slug===LV.State?(0,i.jsx)(xc,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.state===lt.Full?(0,i.jsx)(Gd,{color:"success",children:t(e.positionSlot.state)}):(0,i.jsx)(Gd,{color:"warning",children:t(e.positionSlot.state)})},n.slug):n.slug===LV.FillingRate?(0,i.jsxs)(xc,{minWidth:n.minWidth,width:n.width,children:[e.positionSlot.fillingRate,"%"]},n.slug):n.slug==LV.CheckedInRate?(0,i.jsxs)(xc,{minWidth:n.minWidth,width:n.width,children:[e.positionSlot.checkedInRate||0,"%"]},n.slug):n.slug===LV.CreatedAt?(0,i.jsx)(B$,{column:n,insertedAt:e.positionSlot.insertedAt}):n.slug===LV.CreatedBy?(0,i.jsx)(V$,{column:n,createdBy:e.positionSlot.position.createdBy},n.slug):(0,i.jsx)(xc,{minWidth:n.minWidth,width:n.width,children:a?r.getValueString(a,e.positionSlot.position.fields,{fileReturnValue:"name"}):""},n.slug)}),(0,i.jsx)(ub,{positionsPermissions:db.EDIT_POSITION,children:(0,i.jsx)(im,{justify:"center",children:(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"pen",onClick:()=>{u(!0)}})})}),(0,i.jsx)(am,{placement:"top",children:t("_diter_62574")})]})})})]}),c&&(0,i.jsx)(zV,{event:e.event,slot:e.positionSlot,onClose:()=>{u(!1)},onSuccess:async t=>{await a({eventId:n,positionId:e.positionSlot.position.id,positionSlotId:e.positionSlot.id,positionSlot:t}),d()}})]})},oU=e=>{const{params:{eventId:t}}=il(),{columns:n,columnsSearch:o,limit:s,nameDebounced:r,offset:a,possibleColumns:l,predicates:d,reloadKey:c,setLimit:u,setOffset:m,setSort:g,sort:p}=zC(),f=(0,F.useMemo)(()=>({includeCheckedInRate:n.includes(LV.CheckedInRate),includeConditions:n.includes(LV.Conditions),includeCreatedBy:n.includes(LV.CreatedBy),includeTags:n.includes(LV.Tags)}),[n]),{data:x,isLoading:_,reload:I}=Vn("query PositionsSlots(\n    $eventId: EventId!\n    $name: String\n    $predicates: [Predicate!]\n    $columnsSearch: [String!]\n    $limit: Int\n    $offset: Int\n    $sort: PositionsSlotsSort\n    $includeCheckedInRate: Boolean!\n    $includeConditions: Boolean!\n    $includeCreatedBy: Boolean!\n    $includeTags: Boolean!\n) {\n    event(id: $eventId) {\n        startAt\n        endAt\n\n        positionsSlots(\n            name: $name\n            predicates: $predicates\n            columnsSearch: $columnsSearch\n            limit: $limit\n            offset: $offset\n            sort: $sort\n        ) {\n            nodes {\n                ...PositionsPositionSlot\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{...f,eventId:t,name:h(r)?r:null,columnsSearch:Zo(o)?o:null,predicates:d,limit:s,offset:a,sort:p},[Ro.PositionsPositionSlotFragment]);const v=(0,F.useMemo)(()=>n.flatMap(e=>(0,Da.A)([l.find(t=>t.slug===e)])),[l,n]),{numberOfPages:b,totalCount:j}=lu(x.event?.positionsSlots),[C,y]=(0,F.useState)([]),[k,A]=(0,F.useState)({}),w=(0,F.useCallback)(async e=>{A(t=>({...t,[e]:!0}));const{event:{positionSlot:n}}=await function(e,t){return ss("query PositionsPositionSlot(\n    $eventId: EventId!\n    $id: PositionsSlotId!\n    $includeCheckedInRate: Boolean!\n    $includeConditions: Boolean!\n    $includeCreatedBy: Boolean!\n    $includeTags: Boolean!\n) {\n    event(id: $eventId) {\n        positionSlot(id: $id) {\n            ...PositionsPositionSlot\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.PositionsPositionSlotFragment]})}({...f,eventId:t,id:e},await H());y(t=>t.map(t=>t.id===e?n:t)),A(t=>({...t,[e]:!1}))},[f,A,y]);return(0,F.useEffect)(()=>{y(x.event?.positionsSlots.nodes??[])},[x.event]),(0,F.useEffect)(()=>{c>1&&I()},[c]),(0,i.jsx)(Ea,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(nm,{"aria-busy":_,headerRow:(0,i.jsxs)(cc,{children:[v.map(e=>e.isSortable?(0,i.jsx)(tm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:g,sort:p,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Tc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),(0,i.jsx)(ub,{positionsPermissions:[db.EDIT_POSITION],children:(0,i.jsx)(Tc,{width:100})})]}),paginationRow:(0,i.jsx)(yc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(jc,{limit:s,numberOfPages:b,offset:a,setLimit:u,setOffset:m,showLimits:!0,totalCount:j})}),children:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{})]}):C.map(t=>k[t.id]?(0,i.jsx)(zc,{},t.id):(0,i.jsx)(iU,{columns:v,customFields:e.customFields,event:x.event,positionSlot:t,reloadPositionSlot:w},t.id))})})};let sU=class extends zl{translationService;constructor(e){super(e),this.translationService=e}massConditionsStep1Schema(){return l.Ik().shape({massConditions:l.Ik().shape({...this.massConditionsStep1Fields()})})}massConditionsStep2Schema(){return l.Ik().shape({massConditions:l.Ik().shape({...this.massConditionsStep2Fields()})})}massConditionsSchema(){return l.Ik().shape({...this.massConditionsStep1Fields(),...this.massConditionsStep2Fields()})}massConditionsStep1Fields(){return{strategy:l.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(mn,this.t("la_strat_gie_es_82287"))}}massConditionsStep2Fields(){return{customFieldId:l.ai().required(this.t("le_champ_person_80074")),value:l.gl().required(this.t("la_valeur_est_r_70136"))}}};sU=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],sU);const rU=()=>{const e=Ln();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray900",fontWeight:"medium",children:e("que_souhaitez_v_87607")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(nO,{label:e("ajouter_des_con_91773"),name:"massConditions.strategy",value:Je.Add}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(nO,{label:e("remplacer_les_c_29446"),name:"massConditions.strategy",value:Je.Replace})]})},aU=e=>{const t=Ln(),{data:n,loader:o}=Vn("query MassConditionsCustomFields($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        ...ConditionsCustomFields\n    }\n}\n",{organizationId:e.organizationId},[Ro.ConditionsCustomFieldsFragment]);const s=(0,F.useMemo)(()=>n.organization&&e.values.massConditions.customFieldId?n.organization.conditionsCustomFields.nodes.find(t=>t.id===e.values.massConditions.customFieldId):void 0,[n.organization,e.values.massConditions.customFieldId]);return(0,F.useEffect)(()=>{s?.fieldType===Ne.Checkbox?e.change("massConditions.value",!0):s?.fieldType===Ne.Select&&e.change("massConditions.value",[])},[s]),o||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(lj,{label:t("CustomField"),name:"massConditions.customFieldId",shouldParseAsInt:!0,children:[(0,i.jsx)("option",{value:-1,children:t("s_lectionner_un_01451")}),n.organization.conditionsCustomFields.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),s?.fieldType===Ne.Select&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Sm,{isSearchVisible:!0,label:t("mission_accessi_77261"),multiple:!0,name:"massConditions.value",children:s.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))})]}),s?.fieldType===Ne.Checkbox&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(lj,{label:t("mission_accessi_77261"),name:"massConditions.value",shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]})]})]})},lU=e=>{const t=Ln(),n=Nn(sU),o=Nn(za),{mutate:s}=function(e={}){return Un("mutation PositionsMassConditions($eventId: EventId!, $massConditions: MassConditionsInput!) {\n    numberOfPositions: positionsMassConditions(eventId: $eventId, massConditions: $massConditions)\n}\n",e)}(),[r,a]=(0,F.useState)(0);return(0,i.jsx)(Bc,{size:"md",onClose:e.onClose,children:(0,i.jsx)(Oa.lV,{initialValues:{massConditions:{customFieldId:-1,selecteds:e.selecteds,strategy:Je.Add,value:""}},initialValuesEqual:wr.A,render:({form:n,handleSubmit:o,values:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ea,{justify:"center",children:(0,i.jsx)(mj,{color:"primary",icon:"lock"})}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("_diter_les_cond_95618")}),(0,i.jsx)(Pa,{height:"7"}),0===r?(0,i.jsx)(rU,{}):(0,i.jsx)(aU,{change:n.change,organizationId:e.organizationId,values:s}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",children:[0!==r&&(0,i.jsx)(pl,{color:"white",leftIcon:"arrow-left",onClick:()=>{a(Math.max(0,r-1))},children:t("retour_92202")}),(0,i.jsx)(fr,{css:{flex:"1"}}),0===r?(0,i.jsx)(pl,{rightIcon:"arrow-right",onClick:o,children:t("suivant_1_2_16815")}):(0,i.jsx)(pl,{onClick:o,children:t("mettre_jour_l_67209")})]})]}),validate:e=>0===r?o.validateForForm(n.massConditionsStep1Schema())(e):o.validateForForm(n.massConditionsStep2Schema())(e),onSubmit:async n=>{if(1===r){const i=(await s({eventId:e.eventId,massConditions:n.massConditions})).numberOfPositions;e.onSuccess(t("les_conditions_78548",i)),e.onClose()}else a(r+1)}})})},dU=()=>{const e=Ln(),{roles:t}=nI(),{eventId:n,massActions:o,onMassEditSuccess:s,organizationId:r,predicates:a,segment:l}=zC(),{showNotification:d}=Yv(),{mutate:c}=ks(),{mutate:u}=Jr(),{mutate:m}=ra(),[g,p]=(0,F.useState)(!1),[f,x]=(0,F.useState)(!1),[_,I]=(0,F.useState)(!1),[v,b]=(0,F.useState)(!1),j=o.getSelectedsInput(a,null),C=o.isAllSelected?l.count:o.numberOfSelected,y=(0,F.useCallback)(e=>{h(e)&&d(e),s()},[s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pl,{onClick:()=>{p(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsx)(Od,{icon:"lock",onClick:()=>{x(!0)},children:e("_diter_les_cond_95618")}),(0,i.jsx)(Od,{icon:"user-gear",onClick:()=>I(!0),children:e("_diter_les_resp_29588")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{b(!0)},children:e("supprimer_43083")})]})]}),g&&(0,i.jsx)(zk,{eventId:n,mutate:e=>c({eventId:n,massEdit:e}),organizationId:r,selecteds:j,onClose:()=>{p(!1)},onSuccess:t=>{y(e("_1_missions_on_96803",t))}}),f&&(0,i.jsx)(lU,{eventId:n,organizationId:r,selecteds:j,onClose:()=>{x(!1)},onSuccess:y}),_&&(0,i.jsx)(MO,{roles:t.positionRoles,showRoleSelect:!0,onClose:()=>I(!1),onSuccess:async(t,i)=>{const o=(await u({eventId:n,massLeaders:{leaders:i,strategy:t,selecteds:j}})).numberOfPositions;y(e("les_responsable_23291",o))}}),v&&(0,i.jsx)(kk,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_65487")],text:e("suppression_de_81835",C),onClose:()=>{b(!1)},onDelete:async()=>{const t=(await m({eventId:n,selecteds:j})).numberOfPositions;y(e("_1_missions_on_56713",t))}})]})};function cU(){const{history:e,params:{organizationId:t,eventId:n}}=il(),{mutate:i}=function(e={}){return Un("mutation PositionDuplicate($eventId: EventId!, $positionId: PositionId!) {\n    positionDuplicate(eventId: $eventId, positionId: $positionId) {\n        id\n    }\n}\n",e)}();return(0,F.useCallback)(async o=>{const{positionDuplicate:s}=await i({eventId:n,positionId:o});e.push(So.EDIT_POSITION(t,n,s.id))},[t,n,i])}const uU=e=>{const{translate:t,params:{eventId:n}}=il(),{showNotification:o}=Yv(),{mutate:s}=ra(),r=[];return e.position.assignedResources>0&&r.push(t("_1_membre_est_66702",e.position.assignedResources)),(0,i.jsx)(kk,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_01544"),t("cela_supprimera_15744"),...r],text:t("suppression_de_73669",e.position.name),onClose:e.onClose,onDelete:async()=>{await s({eventId:n,selecteds:{ids:[e.position.id]}}),o(t("la_mission_1_45985",e.position.name)),e.onSuccess()}})},hU=e=>{const{params:{organizationId:t,eventId:n},translate:o}=il(),s=cU(),{isEventAdmin:r}=Uv(),[a,l]=(0,F.useState)(!1),[d,c]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(pm,{children:[(0,i.jsx)(Od,{icon:"pen",to:So.EDIT_POSITION(t,n,e.position.id),children:o("_diter_62574")}),(0,i.jsx)(Od,{icon:"clone",onClick:async()=>{await s(e.position.id)},children:o("dupliquer_28256")}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:e=>{l(!0),wd(e.target)},children:o("supprimer_43083")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{icon:"plus",to:So.CREATE_POSITION(t,n,e.position.category.id),children:o("ajouter_une_mis_99800")}),(0,i.jsx)(Od,{icon:"eye",to:ao.POSITION_CATEGORY({organizationId:t,eventId:n,positionCategoryId:e.position.category.id}),children:o("voir_1_90465",e.position.category.name)}),r&&(0,i.jsx)(Od,{icon:"pen",onClick:()=>{c(!0)},children:o("renommer_1_40542",e.position.category.name)})]}),a&&(0,i.jsx)(uU,{position:e.position,onClose:()=>{l(!1)},onSuccess:e.reload}),d&&(0,i.jsx)(SV,{eventId:n,positionCategoryId:e.position.category.id,positionCategoryName:e.position.category.name,onClose:()=>{c(!1)},onSuccess:e.reload})]})},mU=e=>{const t=(0,F.useMemo)(()=>(e.position.category?.leaders??[]).map(e=>({id:e.userInfo.id,color:"gray",icon:null,text:e.userInfo.nameOrEmail})),[e.position]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:t})})},gU=e=>{const t=(0,F.useMemo)(()=>(e.position?.leaders??[]).map(e=>({id:e.userInfo.id,color:"gray",icon:null,text:e.userInfo.nameOrEmail})),[e.position]);return(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qC,{badges:t})})},pU=e=>{const{translate:t}=il(),n=Nn($c),{mutate:o}=ks(),s=(0,F.useCallback)((t,n)=>o({eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:n,strategy:Je.Replace,value:t}}),[e.row,o]),r=(0,F.useMemo)(()=>{if(e.row.range){const t=e.row.range.start,i=e.row.range.end;return t.startOf("day").equals(i.startOf("day"))?n.toLocaleString(t,Ho.DateOnly.MonthShort):`${n.toLocaleString(t,Ho.DateOnly.MonthShort)} → ${n.toLocaleString(i,Ho.DateOnly.MonthShort)}`}return"-"},[e.row]),{isEventAdmin:a}=Uv();return e.column.slug==LV.Id?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===LV.Category?(0,i.jsx)(YV,{column:e.column,positionCategory:e.row.category,positionId:e.row.id,reload:e.reloadRow,updatable:a}):e.column.slug===LV.Name?(0,i.jsx)(QV,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===LV.Slot?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Ea,{css:{overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(fr,{font:"gray900 textSm medium",children:r}),(0,i.jsx)(fr,{color:"gray500",children:t("creneau",e.row.numberOfSlots)})]})}):e.column.slug===LV.SlotName?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===LV.Resources?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UO,{assignedResources:e.row.assignedResources,resources:e.row.resources})}):e.column.slug===LV.Tags?(0,i.jsx)(tU,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===LV.Conditions?(0,i.jsx)(ZV,{column:e.column,position:e.row}):e.column.slug===LV.Address?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.address}):e.column.slug===LV.Latitude?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.latitude}):e.column.slug===LV.Longitude?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.longitude}):"isVisible"===e.column.slug?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ea,{align:"center",gap:"3",width:1,children:e.row.isVisible?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"square-check"})}),(0,i.jsx)(fr,{children:t("visible_27909")})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"square"})}),(0,i.jsx)(fr,{children:t("non_visible_30040")})]})})}):e.column.slug===LV.Acronym?(0,i.jsx)(UV,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===LV.Color?(0,i.jsx)(KV,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===LV.Icon?(0,i.jsx)(XV,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===LV.IconColor?(0,i.jsx)(JV,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===LV.State?(0,i.jsx)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.state===lt.Full?(0,i.jsx)(Gd,{color:"success",children:t(e.row.state)}):(0,i.jsx)(Gd,{color:"warning",children:t(e.row.state)})}):e.column.slug===LV.FillingRate?(0,i.jsxs)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===LV.CheckedInRate?(0,i.jsxs)(xc,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.checkedInRate||0,"%"]}):e.column.slug===LV.CreatedAt?(0,i.jsx)(B$,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===LV.CreatedBy?(0,i.jsx)(V$,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===LV.Leaders?(0,i.jsx)(gU,{column:e.column,position:e.row}):e.column.slug===LV.CategoryLeaders?(0,i.jsx)(mU,{column:e.column,position:e.row}):(0,i.jsx)(JC,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:s,reload:e.reloadRow,updatable:a})},fU=e=>{const{params:{organizationId:t,eventId:n},translate:o}=il(),{isEventAdmin:s}=Uv(),r=SC(e.customFields),a=(0,F.useCallback)(()=>{e.reloadPosition(e.position.id)},[e.position,e.reloadPosition]);return(0,i.jsxs)(Cc,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},onMouseLeave:e=>{wd(e.target)},children:[s&&(0,i.jsx)(xc,{justify:"center",width:48,children:(0,i.jsx)(tc,{state:e.state,onClick:(t,n)=>{Il(n),e.toggleRow(`p${e.position.id}`,t)}})}),e.columns.map(t=>{const o=r.get(t.slug);return(0,i.jsx)(pU,{column:t,customField:o,eventId:n,reloadRow:a,row:e.position},t.slug)}),(0,i.jsx)(ub,{positionsPermissions:db.EDIT_POSITION,children:(0,i.jsx)(im,{justify:"center",children:(0,i.jsxs)(ub,{positionsPermissions:db.EDIT_POSITION,scope:{positionCategoryId:e.position.category.id},children:[(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"pen",to:So.EDIT_POSITION(t,n,e.position.id)})})}),(0,i.jsx)(am,{placement:"top",children:o("_diter_62574")})]}),(0,i.jsx)(hU,{position:e.position,reload:e.reload})]})})})]})},xU=e=>{const{params:{eventId:t}}=il(),{isEventAdmin:n}=Uv(),{columns:o,columnsSearch:s,limit:r,massActions:a,nameDebounced:l,offset:d,possibleColumns:c,predicates:u,reloadKey:m,setLimit:g,setOffset:p,setSort:f,sort:x}=zC(),_=(0,F.useMemo)(()=>({includeCheckedInRate:o.includes(LV.CheckedInRate),includeConditions:o.includes(LV.Conditions),includeCreatedBy:o.includes(LV.CreatedBy),includeLeaders:o.includes(LV.Leaders)||o.includes(LV.CategoryLeaders),includeTags:o.includes(LV.Tags),includeTraces:!1}),[o]),{data:I,isLoading:v,reload:b}=aa({..._,eventId:t,name:h(l)?l:null,columnsSearch:Zo(s)?s:null,predicates:u,limit:r,offset:d,sort:x}),j=(0,F.useMemo)(()=>o.flatMap(e=>(0,Da.A)([c.find(t=>t.slug===e)])),[c,o]),{numberOfPages:C,totalCount:y}=lu(I.data?.rows),[k,A]=(0,F.useState)([]),[w,S]=(0,F.useState)({}),E=(0,F.useCallback)(async e=>{S(t=>({...t,[e]:!0}));const{data:{row:n}}=await(i={..._,eventId:t,id:e},o=await H(),ss("query PositionsPosition(\n    $eventId: EventId!\n    $id: PositionId!\n    $includeCheckedInRate: Boolean!\n    $includeConditions: Boolean!\n    $includeCreatedBy: Boolean!\n    $includeLeaders: Boolean!\n    $includeTags: Boolean!\n) {\n    data: event(id: $eventId) {\n        row: position(id: $id) {\n            ...PositionsPosition\n        }\n    }\n}\n",{variables:i,token:o||void 0,fragments:[Ro.PositionsPositionFragment]}));var i,o;A(t=>t.map(t=>t.id===e?n:t)),S(t=>({...t,[e]:!1}))},[_,S,A]);return(0,F.useEffect)(()=>{A(I.data?.rows.nodes??[])},[I.data]),(0,F.useEffect)(()=>{m>1&&b()},[m]),(0,F.useEffect)(()=>{a.setStates(Object.fromEntries((I.data?.rows.nodes??[]).map(e=>[`p${e.id}`,{id:e.id,state:"unchecked"}])))},[I.data,a.setStates]),(0,i.jsx)(Ea,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(nm,{"aria-busy":v,headerRow:(0,i.jsxs)(cc,{children:[n&&(0,i.jsx)(Tc,{justify:"center",width:48,children:(0,i.jsx)(tc,{state:a.selectAllState,onClick:a.toggleSelectAll})}),j.map(e=>e.isSortable?(0,i.jsx)(tm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:f,sort:x,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Tc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),(0,i.jsx)(ub,{positionsPermissions:[db.EDIT_POSITION],children:(0,i.jsx)(Tc,{width:100})})]}),paginationRow:(0,i.jsx)(yc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(jc,{limit:r,numberOfPages:C,offset:d,setLimit:g,setOffset:p,showLimits:!0,totalCount:y})}),children:v?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{})]}):k.map(t=>w[t.id]?(0,i.jsx)(zc,{},t.id):(0,i.jsx)(fU,{columns:j,customFields:e.customFields,position:t,reload:b,reloadPosition:E,state:a.states[`p${t.id}`]?.state??"unchecked",toggleRow:a.toggleRow},t.id))})})},_U=(0,F.memo)(e=>{const t=(0,F.useCallback)(t=>{t&&(n.current&&(o.current?.setMap(null),s.current?.setMap(null),n.current=null),n.current=new google.maps.Map(t,{...e.mapOptions??{},zoom:e.initialZoom??yr,center:e.initialCenter??Cr,fullscreenControl:!1,mapTypeControl:!1,streetViewControl:!1,mapTypeId:e.layer===Xe.Google?"roadmap":e.layer===Xe.GoogleSatellite?"satellite":e.layer,styles:[{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"poi.government",stylers:[{visibility:"on"}]},{featureType:"poi.park",stylers:[{visibility:"on"}]}]}),n.current.mapTypes.set(Xe.IgnPlan,Er()),o.current=new google.maps.OverlayView,o.current.draw=Bl.A,o.current.setMap(n.current),n.current.addListener("drag",()=>{e.onMapDrag?.()}),n.current.addListener("center_changed",()=>{e.onMapCenterChanged?.({lat:n.current.getCenter().lat(),lng:n.current.getCenter().lng()})}),n.current.addListener("zoom_changed",()=>{e.onMapZoomchanged?.(n.current.getZoom())}),n.current.addListener("click",t=>{e.showMarker&&(s.current?.setMap(null),s.current=new google.maps.Marker({position:t.latLng,map:n.current,draggable:!0}),e.onMarkerDragEnd?.(t.latLng.lat(),t.latLng.lng()),s.current.addListener("dragend",()=>{const t=s.current.getPosition();e.onMarkerDragEnd?.(t.lat(),t.lng())}))}),n.current.addListener("tilesloaded",()=>{setTimeout(()=>{e.onMapTilesloaded?.()},1e3)}),l(),d())},[]),n=(0,F.useRef)(null),o=(0,F.useRef)(null),s=(0,F.useRef)(null),r=(0,F.useRef)([]),a=(0,F.useRef)([]),l=()=>{r.current.forEach(e=>e.setMap(null)),r.current=e.positions.map(t=>{const i=jr(kr(t)),s=new google.maps.Marker({position:i,map:n.current,icon:"acronym"===e.acronymIcon?`${R.HEAVENT_API_URL}/icons/acronym.svg?color=${encodeURIComponent(t.color)}&text=${t.acronym}`:`${R.HEAVENT_API_URL}/icons/${Ba(t.icon)}.svg?color=${encodeURIComponent(t.color)}`});return s.addListener("click",()=>{const n=o.current?.getProjection()?.fromLatLngToContainerPixel(new google.maps.LatLng(i.lat,i.lng));n&&e.onPositionClick?.(t,n)}),s})},d=()=>{a.current.forEach(e=>e.setMap(null)),a.current=e.traces.map(t=>{const i=t.points.map(([e,t])=>({lat:e,lng:t})),o=t.direction===Ct.None?[]:[{icon:{path:t.direction===Ct.Backward?google.maps.SymbolPath.BACKWARD_OPEN_ARROW:google.maps.SymbolPath.FORWARD_OPEN_ARROW,scale:4,strokeColor:t.color},offset:"0%",repeat:"200px"}],s=new google.maps.Polyline({path:i,geodesic:!0,strokeColor:t.color,strokeOpacity:1,strokeWeight:4,visible:!e.hiddenTracesIds.includes(t.id),icons:o});return s.setMap(n.current),s})};return(0,F.useEffect)(()=>{l()},[JSON.stringify(e.positions),e.acronymIcon]),(0,F.useEffect)(()=>{n.current?.setMapTypeId(Ar(e.layer))},[e.layer]),(0,F.useEffect)(()=>{d()},[JSON.stringify(e.traces),e.hiddenTracesIds]),(0,i.jsx)(fr,{ref:t,height:1,width:1})},wr.A);_U.displayName="PositionsMap";const IU=e=>{const t=Ln();return kd(e.onClose),yd(e.onClose),(0,i.jsxs)(Ea,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsxs)(Ea,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onChange("acronym")},children:[(0,i.jsx)(fr,{fontSize:"textMd",children:(0,i.jsx)(Va,{icon:"text"})}),(0,i.jsx)(fr,{color:"gray800",css:{flex:"1"},children:t("acronymes_11499")}),"acronym"===e.selectedAcronymIcon&&(0,i.jsx)(Ea,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(Va,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:lr.colors.primary600.value})})]}),(0,i.jsxs)(Ea,{align:"center",css:{cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onChange("icon")},children:[(0,i.jsx)(fr,{fontSize:"textMd",children:(0,i.jsx)(Va,{icon:"location-dot"})}),(0,i.jsx)(fr,{color:"gray800",css:{flex:"1"},children:t("ic_nes_16022")}),"icon"===e.selectedAcronymIcon&&(0,i.jsx)(Ea,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(Va,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:lr.colors.primary600.value})})]})]})};function vU(e){const t=e.replace(/<\?xml(.*)\?>/,""),n=(new DOMParser).parseFromString(t,"text/xml");if(0!==n.querySelectorAll("parsererror").length)throw new Error("Could not parse: "+e);return n}const bU=e=>{const t=parseFloat(e.getAttribute("lat")),n=parseFloat(e.getAttribute("lon"));return isNaN(t)||isNaN(n)?[]:[[t,n]]};let jU=class extends zl{constructor(e){super(e)}traceInputDefault(e){return{name:e?.name??"",color:e?.color??lr.colors.primary700.value,points:e?.points??[],direction:e?.direction??Ct.None}}traceInputSchema(){return l.Ik().shape({name:l.Yj().required(this.t("le_nom_du_trac_39859")),color:l.Yj().required(this.t("la_couleur_du_t_36646")),points:l.YO().required(this.t("le_trac_doit_c_20895")).min(2,this.t("le_trac_doit_c_20895"))})}createTraceSchema(){return l.Ik().shape({trace:this.traceInputSchema()})}updateNameSchema(){return l.Ik().shape({name:l.Yj().required(this.t("le_nom_du_trac_39859"))})}};jU=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],jU);const CU=e=>{const t=Ln(),n=Nn(jU),o=Nn(za),[s,r]=(0,F.useState)({name:e.trace?`${u(e.trace.name)}.gpx`:"",content:""}),{mutate:a,isLoading:l}=function(e={}){return Un("mutation TraceCreate($eventId: EventId!, $trace: TraceInput!) {\n    traceCreate(eventId: $eventId, trace: $trace) {\n        id\n    }\n}\n",e)}(),{mutate:d,isLoading:c}=function(e={}){return Un("mutation TraceUpdate($eventId: EventId!, $traceId: TraceId!, $trace: TraceInput!) {\n    traceUpdate(eventId: $eventId, traceId: $traceId, trace: $trace) {\n        id\n    }\n}\n",e)}();return(0,i.jsx)(dl,{hideDefaultErrors:!0,initialValues:{trace:n.traceInputDefault(e.trace)},render:({form:n,handleSubmit:o})=>(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(fr,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(Va,{icon:"route"})}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",textAlign:"center",children:t("ajouter_un_trac_05425")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(sl,{}),(0,i.jsx)(Sl,{label:t("nom_du_trac_16379"),name:"trace.name",placeholder:t("nom_du_trac_16379")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(JL,{accept:HI.Gpx,format:"string",label:t("fichier_gpx_55484"),placeholder:t("s_lectionnez_un_17918"),value:s,onChange:e=>{r(e),n.change("trace.points",function(e){const t=vU(e),n=Array.from(t.querySelectorAll("trk trkseg trkpt")),i=Array.from(t.querySelectorAll("wpt")),o=Array.from(t.querySelectorAll("rte rtept"));return n.length>0?n.flatMap(bU):i.length>0?i.flatMap(bU):o.flatMap(bU)}(e.content))}}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(nj,{label:t("couleur_du_trac_28854"),name:"trace.color"}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsxs)(lj,{label:t("sens_du_trac_49290"),name:"trace.direction",children:[(0,i.jsx)("option",{value:Ct.None,children:t("aucun_93456")}),(0,i.jsx)("option",{value:Ct.Forward,children:t("en_avant_17614")}),(0,i.jsx)("option",{value:Ct.Backward,children:t("en_arri_re_24636")})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{isLoading:l||c,onClick:o,children:e.traceId?t("mettre_jour_85141"):t("ajouter_97327")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]}),validate:o.validateForForm(n.createTraceSchema()),onSubmit:async t=>{e.traceId?await d({eventId:e.eventId,traceId:e.traceId,trace:t.trace}):await a({eventId:e.eventId,trace:t.trace}),e.onClose(),e.reload()}})},yU=e=>(kd(e.onClose),yd(e.onClose),(0,i.jsxs)(Ea,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsx)(Ea,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onExport("a3")},children:(0,i.jsx)(fr,{color:"gray800",css:{flex:"1"},children:"A3 (420 x 297 mm)"})}),(0,i.jsx)(Ea,{align:"center",css:{cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onExport("a4")},children:(0,i.jsx)(fr,{color:"gray800",css:{flex:"1"},children:"A4 (297 x 210 mm)"})})]})),kU=e=>(0,i.jsxs)(Ea,{align:"center",css:{cursor:"pointer",py:"$2","&:not(:last-child)":{borderBottom:"1px solid $gray200"}},gap:"2",onClick:e.onClick,children:[(0,i.jsx)(fr,{css:{borderRadius:"$1",height:"32px",overflow:"hidden",width:"32"},children:(0,i.jsx)("img",{alt:"Layer",height:"32px",src:e.imageSrc,width:"32px"})}),(0,i.jsx)(fr,{css:{flex:"1"},children:e.name}),e.isSelected&&(0,i.jsx)(Ea,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(Va,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:lr.colors.primary600.value})})]}),AU=e=>{const t=Ln();return kd(e.onClose),yd(e.onClose),(0,i.jsxs)(Ea,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsx)(kU,{imageSrc:od.Maps.GooglePlan,isSelected:e.selectedLayer===Xe.Google,name:"Plan",onClick:()=>{e.onChange(Xe.Google)}}),(0,i.jsx)(kU,{imageSrc:od.Maps.GoogleSatellite,isSelected:e.selectedLayer===Xe.GoogleSatellite,name:t("satellite_82253"),onClick:()=>{e.onChange(Xe.GoogleSatellite)}}),(0,i.jsx)(kU,{imageSrc:od.Maps.IgnPlan,isSelected:e.selectedLayer===Xe.IgnPlan,name:"IGN Plan",onClick:()=>{e.onChange(Xe.IgnPlan)}})]})},wU=e=>(0,i.jsxs)(Ea,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$md",cursor:"pointer",height:"48px",minWidth:"180px",padding:"$2 $3",userSelect:"none"},gap:"3",onClick:t=>{Il(t),e.onClick()},children:[e.children,(0,i.jsx)(fr,{color:"gray700",children:e.isOpen?(0,i.jsx)(Va,{icon:"chevron-up"}):(0,i.jsx)(Va,{icon:"chevron-down"})})]}),SU=e=>{const{organizationId:t,eventId:n}=Wn(),o=Nn(Ku);return(0,i.jsx)(Ea,{align:"center",css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",height:70,children:(0,i.jsxs)(La,{to:ao.POSITION({organizationId:t,eventId:n,positionId:e.position.id}),children:[(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{color:"gray800",children:e.position.name}),(0,i.jsx)(fr,{color:"gray500",fontSize:"textXs",children:e.position.range?o.toDisplayString(e.position.range):"-"})]}),(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"chevron-right"})})]})})},EU=e=>{const t=Ln(),{mutate:n}=function(e={}){return Un("mutation TraceDelete($eventId: EventId!, $traceId: TraceId!) {\n    traceDelete(eventId: $eventId, traceId: $traceId) {\n        id\n    }\n}\n",e)}(),[o,s]=(0,F.useState)(!1),[r,a]=(0,F.useState)(!1);return(0,i.jsxs)(Ea,{align:"center",css:{py:"$2","&:not(:last-child)":{borderBottom:"1px solid $gray200"}},gap:"2",children:[(0,i.jsx)(fr,{css:{background:e.trace.color,borderRadius:"$1",height:"16px",width:"16px"}}),(0,i.jsx)(fr,{color:"gray900",css:{flex:"1",ellipsis:!0},children:e.trace.name}),(0,i.jsx)(fr,{color:"gray700",css:{cursor:"pointer"},onClick:()=>{e.toggleVisible(e.trace.id)},children:(0,i.jsx)(Va,{icon:e.isHidden?"eye-slash":"eye"})}),(0,i.jsx)(fr,{color:"gray700",css:{cursor:"pointer"},onClick:()=>{a(!0)},children:(0,i.jsx)(Va,{icon:"pen"})}),(0,i.jsx)(fr,{color:"gray700",css:{cursor:"pointer"},onClick:()=>{s(!0)},children:(0,i.jsx)(Va,{icon:"xmark"})}),o&&(0,i.jsx)(kk,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_34035"),text:t("suppression_de_73669",e.trace.name),onClose:()=>{s(!1)},onDelete:async()=>{await n({eventId:e.eventId,traceId:e.trace.id}),e.reload()}}),r&&(0,i.jsx)(CU,{eventId:e.eventId,reload:e.reload,trace:e.trace,traceId:e.trace.id,onClose:()=>{a(!1)}})]})},TU=e=>{const t=Ln();return kd(e.onClose),yd(e.onClose),(0,i.jsxs)(Ea,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"240px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[e.traces.map(t=>(0,i.jsx)(EU,{eventId:e.eventId,isHidden:e.hiddenTracesIds.includes(t.id),reload:e.reload,toggleVisible:e.toggleVisible,trace:t},t.id)),(0,i.jsx)(fr,{color:"primary700",css:{cursor:"pointer",py:"$2"},onClick:()=>{e.onAddTrace(),e.onClose()},children:t("ajouter_un_trac_05425")})]})},zU=e=>{const{translate:t,params:{eventId:n,segmentId:o}}=il(),{isEventAdmin:s,localEvent:r,updateLocalEvent:a}=Uv(),{mutate:l}=function(e={}){return Un("mutation EventLayerUpdate($eventId: EventId!, $layer: MapLayer!) {\n    eventLayerUpdate(eventId: $eventId, layer: $layer) {\n        id\n    }\n}\n",e)}(),{setNewPositionLatLng:d}=HV(),[c,u]=(0,F.useState)(e.layer),[h,m]=(0,F.useState)([]),[g,p]=(0,F.useState)(null),[f,x]=(0,F.useState)(!1),[_,I]=(0,F.useState)(!1),[v,b]=(0,F.useState)(!1),[j,C]=(0,F.useState)(!1),[y,k]=ET("positionsMap.center",e.center),[A,w]=ET("positionsMap.zoom",yr),[S,E]=ET("positionsMap.acronymIcon","icon"),[T,z]=(0,F.useState)(!1),[$,O]=(0,F.useState)(r?.isPositionsMapAlertVisible??!0),P=(0,F.useRef)(null),D=(0,F.useCallback)(e=>{const t=y?`${y.lat},${y.lng}`:"",i=new URLSearchParams;i.set("format",e),i.set("hiddenTracesIds",h.join(",")),i.set("center",t),i.set("acronymIcon",S),i.set("zoom",A.toString(10)),window.open(`${R.HEAVENT_API_URL}/image/event/${n}/positions/${o}/map.png?${i.toString()}`)},[y,A,h,S]);return(0,i.jsxs)(Ea,{css:{flex:"1",position:"relative"},direction:"column",width:1,children:[s&&$&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ha,{leftIcon:"circle-exclamation",rightIcon:"xmark",rightIconClick:async()=>{await a({isPositionsMapAlertVisible:!1}),O(!1)},children:t("pour_cr_er_une_11133")}),(0,i.jsx)(Pa,{height:"6"})]}),(0,i.jsx)(fr,{ref:P,css:{flex:"1",borderRadius:"$1"},width:1,children:(0,i.jsx)(_U,{acronymIcon:S,hiddenTracesIds:h,initialCenter:y,initialZoom:A,layer:c,positions:e.positions,showMarker:s,traces:e.traces,onMapCenterChanged:k,onMapDrag:()=>{p(null)},onMapZoomchanged:e=>{p(null),w(e)},onMarkerDragEnd:(e,t)=>{d({latitude:e,longitude:t})},onPositionClick:(e,t)=>{p({position:e,left:t.x,top:t.y})}})}),s&&(0,i.jsxs)(Ea,{css:{bottom:"12px",left:"12px",position:"absolute",zIndex:10},gap:"2",children:[(0,i.jsx)(Ea,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$md",cursor:"pointer",fontSize:"$textLg"},height:48,justify:"center",width:48,onClick:()=>{P.current?.requestFullscreen()},children:(0,i.jsx)(Va,{icon:"expand"})}),(0,i.jsxs)(wU,{isOpen:f,onClick:()=>{x(e=>!e),I(()=>!1),b(()=>!1),C(()=>!1)},children:[(0,i.jsx)(fr,{css:{borderRadius:"$1",height:"32px",overflow:"hidden",width:"32px"},children:(0,i.jsx)("img",{alt:"Layer",height:"32px",src:c===Xe.Google?od.Maps.GooglePlan:c===Xe.GoogleSatellite?od.Maps.GoogleSatellite:od.Maps.IgnPlan,width:"32px"})}),(0,i.jsx)(fr,{color:"gray900",css:{flex:"1"},children:c===Xe.Google?"Plan":c===Xe.GoogleSatellite?t("satellite_82253"):"IGN Plan"})]}),(0,i.jsx)(wU,{isOpen:_,onClick:()=>{x(()=>!1),I(e=>!e),b(()=>!1),C(()=>!1)},children:(0,i.jsxs)(Ea,{align:"center",css:{flex:"1"},gap:"1",children:[(0,i.jsx)(fr,{color:"gray900",children:t("trac_s_41454")}),(0,i.jsx)(Pa,{width:"1"}),e.traces.map(e=>(0,i.jsx)(fr,{css:{background:e.color,borderRadius:"$1",height:"16px",width:"16px"}},e.id))]})}),(0,i.jsx)(wU,{isOpen:v,onClick:()=>{x(()=>!1),I(()=>!1),b(e=>!e),C(()=>!1)},children:(0,i.jsxs)(Ea,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(fr,{fontSize:"textMd",children:(0,i.jsx)(Va,{icon:"acronym"===S?"text":"location-dot"})}),(0,i.jsx)(fr,{color:"gray900",children:t("acronym"===S?"acronymes_11499":"ic_nes_16022")})]})}),(0,i.jsx)(wU,{isOpen:j,onClick:()=>{x(()=>!1),I(()=>!1),b(()=>!1),C(e=>!e)},children:(0,i.jsxs)(Ea,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(fr,{fontSize:"textMd",children:(0,i.jsx)(Va,{icon:"file-export"})}),(0,i.jsx)(fr,{color:"gray900",children:t("exporter_59120")})]})})]}),f&&(0,i.jsx)(fr,{css:{bottom:"64px",left:"68px",position:"absolute",zIndex:10},children:(0,i.jsx)(AU,{selectedLayer:c,onChange:async e=>{u(e),await l({eventId:n,layer:e})},onClose:()=>{x(!1)}})}),_&&(0,i.jsx)(fr,{css:{bottom:"64px",left:"256px",position:"absolute",zIndex:10},children:(0,i.jsx)(TU,{eventId:n,hiddenTracesIds:h,reload:e.reload,toggleVisible:e=>{m(Qo(h,e))},traces:e.traces,onAddTrace:()=>{z(!0)},onClose:()=>{I(!1)}})}),T&&(0,i.jsx)(CU,{eventId:n,reload:e.reload,onClose:()=>{z(!1)}}),v&&(0,i.jsx)(fr,{css:{bottom:"64px",left:"444px",position:"absolute",zIndex:10},children:(0,i.jsx)(IU,{selectedAcronymIcon:S,onChange:E,onClose:()=>{b(!1)}})}),j&&(0,i.jsx)(fr,{css:{bottom:"64px",left:"632px",position:"absolute",zIndex:10},children:(0,i.jsx)(yU,{onClose:()=>{C(!1)},onExport:D})}),P.current&&g&&(0,ee.createPortal)((0,i.jsx)(fr,{css:{left:`${g.left+32}px`,position:"absolute",top:g.top-35-16+"px",zIndex:10},children:(0,i.jsx)(SU,{position:g.position})}),P.current)]})},$U=e=>{const{eventId:t}=Wn(),{data:n,loader:o,reload:s}=aa({eventId:t,includeCheckedInRate:!1,includeConditions:!1,includeCreatedBy:!1,includeLeaders:!1,includeTags:!1,includeTraces:!0,name:h(e.name)?e.name:null,predicates:e.predicates,hasCoordinates:!0});return o?(0,i.jsx)(Ea,{css:{flex:"1"},children:o}):(0,i.jsx)(zU,{center:(r=n.data,"number"==typeof r?.latitude&&"number"==typeof r?.longitude?{lat:r.latitude,lng:r.longitude}:void 0),layer:n.data.layer,positions:n.data.rows.nodes,reload:s,traces:n.data.traces});var r};var OU=n(6965);const RU=e=>{const t=F.useMemo(()=>e.startOfDay.plus({day:1}).minus({second:1}),[e.startOfDay]),n=F.useMemo(()=>Fo.IX.fromDateTimes(e.startOfDay,t).overlaps(e.slot.range),[e.startOfDay,t,e.slot]),o=F.useMemo(()=>n?Fo.IX.fromDateTimes(Fo.c9.max(e.startOfDay,e.slot.range.start),Fo.c9.min(t,e.slot.range.end)):e.slot.range,[n,e.startOfDay,t,e.slot]),s=F.useMemo(()=>{const t=o.start.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*t.hours+t.minutes)},[e.startOfDay,o]),r=F.useMemo(()=>{const t=o.end.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*t.hours+t.minutes)},[e.startOfDay,o]);return n?(0,i.jsx)(Ea,{css:{gridColumnStart:s,gridColumnEnd:r},height:32,children:e.renderSlot(e.slot,e.row)},o.toISO()):null},PU=e=>{const[t,n]=F.useState(null),o=F.useCallback(e=>{e&&n(e.getBoundingClientRect())},[]),[s,r]=F.useState(!1),[a,l]=F.useState(1),d=F.useMemo(()=>e.date.startOf("day").set({hour:e.startHour}),[e.date,e.startHour]),c=F.useCallback(e=>{const n=Math.floor(1440*(e.clientX-(t?.left??0))/(t?.width??0)),i=n-n%60+1;i!==a&&l(i)},[t,a,l]),u=F.useCallback(n=>{const i=Math.floor(1440*(n.clientX-(t?.left??0))/(t?.width??0)),o=i-i%60,s=d.plus({minute:o});e.onPlus?.(s,e.row)},[d,e.row,e.onPlus,t]);return(0,i.jsxs)(Ea,{className:"h-planning-data-row",css:{borderBottom:"1px solid $gray200"},width:1,children:[(0,i.jsx)(Ea,{css:{borderRight:"1px solid $gray200",width:"calc(2 * $cellWidth)"},children:e.renderLeftCell(e.row)}),(0,i.jsxs)(Ea,{css:{flex:"1",py:"$3",position:"relative"},children:[(0,i.jsx)(Jl,{ref:o,css:{cursor:e.showPlus?"pointer":"inherit",gridAutoFlow:"column",overflow:"hidden",rowGap:"$2",zIndex:10},gridtemplatecolumns:"repeat(1440, 1fr)",width:1,onClick:e.showPlus?u:void 0,onMouseMove:e.showPlus?c:void 0,onMouseOut:()=>{r(!1)},onMouseOver:()=>{r(!0)},children:e.row.slots.map((t,n)=>(0,i.jsx)(RU,{renderSlot:e.renderSlot,row:e.row,slot:t,startOfDay:d},n))}),e.showPlus&&(0,i.jsx)(Jl,{css:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:5},gridtemplatecolumns:"repeat(1440, 1fr)",children:s&&(0,i.jsx)(Ea,{align:"center",css:{gridColumn:`${a} / span 60`,padding:"$1"},height:1,justify:"center",children:(0,i.jsx)(Ea,{align:"center",css:{background:"$gray100",borderRadius:"$1",color:"$gray800",cursor:"pointer",fontSize:"$textMd"},height:1,justify:"center",width:1,children:(0,i.jsx)(Va,{icon:"plus"})})})}),(0,i.jsx)(Jl,{css:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:1},gridtemplatecolumns:"repeat(1440, 1fr)",children:(0,vc.A)(0,23).map(e=>(0,i.jsx)(fr,{css:{borderRightColor:"$gray200",borderRightStyle:"dashed",borderRightWidth:"1px",gridColumn:`${60*e+1} / ${60*e+61}`}},e))})]})]})},DU=e=>{const t=Nn($c),n=e.date.startOf("day").equals(e.minDate.startOf("day")),o=e.date.endOf("day").equals(e.maxDate.endOf("day"));return(0,i.jsxs)(Ea,{css:{border:"1px solid $gray200",...e.css},direction:"column",width:1,children:[(0,i.jsxs)(Ea,{css:{borderBottom:"1px solid $gray200"},height:52,width:1,children:[(0,i.jsxs)(Ea,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:"calc(2 * $cellWidth)"},gap:"3",height:1,children:[(0,i.jsx)(_u,{max:e.maxDate,min:e.minDate,value:e.date,onChange:e.onChange}),e.renderFilters?.()]}),(0,i.jsxs)(Ea,{align:"center",css:{flex:"1",px:"$2"},gap:"3",children:[(0,i.jsx)(pl,{color:"white",disabled:n,leftIcon:"chevron-left",onClick:()=>{e.onChange(e.date.minus({day:1}))}}),(0,i.jsx)(fr,{css:{flex:"1",textTransform:"capitalize"},font:"gray800 textSm medium",textAlign:"center",children:t.toLocaleString(e.date,Ho.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(pl,{color:"white",disabled:o,leftIcon:"chevron-right",onClick:()=>{e.onChange(e.date.plus({day:1}))}})]})]}),(0,i.jsxs)(Ea,{css:{background:"$gray50",borderBottom:"1px solid $gray200"},height:24,width:1,children:[(0,i.jsx)(Ea,{css:{borderRight:"1px solid $gray200",width:"calc(2 * $cellWidth)"}}),(0,i.jsx)(Ea,{css:{flex:"1"},children:(0,i.jsxs)(Jl,{gridtemplatecolumns:"repeat(1440, 1fr)",height:1,width:1,children:[(0,i.jsx)(fr,{css:{gridColumn:"span 60"}}),(0,vc.A)(e.startHour+2,e.startHour+24,2).map(e=>(0,i.jsxs)(Ea,{align:"center",css:{fontSize:"$textXs",gridColumn:"span 120"},justify:"center",children:[(0,OU.A)((e>=24?e-24:e).toString(10),2,"0"),":00"]},e))]})})]}),e.data.map(t=>(0,i.jsx)(PU,{date:e.date,renderLeftCell:e.renderLeftCell,renderSlot:e.renderSlot,row:t,showPlus:e.showPlus,startHour:e.startHour,onPlus:e.onPlus},t.id.toString(10)))]})},FU=e=>{const{params:{organizationId:t,eventId:n}}=il();return(0,i.jsxs)(Ea,{css:{padding:"$1 $4"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(j_,{css:{overflow:"hidden",width:"100%"},to:ao.POSITION({organizationId:t,eventId:n,positionId:e.position.id}),children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.position.name,width:1,children:e.position.name})}),(0,i.jsx)(fr,{color:"gray500",css:{ellipsis:!0},title:e.position.category.name,width:1,children:e.position.category.name})]})},MU=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),s=Nn(Ku),r="number"==typeof e.slot.assignedResources&&"number"==typeof e.slot.fillingRate&&"number"==typeof e.slot.resources;return(0,i.jsxs)(Ea,{direction:"column",width:1,children:[(0,i.jsxs)(Ea,{css:{borderBottom:"1px solid $gray200",padding:"$4 $3 $3 $6"},gap:"4",children:[(0,i.jsx)(Xj,{color:e.position.color,icon:e.position.icon}),(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(j_,{to:ao.POSITION({organizationId:n,eventId:o,positionId:e.position.id}),children:(0,i.jsx)(fr,{css:{ellipsis:!0},width:1,children:e.position.name})}),(0,i.jsx)(fr,{color:"gray500",children:e.category.name})]})]}),(0,i.jsxs)(Ea,{css:{padding:"$5 $6 $4 $6"},direction:"column",gap:"6",children:[(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{color:"gray500",children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(fr,{font:"gray800 textSm medium",children:h(e.slot.name)?e.slot.name:"-"})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsx)(fr,{color:"gray500",children:t("cr_neau_horaire_28150")}),(0,i.jsx)(fr,{css:{textTransform:"capitalize"},font:"gray800 textSm medium",children:s.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}})})]}),r&&(0,i.jsxs)(Ea,{direction:"column",gap:"1",children:[(0,i.jsxs)(Ea,{justify:"between",children:[(0,i.jsx)(fr,{color:"gray500",children:t("membres_11310")}),(0,i.jsxs)(fr,{color:"gray500",children:[e.slot.assignedResources,"/",e.slot.resources]})]}),(0,i.jsx)(fr,{css:{textTransform:"capitalize"},font:"gray800 textSm medium",children:(0,i.jsx)(YA,{percent:e.slot.fillingRate/100})})]})]}),(0,i.jsx)(Ea,{css:{padding:"$4"},gap:"4",justify:"end",children:(0,i.jsx)(pl,{to:So.POSITION_SLOT_ASSIGN_VOLUNTEERS(n,o,e.position.id,e.slot.id),children:t("affecter_sur_le_19590")})})]})},NU=e=>{const t=ih(Nn(Ku),e.slot,"",{interval:{options:{hideDate:!0}},slot:{includeRange:!0}});return(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(Ea,{align:"center",css:{background:qA(e.slot.fillingRate/100),borderRadius:"$1",cursor:"pointer",px:"$2",userSelect:"none"},height:1,width:1,children:(0,i.jsx)(fr,{css:{ellipsis:!0},font:"white textXs medium",title:t,width:1,children:t})})}),(0,i.jsx)(Pd,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:460,children:(0,i.jsx)(MU,{category:e.position.category,position:e.position,slot:e.slot})})]})},LU=e=>{const{params:{eventId:t}}=il(),n=Nn(kV),{infos:o,isEditMode:s,limit:r,nameDebounced:a,offset:l,predicates:d,setInfos:c,setLimit:u,setOffset:m}=zC(),{mutate:g}=function(e={}){return Un("mutation PositionSlotCreate(\n    $eventId: EventId!\n    $positionId: PositionId!\n    $positionSlot: PositionsSlotInput!\n) {\n    positionSlotCreate(eventId: $eventId, positionId: $positionId, positionSlot: $positionSlot) {\n        id\n    }\n}\n",e)}(),{data:p,loader:f}=Vn("query PositionsPlanning(\n    $eventId: EventId!\n    $name: String\n    $predicates: [Predicate!]\n    $limit: Int\n    $offset: Int\n) {\n    data: event(id: $eventId) {\n        rows: positions(name: $name, predicates: $predicates, limit: $limit, offset: $offset) {\n            nodes {\n                ...PositionPlanning\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{eventId:t,name:h(a)?a:void 0,predicates:d,limit:r,offset:l},[Ro.PositionPlanningFragment]);const{numberOfPages:x,totalCount:_}=lu(p.data?.rows),[I,v]=(0,F.useState)([]),b=(0,F.useMemo)(()=>Fo.c9.isDateTime(o.positionsPlanningStartAt)&&o.positionsPlanningStartAt?.isValid?o.positionsPlanningStartAt:Fo.c9.fromISO(o.positionsPlanningStartAt)?.isValid?Fo.c9.fromISO(o.positionsPlanningStartAt,{zone:"utc"}):Fo.IX.fromDateTimes(e.startAt.startOf("day"),e.endAt.endOf("day")).contains(Fo.c9.utc())?Fo.c9.utc():e.startAt,[e.startAt,e.endAt,o]),j=(0,F.useCallback)(t=>{c({...o,positionsPlanningStartAt:t?.toISO()??e.startAt.toISO()})},[e.startAt,o,c]),[C,y]=(0,F.useState)(!1),[k,A]=(0,F.useState)(e.startAt),[w,S]=(0,F.useState)(-1),E=(0,F.useMemo)(()=>{const t=nh(e.dayStartTime);return t?.[0]??0},[e.dayStartTime]),T=(0,F.useCallback)(async e=>{const{data:{row:n}}=await function(e,t){return ss("query PositionsPlanningPosition($eventId: EventId!, $positionId: PositionId!) {\n    data: event(id: $eventId) {\n        row: position(id: $positionId) {\n            ...PositionPlanning\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.PositionPlanningFragment]})}({eventId:t,positionId:e},await H());v(t=>t.map(t=>t.id===e?n:t))},[t]);return(0,F.useEffect)(()=>{v(p.data?.rows.nodes??[])},[p.data]),f||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",width:1,children:[(0,i.jsx)(Ea,{css:{background:"white",flex:"1"},children:(0,i.jsx)(DU,{data:I,date:b,maxDate:e.endAt,minDate:e.startAt,renderLeftCell:e=>(0,i.jsx)(FU,{position:e}),renderSlot:(e,t)=>(0,i.jsx)(NU,{position:t,slot:e}),showPlus:s,startHour:E,onChange:j,onPlus:(e,t)=>{A(e),y(!0),S(t.id)}})}),(0,i.jsx)(yc,{children:(0,i.jsx)(jc,{limit:r,numberOfPages:x,offset:l,setLimit:u,setOffset:m,showLimits:!0,totalCount:_})})]}),C&&(0,i.jsx)(zV,{event:{endAt:e.endAt,startAt:e.startAt},slot:n.positionsSlotInputDefault(k),onClose:()=>{y(!1)},onSuccess:async e=>(await g({eventId:t,positionId:w,positionSlot:e}),T(w))})]})};function BU(e,t,n,i){const o=vU(e),s=(e=>Object.fromEntries(Array.from(e.querySelectorAll("Style")).map(e=>{const t=e.getAttribute("id"),[,,n,i,o,s,r,a]=(e.querySelector("color")?.textContent||"").trim().split("");return[`#${t}`,`#${r}${a}${o}${s}${n}${i}`]})))(o);return Array.from(o.querySelectorAll("Placemark")).map(e=>((e,t,n,i,o)=>{const[s,r]=(e.querySelector("Point coordinates")?.textContent||"").trim().split(",");return{positionCategoryId:t,name:(e.querySelector("name")?.textContent||"").trim(),description:(e.querySelector("description")?.textContent||"").trim(),color:o[`${e.querySelector("styleUrl")?.textContent||""}-normal`]||lr.colors.primary700.value,icon:He.LocationDot,layer:n,latitude:parseFloat(r),longitude:parseFloat(s),tracesIds:[],slots:[{startDate:i,startTime:"08:00",endDate:i,endTime:"09:00",resources:1}],conditionsOperator:ge.And,positionsCustomFields:[],tagsIds:[],fields:{},leadersIds:[]}})(e,t,n,i,s))}const VU=e=>{const t=Ln(),{data:n,loader:o}=Vn("query KmlEventInfos($eventId: EventId!) {\n    event(id: $eventId) {\n        layer\n        startAt\n\n        positionsCategories {\n            id\n            name\n        }\n    }\n}\n",{eventId:e.eventId},[]);const{mutate:s,isLoading:r}=function(e={}){return Un("mutation PositionsCreate($eventId: EventId!, $positions: [PositionInput!]!) {\n    positionsCreate(eventId: $eventId, positions: $positions) {\n        id\n    }\n}\n",e)}(),[a,l]=(0,F.useState)(),[d,c]=(0,F.useState)(-1),u=h(a?.content)&&-1!==d;return(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(fr,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(Va,{icon:"cloud-arrow-up"})}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",textAlign:"center",children:t("importer_des_mi_32264")}),(0,i.jsx)(Pa,{height:"7"}),o||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(JL,{accept:HI.Kml,format:"string",label:t("fichier_kml_55657"),placeholder:t("s_lectionnez_un_75984"),value:a,onChange:e=>{l(e)}}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsxs)(gu,{label:t("cat_gorie_00291"),shouldParseAsInt:!0,value:d??-1,onChange:e=>{c(e)},children:[(0,i.jsx)("option",{disabled:!0,value:"-1",children:t("choisissez_la_c_72356")}),n.event.positionsCategories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[(0,i.jsx)(pl,{disabled:!u,isLoading:r,onClick:async()=>{a&&(await s({eventId:e.eventId,positions:BU(a.content,d,n.event.layer,n.event.startAt)}),window.location.reload())},children:t("importer_90688")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},UU=({name:e,numberOfCategories:t,segment:n})=>{const{history:o,params:{organizationId:s,eventId:r},translate:a}=il(),{hasFeature:l}=nI(),{isEventAdmin:d,hasPositionPermissions:c}=Uv(),{newPositionLatLng:u}=HV(),{data:h}=Vn("query PositionsHeader($eventId: EventId!, $segmentId: SegmentId!) {\n    event(id: $eventId) {\n        segment(id: $segmentId) {\n            count\n\n            links {\n                positionsPlanningLink\n                positionsVolunteersPlanningLink\n            }\n\n            stats {\n                ... on PositionsSegmentStats {\n                    assignedResources\n                    resources\n                }\n            }\n        }\n    }\n}\n",{eventId:r,segmentId:n.id},[]);const[m,g]=(0,F.useState)(!1),[p,f]=(0,F.useState)(!1),[x,_]=(0,F.useState)(!1),[I]=c([db.EDIT_POSITION],{positionCategoryId:"ANY"});return(0,i.jsxs)(xO,{name:(0,i.jsxs)(Ea,{align:"center",css:{flex:"1",overflow:"hidden",position:"relative"},gap:"2",children:[(0,i.jsx)(fr,{css:{ellipsis:!0},font:"gray900 displaySm semiBold",title:e,children:e}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{color:"gray500",children:(0,i.jsx)(Va,{icon:"circle-exclamation"})})}),(0,i.jsxs)(am,{placement:"bottom-start",renderOnPortal:!0,children:[a("nombre_de_missi_06171",h.event?.segment.count??0),(0,i.jsx)("br",{}),a("nombre_de_membr_16367",h.event?.segment.stats?.assignedResources??0),(0,i.jsx)("br",{}),a("nombre_de_membr_29724",h.event?.segment.stats?.resources??0)]})]})]}),children:[I&&(0,i.jsx)(pl,{onClick:()=>{let e;u&&(e=`${u.latitude},${u.longitude}`),o.push(So.CREATE_POSITION(s,r,e))},children:a("cr_er_une_missi_66818")}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ed,{isOpen:m,onStateChange:g,children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsx)(Od,{icon:"plus",onClick:()=>{g(!1),f(!0)},children:a("cr_er_une_cat_g_20051")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{icon:"calendar",to:Zm(h.event?.segment.links.positionsPlanningLink,"html"),children:a("voir_le_plannin_85187")}),(0,i.jsx)(Od,{icon:"calendar",to:Zm(h.event?.segment.links.positionsVolunteersPlanningLink,"html"),children:a("voir_le_plannin_47650")}),(0,i.jsx)(Od,{download:`${n.name}-positions-planning`,icon:"arrow-down-to-bracket",to:Zm(h.event?.segment.links.positionsPlanningLink,"pdf"),children:a("t_l_charger_le_06050")}),(0,i.jsx)(Od,{download:`${n.name}-positions-volunteers-planning`,icon:"arrow-down-to-bracket",to:Zm(h.event?.segment.links.positionsVolunteersPlanningLink,"pdf"),children:a("t_l_charger_le_02952")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),l(Fe.KmlImport)&&(0,i.jsx)(Od,{color:0===t?"disabled":"default",icon:"file-import",onClick:()=>{g(!1),_(!0)},children:a("importer_des_mi_32264")}),(0,i.jsx)(Od,{icon:"file-import",to:ao.POSITION_IMPORT_CSV({organizationId:s,eventId:r}),children:a("import_tasks_fr_52548")})]})]}),p&&(0,i.jsx)(wV,{eventId:r,onClose:()=>{f(!1)},onSuccess:({id:e})=>{o.push(ao.POSITION_CATEGORY({organizationId:s,eventId:r,positionCategoryId:e}))}}),x&&(0,i.jsx)(VU,{eventId:r,onClose:()=>{_(!1)}})]})]})},WU=e=>{const t=Ln(),n=Hn(),{isEventAdmin:o,hasPositionPermission:s,updateLocalEvent:r}=Uv(),{limit:a,nameDebounced:l,predicates:d,rendering:c,segment:u}=zC(),h=s(db.EDIT_POSITION)&&(c===Ch.List||c===Ch.SlotsList),m=o&&(c===Ch.Calendar||c===Ch.List||c===Ch.SlotsList);return(0,F.useEffect)(()=>{r({positionBackPath:n.pathname,positionCategoryBackPath:n.pathname})},[u]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(UU,{name:u.name,numberOfCategories:e.event.positionsCategories.length,segment:u}),0===e.event.numberOfPositions&&c!==Ch.Map?(0,i.jsx)(yC,{css:{overflow:"hidden"},children:(0,i.jsx)(fr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(rk,{subtitle:t("plus_besoin_de_08254"),title:t("vous_n_avez_pas_08610")})})}):(0,i.jsxs)(yC,{children:[(0,i.jsx)(fO,{searchRow:(0,i.jsx)(gO,{actions:(0,i.jsx)(dU,{}),searchPlaceholder:t("rechercher_une_69998"),showEditColumns:h,showEditMode:m,showSearchColumns:!0}),selectSegment:(0,i.jsx)(FO,{pageSelectedText:t("les_1_mission_95719",a),segmentSelectedText:t("les_1_mission_38484",u.count,u.name)})}),c===Ch.List?(0,i.jsx)(xU,{customFields:e.customFields}):c===Ch.Map?(0,i.jsx)($U,{name:l,predicates:d}):c==Ch.SlotsList?(0,i.jsx)(oU,{customFields:e.customFields}):(0,i.jsx)(LU,{dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,startAt:e.event.startAt})]})]})},GU=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,segmentId:r}}=il(),{isEventAdmin:a,localEvent:l,updateLocalEvent:d}=Uv(),c=Nn(BV),u=(0,F.useMemo)(()=>c.getPositionsFilters(e.event,e.customFields),[e.event,e.customFields]),h=(0,F.useMemo)(()=>c.getPositionsPossibleColumns(e.customFields),[e.customFields]);return(0,i.jsx)(GV,{eventId:s,organizationId:o,children:(0,i.jsx)(uO,{eventId:s,filters:u,filtersButtonText:n("filtrer_les_mis_43681"),filtersSubtitle:n("appliquer_des_f_16037"),getSegmentPath:e=>So.POSITIONS_SEGMENT(o,s,e),hideSegments:0===e.event.numberOfPositions,initialLimit:l?.positionsLimit??_c,initialSegmentsOpen:l?.arePositionsSegmentsOpen??!0,isAdmin:a,organizationId:o,possibleColumns:h,possibleRenderings:[Ch.List,Ch.Calendar,Ch.Map,Ch.SlotsList],reload:e.reload,segmentId:r,segmentType:ft.Positions,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{d({positionsLimit:e})},onSegmentClick:e=>{d({positionsSegmentId:e})},onSegmentDelete:async()=>{await d({positionsSegmentId:null}),t.push(ao.POSITIONS({organizationId:o,eventId:s}))},onSegmentsToggle:async e=>{await d({arePositionsSegmentsOpen:e})},children:(0,i.jsx)(WU,{customFields:e.customFields,event:e.event})})})},HU=(0,F.memo)(function(){const{params:{organizationId:e,eventId:t},translate:n}=il(),{event:{name:o},localEvent:s}=Uv();Cd(`${o} ${n("missions_63972")}`);const{data:r,loader:a,reload:l}=Vn("query PositionsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n    organization(id: $organizationId) {\n        customFields(variety: Position) {\n            nodes {\n                ...SegmentCustomField\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        id\n        organizationId\n        startAt\n        endAt\n        numberOfPositions\n        dayStartTime\n\n        positionsCategories {\n            id\n            name\n\n            leaders {\n                ...LeaderInfos\n            }\n        }\n\n        segmentsFolders(segmentType: Positions) {\n            ...SegmentsFoldersSegments\n        }\n    }\n}\n",{organizationId:e,eventId:t},[Ro.SegmentCustomFieldFragment,Ro.LeaderInfosFragment,Ro.SegmentsFoldersSegmentsFragment]),d=(0,F.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.POSITIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(GU,{customFields:r.organization.customFields.nodes,event:r.event,reload:l})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.POSITIONS_SEGMENT(e,t,s?.positionsSegmentId&&d.includes(s.positionsSegmentId)?s?.positionsSegmentId:d[0]),replace:!0})})]})}),qU=e=>{const{translate:t}=il(),n=pc();return(0,i.jsx)(WA,{title:e.title,children:(0,i.jsxs)(Ea,{align:"center",direction:"column",...n?{gap:"9"}:{gap:"7"},gap:"4",width:1,children:[(0,i.jsx)(KA,{count:e.category.assignedResources,total:e.category.resources}),(0,i.jsx)(Gd,{leftIcon:"user",children:t("_1_membre_pr_32812",e.category.preassignedResources)})]})})},YU=({position:e})=>(0,i.jsx)(fr,{color:"gray800",css:{background:e.color,borderRadius:"20px",height:"20px",width:"20px"}}),KU=e=>{const{eventId:t,positionId:n}=Wn(),{mutate:o}=ks(),s=(0,F.useRef)(null),[r,a]=(0,F.useState)(e.position.color),l=Sc(e=>o({eventId:t,massEdit:{reset:!1,selecteds:{ids:[n]},slug:it.Color,strategy:Je.Replace,value:e}})),{hasPositionPermission:d}=Uv(),c=d(db.EDIT_POSITION,{positionCategoryId:e.position.positionCategoryId,positionId:e.position.id});return(0,i.jsx)(fr,{color:"gray800",css:{background:r,borderRadius:"20px",cursor:"pointer",height:"20px",width:"20px","& input":{background:"transparent",border:"none",borderRadius:"20px",cursor:"pointer",height:"20px",width:"20px","&::-webkit-color-swatch-wrapper":{padding:0},"&::-webkit-color-swatch":{borderRadius:"20px",border:"none"},"&::-moz-color-swatch":{border:"none"}}},onClick:()=>{c&&s.current?.click()},children:c&&(0,i.jsx)("input",{ref:s,type:"color",value:r,onChange:e=>{a(e.target.value),l(e.target.value)}})})},ZU=({customFields:e,position:t})=>{const n=pc(),{params:{organizationId:o,eventId:s},translate:r}=il(),a=Nn(Ku);return(0,i.jsx)(WA,{title:r("param_tres_78420"),children:(0,i.jsx)(Ea,{direction:"column",gap:"4",width:1,children:(0,i.jsxs)(eF,{children:[(0,i.jsxs)(JD,{children:[(0,i.jsx)(YD,{children:r("cat_gorie_00291")}),(0,i.jsx)(ZD,{children:n?(0,i.jsx)(i.Fragment,{children:t.positionCategoryName}):(0,i.jsx)(j_,{to:ao.POSITION_CATEGORY({organizationId:o,eventId:s,positionCategoryId:t.positionCategoryId}),children:t.positionCategoryName})})]}),(0,i.jsx)(HD,{direction:"horizontal"}),(0,i.jsxs)(JD,{children:[(0,i.jsx)(YD,{children:r("Color")}),(0,i.jsx)(ZD,{children:n?(0,i.jsx)(YU,{position:t}):(0,i.jsx)(KU,{position:t})})]}),(0,i.jsx)(HD,{direction:"horizontal"}),(0,i.jsxs)(JD,{children:[(0,i.jsx)(YD,{children:r("ic_ne_55554")}),(0,i.jsx)(ZD,{children:(0,i.jsx)(Va,{icon:Ba(t.icon)})})]}),(0,i.jsx)(HD,{direction:"horizontal"}),(0,i.jsxs)(JD,{children:[(0,i.jsx)(YD,{children:r("Date")}),(0,i.jsx)(ZD,{children:t.range?n?a.toLocaleString(t.range,void 0,{year:"numeric",month:"long",day:"numeric"}):a.toDisplayString(t.range):"-"})]}),e.map(e=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsxs)(Ea,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(fr,{color:"gray500",css:{flex:"1"},children:e.name}),(0,i.jsx)(Ea,{justify:"end",width:300,children:(0,i.jsx)(BA,{field:e,fields:t.fields})})]})]},e.slug))]})})})},XU=e=>{const t=Ln(),{hasPositionPermissions:n}=Uv(),[o]=n([db.ASSIGN_MEMBER],{positionCategoryId:e.positionSlot.positionCategoryId,positionId:e.positionSlot.positionId}),{mutate:s}=zs(),{mutate:r}=Us(),a=e.volunteerRegistration.positionSlotUserInfo;return(0,i.jsxs)(pm,{children:[a.state===he.Waiting&&(0,i.jsx)(Od,{icon:"clock",onClick:async()=>{await s({eventId:e.eventId,checkIn:{strategy:me.CheckIn,positionsSlotsUsersInfosIds:[a.id]}}),e.reload()},children:t("pointer_1_57919",e.volunteerRegistration.userInfo.name)}),a.state===he.CheckedIn&&(0,i.jsx)(Od,{icon:"clock",onClick:async()=>{await s({eventId:e.eventId,checkIn:{strategy:me.CheckOut,positionsSlotsUsersInfosIds:[a.id]}}),e.reload()},children:t("d_pointer_1_08337",e.volunteerRegistration.userInfo.name)}),a.state===he.CheckedOut&&(0,i.jsx)(Od,{icon:"clock",onClick:async()=>{await s({eventId:e.eventId,checkIn:{strategy:me.Reset,positionsSlotsUsersInfosIds:[a.id]}}),e.reload()},children:t("remettre_z_ro_11572")}),o&&(0,i.jsx)(Od,{color:"red",icon:"user-xmark",onClick:async()=>{await r({eventId:e.eventId,massAssign:{positionsSlotsIds:[e.positionSlot.id],selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:Je.Delete}}),e.reload()},children:t("d_saffecter_du_47122")})]})},JU=e=>{const{translate:t,params:{eventId:n}}=il(),o=Nn($c),s=Nn(Ng);return(0,i.jsxs)(Cc,{css:{"&:hover":{background:"$gray100"}},children:[(0,i.jsx)(xc,{children:(0,i.jsx)(Eb,{userInfo:e.volunteerRegistration.userInfo})}),(0,i.jsx)(xc,{children:e.volunteerRegistration.positionSlotUserInfo.state===he.CheckedOut?(0,i.jsx)(Gd,{leftIcon:"clock",children:t("temps_total_79448",s.minutesToHoursMinutesString(e.volunteerRegistration.positionSlotUserInfo.timeDifferenceMinutes))}):e.volunteerRegistration.positionSlotUserInfo.state===he.CheckedIn?(0,i.jsx)(Gd,{color:"success",leftIcon:"circle",leftIconStyle:"solid",size:"sm",children:t("point_le_1_63576",o.toLocaleString(e.volunteerRegistration.positionSlotUserInfo.checkInAt.toLocal(),Ho.DateTime))}):(0,i.jsx)(Gd,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",size:"sm",children:t("non_point_42145")})}),(0,i.jsx)(im,{justify:"center",children:(0,i.jsx)(XU,{eventId:n,positionSlot:e.positionSlot,reload:e.reload,volunteerRegistration:e.volunteerRegistration})})]})},QU=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,positionId:s,positionSlotId:r}}=il(),a=Nn(Ku),[l,d]=(0,F.useState)(0),[c,u]=(0,F.useState)({direction:_t.Asc,attribute:zt.Name}),{data:h,isLoading:m,reload:g}=Vn("query PositionSlotVolunteers(\n    $eventId: EventId!\n    $positionSlotId: PositionsSlotId!\n    $offset: Int\n    $sort: VolunteersRegistrationsSort\n) {\n    event(id: $eventId) {\n        positionSlot(id: $positionSlotId) {\n            id\n            positionId\n            positionCategoryId\n            name\n            range\n            assignedResources\n            resources\n        }\n\n        volunteersRegistrations(\n            positionSlotId: $positionSlotId\n            limit: 25\n            offset: $offset\n            sort: $sort\n        ) {\n            nodes {\n                id\n\n                userInfo {\n                    id\n                    name\n                    email\n                    picture {\n                        url\n                    }\n                }\n\n                positionSlotUserInfo(positionSlotId: $positionSlotId) {\n                    id\n                    checkInAt\n                    checkOutAt\n                    state\n                    timeDifferenceMinutes\n                }\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{eventId:o,positionSlotId:r,offset:l,sort:c},[]),{numberOfPages:p,totalCount:f}=lu(h.event?.volunteersRegistrations),x=(0,F.useMemo)(()=>h.event?.positionSlot?h.event.positionSlot.resources-h.event.positionSlot.assignedResources:0,[h.event?.positionSlot]),{hasPositionPermissions:_}=Uv(),[I]=m?[!1]:_([db.ASSIGN_MEMBER],{positionCategoryId:h.event.positionSlot.positionCategoryId,positionId:s});return(0,i.jsxs)(eu,{returnToFallback:ao.POSITION({organizationId:n,eventId:o,positionId:s}),size:"md",children:[(0,i.jsx)(Lb,{children:(0,i.jsx)(Ea,{direction:"column",gap:"1",width:1,children:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qd,{borderRadius:"$1",height:28,width:1}),(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{children:h.event.positionSlot.name||"-"}),(0,i.jsx)(fr,{font:"gray500 textSm regular",children:a.toDisplayString(h.event.positionSlot.range)})]})})}),(0,i.jsxs)(tu,{children:[(0,i.jsx)(Pa,{height:"5"}),(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{children:t("liste_des_membr_89037")}),h.event?x>0?(0,i.jsx)(Gd,{color:"warning",children:t("_1_membre_manq_31014",x)}):(0,i.jsx)(Gd,{color:"success",children:t("complet_51600")}):null]}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsxs)(mc,{children:[(0,i.jsxs)(cc,{children:[(0,i.jsx)(tm,{attribute:zt.Name,setSort:e=>{d(0),u(e)},sort:c,children:t("nom_08311")}),(0,i.jsx)(Tc,{children:t("status_06428")}),(0,i.jsx)(Tc,{width:100})]}),m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):h.event.volunteersRegistrations.nodes.map(e=>(0,i.jsx)(JU,{positionSlot:h.event.positionSlot,reload:g,volunteerRegistration:e},e.id)),(0,i.jsx)(yc,{children:(0,i.jsx)(jc,{numberOfPages:p,offset:l,setOffset:d,totalCount:f})})]}),(0,i.jsx)(Pa,{height:"5"})]}),(0,i.jsx)(nu,{children:(0,i.jsxs)(Ea,{gap:"3",justify:"end",children:[I&&(0,i.jsx)(pl,{onClick:()=>{e.push(So.POSITION_SLOT_ASSIGN_VOLUNTEERS(n,o,s,r))},children:t("affecter_des_me_30349")}),(0,i.jsx)(pl,{color:"white",onClick:()=>e.goBack(ao.POSITION_SLOT({organizationId:n,eventId:o,positionId:s,positionSlotId:r})),children:t("fermer_62479")})]})})]})},eW=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=il(),r=Nn(Ku),{hasPositionPermissions:a}=Uv(),l=Nn(kV),{mutate:d}=ha(),{mutate:c}=zs(),{mutate:u}=function(e={}){return Un("mutation PositionSlotDelete(\n    $eventId: EventId!\n    $positionId: PositionId!\n    $positionSlotId: PositionsSlotId!\n) {\n    positionSlotDelete(\n        eventId: $eventId\n        positionId: $positionId\n        positionSlotId: $positionSlotId\n    ) {\n        id\n    }\n}\n",e)}(),[m,g]=(0,F.useState)(!1),[p,f]=(0,F.useState)(!1),x=(0,F.useMemo)(()=>r.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}}),[e.slot]),[_,I]=a([db.EDIT_POSITION,db.ASSIGN_MEMBER],{positionCategoryId:e.slot.positionCategoryId,positionId:e.slot.positionId});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Cc,{css:{cursor:"pointer"},onClick:()=>{t.push(So.POSITION_SLOT_MEMBERS(o,s,e.slot.positionId,e.slot.id))},children:[(0,i.jsx)(xc,{align:"start",direction:"column",justify:"center",children:(0,i.jsx)(fr,{font:"gray900 textSm medium",children:h(e.slot.name)?e.slot.name:"-"})}),(0,i.jsx)(xc,{css:{textTransform:"capitalize"},children:x}),(0,i.jsx)(xc,{children:(0,i.jsx)(UO,{assignedResources:e.slot.assignedResources,resources:e.slot.resources})}),(0,i.jsx)(im,{justify:"end",children:(0,i.jsxs)(pm,{children:[I&&(0,i.jsx)(Od,{icon:"wand-magic-sparkles",to:So.POSITION_SLOT_ASSIGN_VOLUNTEERS(o,s,e.slot.positionId,e.slot.id),children:n("affecter_des_me_30349")}),_&&(0,i.jsx)(Od,{icon:"pen",onClick:()=>{g(!0)},children:n("_diter_62574")}),_&&(0,i.jsx)(Od,{color:e.slot.assignedResources>0?"disabled":"red",icon:"trash-can",onClick:()=>{f(!0)},children:n("supprimer_43083")}),(0,i.jsx)(Od,{icon:"clock",onClick:async()=>{await c({eventId:s,checkIn:{strategy:me.CheckIn,positionsSlotsIds:[e.slot.id]}})},children:n("pointer_les_mem_50347")}),(0,i.jsx)(Od,{icon:"clock",onClick:async()=>{await c({eventId:s,checkIn:{strategy:me.CheckOut,positionsSlotsIds:[e.slot.id]}})},children:n("d_pointer_les_m_17150")})]})})]}),m&&(0,i.jsx)(zV,{event:e.event,slot:l.positionsSlotInputDefault(e.event.startAt,e.slot),onClose:()=>{g(!1)},onSuccess:async t=>{await d({eventId:s,positionId:e.slot.positionId,positionSlotId:e.slot.id,positionSlot:t}),e.reload()}}),p&&(0,i.jsx)(kk,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_48876")],text:n("suppression_de_73669",x),onClose:()=>{f(!1)},onDelete:async()=>{await u({eventId:s,positionId:e.slot.positionId,positionSlotId:e.slot.id}),e.reload()}})]})},tW=()=>{const{translate:e,params:{eventId:t,positionId:n}}=il(),[o,s,r]=Ec(""),[a,l]=ET("position.slots.date",Fo.c9.invalid("Invalid"),Qh),[d,c]=(0,F.useState)(0),[u,m]=ET("position.slots.sort",null),{data:g,isLoading:p,reload:f}=Vn("query PositionSlots(\n    $eventId: EventId!\n    $positionId: PositionId!\n    $name: String\n    $date: Date\n    $offset: Int\n    $sort: PositionsSlotsSort\n) {\n    event(id: $eventId) {\n        startAt\n        endAt\n\n        positionsSlots(\n            positionsIds: [$positionId]\n            name: $name\n            date: $date\n            limit: 25\n            offset: $offset\n            sort: $sort\n        ) {\n            nodes {\n                ...PositionPositionSlot\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{eventId:t,positionId:n,name:h(s)?s:void 0,date:a.isValid?a:void 0,offset:d,sort:u},[Ro.PositionPositionSlotFragment]);const{numberOfPages:x,totalCount:_}=lu(g.event?.positionsSlots),I=(0,F.useCallback)(e=>{m(e),c(0)},[m,c]);return(0,i.jsx)(kc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:o,onChange:r})}),(0,i.jsx)(fr,{width:200,children:(0,i.jsx)(_u,{max:g.event?.endAt,min:g.event?.startAt,value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tm,{attribute:rt.Name,setSort:I,sort:u,children:e("nom_du_cr_neau_54351")}),(0,i.jsx)(tm,{attribute:rt.Range,setSort:I,sort:u,children:e("cr_neau_11117")}),(0,i.jsx)(Tc,{children:e("remplissage_75916")}),(0,i.jsx)(Tc,{width:100})]}),numberOfPages:x,offset:d,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:g.event.positionsSlots.nodes.map(e=>(0,i.jsx)(eW,{event:g.event,reload:f,slot:e},e.id))}),setOffset:c,title:e("liste_des_cr_ne_86148"),totalCount:_})},nW=()=>{const{params:{organizationId:e,eventId:t,positionId:n},translate:o}=il(),{data:s,loader:r,reload:a}=ua({organizationId:e,eventId:t,positionId:n}),{mutate:l}=Jr(),{mutate:d}=ks(),{hasPositionPermission:c}=Uv(),u=c(db.EDIT_POSITION,{positionCategoryId:s.event?.position.positionCategoryId,positionId:n});return r||(0,i.jsxs)(yC,{children:[(0,i.jsxs)(Ea,{gap:"6",children:[(0,i.jsx)(qU,{category:s.event.position,title:o("remplissage_de_52564")}),(0,i.jsx)(ZU,{customFields:s.organization.customFields.nodes,position:s.event.position})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(tW,{}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(Ea,{gap:"6",children:[(0,i.jsxs)(Ea,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)($w,{defaultRoleType:pt.PositionReader,leaders:s.event.position.leaders,reload:a,rolesTypes:[pt.Custom,pt.PositionEditor,pt.PositionReader],onSave:e=>l({eventId:t,massLeaders:{leaders:e,selecteds:{ids:[n]},strategy:Je.Replace}})}),(0,i.jsx)(oF,{customFields:s.event.position.customFields}),(0,i.jsx)(ow,{modalSubtitle:o("ajouter_des_tag_64526"),reload:a,tags:s.event.position.tags,...u?{associateTags:e=>d({eventId:t,massEdit:{reset:!1,selecteds:{ids:[n]},slug:it.Tag,strategy:Je.Replace,value:e}})}:{}})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(QA,{description:s.event.position.description}),(0,i.jsx)(rF,{location:s.event.position}),(0,i.jsx)(ew,{privateNote:s.event.position.privateNote})]})]}),(0,i.jsx)(_r.qh,{path:So.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(QU,{})})]})},iW=e=>{const{params:{organizationId:t,eventId:n}}=il(),o=Nn(Eh),{isEventAdmin:s}=Uv(),[r,a]=ET("positionMembers.columns",[wh.Name,wh.Positions]),[l,d]=ET("positionMembers.limit",_c),[c,u]=ET("positionMembers.predicates",[]),[h,m]=ET("positionMembers.sort",null),{data:g}=Hs({organizationId:t,eventId:n,privacy:s?fe.All:fe.Public,loadForms:!1,loadSegments:!1}),p=(0,F.useMemo)(()=>g.organization?.customFields.nodes??[],[g.organization]),f=SC(p),x=(0,F.useMemo)(()=>g.event?o.getPositionMembersFilters(t,n,p,g.event):[],[n,p,g.event]),_=(0,F.useMemo)(()=>o.getPositionMembersPossibleColumns(p),[p]);return(0,i.jsx)(yC,{children:(0,i.jsx)(Zh,{columns:r,columnsSearch:[],columnsToIncludes:Sh,eventId:n,filters:x,getMassActionId:e=>e.userInfo.id,limit:l,loadDataList:Xs,loadDataListParams:{includeCanRegistrationStateUpdate:!s,includeIsEditable:!s,positionCategoryId:e.positionCategoryId,positionId:e.positionId,preassignedPositionCategoryId:e.preassignedPositionCategoryId,preassignedPositionId:e.preassignedPositionId},loadRow:Ks,loadRowParams:{includeCanRegistrationStateUpdate:!s,includeIsEditable:!s},organizationId:t,possibleColumns:_,predicates:c,renderActions:(e,t,n)=>(0,i.jsx)(RF,{massActions:e,predicates:null,showOnlyMassEdit:!0,totalNumberOfMembers:t,onMassEditSuccess:n}),rendering:yh.List,setColumns:a,setLimit:d,setPredicates:u,setSort:m,showEditColumns:s,showEditMode:s,showFilters:s,showMassActions:s,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,sort:h,children:(0,i.jsx)(cm,{renderCell:(e,t,o)=>(0,i.jsx)(My,{canAccredit:s,canAssign:s,canChangeDelegation:s,canClickMemberName:!0,column:e,customField:f.get(e.slug),eventId:n,reloadRow:o,row:t})})})})},oW=({position:e})=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=il(),{user:r}=Zn(),{hasPositionPermission:a}=Uv(),l=a(db.EDIT_POSITION,{positionCategoryId:e.positionCategoryId}),d=cU(),[c,u]=(0,F.useState)(!1);return(0,i.jsxs)(kC,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(yb,{returnPathFallback:ao.POSITIONS({organizationId:o,eventId:s})}),(0,i.jsxs)(fr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"medium",children:[e.name," ",h(e.acronym)?`(${e.acronym})`:""]}),(0,i.jsx)(pl,{color:"white",download:`${e.name}-position-sheet`,to:Zm(e.links.positionSheetLink,"pdf",{lang:r?.language}),children:n("t_l_charger_la_16259")}),(0,i.jsx)(ub,{positionsPermissions:[db.EDIT_POSITION],scope:{positionCategoryId:e.positionCategoryId,positionId:e.id},children:(0,i.jsx)(pl,{to:So.EDIT_POSITION(o,s,e.id),children:n("_diter_la_missi_90442")})}),(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[l&&(0,i.jsx)(Od,{icon:"clone",onClick:async()=>await d(e.id),children:n("dupliquer_28256")}),(0,i.jsx)(Od,{download:`${e.name}-position-planning`,icon:"arrow-down-to-bracket",target:"_blank",to:Zm(e.links.positionPlanningLink,"pdf",{lang:r?.language}),children:n("t_l_charger_le_06050")}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:async()=>u(!0),children:n("supprimer_43083")})]})]})]}),c&&(0,i.jsx)(uU,{position:e,onClose:()=>u(!1),onSuccess:()=>t.replace(ao.POSITIONS({organizationId:o,eventId:s}))})]})},sW=e=>{const{params:{organizationId:t,eventId:n,positionId:o},translate:s}=il();Cd(e.event.position.name);const r=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":n,positionId:e?":positionId":o});return(0,i.jsxs)(AC,{children:[(0,i.jsx)(oW,{position:e.event.position}),(0,i.jsxs)(Vy,{css:{flex:"1"},children:[(0,i.jsxs)(Ly,{css:{px:"$7"},children:[(0,i.jsx)(Ny,{path:ao.POSITION_DASHBOARD(r(!1)),children:s("tableau_de_bord_24627")}),(0,i.jsx)(Ny,{path:ao.POSITION_MEMBERS(r(!1)),children:s("membres_125561",e.event.volunteersRegistrations.totalCount)}),(0,i.jsx)(Ny,{path:ao.POSITION_PREASSIGNED_MEMBERS(r(!1)),children:s("membres_pr_aff_93093",e.event.position.preassignedResources)})]}),(0,i.jsx)(By,{path:[ao.POSITION_DASHBOARD(r(!0)),So.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId")],children:(0,i.jsx)(nW,{})}),(0,i.jsx)(By,{path:ao.POSITION_MEMBERS(r(!0)),children:(0,i.jsx)(iW,{positionId:o})}),(0,i.jsx)(By,{path:ao.POSITION_PREASSIGNED_MEMBERS(r(!0)),children:(0,i.jsx)(iW,{preassignedPositionId:o})})]})]})},rW=()=>{const{params:{organizationId:e,eventId:t,positionId:n}}=il(),{data:o,loader:s}=Vn("query Position($eventId: EventId!, $positionId: PositionId!) {\n    event(id: $eventId) {\n        position(id: $positionId) {\n            id\n            name\n            acronym\n            positionCategoryId\n            assignedResources\n            preassignedResources\n\n            links {\n                positionPlanningLink\n                positionSheetLink\n            }\n        }\n\n        volunteersRegistrations(positionId: $positionId) {\n            totalCount\n        }\n    }\n}\n",{eventId:t,positionId:n},[]);return s||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{exact:!0,path:ao.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(Yn,{path:ao.POSITION_DASHBOARD({organizationId:e,eventId:t,positionId:n}),replace:!0})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(sW,{event:o.event})})]})},aW=e=>{const t=Ln(),{mutate:n}=function(e={}){return Un("mutation PositionCategoryDescriptionUpdate(\n    $eventId: EventId!\n    $positionCategoryId: PositionsCategoryId!\n    $description: String!\n) {\n    positionCategoryDescriptionUpdate(\n        eventId: $eventId\n        positionCategoryId: $positionCategoryId\n        description: $description\n    ) {\n        id\n    }\n}\n",e)}();return(0,i.jsx)(gj,{buttonText:t("mettre_jour_l_18158"),icon:"text",initialValues:{positionCategory:{description:e.positionCategory.description}},size:"md",subtitle:t("la_description_98866"),title:t("ajouter_une_des_10769"),onClose:e.onClose,onSubmit:async t=>{await n({eventId:e.eventId,positionCategoryId:e.positionCategory.id,description:t.positionCategory?.description??""}),e.reload(),e.onClose()},children:(0,i.jsx)(fr,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(gv,{label:t("description_58935"),name:"positionCategory.description"})})})},lW=e=>{const t=Ln(),{hasPositionPermission:n}=Uv(),o=n(db.EDIT_POSITION,{positionCategoryId:e.category.id}),[s,r]=(0,F.useState)(!1),a=h(e.category.description);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(WA,{rightIcon:o?a?"pen":"plus":void 0,rightIconClick:()=>{r(!0)},title:t("description_58935"),children:a?(0,i.jsx)(ng,{text:e.category.description}):(0,i.jsx)(fr,{color:"gray500",textAlign:"center",width:1,children:t("aucune_descript_25737")})}),o&&s&&(0,i.jsx)(aW,{eventId:e.eventId,positionCategory:e.category,reload:e.reload,onClose:()=>{r(!1)}})]})},dW=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=il(),r=Nn(Ku),a=(0,F.useMemo)(()=>e.position.resources-e.position.assignedResources,[e.position]);return(0,i.jsxs)(Cc,{css:{cursor:"pointer"},onClick:()=>{t.push(ao.POSITION({organizationId:o,eventId:s,positionId:e.position.id}))},children:[(0,i.jsx)(xc,{children:(0,i.jsx)(fr,{font:"gray900 textSm medium",children:e.position.name})}),(0,i.jsx)(xc,{children:(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{font:"gray900 textSm medium",children:e.position.range?r.toLocaleString(e.position.range,void 0,{day:"numeric",month:"short",year:"numeric"}):"-"}),(0,i.jsx)(fr,{font:"gray500 textSm regular",children:n("creneau",e.position.numberOfSlots)})]})}),(0,i.jsx)(xc,{children:a>0?(0,i.jsx)(Gd,{color:"warning",children:n("_1_membre_manq_31014",a)}):(0,i.jsx)(Gd,{color:"success",children:n("complet_51600")})}),(0,i.jsx)(im,{justify:"end",children:(0,i.jsxs)(pm,{children:[(0,i.jsx)(Od,{icon:"eye",to:ao.POSITION({organizationId:o,eventId:s,positionId:e.position.id}),children:n("voir_la_mission_68087")}),(0,i.jsx)(Od,{icon:"pen",onClick:()=>{t.push(So.EDIT_POSITION(o,s,e.position.id))},children:n("_diter_la_missi_90442")})]})})]})},cW=()=>{const{translate:e,params:{eventId:t,positionCategoryId:n}}=il(),[o,s,r]=Ec(""),[a,l]=(0,F.useState)(Fo.c9.invalid("Invalid")),[d,c]=(0,F.useState)(0),{data:u,isLoading:m}=Vn("query PositionCategoryPositions(\n    $eventId: EventId!\n    $positionCategoryId: PositionsCategoryId!\n    $name: String\n    $date: Date\n    $offset: Int\n) {\n    event(id: $eventId) {\n        startAt\n        endAt\n\n        positions(\n            positionCategoriesIds: [$positionCategoryId]\n            name: $name\n            date: $date\n            limit: 25\n            offset: $offset\n        ) {\n            nodes {\n                ...PositionCategoryPosition\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{eventId:t,positionCategoryId:n,name:h(s)?s:void 0,date:a.isValid?a:void 0,offset:d},[Ro.PositionCategoryPositionFragment]);const{numberOfPages:g,totalCount:p}=lu(u.event?.positions);return(0,i.jsx)(kc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:o,onChange:r})}),(0,i.jsx)(fr,{width:200,children:(0,i.jsx)(_u,{max:u.event?.endAt,min:u.event?.startAt,value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:e("nom_de_la_missi_64605")}),(0,i.jsx)(Tc,{children:e("Date")}),(0,i.jsx)(Tc,{children:e("status_06428")})]}),numberOfPages:g,offset:d,rows:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:u.event.positions.nodes.map(e=>(0,i.jsx)(dW,{position:e},e.id))}),setOffset:c,title:e("liste_des_missi_40241"),totalCount:p})},uW=e=>{const{translate:t,params:{eventId:n,positionCategoryId:o}}=il(),s=Nn(Ku),{mutate:r}=function(e={}){return Un("mutation PositionsCategoriesMassLeadersEdit($eventId: EventId!, $massLeaders: MassLeadersInput!) {\n    positionsCategoriesMassLeadersAssign(eventId: $eventId, massLeaders: $massLeaders)\n}\n",e)}();return(0,i.jsx)(yC,{children:(0,i.jsxs)(Ea,{direction:"column",gap:"6",children:[(0,i.jsxs)(Ea,{gap:"6",width:1,children:[(0,i.jsx)(Aw,{iconColor:"primary",text:t("nombre_de_missi_56719"),value:e.positionCategory.numberOfPositions}),(0,i.jsx)(Aw,{iconColor:"primary",text:t("number_of_membe_24698"),value:e.positionCategory.assignedResources}),(0,i.jsx)(Aw,{iconColor:"primary",text:t("nombre_de_membr_74699"),value:e.positionCategory.preassignedResources}),(0,i.jsx)(Aw,{iconColor:"primary",text:t("Date"),value:e.positionCategory.range?s.toLocaleString(e.positionCategory.range,void 0,{day:"numeric",month:"short",year:"numeric"}):"-"})]}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsxs)(Ea,{direction:"column",gap:"6",width:470,children:[(0,i.jsx)($w,{defaultRoleType:pt.PositionReader,leaders:e.positionCategory.leaders,reload:e.reload,rolesTypes:[pt.Custom,pt.PositionEditor,pt.PositionReader],onSave:e=>r({eventId:n,massLeaders:{leaders:e,selecteds:{ids:[o]},strategy:Je.Replace}})}),(0,i.jsx)(lW,{category:e.positionCategory,eventId:n,reload:e.reload})]}),(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(cW,{})})]})]})})},hW=e=>{const t=Ln(),{mutate:n}=function(e={}){return Un("mutation PositionCategoryDelete($eventId: EventId!, $positionCategoryId: PositionsCategoryId!) {\n    positionCategoryDelete(eventId: $eventId, positionCategoryId: $positionCategoryId) {\n        id\n    }\n}\n",e)}();return(0,i.jsx)(kk,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_50954"),t("cela_supprimera_30946")],text:t("suppression_de_73669",e.positionCategory.name),onClose:e.onClose,onDelete:async()=>{await n({eventId:e.eventId,positionCategoryId:e.positionCategory.id}),e.onSuccess()}})},mW=({category:e,reload:t})=>{const{translate:n,history:o,params:{organizationId:s,eventId:r}}=il(),{isEventAdmin:a}=Uv(),{mutate:l}=function(e={}){return Un("mutation PositionCategoryDuplicate($eventId: EventId!, $positionCategoryId: PositionsCategoryId!) {\n    positionCategoryDuplicate(eventId: $eventId, positionCategoryId: $positionCategoryId) {\n        id\n    }\n}\n",e)}(),[d,c]=(0,F.useState)(!1),[u,h]=(0,F.useState)(!1);return(0,i.jsxs)(kC,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(yb,{returnPathFallback:ao.POSITIONS({organizationId:s,eventId:r})}),(0,i.jsx)(fr,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.name}),(0,i.jsxs)(ub,{positionsPermissions:[db.EDIT_POSITION],scope:{positionCategoryId:e.id},children:[(0,i.jsx)(pl,{color:"white",onClick:()=>h(!0),children:n("_diter_62574")}),(0,i.jsx)(pl,{onClick:()=>{o.push(So.CREATE_POSITION(s,r,e.id))},children:n("ajouter_une_mis_99800")})]}),a&&(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsx)(Od,{icon:"copy",onClick:async()=>{const{positionCategoryDuplicate:{id:t}}=await l({eventId:r,positionCategoryId:e.id});o.push(ao.POSITION_CATEGORY({organizationId:s,eventId:r,positionCategoryId:t}))},children:n("dupliquer_28256")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{c(!0)},children:n("supprimer_43083")})]})]}),u&&(0,i.jsx)(SV,{eventId:r,positionCategoryId:e.id,positionCategoryName:e.name,onClose:()=>{h(!1)},onSuccess:t}),d&&(0,i.jsx)(hW,{eventId:r,positionCategory:e,onClose:()=>{c(!1)},onSuccess:()=>{o.replace(ao.POSITIONS({organizationId:s,eventId:r}))}})]})},gW=({event:e,reload:t})=>{const{translate:n,params:{organizationId:o,eventId:s,positionCategoryId:r}}=il(),a=Hn(),{updateLocalEvent:l}=Uv();Cd(e.positionCategory.name),(0,F.useEffect)(()=>{l({positionBackPath:a.pathname})},[]);const d=e=>({organizationId:e?":organizationId":o,eventId:e?":eventId":s,positionCategoryId:e?":positionCategoryId":r});return(0,i.jsxs)(AC,{children:[(0,i.jsx)(mW,{category:e.positionCategory,reload:t}),(0,i.jsxs)(Vy,{css:{flex:"1"},children:[(0,i.jsxs)(Ly,{css:{px:"$7"},children:[(0,i.jsx)(Ny,{path:ao.POSITION_CATEGORY_DASHBOARD(d(!1)),children:n("tableau_de_bord_24627")}),(0,i.jsx)(Ny,{path:ao.POSITION_CATEGORY_MEMBERS(d(!1)),children:n("membres_125561",e.volunteersRegistrations.totalCount)}),(0,i.jsx)(Ny,{path:ao.POSITION_CATEGORY_PREASSIGNED_MEMBERS(d(!1)),children:n("membres_pr_aff_93093",e.positionCategory.preassignedResources)})]}),(0,i.jsx)(By,{path:ao.POSITION_CATEGORY_DASHBOARD(d(!0)),children:(0,i.jsx)(uW,{positionCategory:e.positionCategory,reload:t})}),(0,i.jsx)(By,{path:ao.POSITION_CATEGORY_MEMBERS(d(!0)),children:(0,i.jsx)(iW,{positionCategoryId:r})}),(0,i.jsx)(By,{path:ao.POSITION_CATEGORY_PREASSIGNED_MEMBERS(d(!0)),children:(0,i.jsx)(iW,{preassignedPositionCategoryId:r})})]})]})},pW=()=>{const{params:{organizationId:e,eventId:t,positionCategoryId:n}}=il(),{data:o,loader:s,reload:r}=Vn("query PositionCategory($eventId: EventId!, $positionCategoryId: PositionsCategoryId!) {\n    event(id: $eventId) {\n        positionCategory(id: $positionCategoryId) {\n            id\n            name\n            description\n            assignedResources\n            preassignedResources\n            numberOfPositions\n            resources\n            range\n\n            leaders {\n                ...LeaderInfos\n            }\n        }\n\n        volunteersRegistrations(positionCategoryId: $positionCategoryId) {\n            totalCount\n        }\n    }\n}\n",{eventId:t,positionCategoryId:n},[Ro.LeaderInfosFragment]);return s||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{exact:!0,path:ao.POSITION_CATEGORY({organizationId:":organizationId",eventId:":eventId",positionCategoryId:":positionCategoryId"}),children:(0,i.jsx)(Yn,{path:ao.POSITION_CATEGORY_DASHBOARD({organizationId:e,eventId:t,positionCategoryId:n}),replace:!0})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(gW,{event:o.event,reload:r})})]})},fW=e=>(0,i.jsx)(bm,{category:e.popup.category,fallbackClosePath:e.closePath,title:e.popup.title,children:(0,i.jsxs)(Ea,{css:{overflow:"hidden"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ea,{css:{background:"$gray50",flex:"1",overflow:"auto",py:"$9"},justify:"center",children:(0,i.jsx)(Ea,{css:{height:"fit-content",overflow:"hidden"},direction:"column",width:1170,children:e.children})}),(0,i.jsx)(Ea,{align:"center",css:{boxShadow:"0px -4px 8px -2px rgba(16, 24, 40, 0.1), 0px -2px 4px -2px rgba(16, 24, 40, 0.06)"},height:72,justify:"center",width:1,children:e.button})]})}),xW=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,positionId:s,positionSlotId:r}}=il(),a=Nn($c),[l,d]=ET("positionsSlotsAssignVolunteers.filterAvailabilities",!0),[c,u]=ET("positionsSlotsAssignVolunteers.filterPositions",!1),[m,g]=ET("positionsSlotsAssignVolunteers.applyConditions",!0),[p,f]=(0,F.useState)(null),{data:x,isLoading:_}=Vn("query AvailableVolunteersRegistrations(\n    $eventId: EventId!\n    $positionSlotId: PositionsSlotId!\n    $filterAvailabilities: Boolean!\n    $filterPositions: Boolean!\n    $applyConditions: Boolean!\n    $sort: VolunteersRegistrationsSort\n) {\n    event(id: $eventId) {\n        positionSlot(id: $positionSlotId) {\n            positionName\n            positionCategoryId\n            nameOrRange\n\n            availableVolunteersRegistrations(\n                filterAvailabilities: $filterAvailabilities\n                filterPositions: $filterPositions\n                applyConditions: $applyConditions\n                sort: $sort\n            ) {\n                id\n                positionsCategoriesIds\n                positionsSlotsIds\n                positionsIds\n                numberOfAssignments\n                isAssignedTo(positionSlotId: $positionSlotId)\n                insertedAt\n\n                userInfo {\n                    id\n                    email\n                    name\n                    picture {\n                        url\n                    }\n                }\n            }\n        }\n    }\n}\n",{eventId:o,positionSlotId:r,filterAvailabilities:l,filterPositions:c,applyConditions:m,sort:p},[]),{mutate:I,isLoading:v}=Us(),[b,j]=(0,F.useState)(""),C=(0,F.useMemo)(()=>{const e=x.event?.positionSlot.availableVolunteersRegistrations??[];return h(b)?e.filter(e=>e.userInfo.name.toLowerCase().includes(b.toLowerCase())||e.userInfo.email.includes(b.toLowerCase())):e},[x.event,b]),{numberOfSelected:y,selectAllState:k,states:A,setStates:w,toggleRow:S,toggleSelectAll:E}=au({}),T=(0,F.useMemo)(()=>(m?1:0)+(l?1:0)+(c?1:0),[m,l,c]);return(0,F.useEffect)(()=>{w(Object.fromEntries((x.event?.positionSlot.availableVolunteersRegistrations??[]).map(e=>[`ui${e.userInfo.id}`,{id:e.userInfo.id,state:e.isAssignedTo?"checked":"unchecked"}])))},[x.event]),(0,i.jsx)(fW,{button:(0,i.jsx)(pl,{isLoading:v,to:ao.POSITION({organizationId:n,eventId:o,positionId:s}),onClick:async()=>{const e=(x.event?.positionSlot.availableVolunteersRegistrations??[]).flatMap(e=>e.isAssignedTo?[e.userInfo.id]:[]),t=Object.values(A).filter(({state:e})=>"checked"===e).map(({id:e})=>e),n=(0,Jd.A)(t,e),i=(0,Jd.A)(e,t);Zo(n)&&await I({eventId:o,massAssign:{positionsSlotsIds:[r],selecteds:{ids:n},strategy:Je.Add}}),Zo(i)&&await I({eventId:o,massAssign:{positionsSlotsIds:[r],selecteds:{ids:i},strategy:Je.Delete}})},children:0===y?t("ne_pas_affecter_05756"):t("affecter_1_me_46721",y)}),closePath:ao.POSITION({organizationId:n,eventId:o,positionId:s}),popup:{category:t("affectation_u_96975",x.event?.positionSlot.positionName??""),title:x.event?.positionSlot.nameOrRange??""},children:(0,i.jsx)(kc,{filters:(0,i.jsxs)(Ea,{gap:"3",children:[(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),value:b,onChange:j})}),(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"gray",leftIcon:"sliders",children:t("filtres_1_41774",T)})}),(0,i.jsx)(Pd,{css:{padding:"0"},placement:"bottom-end",children:(0,i.jsxs)(Ea,{css:{padding:"$4 $6"},direction:"column",width:440,children:[(0,i.jsx)(fr,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("disponibilit_s_49923")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(sc,{state:l?"unchecked":"checked",onClick:e=>{d("checked"!==e)},children:t("afficher_tous_l_44338")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:l?"checked":"unchecked",onClick:e=>{d("checked"===e)},children:t("filtrer_selon_l_35857")}),(0,i.jsx)($u,{height:"4"}),(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("missions_63972")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(sc,{state:c?"unchecked":"checked",onClick:e=>{u("checked"!==e)},children:t("afficher_tous_l_44338")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:c?"checked":"unchecked",onClick:e=>{u("checked"===e)},children:t("filtrer_selon_l_42798")}),(0,i.jsx)($u,{height:"4"}),(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("conditions_77756")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(sc,{state:m?"unchecked":"checked",onClick:e=>{g("checked"!==e)},children:t("afficher_tous_l_44338")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:m?"checked":"unchecked",onClick:e=>{g("checked"===e)},children:t("filtrer_selon_l_59697")})]})})]})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(tc,{state:k,onClick:E})}),(0,i.jsx)(tm,{attribute:zt.Name,css:{paddingLeft:"$2",flexGrow:2},setSort:f,sort:p,children:t("nom_du_membre_69353")}),(0,i.jsx)(Tc,{children:t("nombre_d_affect_31455")}),(0,i.jsx)(tm,{attribute:zt.InsertedAt,setSort:f,sort:p,children:t("date_d_inscript_31369")})]}),limit:C.length,numberOfPages:1,offset:0,rows:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):C.map(t=>(0,i.jsxs)(Cc,{css:{cursor:"pointer",userSelect:"none"},onClick:()=>{e.push(So.POSITION_SLOT_ASSIGN_VOLUNTEERS_USER_INFORMATIONS(n,o,s,r,t.userInfo.id))},children:[(0,i.jsx)(xc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(tc,{state:A[`ui${t.userInfo.id}`]?.state??"unchecked",onClick:(e,n)=>{Il(n),S(`ui${t.userInfo.id}`,e)}})}),(0,i.jsx)(xc,{css:{paddingLeft:"$2",flexGrow:2},children:(0,i.jsx)(Eb,{userInfo:t.userInfo})}),(0,i.jsx)(xc,{children:t.numberOfAssignments}),(0,i.jsx)(xc,{children:a.toLocaleString(t.insertedAt.toLocal(),Ho.DateTime)})]},t.id)),setOffset:Bl.A,title:t("liste_des_membr_42505"),totalCount:C.length})})},_W=e=>{const{params:{organizationId:t,eventId:n,userInfoId:o},translate:s}=il(),r=e.userInfo.volunteerRegistration?.delegation;return(0,i.jsx)(Pz,{forms:e.forms,getTabPath:e=>So.EDIT_USER_ACCREDITATIONS_FORM(t,n,o,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:So.VOLUNTEERS(t,n),title:s("mise_jour_des_60902",e.userInfo.nameOrEmail),children:e.forms.map((s,a)=>(0,i.jsxs)(By,{path:So.EDIT_USER_ACCREDITATIONS_FORM(t,n,o,s.id),children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(BE,{accreditationsSlotsIds:e.values.userInfo.accreditations[a].accreditationsSlotsIds,change:e.change,delegationAccreditations:r?.formId===s.id?r.accreditationsSlots:[],displayFormCustomFields:!1,event:e.event,options:{...s,showFullAccreditation:!0,slotDisplay:gt.Hide,accreditationFilter:mt.None},prefix:`userInfo.accreditations[${a}].`,showAutoAccredit:!1,slots:[],userInfosFields:e.userInfo.fields})]},s.id))})},IW=e=>{const{history:t,params:{organizationId:n,eventId:o,userInfoId:s}}=il(),r=Nn(zE),{mutate:a,isLoading:l}=function(e={}){return Un("mutation UserInfoAccreditationsUpdate(\n    $eventId: EventId!\n    $userId: UserId\n    $delegationId: DelegationId\n    $userInfoId: UsersInfoId!\n    $userInfoAccreditations: [UserInfoAccreditationsInput!]!\n) {\n    userInfoAccreditationsUpdate(\n        eventId: $eventId\n        userId: $userId\n        delegationId: $delegationId\n        userInfoId: $userInfoId\n        userInfoAccreditations: $userInfoAccreditations\n    )\n}\n",e)}(),d=(0,F.useMemo)(()=>e.forms.map(t=>{const n=e.userInfo.formsUsersInfos.find(e=>e.formId===t.id);return{formId:t.id,...r.volunteersRegistrationsWishedAccreditationsUpdateInputDefault(n)}}),[e.forms,e.userInfo.formsUsersInfos]);return(0,i.jsx)(dl,{direction:"column",height:1,initialValues:{userInfo:{accreditations:d}},render:({form:t,handleSubmit:n,values:o})=>(0,i.jsx)(_W,{change:t.change,event:e.event,forms:e.forms,handleSubmit:n,isLoading:l,userInfo:e.userInfo,values:o}),width:1,onSubmit:async e=>{await a({eventId:o,userInfoId:s,userInfoAccreditations:e.userInfo.accreditations}),t.goBack(So.VOLUNTEERS(n,o))}})},vW=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Wn(),{data:o,loader:s}=Vn("query UserUpdateAccreditationsInfos(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $userInfoId: UsersInfoId!\n    $loadDelegation: Boolean!\n) {\n    organization(id: $organizationId) {\n        userInfo(id: $userInfoId) {\n            ...MemberRegistrationUserInfo\n            ...FormsUsersInfosWished\n\n            volunteerRegistration(eventId: $eventId) @include(if: $loadDelegation) {\n                delegation {\n                    formId\n\n                    accreditationsSlots {\n                        ...DelegationAccreditationSlot\n                    }\n                }\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        forms {\n            nodes {\n                ...FormMemberRegistration\n            }\n        }\n\n        accreditationsCategories {\n            ...FormRegisterAccreditationCategory\n        }\n    }\n}\n",{organizationId:e,eventId:t,userInfoId:n,loadDelegation:!0},[Ro.MemberRegistrationUserInfoFragment,Ro.FormsUsersInfosWishedFragment,Ro.DelegationAccreditationSlotFragment,Ro.FormMemberRegistrationFragment,Ro.FormRegisterAccreditationCategoryFragment]),r=(0,F.useMemo)(()=>{if(o.organization&&o.event){const e=o.organization.userInfo.volunteerRegistration;return o.event.forms.nodes.filter(t=>t.accreditationDisplay!==ct.None||e.delegation?.formId===t.id&&Zo(e.delegation.accreditationsSlots))}return[]},[o.organization,o.event]);return s||(Zo(r)?(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.EDIT_USER_ACCREDITATIONS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(IW,{event:o.event,forms:r,userInfo:o.organization.userInfo})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.EDIT_USER_ACCREDITATIONS_FORM(e,t,n,r[0].id),replace:!0})})]}):(0,i.jsx)(Yn,{}))},bW=e=>{const{params:{organizationId:t,eventId:n,userInfoId:o},translate:s}=il();return(0,i.jsx)(Pz,{forms:e.forms,getTabPath:e=>So.EDIT_USER_MISSIONS_FORM(t,n,o,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:So.VOLUNTEERS(t,n),title:s("mise_jour_des_02859",e.userInfo.nameOrEmail),children:e.forms.map((s,r)=>(0,i.jsxs)(By,{path:So.EDIT_USER_MISSIONS_FORM(t,n,o,s.id),children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(tT,{change:e.change,event:e.event,options:{...s,showFullPosition:!0,slotDisplay:gt.Hide,positionFilter:mt.None},positionsCategoriesIds:e.values.userInfo.missions[r].positionsCategoriesIds,positionsIds:e.values.userInfo.missions[r].positionsIds,positionsSlotsIds:e.values.userInfo.missions[r].positionsSlotsIds,prefix:`userInfo.missions[${r}].`,slots:[],userInfoFields:e.userInfo.fields})]},s.id))})},jW=e=>{const{history:t,params:{organizationId:n,eventId:o,userInfoId:s}}=il(),r=Nn(zE),{mutate:a,isLoading:l}=function(e={}){return Un("mutation UserInfoPositionsUpdate(\n    $eventId: EventId!\n    $userId: UserId\n    $delegationId: DelegationId\n    $userInfoId: UsersInfoId!\n    $userInfoPositions: [UserInfoPositionsInput!]!\n) {\n    userInfoPositionsUpdate(\n        eventId: $eventId\n        userId: $userId\n        delegationId: $delegationId\n        userInfoId: $userInfoId\n        userInfoPositions: $userInfoPositions\n    )\n}\n",e)}(),d=(0,F.useMemo)(()=>e.forms.map(t=>{const n=e.userInfo.formsUsersInfos.find(e=>e.formId===t.id);return{formId:t.id,...r.volunteersRegistrationsWishedPositionsUpdateInputDefault(n)}}),[e.forms,e.userInfo.formsUsersInfos]);return(0,i.jsx)(dl,{direction:"column",height:1,initialValues:{userInfo:{missions:d}},render:({form:t,handleSubmit:n,values:o})=>(0,i.jsx)(bW,{change:t.change,event:e.event,forms:e.forms,handleSubmit:n,isLoading:l,userInfo:e.userInfo,values:o}),width:1,onSubmit:async e=>{await a({eventId:o,userInfoId:s,userInfoPositions:e.userInfo.missions}),t.goBack(So.VOLUNTEERS(n,o))}})},CW=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Wn(),{data:o,loader:s}=Vn("query UserUpdateMissionsInfos(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $userInfoId: UsersInfoId!\n) {\n    organization(id: $organizationId) {\n        userInfo(id: $userInfoId) {\n            ...MemberRegistrationUserInfo\n\n            ...FormsUsersInfosWished\n        }\n    }\n\n    event(id: $eventId) {\n        forms {\n            nodes {\n                ...FormMemberRegistration\n            }\n        }\n\n        positionsCategories {\n            ...FormRegisterCategory\n        }\n    }\n}\n",{organizationId:e,eventId:t,userInfoId:n},[Ro.MemberRegistrationUserInfoFragment,Ro.FormsUsersInfosWishedFragment,Ro.FormMemberRegistrationFragment,Ro.FormRegisterCategoryFragment]),r=(0,F.useMemo)(()=>(o.event?.forms.nodes??[]).filter(e=>e.positionDisplay!==ht.None),[o.event]);return s||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.EDIT_USER_MISSIONS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(jW,{event:o.event,forms:r,userInfo:o.organization.userInfo})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.EDIT_USER_MISSIONS_FORM(e,t,n,r[0].id),replace:!0})})]})},yW=e=>{const{translate:t,params:{organizationId:n,eventId:o,userInfoId:s}}=il();return(0,i.jsx)(Pz,{forms:e.forms,getTabPath:e=>So.EDIT_USER_SLOTS_FORM(n,o,s,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:So.VOLUNTEERS(n,o),title:t("mise_jour_des_28904",e.userInfo.nameOrEmail),children:e.forms.map((t,r)=>(0,i.jsxs)(By,{path:So.EDIT_USER_SLOTS_FORM(n,o,s,t.id),children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(hT,{change:e.change,currentSlots:e.values.userInfo.slots[r].slots,customSlotsPeriods:t.customSlotsPeriods,daysDisplay:t.daysDisplay,event:e.event,prefix:`userInfo.slots[${r}].`,slotDisplay:t.slotDisplay})]},t.id))})},kW=e=>{const{history:t,params:{organizationId:n,eventId:o,userInfoId:s}}=il(),r=Nn(zE),{mutate:a,isLoading:l}=function(e={}){return Un("mutation UserInfoSlotsUpdate(\n    $eventId: EventId!\n    $userId: UserId\n    $delegationId: DelegationId\n    $userInfoId: UsersInfoId!\n    $userInfoSlots: [UserInfoSlotsInput!]!\n) {\n    userInfoSlotsUpdate(\n        eventId: $eventId\n        userId: $userId\n        delegationId: $delegationId\n        userInfoId: $userInfoId\n        userInfoSlots: $userInfoSlots\n    )\n}\n",e)}(),d=(0,F.useMemo)(()=>e.forms.map(t=>{const n=e.userInfo.formsUsersInfos.find(e=>e.formId===t.id);return{formId:t.id,slots:r.volunteersRegistrationsSlotsUpdateInputDefault(n?.slots)}}),[e.forms,e.userInfo]);return(0,i.jsx)(dl,{direction:"column",height:1,initialValues:{userInfo:{slots:d}},render:({form:t,handleSubmit:n,values:o})=>(0,i.jsx)(yW,{change:t.change,event:e.event,forms:e.forms,handleSubmit:n,isLoading:l,userInfo:e.userInfo,values:o}),width:1,onSubmit:async e=>{await a({eventId:o,userInfoId:s,userInfoSlots:e.userInfo.slots}),t.goBack(So.VOLUNTEERS(n,o))}})},AW=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Wn(),{data:o,loader:s}=Vn("query UserUpdateSlotsInfos(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $userInfoId: UsersInfoId!\n) {\n    organization(id: $organizationId) {\n        userInfo(id: $userInfoId) {\n            ...MemberRegistrationUserInfo\n\n            ...FormsUsersInfosWished\n        }\n    }\n\n    event(id: $eventId) {\n        startAt\n        endAt\n        ranges\n\n        forms {\n            nodes {\n                ...FormMemberRegistration\n            }\n        }\n    }\n}\n",{organizationId:e,eventId:t,userInfoId:n},[Ro.MemberRegistrationUserInfoFragment,Ro.FormsUsersInfosWishedFragment,Ro.FormMemberRegistrationFragment]),r=(0,F.useMemo)(()=>(o.event?.forms.nodes??[]).filter(e=>e.slotDisplay!==gt.Hide),[o.organization,o.event]),{permissions:[a],isLoading:l}=wy(jy({eventId:t,userInfoId:n})),d=Gn();return l||a||d.push(So.DASHBOARD(e,t)),s||l?s:(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.EDIT_USER_SLOTS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(kW,{event:o.event,forms:r,userInfo:o.organization.userInfo})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.EDIT_USER_SLOTS_FORM(e,t,n,r[0].id),replace:!0})})]})},wW=()=>{const{params:{eventId:e}}=il(),{columns:t,columnsSearch:n,infos:o,isEditMode:s,limit:r,nameDebounced:a,offset:l,predicates:d,rendering:c,setInfos:u,setLimit:m,setOffset:g}=zC(),p=(0,F.useMemo)(()=>({...Sh(t,c),includeCanRegistrationStateUpdate:!1,includeIsEditable:!1}),[t,c]),{mutate:f}=ps(),{data:x,isLoading:_}=Vn("query VolunteersAccreditationsMatrix($eventId: EventId!) {\n    event(id: $eventId) {\n        accreditationsSlots(includeHidden: true) {\n            nodes {\n                ...AccreditationSlotMatrix\n            }\n        }\n    }\n}\n",{eventId:e},[Ro.AccreditationSlotMatrixFragment]),{data:I,isLoading:v}=Zs({...p,eventId:e,predicates:d,name:h(a)?a:null,columnsSearch:Zo(n)?n:void 0,limit:r,offset:l}),{numberOfPages:b,totalCount:j}=lu(I.data?.rows),[C,y]=(0,F.useState)([]),[k,A]=(0,F.useState)({}),w=(0,F.useMemo)(()=>o.volunteersMatrixSelectedSlotsIds||[],[o]),S=(0,F.useCallback)(e=>u({...o,volunteersMatrixSelectedSlotsIds:e}),[o,u]),E=(0,F.useCallback)(async t=>{A(e=>({...e,[t]:!0}));const{data:{row:n}}=await Ks({...p,eventId:e,id:t},await H());y(e=>e.map(e=>e.id===t?n:e)),A(e=>({...e,[t]:!1}))},[p,A,y]),T=(0,F.useCallback)(e=>k[e]??!1,[k]),z=(0,F.useCallback)((t,n)=>f({eventId:e,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[t]},strategy:Je.Add}}),[e,f]),$=(0,F.useCallback)((t,n)=>f({eventId:e,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[t]},strategy:Je.Delete}}),[e,f]);return(0,F.useEffect)(()=>{y(I.data?.rows.nodes??[])},[I.data]),(0,i.jsx)(dA,{addAccreditationSlot:z,allAccreditationsSlots:x.event?.accreditationsSlots.nodes??[],deleteAccreditationSlot:$,editMode:"assigned",isEditMode:s,isLoading:v||_,isRowLoading:T,limit:r,members:C,numberOfPages:b,offset:l,reloadRow:E,selectedSlotsIds:w,setLimit:m,setOffset:g,setSelectedSlotsIds:S,totalCount:j})},SW=({eventId:e,organizationId:t,reload:n,reloadRow:o,volunteerRegistration:s})=>{const{history:r,translate:a}=il(),{hasFeature:l}=nI(),{isEventAdmin:d}=Uv(),{showNotification:c}=Yv(),u=s.state,h=s.accreditationState,{mutate:m}=function(e={}){return Un("mutation VolunteerRegistrationDuplicate(\n    $eventId: EventId!\n    $volunteerRegistrationId: VolunteersRegistrationId!\n) {\n    volunteerRegistrationDuplicate(\n        eventId: $eventId\n        volunteerRegistrationId: $volunteerRegistrationId\n    ) {\n        id\n    }\n}\n",e)}(),{mutate:g,isLoading:p}=Gs(),{mutate:f,isLoading:x}=Vs(),{mutate:_}=Es(),{mutate:I}=Rs(),v=u!==Et.WaitingAssignment,b=u!==Et.Refused,j=u===Et.WaitingAssignment||u===Et.Assigned,C=u===Et.Assigned,y=u===Et.PreAssigned,k=u===Et.WaitingAssignment,A=h!==ae.WaitingAccreditation,w=h!==ae.Refused,S=h===ae.WaitingAccreditation||h===ae.Accredited||h===ae.AutoAccredited,E=h===ae.Accredited||h===ae.AutoAccredited,T=h===ae.WaitingAccreditation,[z,$]=(0,F.useState)(!1),[O,R]=(0,F.useState)(!1),P=l(Fe.Delegation)&&s.delegation,D=d,M=d&&s.canDelete,N=P||D||M;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(pm,{children:[v&&(0,i.jsx)(Od,{icon:"arrow-right-arrow-left",onClick:async()=>{p||(await g({eventId:e,massStateUpdate:{selecteds:{ids:[s.userInfo.id]},state:Et.WaitingAssignment}}),o())},children:a("changer_le_stat_90266")}),b&&(0,i.jsx)(Od,{icon:"arrow-right-arrow-left",onClick:async()=>{p||(await g({eventId:e,massStateUpdate:{selecteds:{ids:[s.userInfo.id]},state:Et.Refused}}),o())},children:a("changer_le_stat_68392")}),j&&(0,i.jsx)(Od,{icon:"arrow-right-arrow-left",onClick:async()=>{p||(await g({eventId:e,massStateUpdate:{selecteds:{ids:[s.userInfo.id]},state:Et.NotApplicable}}),o())},children:a("changer_le_stat_62507")}),C&&(0,i.jsx)(Od,{icon:"pen",onClick:()=>{p||r.push(So.EDIT_ASSIGNMENT(t,e,s.userInfo.id))},children:a("_diter_les_affe_42283")}),y&&(0,i.jsx)(Od,{icon:"pen",onClick:()=>{p||r.push(So.PRE_ASSIGNMENT(t,e,s.userInfo.id))},children:a("_diter_les_pr_10213")}),k&&(0,i.jsx)(Od,{icon:"wand-magic-sparkles",onClick:()=>{p||r.push(So.ASSIGNMENT(t,e,s.userInfo.id))},children:a("affecter_94255")}),l(Fe.Accreditation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),A&&(0,i.jsx)(Od,{icon:"arrow-right-arrow-left",onClick:async()=>{x||(await f({eventId:e,massStateUpdate:{selecteds:{ids:[s.userInfo.id]},state:ae.WaitingAccreditation}}),o())},children:a("change_le_statu_93385")}),w&&(0,i.jsx)(Od,{icon:"arrow-right-arrow-left",onClick:async()=>{x||(await f({eventId:e,massStateUpdate:{selecteds:{ids:[s.userInfo.id]},state:ae.Refused}}),o())},children:a("changer_le_stat_68392")}),S&&(0,i.jsx)(Od,{icon:"arrow-right-arrow-left",onClick:async()=>{x||(await f({eventId:e,massStateUpdate:{selecteds:{ids:[s.userInfo.id]},state:ae.NotApplicable}}),o())},children:a("changer_le_stat_62507")}),E&&(0,i.jsx)(Od,{icon:"pen",onClick:()=>{x||r.push(So.EDIT_ACCREDIT(t,e,s.userInfo.id))},children:a("_diter_les_accr_86042")}),T&&(0,i.jsx)(Od,{icon:"badge-check",onClick:()=>{x||r.push(So.ACCREDIT(t,e,s.userInfo.id))},children:a("accr_diter_70543")})]}),N&&(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),D&&(0,i.jsx)(Od,{icon:"clone",onClick:async()=>{await m({eventId:e,volunteerRegistrationId:s.id}),n()},children:a("dupliquer_28256")}),P&&(0,i.jsx)(Od,{color:"red",icon:"minus",onClick:()=>{$(!0)},children:a("retirer_de_la_d_64963")}),M&&(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{R(!0)},children:a("d_sinscrire_de_06416")})]}),P&&z&&(0,i.jsx)(kk,{buttonText:a("retirer_de_la_d_64963"),subtext:[a("_tes_vous_sur_d_34901",s.delegation.name)],text:a("suppression_de_73669",s.userInfo.name),onClose:()=>{$(!1)},onDelete:async()=>{await _({organizationId:t,eventId:e,delegationId:s.delegation.id,selecteds:{ids:[s.userInfo.id]}}),c(a("_1_a_t_retir_36729",s.userInfo.name,s.delegation.name)),o()}}),d&&O&&(0,i.jsx)(kk,{buttonText:a("d_sinscrire_de_06416"),subtext:[a("_tes_vous_sur_d_79932")],text:a("suppression_de_73669",s.userInfo.name),onClose:()=>{R(!1)},onDelete:async()=>{await I({eventId:e,selecteds:{ids:[s.userInfo.id]}}),c(a("_1_a_t_d_sin_66177",s.userInfo.name)),n()}})]})},EW=({columns:e,customFields:t,eventId:n,organizationId:o,reload:s,reloadVolunteer:r,segmentId:a,state:l,toggleRow:d,volunteerRegistration:c})=>{const{translate:u}=il(),{isEventAdmin:h,hasPositionPermission:m}=Uv(),g=SC(t),p=(0,F.useCallback)(()=>{r(c.id)},[c,r]),f=(0,F.useMemo)(()=>h||m(db.EDIT_MEMBER),[h,m]),x=c.userInfo,_=So.VOLUNTEERS_LIST_USER_PANEL_ACCREDITATIONS(o,n,a,x.id),I=So.VOLUNTEERS_LIST_USER_PANEL_AVAILABILITIES(o,n,a,x.id),v=So.VOLUNTEERS_LIST_USER_PANEL_POSITIONS(o,n,a,x.id),b=(c.teams||[]).map(e=>So.VOLUNTEERS_LIST_USER_PANEL_TEAM(o,n,a,x.id,e.teamCode));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Cc,{css:{background:"checked"===l?"$primary100":"white","&:hover":{background:"checked"===l?"$primary100":"$gray100"}},onMouseLeave:e=>wd(e.target),children:[h&&(0,i.jsx)(xc,{justify:"center",width:48,children:(0,i.jsx)(tc,{state:l,onClick:(e,t)=>{Il(t),d(`ui${x.id}`,e)}})}),e.map(e=>{const t=g.get(e.slug);return(0,i.jsx)(My,{accreditationsPanelPath:_,availabilitiesPanelPath:I,canAccredit:h,canAssign:h,canChangeDelegation:h,canClickMemberName:!0,column:e,customField:t,eventId:n,positionsPanelPath:v,reloadRow:p,row:c},e.slug)}),f&&(0,i.jsxs)(im,{justify:"center",children:[(x.isEditable??!0)&&(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"pen",to:So.EDIT_USER(o,n,c.userInfo.id)})})}),(0,i.jsx)(am,{placement:"top",children:u("_diter_62574")})]}),h&&(0,i.jsx)(SW,{eventId:n,organizationId:o,reload:s,reloadRow:p,volunteerRegistration:c})]})]}),(0,i.jsx)(Ck,{accreditationsPanelPath:_,availabilitiesPanelPath:I,canAccredit:h,canCheckIn:(e,t)=>m(db.READ_POSITION,{positionCategoryId:e,positionId:t}),canDeletePosition:(e,t)=>m(db.ASSIGN_MEMBER,{positionCategoryId:e,positionId:t}),canEditWishedAccreditations:!1,defaultHiddenAccreditationsSlotsIds:[],eventId:n,organizationId:o,positionsPanelPath:v,reloadRow:p,returnPathFallback:So.VOLUNTEERS(o,n),teamsPanelsPath:b,volunteerRegistration:c})]})},TW=(0,F.memo)(function(e){const{params:{organizationId:t,eventId:n,segmentId:o}}=il(),{isEventAdmin:s,hasPositionPermission:r}=Uv(),{columns:a,columnsSearch:l,limit:d,massActions:c,nameDebounced:u,offset:m,possibleColumns:g,predicates:p,reloadKey:f,rendering:x,setLimit:_,setOffset:I,setSort:v,sort:b}=zC(),j=(0,F.useMemo)(()=>({...Sh(a,x,{includeWeezeventUrls:!0}),includeCanRegistrationStateUpdate:!s,includeIsEditable:!s}),[a,x]),{data:C,isLoading:y,reload:k}=Zs({...j,eventId:n,predicates:p,name:h(u)?u:null,columnsSearch:Zo(l)?l:null,limit:d,offset:m,sort:b}),{numberOfPages:A,totalCount:w}=lu(C.data?.rows);(0,F.useEffect)(()=>{f>1&&k()},[f]);const S=(0,F.useMemo)(()=>a.flatMap(e=>(0,Da.A)([g.find(t=>t.slug===e)])),[g,a]),[E,T]=(0,F.useState)([]),[z,$]=(0,F.useState)({}),O=(0,F.useCallback)(async e=>{$(t=>({...t,[e]:!0}));const{data:{row:t}}=await Ks({...j,eventId:n,id:e},await H());T(n=>n.map(n=>n.id===e?t:n)),$(t=>({...t,[e]:!1}))},[j,$,T]),R=(0,F.useMemo)(()=>s||r(db.EDIT_MEMBER),[s,r]);return(0,F.useEffect)(()=>{T(C.data?.rows.nodes??[])},[C.data]),(0,F.useEffect)(()=>{c.setStates(Object.fromEntries((C.data?.rows.nodes??[]).map(({userInfo:e})=>[`ui${e.id}`,{id:e.id,state:"unchecked"}])))},[C.data,c.setStates]),(0,i.jsx)(Ea,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(nm,{"aria-busy":y,headerRow:(0,i.jsxs)(cc,{children:[s&&(0,i.jsx)(Tc,{justify:"center",width:48,children:(0,i.jsx)(tc,{state:c.selectAllState,onClick:c.toggleSelectAll})}),S.map(e=>e.isSortable?(0,i.jsx)(tm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:v,sort:b,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Tc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(fr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),R&&(0,i.jsx)(Tc,{width:100})]}),paginationRow:(0,i.jsx)(yc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(jc,{limit:d,numberOfPages:A,offset:m,setLimit:_,setOffset:I,showLimits:!0,totalCount:w})}),children:y?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{})]}):E.map(s=>z[s.id]?(0,i.jsx)(zc,{},s.id):(0,i.jsx)(EW,{columns:S,customFields:e.customFields,eventId:n,organizationId:t,reload:k,reloadVolunteer:O,segmentId:o,state:c.states[`ui${s.userInfo.id}`]?.state??"unchecked",toggleRow:c.toggleRow,volunteerRegistration:s},s.id))})})}),zW=e=>(0,i.jsx)(Ea,{align:"center",css:{padding:"$2 $4"},direction:"column",height:1,justify:"center",width:1,children:(0,i.jsx)(Eb,{size:32,userInfo:e.vr.userInfo})}),$W=()=>{const{translate:e}=il();return(0,i.jsx)(Ea,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",px:"$2"},height:1,width:1,children:(0,i.jsx)(fr,{css:{ellipsis:!0},font:"gray800 textXs medium",textAlign:"center",width:1,children:e("disponible_69523")})})},OW=e=>{const t=Nn(Ku),n=(0,F.useMemo)(()=>Vd(e.slot.position.color),[e.slot]),o=(0,F.useMemo)(()=>ih(t,e.slot.positionSlot,e.slot.position.name,{position:{includeName:!0},slot:{includeRange:!0}}),[e.slot]);return(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(Ea,{align:"center",css:{background:n[50],borderRadius:"$1",color:n[700],cursor:"pointer",px:"$2"},height:1,width:1,children:(0,i.jsx)(fr,{css:{ellipsis:!0},fontSize:"textXs",fontWeight:"medium",textAlign:"center",title:o,width:1,children:o})})}),(0,i.jsx)(Pd,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:460,children:(0,i.jsx)(MU,{category:e.slot.positionCategory,position:e.slot.position,slot:e.slot.positionSlot})})]})},RW=e=>"assignment"===e.slot.type?(0,i.jsx)(OW,{slot:e.slot}):(0,i.jsx)($W,{}),PW=e=>{const{translate:t,params:{eventId:n}}=il(),{infos:o,limit:s,nameDebounced:r,offset:a,predicates:l,setInfos:d,setLimit:c,setOffset:u}=zC(),{data:m,loader:g}=Vn("query VolunteersPlanning(\n    $eventId: EventId!\n    $predicates: [Predicate!]!\n    $name: String\n    $limit: Int\n    $offset: Int\n) {\n    data: event(id: $eventId) {\n        rows: volunteersRegistrations(\n            predicates: $predicates\n            name: $name\n            limit: $limit\n            offset: $offset\n        ) {\n            nodes {\n                ...DocumentUsersPlanning\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{eventId:n,predicates:l,name:h(r)?r:void 0,limit:s,offset:a},[Ro.DocumentUsersPlanningFragment]);const{numberOfPages:p,totalCount:f}=lu(m.data?.rows),x=(0,F.useMemo)(()=>o?.volunteersPlanningshowAvailabilities??!0,[o]),_=(0,F.useCallback)(e=>{d({...o,volunteersPlanningshowAvailabilities:e})},[o,d]),I=(0,F.useMemo)(()=>(m.data?.rows.nodes??[]).map(e=>({...e,slots:e.slots.flatMap(e=>x?[{type:"availability",range:e.range}]:[]).concat(e.positionsSlotsUsersInfos.map(e=>({type:"assignment",range:e.positionSlot.range,positionCategory:e.positionCategory,position:e.position,positionSlot:e.positionSlot})))})),[m.data,x]),v=(0,F.useMemo)(()=>Fo.c9.isDateTime(o.volunteersPlanningStartAt)&&o.volunteersPlanningStartAt?.isValid?o.volunteersPlanningStartAt:Fo.c9.fromISO(o.volunteersPlanningStartAt)?.isValid?Fo.c9.fromISO(o.volunteersPlanningStartAt,{zone:"utc"}):Fo.IX.fromDateTimes(e.startAt.startOf("day"),e.endAt.endOf("day")).contains(Fo.c9.utc())?Fo.c9.utc():e.startAt,[e.startAt,e.endAt,o]),b=(0,F.useCallback)(t=>{d({...o,volunteersPlanningStartAt:t?.toISO()??e.startAt.toISO()})},[e.startAt,o,d]),j=(0,F.useMemo)(()=>{const t=nh(e.dayStartTime);return t?.[0]??0},[e.dayStartTime]);return g||(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",width:1,children:[(0,i.jsx)(Ea,{css:{background:"white",flex:"1"},children:(0,i.jsx)(DU,{data:I,date:v,maxDate:e.endAt,minDate:e.startAt,renderFilters:()=>(0,i.jsx)(fr,{width:40,children:(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(pl,{color:"white",leftIcon:x?"eye":"eye-slash",onClick:()=>_(!x)})}),(0,i.jsx)(am,{placement:"top",children:t(x?"masquer_les_dis_82263":"afficher_les_di_01534")})]})}),renderLeftCell:e=>(0,i.jsx)(zW,{vr:e}),renderSlot:e=>(0,i.jsx)(RW,{slot:e}),showPlus:!1,startHour:j,onChange:b})}),(0,i.jsx)(yc,{children:(0,i.jsx)(jc,{limit:s,numberOfPages:p,offset:a,setLimit:c,setOffset:u,showLimits:!0,totalCount:f})})]})},DW=()=>(0,i.jsxs)(Ea,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$3",userSelect:"none",width:"100%","&:last-child":{border:"none"}},children:[(0,i.jsx)(tc,{shouldPreventDefault:!1,state:"unchecked",onClick:Bl.A}),(0,i.jsx)(Pa,{width:"3"}),(0,i.jsx)(qd,{size:40,variant:"circular"}),(0,i.jsx)(Pa,{width:"4"}),(0,i.jsxs)(Ea,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(qd,{borderRadius:"$1",height:12,width:1}),(0,i.jsx)(qd,{borderRadius:"$1",height:12,width:1})]})]}),FW=e=>{const{data:t,isLoading:n}=xa({organizationId:e.organizationId,excludedEventId:e.eventId,name:h(e.nameOrEmail)?e.nameOrEmail:null});return n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(DW,{}),(0,i.jsx)(DW,{}),(0,i.jsx)(DW,{})]}):(0,i.jsx)(i.Fragment,{children:t.organization.usersInfos.nodes.map(t=>{const n=e.usersInfosIds.includes(t.id)?"checked":"unchecked";return(0,i.jsx)(dw,{state:n,userInfo:t,onClick:()=>{e.select(t.id)}},t.id)})})},MW=e=>{const t=Ln(),n=Nn(zE),o=Nn(za),[s,r,a]=Ec(""),{mutate:l,isLoading:d}=_a();return(0,i.jsx)(dl,{hideDefaultErrors:!0,initialValues:{usersInfosIds:[],sendVolunteerRegistrationEmail:!1},render:({form:n,handleSubmit:o,values:l})=>(0,i.jsxs)(Bc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(fr,{color:"gray800",css:{height:"56px",textAlign:"center"},children:(0,i.jsx)("img",{alt:"Avatars",height:"100%",src:od.AvatarGroup})}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("ajouter_un_memb_33261")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:t("ajouter_un_ou_d_44771")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),value:s,onChange:a}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(sl,{}),(0,i.jsx)(Ea,{css:{flex:"1",overflowY:"auto"},direction:"column",children:(0,i.jsx)(FW,{eventId:e.eventId,nameOrEmail:r,organizationId:e.organizationId,select:e=>{n.change("usersInfosIds",Qo(l.usersInfosIds,e))},usersInfosIds:l.usersInfosIds})}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{align:"center",gap:"3",justify:"end",children:[(0,i.jsx)(ym,{name:"sendVolunteerRegistrationEmail",children:t("envoyer_l_e_mai_35622")}),(0,i.jsx)(pl,{isLoading:d,onClick:o,children:t("ajouter_97327")}),(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]}),validate:o.validateForForm(n.adminAddSchema()),onSubmit:async t=>{await l({eventId:e.eventId,usersInfosIds:t.usersInfosIds,sendVolunteerRegistrationEmail:t.sendVolunteerRegistrationEmail}),e.reload(),e.onClose()}})},NW=({reload:e})=>{const{history:t,params:{organizationId:n,eventId:o,segmentId:s},translate:r}=il(),{user:a}=Zn(),{isEventAdmin:l}=Uv(),{segment:d,columns:c}=zC(),{mutate:u}=function(e={}){return Un("mutation VolunteersExport(\n    $eventId: EventId!\n    $segmentId: SegmentId!\n    $format: ExportFormat!\n    $includeFiles: Boolean!\n    $columns: [String!]!\n) {\n    jobId: volunteersExport(\n        eventId: $eventId\n        segmentId: $segmentId\n        format: $format\n        includeFiles: $includeFiles\n        columns: $columns\n    )\n}\n",e)}(),{data:h,isLoading:m}=Vn("query VolunteersHeader($eventId: EventId!, $segmentId: SegmentId!) {\n    event(id: $eventId) {\n        key\n\n        segment(id: $segmentId) {\n            links {\n                usersListingLink\n            }\n        }\n    }\n}\n",{eventId:o,segmentId:s},[]),[g,p]=(0,F.useState)(!1),[f,x]=(0,F.useState)(!1),[_,I]=(0,F.useState)(!1),{checkExport:v}=Yv();return(0,i.jsxs)(xO,{children:[l&&(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{children:r("ajouter_un_memb_33261")})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsx)(Od,{icon:"user-plus",onClick:()=>{t.push(kI.CREATE({organizationId:n,eventId:o}))},children:r("ajouter_un_nouv_29283")}),(0,i.jsx)(Od,{icon:"user-group",onClick:e=>{wd(e.target),p(!0)},children:r("ajouter_des_mem_06922")}),(0,i.jsx)(Od,{icon:"file-import",to:So.EVENT_VOLUNTEERS_IMPORT(n,o),onClick:e=>wd(e.target),children:r("importer_via_un_61623")})]})]}),(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[(0,i.jsxs)(ub,{positionsPermissions:[db.EDIT_POSITION],children:[(0,i.jsx)(Od,{icon:"plug-circle-bolt",onClick:e=>{wd(e.target),x(!0)},children:r("exporter_via_l_09843")}),(0,i.jsx)(Od,{icon:"file-xls",onClick:e=>{wd(e.target),I(!0)},children:r("exporter_en_exc_51862")})]}),(0,i.jsx)(Od,{download:`${d.name}-users-listing`,icon:"arrow-down-to-bracket",to:Zm(h.event?.segment.links.usersListingLink,"pdf",{lang:a?.language}),children:r("t_l_charger_en_59616")}),(0,i.jsx)(ub,{rolesTypes:zv,children:(0,i.jsx)(Od,{icon:"file-import",to:So.EVENT_FILES_IMPORT(n,o),children:r("importer_des_do_55420")})})]})]}),g&&(0,i.jsx)(MW,{eventId:o,organizationId:n,reload:e,onClose:()=>{p(!1)}}),!m&&(0,i.jsx)(jR,{isOpen:f,link:Km({organizationId:n,eventId:o,segmentId:s,key:h.event.key}),onClose:()=>{x(!1)}}),(0,i.jsx)(CR,{isOpen:_,requestExport:async(e,t)=>{const{jobId:i}=await u({eventId:o,segmentId:d.id,format:e,includeFiles:t,columns:c});v(n,o,i)},showIncludeFiles:!0,onClose:()=>{I(!1)}})]})},LW=(0,F.memo)(function(e){const t=Ln(),{isEventAdmin:n,isEventReader:o}=Uv(),{limit:s,massActions:r,onMassEditSuccess:a,predicates:l,reloadKey:d,rendering:c,segment:u,setReloadKey:h}=zC(),m=n&&c===yh.List,g=n&&c===yh.AccreditationsMatrix||c===yh.List;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(NW,{reload:()=>{h(d+1)}}),(0,i.jsxs)(yC,{children:[(0,i.jsx)(fO,{searchRow:(0,i.jsx)(gO,{actions:(0,i.jsx)(RF,{massActions:r,predicates:l,showOnlyMassEdit:!1,totalNumberOfMembers:u.count,onMassEditSuccess:a}),searchPlaceholder:t("rechercher_un_m_05904"),showEditColumns:m,showEditMode:g,showSearchColumns:!0}),selectSegment:(0,i.jsx)(FO,{pageSelectedText:t("les_1_membres_00895",s),segmentSelectedText:t("les_1_membres_56748",u.count,u.name)})}),o&&c===yh.AccreditationsMatrix?(0,i.jsx)(wW,{}):c===yh.Calendar?(0,i.jsx)(PW,{dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,startAt:e.event.startAt}):(0,i.jsx)(TW,{customFields:e.customFields})]})]})}),BW=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,segmentId:r}}=il(),{hasFeature:a}=nI(),{isEventAdmin:l,isEventReader:d,localEvent:c,updateLocalEvent:u}=Uv(),h=Nn(Eh),m=(0,F.useMemo)(()=>h.getVolunteersFilters(o,s,r,e.organization.customFields.nodes,e.event,{hasAccreditations:a(Fe.Accreditation),hasDelegations:a(Fe.Delegation),isWeezeventConnected:e.event.isWeezeventConnected}),[s,r,e.organization,e.event]),g=(0,F.useMemo)(()=>h.getVolunteersPossibleColumns(e.organization.customFields.nodes,e.event.forms.nodes,{hasAccreditations:a(Fe.Accreditation),isWeezeventConnected:e.event.isWeezeventConnected}),[e.organization,e.event]);return(0,i.jsx)(uO,{eventId:s,filters:m,filtersButtonText:n("filtrer_les_mem_47149"),filtersSubtitle:n("appliquer_des_f_48814"),getSegmentPath:e=>So.VOLUNTEERS_SEGMENT(o,s,e),initialLimit:c?.volunteersLimit??_c,initialSegmentsOpen:c?.areVolunteersSegmentsOpen??!0,isAdmin:l,organizationId:o,possibleColumns:g,possibleRenderings:d?[yh.List,yh.Calendar,yh.AccreditationsMatrix]:[yh.List,yh.Calendar],reload:e.reload,segmentId:r,segmentType:ft.Volunteers,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{u({volunteersLimit:e})},onSegmentClick:e=>{u({volunteersSegmentId:e})},onSegmentDelete:async()=>{await u({volunteersSegmentId:null}),t.replace(So.VOLUNTEERS(o,s))},onSegmentsToggle:async e=>{await u({areVolunteersSegmentsOpen:e})},children:(0,i.jsx)(LW,{customFields:e.organization.customFields.nodes,event:e.event})})},VW=(0,F.memo)(function(){const{params:{organizationId:e,eventId:t},translate:n}=il(),{event:{name:o},localEvent:s}=Uv();Cd(`${o} ${n("membres_11310")}`);const{data:r,loader:a,reload:l}=Hs({organizationId:e,eventId:t,privacy:fe.All,loadForms:!0,loadSegments:!0}),d=(0,F.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.VOLUNTEERS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(BW,{event:r.event,organization:r.organization,reload:l})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.VOLUNTEERS_SEGMENT(e,t,s?.volunteersSegmentId&&d.includes(s?.volunteersSegmentId)?s.volunteersSegmentId:d[0]),replace:!0})})]})}),UW=ar(Ea,{variants:{active:{true:{color:"$blue600"}}}}),WW=({children:e,path:t,text:n,eventId:o})=>{const s=Hn(),r=null!==(0,_r.B6)(s.pathname,{path:t}),a=Wn(),l=Gn();return(0,i.jsxs)(UW,{active:r,align:"center",direction:"column",onClick:()=>{!1===r&&l.push((0,_r.tW)(t,{...a,eventId:a.eventId||o}))},children:[(0,i.jsx)(fr,{children:e(r)}),(0,i.jsx)(fr,{fontSize:"textXs",children:n})]})},GW=ar("i",{fontSize:"18px"}),HW=({active:e,className:t})=>(0,i.jsx)(GW,{className:`${e?"fa-solid":"fa-regular"} ${t}`}),qW=ar(Ea,{color:"$gray500",padding:"10px 0",boxShadow:"0px -2px 8px -2px rgba(16, 24, 40, 0.04), 0px -4px 12px -2px rgba(16, 24, 40, 0.05)"}),YW=({user:e,eventId:t})=>{const n=Ln();return(0,i.jsxs)(qW,{justify:"evenly",children:[(0,i.jsx)(WW,{eventId:t,path:So.DASHBOARD(":organizationId",":eventId"),text:n("accueil_70474"),children:e=>(0,i.jsx)(HW,{active:e,className:"fa-house"})}),(0,i.jsx)(WW,{eventId:t,path:So.VOLUNTEERS(":organizationId",":eventId"),text:n("membres_11310"),children:e=>(0,i.jsx)(HW,{active:e,className:"fa-user-group"})}),(0,i.jsx)(WW,{eventId:t,path:ao.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),text:n("missions_63972"),children:e=>(0,i.jsx)(HW,{active:e,className:"fa-sitemap"})}),(0,i.jsx)(WW,{eventId:t,path:So.ORGANIZATION_PARAMETERS(":organizationId"),text:n("profil_14444"),children:()=>(0,i.jsx)(Fg,{email:e.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:24})})]})},KW=({children:e,user:t,eventId:n})=>(0,i.jsxs)(Ea,{css:{height:"100%"},direction:"column",children:[(0,i.jsx)(fr,{css:{flex:1,overflow:"auto"},children:e}),(0,i.jsx)(YW,{eventId:n,user:t})]}),ZW=({header:e,value:t})=>(0,i.jsxs)(Ea,{css:{bd:!0,padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(fr,{color:"gray500",fontSize:"textSm",fontWeight:"medium",children:e}),(0,i.jsx)(fr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:t})]}),XW=({position:e})=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=il();return(0,i.jsx)(Cc,{css:{cursor:"pointer"},onClick:()=>{t.push(ao.POSITION({organizationId:n,eventId:o,positionId:e.id}))},children:(0,i.jsx)(xc,{children:(0,i.jsxs)(Ea,{direction:"column",gap:"2",width:1,children:[(0,i.jsxs)(Ea,{gap:"3",children:[(0,i.jsx)(fr,{color:"gray700",css:{flex:"1"},children:e.name}),(0,i.jsx)(fr,{color:"gray700",children:s("_1_2_membres_04485",e.assignedResources,e.resources)})]}),(0,i.jsx)(fr,{width:1,children:(0,i.jsx)(YA,{percent:e.assignedResources/e.resources})})]})})},e.id)},JW=ar("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),QW=ar(Va,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),eG=ar("h2",{fontSize:"$textMd",fontWeight:"$semiBold",margin:0}),tG=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o}}=il(),s=Nn(Ng),{isEventAdmin:r,hasPositionPermission:a}=Uv(),{data:l,loader:d}=Vn("query DashboardMobile($eventId: EventId!) {\n    event(id: $eventId) {\n        assignedResources\n        name\n        resources\n        volunteerMinutesAssigned\n        volunteerMinutesNeeded\n\n        positions {\n            nodes {\n                id\n                name\n                resources\n                assignedResources\n            }\n            totalCount\n        }\n\n        waitingAssignment: volunteersRegistrations(states: [WaitingAssignment], limit: 1) {\n            totalCount\n        }\n\n        assigned: volunteersRegistrations(states: [Assigned], limit: 1) {\n            totalCount\n        }\n\n        positionsCategories {\n            id\n            name\n            resources\n            assignedResources\n        }\n    }\n}\n",{eventId:o},[]),c=(0,F.useMemo)(()=>l.event?(0,Zd.A)(l.event.positionsCategories,e=>e.name.toLowerCase()):[],[l.event]),u=()=>{e.push(So.DASHBOARD_EVENT_SWITCH(n,o))};if(d)return d;{const e=r||c.some(e=>a(db.READ_POSITION,{positionCategoryId:e.id}));return(0,i.jsxs)(Ea,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Ea,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(JW,{children:t("accueil_70474")}),(0,i.jsx)(QW,{icon:"arrow-down-arrow-up",onClick:u})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"4",children:[(0,i.jsx)(eG,{children:l.event.name}),(0,i.jsx)(ZW,{header:t("nombre_de_membr_60320",l.event.resources),value:l.event.resources}),(0,i.jsx)(ZW,{header:t("nombre_de_missi_67304",l.event.positions.totalCount),value:l.event.positions.totalCount}),(0,i.jsx)(ZW,{header:t("nombre_de_membr_87779",l.event.assigned.totalCount),value:l.event.assigned.totalCount}),(0,i.jsx)(ZW,{header:t("nombre_de_membr_63555",l.event.waitingAssignment.totalCount),value:l.event.waitingAssignment.totalCount}),(0,i.jsx)(ZW,{header:t("taux_de_remplis_11913"),value:`${0===l.event.resources?"0":Math.round(l.event.assignedResources/l.event.resources*100)}%`}),(0,i.jsx)(ZW,{header:t("temps_de_b_n_vo_87924"),value:s.minutesToHoursMinutesString(l.event.volunteerMinutesNeeded)}),(0,i.jsx)(ZW,{header:t("temps_de_b_n_vo_60725"),value:s.minutesToHoursMinutesString(l.event.volunteerMinutesAssigned)}),(0,i.jsx)(fr,{css:{boxShadow:"$xs"},children:e?(0,i.jsx)(kc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(Tc,{children:t("cat_gories_24533")}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:c.length>0?c.map(e=>(0,i.jsx)(aN,{category:e,clickable:!1,eventId:o,organizationId:n},e.id)):(0,i.jsx)(Uy,{subtitle:t("vous_n_avez_pas_59681"),title:t("aucune_cat_gori_21347")})}),setOffset:Bl.A,title:t("liste_des_membr_59735"),totalCount:0}):(0,i.jsx)(kc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(Tc,{children:t("missions_63972")}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:l.event.positions.nodes.map(e=>(0,i.jsx)(XW,{position:e},e.id))}),setOffset:Bl.A,title:t("liste_des_membr_57353"),totalCount:0})})]})]})}},nG=ar("div",{alignSelf:"flex-end",cursor:"pointer",padding:"$4 $6 $3 $6",i:{color:"$gray500"}}),iG=({onClose:e})=>(0,i.jsx)(nG,{onClick:e,children:(0,i.jsx)("i",{className:"fa-regular fa-xmark"})}),oG=ar(Ea,{overflowX:"hidden",overflowY:"auto"}),sG=ar(Ea,{background:"rgba(0, 0, 0, 0.7)",position:"absolute",left:"0",right:"0",top:"0",bottom:"0"}),rG=ar(Ea,{background:"white",borderRadius:"20px 20px 0 0",marginTop:"44px",flex:"1",overflow:"auto"}),aG=({children:e,onClose:t})=>{const n=(0,_r.W6)(),o=t??n.goBack;return kd(o),(0,i.jsx)(sG,{"data-testid":"overlay-backdrop",direction:"column",onClick:o,children:(0,i.jsxs)(rG,{"data-testid":"overlay-body",direction:"column",onClick:e=>e.stopPropagation(),children:[(0,i.jsx)(iG,{onClose:o}),(0,i.jsx)(oG,{direction:"column",children:e})]})})},lG=({event:e})=>{const t=Nn($c);return(0,i.jsx)(fr,{children:(0,i.jsxs)(Ea,{align:"center",css:{color:"$gray500"},children:[(0,i.jsx)(fr,{width:25,children:(0,i.jsx)(Va,{icon:"calendar"})}),(0,i.jsx)(fr,{css:{flex:"1",ellipsis:!0},children:C_(t,e.startAt,e.endAt)})]})})},dG=({event:e})=>{const t=Ln();return(0,i.jsxs)(Ea,{align:"start",direction:"column",gap:"2",children:[(0,i.jsx)(Gd,{color:e.state===Re.Ongoing?"success":"error",children:t(e.state)}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textLg",fontWeight:"medium",width:1,children:e.name}),(0,i.jsx)(lG,{event:e})]})},cG=({events:e})=>{const{organizationId:t,eventId:n}=Wn(),[o,s]=(0,F.useState)(n),r=Gn(),a=Ln();return(0,i.jsxs)(Ea,{css:{margin:"0 $4 $7 $4"},direction:"column",children:[(0,i.jsx)(Ea,{direction:"column",gap:"4",children:e.map(e=>(0,i.jsx)(tO,{state:e.id===o?"checked":"unchecked",onClick:()=>s(e.id),children:(0,i.jsx)(dG,{event:e})},e.id))}),(0,i.jsx)(Pa,{height:7}),(0,i.jsx)(pl,{onClick:()=>{r.push(So.DASHBOARD(t,o))},children:a("s_lectionner_l_77300")})]})},uG=ar("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),hG=()=>{const{organizationId:e,eventId:t}=Wn(),{loader:n,data:o}=Yr({organizationId:e,includeNumberOfMembers:!1}),s=Gn(),r=Ln();return(0,i.jsxs)(aG,{onClose:()=>{s.push(So.DASHBOARD(e,t))},children:[(0,i.jsx)(uG,{children:r("liste_de_vos_v_44993")}),n||(0,i.jsx)(cG,{events:o.data.rows.nodes})]})},mG=ar("div",{display:"flex",flex:1,flexDirection:"column",margin:"0 $3"}),gG=ar(Ea,{margin:"0 $3",padding:"$3 $4"}),pG=({back:e,children:t})=>(0,i.jsxs)(Ea,{align:"center",css:{padding:"10px 0",borderBottom:"1px solid $gray100"},children:[(0,i.jsx)(gG,{color:"gray700",onClick:e,children:(0,i.jsx)(Va,{icon:"chevron-left"})}),t]}),fG=ar("div",{display:"flex",flexDirection:"column",height:"100%",overflow:"auto"}),xG=ar("i",{fontSize:"$textXl"}),_G=({replaySearch:e})=>{const{eventId:t}=Wn(),{data:n,loader:o}=Vn("query RecentPositionsSearchesMobile($eventId: EventId!) {\n    event(id: $eventId) {\n        recentPositionsRegistrationsSearches\n    }\n}\n",{eventId:t},[]),s=Ln();if(o)return o;{const t=n.event.recentPositionsRegistrationsSearches;return(0,i.jsxs)(Ea,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(fr,{fontSize:"textMd",fontWeight:"semiBold",children:s("recherches_r_ce_82891",t.length)}),t.map((t,n)=>(0,i.jsxs)(Ea,{align:"center",gap:"2",onClick:()=>{e(t)},children:[(0,i.jsx)(xG,{className:"fa-regular fa-clock"}),(0,i.jsx)(fr,{children:t})]},n))]})}},IG=e=>{const t=Ln(),n=h(e.content?.[0])?t(e.content[0]):t("ooops_on_a_un_p_56888"),o=((e,t)=>"accreditation_limit_reached"===t?.[0]?e("_ditez_l_accr_d_66820"):"delegation_limit_reached"===t?.[0]?e("_diter_la_d_l_g_14763"):"can_not_delete_paired"===t?.[0]?e("ce_membre_est_d_53903"):Zo(t)?t:[e("une_erreur_est_92333")])(t,e.content);return(0,i.jsx)(nb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"triangle-exclamation",iconColor:"$error700",children:n}),(0,i.jsx)(Qv,{css:{color:"$gray500"},hideBorder:!0,children:o}),(0,i.jsx)(Jv,{hideBorder:!0,hideCancelButton:!0,children:(0,i.jsx)(pl,{color:"error",onClick:e.onClose,children:t("fermer_62479")})})]})})},vG=F.createContext({}),bG=e=>{const[t,n]=F.useState(!1),[o,s]=F.useState([]),r=F.useCallback((e,t)=>{n(e),s((t||[]).flatMap(e=>e.isHeaventError?e.message.split("\n"):e.message?.startsWith("db::")?[e.message.substring(4).split(" ")[0]]:[]))},[n,s]),a=F.useCallback(()=>{n(!1),s([])},[n,s]);return(0,i.jsxs)(vG.Provider,{value:{isError:t,setIsError:r},children:[e.children,t&&(0,i.jsx)(IG,{content:o,onClose:a})]})},jG=(e,t)=>{switch(t.type){case"FIRST_PAGE_INIT":return{...e,isLoading:!0,data:void 0,xs:void 0};case"LOAD_MORE_INIT":return{...e,isLoading:!0};case"FIRST_PAGE_SUCCESS":case"LOAD_MORE_SUCCESS":return{...e,isLoading:!1,data:t.data,xs:t.xs,offset:t.offset}}};function CG(e,t,n){const[o,s]=(0,F.useReducer)(jG,{isLoading:!0,data:void 0,xs:void 0,offset:t.offset}),{setIsError:r}=(0,F.useContext)(vG);(0,F.useEffect)(()=>{let i=!1;return s({type:"FIRST_PAGE_INIT"}),H().then(n=>e(t,n||null)).then(e=>{!1===i&&s({type:"FIRST_PAGE_SUCCESS",data:e,xs:n(e),offset:t.offset})},()=>{!1===i&&r(!0)}),()=>{i=!0}},[e,JSON.stringify(t),n]);const a=()=>{s({type:"LOAD_MORE_INIT"});const i=o.offset+t.limit;H().then(n=>e({...t,offset:i},n||null)).then(e=>{const t=[...o.xs||[]];t.splice(i,0,...n(e)),s({type:"LOAD_MORE_SUCCESS",data:e,xs:t,offset:i})},()=>{r(!0)})};return(e=>e.isLoading&&void 0===e.data)(o)?{data:o.data,loader:(0,i.jsx)(ul,{}),loadMore:a,xs:o.xs}:{data:o.data,loader:o.isLoading?(0,i.jsx)(ul,{}):void 0,loadMore:a,xs:o.xs}}const yG=ar(fr,{display:"flex",flexDirection:"column",[`${pl} + .load-more-status`]:{paddingTop:"12px"}}),kG=({loadMore:e,pageInfo:t,isLoading:n,buttonText:o,statusText:s})=>!1===t.hasNextPage&&!1===t.hasPreviousPage?null:(0,i.jsxs)(yG,{children:[t.hasNextPage&&(0,i.jsx)(pl,{isLoading:n,textAlign:"center",onClick:e,children:o}),(0,i.jsx)(fr,{className:"load-more-status",fontSize:"textSm",textAlign:"center",children:s})]});var AG=n(2872);const wG=ar(Ea,{bd:!0,padding:"$4 $3"}),SG=({children:e,...t})=>(0,i.jsxs)(wG,{align:"center",...t,children:[(0,i.jsx)(fr,{css:{flex:1},children:e}),(0,i.jsx)(fr,{color:"gray700",css:{padding:"0 10px 0 $4"},children:(0,i.jsx)(Va,{icon:"chevron-right"})})]}),EG=({open:e,position:t})=>{const n=Ln(),o=Nn(Ku);return(0,i.jsxs)(SG,{onClick:()=>{e(t.id)},children:[(0,i.jsxs)(Ea,{gap:"2",children:[t.assignedResources>=t.resources?(0,i.jsx)(Gd,{color:"success",children:n("complet_51600")}):(0,i.jsx)(Gd,{color:"warning",children:n("incomplet_45915")}),!t.isVisible&&(0,i.jsx)(Gd,{color:"gray",children:n("Private")})]}),(0,i.jsx)(fr,{color:"gray800",css:{marginTop:"$2"},fontWeight:"semiBold",children:t.name}),(0,i.jsx)(fr,{color:"gray500",css:{marginTop:"$1"},fontSize:"textSm",children:`${n("creneau",t.slots.length)} · ${t.range?o.toLocaleString(t.range,void 0,{year:"numeric",month:"long",day:"numeric"}):"-"}`}),(0,i.jsx)(fr,{css:{marginTop:"$3"},children:(0,i.jsx)(YA,{percent:t.assignedResources/t.resources})})]})},TG=ar("div",{color:"$gray800",fontWeight:"$semiBold",lineHeight:"24px"}),zG=ar("div",{color:"$gray400",fontSize:"$textSm"}),$G=ar("span",{color:"$gray800"}),OG=({category:e})=>{const t=Ln();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(TG,{children:e.name}),Zo(e.leaders)&&(0,i.jsxs)(zG,{children:[`${t("responsable_category",e.leaders.length)} `,(0,i.jsx)($G,{children:e.leaders.map(({userInfo:e})=>e.name).join(", ")})]})]})},RG=({open:e,positions:t})=>{const n=(0,F.useMemo)(()=>(0,Zd.A)((0,AG.A)((0,Kd.A)(t,e=>e.category.id)),e=>e[0].category.name),[t]);return(0,i.jsx)(i.Fragment,{children:n.map((t,n)=>(0,i.jsxs)(Ea,{direction:"column",gap:"3",children:[(0,i.jsx)(OG,{category:t[0].category}),t.map((t,n)=>(0,i.jsx)(EG,{open:e,position:t},n))]},n))})},PG=()=>{const e=Ln();return(0,i.jsx)(rk,{css:{flex:1,padding:"0 $4"},title:e("d_sol_il_n_y_46236")})},DG=e=>e.event.positions.nodes,FG=({search:e})=>{const t=Ln(),{organizationId:n,eventId:o}=Wn(),s={eventId:o,predicates:[],limit:_c,offset:0,name:e},{data:r,loader:a,loadMore:l,xs:d}=CG(la,s,DG),c=Gn();return a&&void 0===r?a:0===d.length?(0,i.jsx)(PG,{}):(0,i.jsxs)(Ea,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(fr,{fontSize:"textMd",fontWeight:"semiBold",children:t("r_sultat_de_la_64686",d.length)}),(0,i.jsx)(RG,{open:t=>{c.push(So.POSITION_SETTINGS(n,o,t),{from:"SEARCH_MOBILE",search:e})},positions:d}),(0,i.jsx)(kG,{buttonText:t("afficher_plus_d_49529"),isLoading:void 0!==a,loadMore:l,pageInfo:r.event.positions.pageInfo,statusText:t("_1_sur_2_mis_94157",d.length,r.event.positions.totalCount)})]})},MG=ar(Ea,{color:"$blue600"}),NG=()=>{const{organizationId:e,eventId:t}=Wn(),n=Gn(),o=Ln(),s=Hn(),[r,a]=(0,F.useState)(s.state?.search||""),[l,d]=(0,F.useState)(s.state?.search||"");return(0,i.jsxs)(fG,{children:[(0,i.jsx)(pG,{back:()=>{n.push(ao.POSITIONS({organizationId:e,eventId:t}))},children:(0,i.jsxs)(Ea,{align:"center",css:{marginRight:"$4",flexGrow:1},gap:"3",children:[(0,i.jsx)(wl,{icon:"search",placeholder:o("rechercher_une_69998"),value:r,onChange:e=>{a(e),e||d(e)},onKeyDown:e=>{"Enter"===e.key&&d(r)}}),l&&(0,i.jsx)(MG,{onClick:()=>{a(""),d("")},children:o("annuler_48254")})]})}),(0,i.jsx)(mG,{children:l?(0,i.jsx)(FG,{search:l}):(0,i.jsx)(_G,{replaySearch:e=>{a(e),d(e)}})})]})},LG=({folders:e,segmentId:t,...n})=>(0,i.jsx)(gu,{shouldParseAsInt:!0,value:t,...n,children:e.map((e,t)=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map((e,t)=>(0,i.jsxs)("option",{value:e.id,children:[e.name," (",e.count,")"]},t))},t))});var BG=n(473);const VG=()=>{const e=Ln();return(0,i.jsx)(rk,{css:{flex:1,padding:"0 $4"},subtitle:e("cr_ez_de_nouvel_87003"),title:e("il_n_y_a_pas_de_55837")})},UG=e=>e.event.positions.nodes,WG=({segment:e})=>{const t=Ln(),{organizationId:n,eventId:o}=Wn(),s={eventId:o,predicates:e.predicates,limit:_c,offset:0},{data:r,loader:a,loadMore:l,xs:d}=CG(la,s,UG),c=Gn();return a&&void 0===r?a:0===d.length?(0,i.jsx)(VG,{}):(0,i.jsxs)(Ea,{direction:"column",gap:"7",children:[(0,i.jsx)(RG,{open:e=>{c.push(So.POSITION_SETTINGS(n,o,e))},positions:d}),(0,i.jsx)(kG,{buttonText:t("afficher_plus_d_49529"),isLoading:void 0!==a,loadMore:l,pageInfo:r.event.positions.pageInfo,statusText:t("_1_sur_2_mis_94157",d.length,r.event.positions.totalCount)})]})},GG=ar("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),HG=ar(Va,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),qG=({event:e})=>{const{organizationId:t,eventId:n,segmentId:o}=Wn(),s=Gn(),r=Ln(),a=(0,BG.A)(e.segmentsFolders.flatMap(e=>e.segments),{id:o});return(0,i.jsxs)(Ea,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Ea,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(GG,{children:r("missions_63972")}),(0,i.jsx)(HG,{icon:"search",onClick:()=>{s.push(So.POSITIONS_SEARCH(t,n))}})]}),(0,i.jsx)(fr,{children:(0,i.jsx)(LG,{folders:e.segmentsFolders,segmentId:o,onChange:e=>s.push(So.POSITIONS_SEGMENT(t,n,e))})}),(0,i.jsx)(Ea,{css:{flex:1},direction:"column",children:(0,i.jsx)(WG,{segment:a})})]})},YG=()=>{const{organizationId:e,eventId:t}=Wn(),{data:n,loader:o}=Vn("query PositionsSegmentsMobile($eventId: EventId!) {\n    event(id: $eventId) {\n        segmentsFolders(segmentType: Positions) {\n            ...SegmentsFoldersSegments\n        }\n    }\n}\n",{eventId:t},[Ro.SegmentsFoldersSegmentsFragment]);return o||(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.POSITIONS_SEARCH(":organizationId",":eventId"),children:(0,i.jsx)(NG,{})}),(0,i.jsx)(_r.qh,{path:So.POSITIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(qG,{event:n.event})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.POSITIONS_SEGMENT(e,t,n.event.segmentsFolders[0].segments[0].id)})})]})},KG=ar(Ea,{backgroundColor:"$gray100",borderRadius:"$1",padding:"2px"}),ZG=({children:e,...t})=>(0,i.jsx)(KG,{...t,children:e}),XG=ar(Ea,{color:"$gray400",flex:1,fontSize:"$textSm",fontWeight:"$medium",padding:"6px 8px",variants:{isSelected:{true:{backgroundColor:"white",border:"0.5px solid $gray200",borderRadius:"$1",color:"$gray800",fontWeight:"$semiBold"}}}}),JG=({children:e,path:t})=>{const n=Gn(),o=Hn().pathname===t;return(0,i.jsx)(XG,{isSelected:o,justify:"center",onClick:()=>{n.push(t)},children:e})},QG=({children:e,css:t,...n})=>(0,i.jsx)(Ea,{align:"center",css:{flex:1,marginRight:"66px",...t},direction:"column",...n,children:e}),eH=({back:e,position:t})=>(0,i.jsx)(pG,{back:e,children:(0,i.jsxs)(QG,{css:{minHeight:"40px"},children:[(0,i.jsx)(fr,{color:"gray900",fontWeight:"medium",textAlign:"center",children:t.name}),(0,i.jsx)(fr,{color:"gray500",fontSize:"textXs",textAlign:"center",children:t.positionCategoryName})]})}),tH=({customFields:e,position:t})=>{const n=Ln();return(0,i.jsxs)(Ea,{css:{marginBottom:"$7"},direction:"column",gap:"7",children:[(0,i.jsx)(qU,{category:t,title:n("remplissage_des_84383")}),(0,i.jsx)($w,{defaultRoleType:pt.PositionReader,leaders:t.leaders,rolesTypes:[pt.Custom,pt.PositionEditor,pt.PositionReader]}),(0,i.jsx)(ZU,{customFields:e,position:t}),(0,i.jsx)(QA,{description:t.description}),(0,i.jsx)(rF,{location:t}),(0,i.jsx)(oF,{customFields:t.customFields}),(0,i.jsx)(ow,{modalSubtitle:n("ajouter_des_tag_64526"),tags:t.tags}),(0,i.jsx)(ew,{privateNote:t.privateNote})]})},nH=(e,t)=>e.name||t.toLocaleString(e.range,void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"}),iH=({open:e,slot:t})=>{const n=Ln(),o=Nn(Ku);return(0,i.jsxs)(SG,{onClick:()=>{e(t.id)},children:[(0,i.jsx)(Ea,{gap:"2",children:t.assignedResources>=t.resources?(0,i.jsx)(Gd,{color:"success",children:n("complet_51600")}):(0,i.jsx)(Gd,{color:"warning",children:n("_1_membre_manq_31014",t.resources-t.assignedResources)})}),(0,i.jsx)(fr,{color:"gray800",css:{marginTop:"$2"},fontWeight:"semiBold",children:t.name}),(0,i.jsx)(fr,{color:"gray500",css:{marginTop:"$1"},fontSize:"textSm",children:nH(t,o)}),(0,i.jsx)(fr,{css:{marginTop:"$3"},children:(0,i.jsx)(YA,{percent:t.assignedResources/t.resources})})]})},oH=({open:e,slots:t})=>{const n=Ln();return(0,i.jsxs)(Ea,{direction:"column",gap:"3",children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:n("liste_des_cr_ne_94056")}),t.map((t,n)=>(0,i.jsx)(iH,{open:e,slot:t},n))]})},sH=e=>e.event.positionsSlots.nodes,rH=({open:e,eventId:t,positionId:n})=>{const o={eventId:t,positionId:n,limit:_c,offset:0},{data:s,loader:r,loadMore:a,xs:l}=CG(ca,o,sH);return r&&void 0===s?r:(0,i.jsxs)(Ea,{css:{marginBottom:"$7"},direction:"column",gap:"7",children:[(0,i.jsx)(oH,{open:e,slots:l}),(0,i.jsx)(kG,{buttonText:"Afficher plus de créneaux",isLoading:void 0!==r,loadMore:a,pageInfo:s.event.positionsSlots.pageInfo,statusText:`${l.length} sur ${s.event.positionsSlots.totalCount} créneaux`})]})},aH=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,positionId:s}}=il(),{data:r,loader:a}=ua({organizationId:n,eventId:o,positionId:s}),l=Hn(),[d]=(0,F.useState)(l.state);if(l.pathname===ao.POSITION({organizationId:n,eventId:o,positionId:s}))return(0,i.jsx)(Yn,{path:So.POSITION_SETTINGS(n,o,s)});const c={settings:So.POSITION_SETTINGS(n,o,s),slots:ao.POSITION_SLOTS({organizationId:n,eventId:o,positionId:s})};return a||(0,i.jsxs)(fG,{children:[(0,i.jsx)(eH,{back:()=>{"SEARCH_MOBILE"===d?.from?e.push(So.POSITIONS_SEARCH(n,o),{search:d?.search}):e.push(ao.POSITIONS({organizationId:n,eventId:o}))},position:r.event.position}),(0,i.jsx)(mG,{children:(0,i.jsxs)(Vy,{children:[(0,i.jsxs)(ZG,{css:{margin:"$6 0"},children:[(0,i.jsx)(JG,{path:c.settings,children:t("param_tres_78420")}),(0,i.jsx)(JG,{path:c.slots,children:t("cr_neaux_33401")})]}),(0,i.jsx)(By,{path:c.settings,children:(0,i.jsx)(tH,{customFields:r.organization.customFields.nodes,position:r.event.position})}),(0,i.jsx)(By,{path:c.slots,children:(0,i.jsx)(rH,{eventId:o,open:t=>{e.push(So.POSITION_SLOT_MEMBERS(n,o,s,t))},positionId:r.event.position.id})})]})})]})},lH=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:o}=Wn(),s=Gn(),r=Ln();return(0,i.jsx)(aG,{onClose:()=>{s.push(So.POSITION_SLOT_MEMBERS(e,t,n,o))},children:(0,i.jsxs)(Ea,{css:{margin:"$3"},direction:"column",gap:"3",children:[(0,i.jsx)(pl,{onClick:()=>{s.push(So.POSITION_SLOT_CHECK_MEMBERS_CHECK_IN(e,t,n,o))},children:r("pointer_des_mem_09244")}),(0,i.jsx)(pl,{onClick:()=>{s.push(So.POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT(e,t,n,o))},children:r("d_pointer_des_m_31557")}),(0,i.jsx)(pl,{onClick:()=>{s.push(So.POSITION_SLOT_CHECK_MEMBERS_RESET(e,t,n,o))},children:r("remettre_z_ro_65589")})]})})},dH=ar(Ea,{fontSize:"$textSm",color:"$blue600"}),cH=({onSubmit:e,children:t,data:n,loader:o,loadMore:s,xs:r,disabled:a})=>{const l=Ln(),[d,c]=(0,F.useState)(r);(0,F.useEffect)(()=>{c(r.toSpliced(0,d.length,...d))},[r]);const u=d.filter(e=>"checked"===e.state&&!a.includes(e.positionSlotUserInfo.id)).map(e=>e.positionSlotUserInfo.id);return(0,i.jsxs)(Ea,{direction:"column",height:"100%",width:"100%",children:[(0,i.jsxs)(Ea,{css:{flex:1,overflow:"auto",padding:"$6 $4 $3 $4"},direction:"column",gap:"5",children:[(0,i.jsxs)(Ea,{justify:"between",children:[(0,i.jsx)(fr,{fontSize:"textMd",fontWeight:"semiBold",children:l("liste_des_membr_86405",r.length)}),(0,i.jsx)(dH,{onClick:()=>{c(d.map(e=>({...e,state:"checked"})))},children:l("tout_s_l_ctionn_18234")})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"3",children:[d.map((e,t)=>(0,i.jsx)(nc,{disabled:a.includes(e.positionSlotUserInfo.id),state:e.state,onClick:e=>((e,t)=>{c(d.toSpliced(e,1,{...d[e],state:t}))})(t,e),children:e.userInfo.name},t)),(0,i.jsx)(kG,{buttonText:l("afficher_plus_d_41906"),isLoading:void 0!==o,loadMore:s,pageInfo:n.event.volunteersRegistrations.pageInfo,statusText:l("_1_sur_2_mem_14323",r.length,n.event.volunteersRegistrations.totalCount)})]})]}),(0,i.jsx)(Ea,{css:{boxShadow:"$mdReverse",padding:"$6 $4"},direction:"column",children:(0,F.isValidElement)(t)?(0,F.cloneElement)(t,{onClick:()=>e(u),disabled:0===u.length}):t})]})},uH=e=>e.event.volunteersRegistrations.nodes,hH=()=>{const{eventId:e,positionSlotId:t}=Wn(),n=Ln(),o={eventId:e,positionSlotId:t,predicates:[{operator:dt.IsNot,value:[he.CheckedIn],value2:[t],slug:"checkInStatePositionSlot"}],limit:50,offset:0},{data:s,loader:r,loadMore:a,xs:l}=CG(da,o,uH),{isLoading:d,mutate:c}=zs(),[u,h]=(0,F.useState)([]);if(r&&void 0===s)return r;{const t=async t=>{await c({eventId:e,checkIn:{strategy:me.CheckIn,positionsSlotsUsersInfosIds:t}}),h([...u,...t])};return(0,i.jsx)(cH,{data:s,disabled:u,loadMore:a,loader:r,xs:l,onSubmit:t,children:(0,i.jsx)(pl,{isLoading:d,textAlign:"center",children:n("pointer_80927")})})}},mH=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:o}=Wn(),s=Gn(),r=Ln();return(0,i.jsxs)(fG,{children:[(0,i.jsx)(pG,{back:()=>{s.push(So.POSITION_SLOT_MEMBERS(e,t,n,o))},children:(0,i.jsx)(QG,{children:r("pointer_des_mem_09244")})}),(0,i.jsx)(mG,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(hH,{})})]})},gH=e=>e.event.volunteersRegistrations.nodes,pH=()=>{const{eventId:e,positionSlotId:t}=Wn(),n=Ln(),o={eventId:e,positionSlotId:t,predicates:[{operator:dt.IsNot,value:[he.CheckedOut],value2:[t],slug:"checkInStatePositionSlot"}],limit:50,offset:0},{data:s,loader:r,loadMore:a,xs:l}=CG(da,o,gH),{isLoading:d,mutate:c}=zs(),[u,h]=(0,F.useState)([]);if(r&&void 0===s)return r;{const t=async t=>{await c({eventId:e,checkIn:{strategy:me.CheckOut,positionsSlotsUsersInfosIds:t}}),h([...u,...t])};return(0,i.jsx)(cH,{data:s,disabled:u,loadMore:a,loader:r,xs:l,onSubmit:t,children:(0,i.jsx)(pl,{isLoading:d,textAlign:"center",children:n("d_pointer_25328")})})}},fH=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:o}=Wn(),s=Gn(),r=Ln();return(0,i.jsxs)(fG,{children:[(0,i.jsx)(pG,{back:()=>{s.push(So.POSITION_SLOT_MEMBERS(e,t,n,o))},children:(0,i.jsx)(QG,{children:r("d_pointer_des_m_31557")})}),(0,i.jsx)(mG,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(pH,{})})]})},xH=e=>e.event.volunteersRegistrations.nodes,_H=()=>{const{eventId:e,positionSlotId:t}=Wn(),n=Ln(),o={eventId:e,positionSlotId:t,predicates:[{operator:dt.IsNot,value:[he.Waiting],value2:[t],slug:"checkInStatePositionSlot"}],limit:50,offset:0},{data:s,loader:r,loadMore:a,xs:l}=CG(da,o,xH),{isLoading:d,mutate:c}=zs(),[u,h]=(0,F.useState)([]);if(r&&void 0===s)return r;{const t=async t=>{await c({eventId:e,checkIn:{strategy:me.Reset,positionsSlotsUsersInfosIds:t}}),h([...u,...t])};return(0,i.jsx)(cH,{data:s,disabled:u,loadMore:a,loader:r,xs:l,onSubmit:t,children:(0,i.jsx)(pl,{isLoading:d,textAlign:"center",children:n("remettre_z_ro_82376")})})}},IH=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:o}=Wn(),s=Gn(),r=Ln();return(0,i.jsxs)(fG,{children:[(0,i.jsx)(pG,{back:()=>{s.push(So.POSITION_SLOT_MEMBERS(e,t,n,o))},children:(0,i.jsx)(QG,{children:r("remettre_z_ro_11572")})}),(0,i.jsx)(mG,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(_H,{})})]})},vH=e=>{let t,n,o;return"registrationState"in e?(({color:t,leftIcon:o}=Rb(e.registrationState)),n=`${t}100`):(t=function(e){switch(e){case he.CheckedIn:case he.CheckedOut:return"success";case he.Waiting:return"warning"}}(e.checkInState),n=`${t}500`),(0,i.jsx)(Ea,{align:"center",css:{background:lr.colors[n].value,border:"2px solid white",borderRadius:`${e.size}px`,bottom:"0",color:lr.colors[`${t}700`].value,fontSize:`${Math.round(.45*e.size)}px`,right:"0",position:"absolute"},height:e.size,justify:"center",width:e.size,children:o&&(0,i.jsx)(Va,{icon:o})})},bH=e=>{switch(e){case 16:return 8;case 24:return 10;case 32:return 12;case 40:return 14;case 48:return 16;case 56:return 18;case 64:return 20;case 88:return 22;case 96:return 24;case 110:return 30;case 160:return 40;case 310:return 80}},jH=ar("div",{position:"relative"}),CH=e=>{let t,n;if("registrationState"in e){t={registrationState:e.registrationState,size:bH(e.size)};const{registrationState:i,...o}=e;n=o}else{t={checkInState:e.checkInState,size:bH(e.size)};const{checkInState:i,...o}=e;n=o}return(0,i.jsxs)(jH,{children:[(0,i.jsx)(Fg,{...n}),(0,i.jsx)(vH,{...t})]})},yH=ar(Ea,{overflow:"hidden"}),kH=ar("div",{color:"$gray500",fontSize:"$textSm",ellipsis:"",variants:{size:{40:{"&:first-child":{color:"$gray800",fontSize:"$textMd",fontWeight:"$medium"}},64:{"&:first-child":{color:"$gray900",fontSize:"$textXl",fontWeight:"$semiBold"}}}}}),AH=({userInfo:e,size:t,...n})=>(0,i.jsxs)(yH,{direction:"column",...n,children:[h(e.name)&&(0,i.jsx)(kH,{size:t,children:e.name}),(0,i.jsx)(kH,{size:t,children:e.email})]}),wH=e=>{const t={name:e.userInfo.name,email:e.userInfo.email,image:e.userInfo.picture?.url};return(0,i.jsxs)(Ea,{align:"center",onClick:e.openVolunteer,children:["registrationState"in e?(0,i.jsx)(CH,{...t,registrationState:e.registrationState,size:40}):"checkInState"in e?(0,i.jsx)(CH,{...t,checkInState:e.checkInState,size:40}):(0,i.jsx)(Fg,{...t,size:40}),(0,i.jsx)(AH,{css:{marginLeft:"$3"},size:40,userInfo:e.userInfo})]})},SH=()=>{const e=Ln();return(0,i.jsxs)(Ea,{align:"center",css:{flex:1},direction:"column",gap:"4",justify:"center",children:[(0,i.jsx)(mj,{color:"primary",icon:"user-group"}),(0,i.jsx)(fr,{color:"gray500",children:e("aucun_b_n_vole_19616")})]})},EH=ar("h1",{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}),TH=ar(Va,{color:"$gray800",margin:"0 $3",padding:"$3 $4"}),zH=({back:e,slot:t})=>{const{organizationId:n,eventId:o,positionId:s,positionSlotId:r}=Wn(),a=Nn(Ku),l=Gn(),{hasPositionPermission:d}=Uv(),c=d(db.READ_POSITION,{positionCategoryId:t.positionCategoryId,positionId:s});return(0,i.jsxs)(pG,{back:e,children:[(0,i.jsx)(QG,{css:{minHeight:"40px",marginRight:"0"},children:(0,i.jsx)(EH,{children:nH(t,a)})}),c&&(0,i.jsx)(TH,{icon:"list-check",onClick:()=>{l.push(So.POSITION_SLOT_MEMBERS_CHECK_OPTIONS(n,o,s,r))}})]})},$H=e=>e.event.volunteersRegistrations.nodes,OH=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:o}=Wn(),s=Ln(),r=Gn(),a={eventId:t,positionSlotId:o,predicates:[],limit:_c,offset:0},{data:l,loader:d,loadMore:c,xs:u}=CG(da,a,$H);return d&&void 0===l?d:(0,i.jsxs)(fG,{children:[(0,i.jsx)(zH,{back:()=>{r.push(ao.POSITION_SLOTS({organizationId:e,eventId:t,positionId:n}))},slot:l.event.positionSlot}),(0,i.jsx)(mG,{children:(0,i.jsx)(Ea,{css:{flex:1,margin:"$7 0"},direction:"column",gap:"7",children:0===u.length?(0,i.jsx)(SH,{}):(0,i.jsxs)(Ea,{direction:"column",gap:"6",children:[u.map(s=>(0,i.jsx)(wH,{checkInState:s.positionSlotUserInfo.state,openVolunteer:()=>{r.push(So.POSITION_SLOT_MEMBERS_USER_INFORMATIONS(e,t,n,o,s.userInfo.id))},userInfo:s.userInfo},s.id)),(0,i.jsx)(kG,{buttonText:s("afficher_plus_d_41906"),isLoading:void 0!==d,loadMore:c,pageInfo:l.event.volunteersRegistrations.pageInfo,statusText:s("_1_sur_2_mem_14323",u.length,l.event.volunteersRegistrations.totalCount)})]})})})]})},RH=ar("div",{minHeight:"$space$5","@tablet":{minHeight:"$space$6"}}),PH=e=>(0,i.jsx)(fr,{color:"gray800",css:{fontSize:"$textLg","@tablet":{fontSize:"$textMd"},...e.css},fontWeight:"semiBold",children:e.children}),DH=e=>{const t=pc(),n=Ln(),o=e.fieldsToDisplay.filter(e=>!["picture","firstName","lastName"].includes(e.fieldProperty)),s=o.length,r=e.privateCustomFields.length;return(0,i.jsxs)(Ea,{direction:"column",children:[s>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(PH,{children:n("informations_pe_37892")}),(0,i.jsx)(Pa,{height:"3"}),o.map(t=>jj(t,e.userInfo.fields,o)&&(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(XT,{field:t,fields:e.userInfo.fields}),(0,i.jsx)(RH,{})]},t.id)),!1===t&&(0,i.jsx)(fr,{css:{borderBottom:"1px solid $gray200"},width:1})]}),r>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:t?5:6}),(0,i.jsxs)(Ea,{gap:"3",children:[(0,i.jsx)(PH,{children:(0,i.jsx)(Va,{icon:"lock"})}),(0,i.jsx)(PH,{children:n("informations_pr_15873")})]}),(0,i.jsx)(Pa,{height:"3"}),e.privateCustomFields.map(t=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(XT,{field:t,fields:e.userInfo.fields}),(0,i.jsx)(RH,{})]},t.id)),!1===t&&(0,i.jsx)(fr,{css:{borderBottom:"1px solid $gray200"},width:1})]}),!1===t&&e.editButton,!1===t&&(0,i.jsx)(Pa,{height:"6"})]})},FH=e=>{const t=Gn(),n=pc(),o=h(e.path);return(0,i.jsxs)(Ea,{css:{cursor:o?"pointer":"initial"},direction:"column",onClick:()=>{o&&t.push(e.path)},children:[(0,i.jsx)(fr,{color:"gray800",css:{fontSize:"$textSm",overflow:"hidden",textOverflow:"ellipsis"},fontWeight:"medium",children:e.text}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:e.subtext}),(0,i.jsx)(Pa,{height:n?5:6})]})},MH=e=>{const t=Ln(),{hasPositionPermission:n}=Uv(),o=Nn($c),s=Nn(Ng),r=Nn(Ku),a=pc(),l=n(db.ASSIGN_MEMBER),d=(0,Zd.A)(e.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),c=(0,Zd.A)(e.volunteerRegistration.preassignPositions.map(({id:e,name:t,range:n})=>({id:e,name:t,range:n,isPosition:!0})).concat(e.volunteerRegistration.preassignPositionsCategories.map(({id:e,name:t,range:n})=>({id:e,name:t,range:n,isPosition:!1}))),e=>e.range?.start.toMillis()??0);return(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(Pa,{height:"6"}),Zo(d)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(PH,{children:t("affectation_plural")}),(0,i.jsx)(Pa,{height:"3"}),d.map((t,o)=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(tk,{canCheckIn:n(db.READ_POSITION,{positionCategoryId:t.positionCategoryId,positionId:t.position.id}),canDelete:l,positionSlotUserInfo:t,reloadCheckIn:e.reload,onDelete:e.reload}),(0,i.jsx)(Pa,{height:a?2:3})]},o)),(0,i.jsx)(Pa,{height:"3"}),!1===a&&(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(Pa,{height:a?5:6})]}),Zo(c)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(PH,{children:t("missions_et_cat_88954")}),(0,i.jsx)(Pa,{height:"3"}),c.map((t,n)=>(0,i.jsx)(FH,{path:t.isPosition?ao.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:t.id}):ao.POSITION_CATEGORY({organizationId:e.organizationId,eventId:e.eventId,positionCategoryId:t.id}),subtext:t.range?r.toDisplayString(t.range):"-",text:t.name},n)),!1===a&&(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(Pa,{height:a?5:6})]}),(Zo(e.volunteerRegistration.positionsCategories)||Zo(e.volunteerRegistration.positions)||Zo(e.volunteerRegistration.positionsSlots))&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(PH,{children:t("missions_souhai_23225")}),(0,i.jsx)(Pa,{height:"3"}),(0,Zd.A)(e.volunteerRegistration.positionsCategories,e=>e.range?.start?.toMillis()??0).map((t,n)=>(0,i.jsx)(FH,{path:ao.POSITION_CATEGORY({organizationId:e.organizationId,eventId:e.eventId,positionCategoryId:t.id}),subtext:t.range?r.toDisplayString(t.range):"-",text:t.name},n)),(0,Zd.A)(e.volunteerRegistration.positions,e=>e.range?.start?.toMillis()??0).map((t,n)=>(0,i.jsx)(FH,{path:ao.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:t.id}),subtext:t.range?r.toDisplayString(t.range):"-",text:t.name},n)),(0,Zd.A)(e.volunteerRegistration.positionsSlots,e=>e.range.start.toMillis()).map((t,n)=>(0,i.jsx)(FH,{path:ao.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:t.position.id}),subtext:t.nameOrRange,text:t.position.name},n)),!1===a&&(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(Pa,{height:a?5:6})]}),Zo(e.volunteerRegistration.slots)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(PH,{children:t("disponibilit_s_49923")}),(0,i.jsx)(Pa,{height:"3"}),e.volunteerRegistration.slots.map((e,n)=>(0,i.jsx)(FH,{subtext:r.toDisplayString(e.range),text:t("disponibilit_n_50484",n+1)},n)),!1===a&&(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(Pa,{height:a?5:6})]}),e.volunteerRegistration.state===Et.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(PH,{children:t("statistiques_98073")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(FH,{subtext:s.minutesToHoursMinutesString(e.volunteerRegistration.volunteerMinutes),text:t("nombre_d_heures_36999")}),!1===a&&(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(Pa,{height:a?5:6})]}),(0,i.jsx)(PH,{children:t("inscription_48144")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(FH,{subtext:o.toLocaleString(e.volunteerRegistration.insertedAt.toLocal(),Ho.DateTime),text:t("date_d_inscript_31369")})]})},NH=ar(fr,{lineHeight:"28px",marginTop:"$3",maxWidth:"100%",ellipsis:""}),LH=ar(fr,{lineHeight:"20px",maxWidth:"100%",ellipsis:""}),BH=({registration:e})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(CH,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,registrationState:e.state,size:64}),(0,i.jsx)(NH,{color:"gray800",fontSize:"textLg",fontWeight:"semiBold",children:e.userInfo.name}),(0,i.jsx)(LH,{color:"gray500",fontSize:"textSm",children:e.userInfo.email})]}),VH=({basePath:e,data:t,reload:n})=>{const o=Ln(),{organizationId:s,eventId:r}=Wn(),a=t.event.volunteerRegistration,l={informations:`${e}/${ii.INFORMATION}`,registration:`${e}/${ii.REGISTRATION}`};return(0,i.jsxs)(Ea,{align:"center",css:{alignSelf:"center",padding:"0 $4"},direction:"column",width:1,children:[(0,i.jsx)(BH,{registration:a}),(0,i.jsxs)(Vy,{css:{marginTop:"$5"},children:[(0,i.jsxs)(ZG,{children:[(0,i.jsx)(JG,{path:l.informations,children:o("informations_22954")}),(0,i.jsx)(JG,{path:l.registration,children:o("missions_63972")})]}),(0,i.jsx)(By,{path:l.informations,children:(0,i.jsx)(DH,{fieldsToDisplay:t.event.formsCustomsFields,privateCustomFields:t.organization.customFields.nodes,userInfo:a.userInfo})}),(0,i.jsx)(By,{path:l.registration,children:(0,i.jsx)(MH,{eventId:r,organizationId:s,reload:n,volunteerRegistration:a})})]})]})},UH=({basePath:e,onClose:t})=>{const{organizationId:n,eventId:o,userInfoId:s}=Wn(),{data:r,loader:a,reload:l}=Vn("query UserInfoMobile(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n    $userInfoId: UsersInfoId!\n) {\n    organization(id: $organizationId) {\n        customFields(variety: UserInfo, privacy: Private) {\n            nodes {\n                ...CustomFieldWithCondition\n            }\n        }\n    }\n\n    event(id: $eventId) {\n        formsCustomsFields {\n            ...CustomFieldWithCondition\n        }\n\n        volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n            id\n            state\n            volunteerMinutes\n            insertedAt\n\n            slots {\n                range\n            }\n\n            positionsSlots {\n                nameOrRange\n                range\n\n                position {\n                    id\n                    name\n                }\n            }\n\n            positions {\n                id\n                name\n                range\n            }\n\n            positionsCategories {\n                id\n                name\n                range\n            }\n\n            userInfo {\n                ...UserInfoOverlay\n            }\n\n            positionsSlotsUsersInfos {\n                ...UserPositionSlotUserInfo\n            }\n\n            preassignPositions {\n                id\n                name\n                range\n            }\n\n            preassignPositionsCategories {\n                id\n                name\n                range\n            }\n        }\n    }\n}\n",{organizationId:n,eventId:o,userInfoId:s},[Ro.CustomFieldWithConditionFragment,Ro.UserInfoOverlayFragment,Ro.UserPositionSlotUserInfoFragment]);return(0,i.jsx)(aG,{onClose:t,children:a||(0,i.jsx)(VH,{basePath:e,data:r,reload:l})})},WH=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:o,userInfoId:s}=Wn(),r=Gn(),a=So.POSITION_SLOT_MEMBERS_USER(e,t,n,o,s);return(0,i.jsx)(UH,{basePath:a,onClose:()=>{r.push(So.POSITION_SLOT_MEMBERS(e,t,n,o))}})},GH=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.POSITION_SLOT_CHECK_MEMBERS_CHECK_IN(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(mH,{})}),(0,i.jsx)(_r.qh,{path:So.POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(fH,{})}),(0,i.jsx)(_r.qh,{path:So.POSITION_SLOT_CHECK_MEMBERS_RESET(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(IH,{})}),(0,i.jsx)(_r.qh,{path:So.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(OH,{})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(aH,{})})]}),(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.POSITION_SLOT_MEMBERS_CHECK_OPTIONS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(lH,{})}),(0,i.jsx)(_r.qh,{path:So.POSITION_SLOT_MEMBERS_USER(":organizationId",":eventId",":positionId",":positionSlotId",":userInfoId"),children:(0,i.jsx)(WH,{})})]})]}),HH=ar("i",{fontSize:"$textXl"}),qH=({replaySearch:e})=>{const{eventId:t}=Wn(),{data:n,loader:o}=Vn("query RecentVolunteersSearchesMobile($eventId: EventId!) {\n    event(id: $eventId) {\n        recentVolunteersRegistrationsSearches\n    }\n}\n",{eventId:t},[]),s=Ln();if(o)return o;{const t=n.event.recentVolunteersRegistrationsSearches;return(0,i.jsxs)(Ea,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(fr,{fontSize:"textMd",fontWeight:"semiBold",children:s("recherches_r_ce_82891",t.length)}),t.map((t,n)=>(0,i.jsxs)(Ea,{align:"center",gap:"2",onClick:()=>{e(t)},children:[(0,i.jsx)(HH,{className:"fa-regular fa-clock"}),(0,i.jsx)(fr,{children:t})]},n))]})}},YH=()=>{const e=Ln();return(0,i.jsx)(rk,{css:{flex:1,padding:"0 $4"},title:e("d_sol_il_n_y_46236")})},KH=e=>e.event.volunteersRegistrations.nodes,ZH=({search:e})=>{const t=Ln(),{organizationId:n,eventId:o}=Wn(),s={eventId:o,predicates:[],limit:_c,offset:0,name:e},{data:r,loader:a,loadMore:l,xs:d}=CG(ja,s,KH),c=Gn();return a&&void 0===r?a:0===d.length?(0,i.jsx)(YH,{}):(0,i.jsxs)(Ea,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(fr,{fontSize:"textMd",fontWeight:"semiBold",children:t("r_sultat_de_la_64686",d.length)}),d.map((e,t)=>(0,i.jsx)(wH,{openVolunteer:()=>{c.push(So.VOLUNTEERS_SEARCH_USER_INFORMATIONS(n,o,e.userInfo.id))},registrationState:e.state,userInfo:e.userInfo},t)),(0,i.jsx)(kG,{buttonText:t("afficher_plus_d_41906"),isLoading:void 0!==a,loadMore:l,pageInfo:r.event.volunteersRegistrations.pageInfo,statusText:t("_1_sur_2_mem_14323",d.length,r.event.volunteersRegistrations.totalCount)})]})},XH=ar(Ea,{color:"$blue600"}),JH=()=>{const{organizationId:e,eventId:t}=Wn(),n=Gn(),o=Ln(),[s,r]=(0,F.useState)(""),[a,l]=(0,F.useState)("");return(0,i.jsxs)(fG,{children:[(0,i.jsx)(pG,{back:()=>{n.push(So.VOLUNTEERS(e,t))},children:(0,i.jsxs)(Ea,{align:"center",css:{marginRight:"$4",flexGrow:1},gap:"3",children:[(0,i.jsx)(wl,{icon:"search",placeholder:o("rechercher_un_m_05904"),value:s,onChange:e=>{r(e),e||l(e)},onKeyDown:e=>{"Enter"===e.key&&l(s)}}),a&&(0,i.jsx)(XH,{onClick:()=>{r(""),l("")},children:o("annuler_48254")})]})}),(0,i.jsx)(mG,{children:a?(0,i.jsx)(ZH,{search:a}):(0,i.jsx)(qH,{replaySearch:e=>{r(e),l(e)}})})]})},QH=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Wn(),o=Gn(),s=So.VOLUNTEERS_SEARCH_USER(e,t,n);return(0,i.jsx)(UH,{basePath:s,onClose:()=>{o.push(So.VOLUNTEERS_SEARCH(e,t))}})},eq=()=>{const e=Ln();return(0,i.jsx)(rk,{css:{flex:1,padding:"0 $4"},subtitle:e("diffusez_le_for_36054"),title:e("il_n_y_a_pas_de_22623")})},tq=e=>e.event.volunteersRegistrations.nodes,nq=({segment:e})=>{const t=Ln(),{organizationId:n,eventId:o,segmentId:s}=Wn(),r={eventId:o,predicates:e.predicates,limit:_c,offset:0},{data:a,loader:l,loadMore:d,xs:c}=CG(ja,r,tq),u=Gn();return l&&void 0===a?l:0===c.length?(0,i.jsx)(eq,{}):(0,i.jsxs)(Ea,{direction:"column",gap:"6",children:[c.map((e,t)=>(0,i.jsx)(wH,{openVolunteer:()=>{u.push(So.VOLUNTEERS_LIST_USER_INFORMATIONS(n,o,s,e.userInfo.id))},registrationState:e.state,userInfo:e.userInfo},t)),(0,i.jsx)(kG,{buttonText:t("afficher_plus_d_41906"),isLoading:void 0!==l,loadMore:d,pageInfo:a.event.volunteersRegistrations.pageInfo,statusText:t("_1_sur_2_mem_14323",c.length,a.event.volunteersRegistrations.totalCount)})]})},iq=ar("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),oq=ar(Va,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),sq=({event:e})=>{const{organizationId:t,eventId:n,segmentId:o}=Wn(),s=Gn(),r=Ln(),a=(0,BG.A)(e.segmentsFolders.flatMap(e=>e.segments),{id:o});return(0,i.jsxs)(Ea,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Ea,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(iq,{children:r("membres_11310")}),(0,i.jsx)(oq,{icon:"search",onClick:()=>{s.push(So.VOLUNTEERS_SEARCH(t,n))}})]}),(0,i.jsx)(fr,{children:(0,i.jsx)(LG,{folders:e.segmentsFolders,segmentId:o,onChange:e=>s.push(So.VOLUNTEERS_SEGMENT(t,n,e))})}),(0,i.jsx)(Ea,{css:{flex:1},direction:"column",children:(0,i.jsx)(nq,{segment:a})})]})},rq=()=>{const{organizationId:e,eventId:t,segmentId:n,userInfoId:o}=Wn(),s=Gn(),r=So.VOLUNTEERS_LIST_USER(e,t,n,o);return(0,i.jsx)(UH,{basePath:r,onClose:()=>{s.push(So.VOLUNTEERS_SEGMENT(e,t,n))}})},aq=()=>{const{organizationId:e,eventId:t}=Wn(),{data:n,loader:o}=Vn("query VolunteersSegmentsMobile($eventId: EventId!) {\n    event(id: $eventId) {\n        segmentsFolders(segmentType: Volunteers) {\n            ...SegmentsFoldersSegments\n        }\n    }\n}\n",{eventId:t},[Ro.SegmentsFoldersSegmentsFragment]);return o||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.VOLUNTEERS_SEARCH(":organizationId",":eventId"),children:(0,i.jsx)(JH,{})}),(0,i.jsx)(_r.qh,{path:So.VOLUNTEERS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(sq,{event:n.event})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.VOLUNTEERS_SEGMENT(e,t,n.event.segmentsFolders[0].segments[0].id)})})]}),(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.VOLUNTEERS_SEARCH_USER(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(QH,{})}),(0,i.jsx)(_r.qh,{path:So.VOLUNTEERS_LIST_USER(":organizationId",":eventId",":segmentId",":userInfoId"),children:(0,i.jsx)(rq,{})})]})]})},lq=()=>{const{organizationId:e,eventId:t}=Wn(),{user:n}=nI();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.DASHBOARD(":organizationId",":eventId"),children:(0,i.jsx)(KW,{eventId:t,user:n,children:(0,i.jsx)(tG,{})})}),(0,i.jsx)(_r.qh,{path:So.VOLUNTEERS(":organizationId",":eventId"),children:(0,i.jsx)(KW,{eventId:t,user:n,children:(0,i.jsx)(aq,{})})}),(0,i.jsx)(_r.qh,{path:ao.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(KW,{eventId:t,user:n,children:(0,i.jsx)(YG,{})})}),(0,i.jsx)(_r.qh,{path:ao.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(GH,{})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.DASHBOARD(e,t)})})]}),(0,i.jsx)(_r.dO,{children:(0,i.jsx)(_r.qh,{path:So.DASHBOARD_EVENT_SWITCH(":organizationId",":eventId"),children:(0,i.jsx)(hG,{})})})]})},dq=e=>{const t=e.isActive?e.isActive(location.pathname):location.pathname===e.to,[n,o]=F.useState(t),s=!!e.children&&(!e.isMenuOpen||n),r=()=>(0,i.jsxs)(Ea,{align:"center",className:t?"h-event-menu-group-active":"",css:{color:"$gray700",cursor:"pointer",padding:"$2 $3","&:hover, &.h-event-menu-group-active":{background:"$primary50",borderRadius:"6px",color:"$primary700"}},gap:"3",height:e.isMenuOpen?void 0:40,width:1,onClick:()=>{e.isMenuOpen&&o(!n)},children:[(0,i.jsx)(Va,{icon:e.icon}),e.isMenuOpen&&(0,i.jsx)(fr,{css:{flex:"1"},fontWeight:"medium",children:e.title}),e.isMenuOpen&&e.children&&(0,i.jsx)(fr,{fontSize:"textXs",children:(0,i.jsx)(Va,{icon:n?"chevron-up":"chevron-down"})})]});return(0,i.jsxs)(Ea,{className:e.isMenuOpen?"h-event-menu-open":"h-event-menu-collapsed",css:{position:"relative",userSelect:"none","&.h-event-menu-collapsed > .h-event-menu-group":{display:"none"},"&.h-event-menu-collapsed:hover > .h-event-menu-group":{display:"flex"}},direction:"column",gap:"2",width:1,children:[e.isMenuOpen&&e.children||!e.to?r():(0,i.jsx)(La,{to:e.to,children:r()}),s&&(0,i.jsx)(Ea,{className:"h-event-menu-group",css:e.isMenuOpen?{paddingLeft:"36px"}:{left:"28px",position:"absolute",paddingLeft:"12px",top:"-8px",width:"192px",zIndex:"10"},children:(0,i.jsxs)(Ea,{css:e.isMenuOpen?{}:{background:"white",bd:"gray200 2 md",py:"$2",width:"100%"},direction:"column",children:[!e.isMenuOpen&&(0,i.jsx)(fr,{css:{padding:"$2 $3"},font:"gray900 textSm semiBold",children:e.title}),e.children]})})]})},cq=e=>{const t=e.isActive(location.pathname);return(0,i.jsx)(La,{"aria-label":e.children,"aria-selected":t,role:"menuitem",to:e.to,onClick:async()=>await(e.onClick?.()),children:(0,i.jsx)(Ea,{className:t?"h-event-menu-item-active":"",css:{color:"$gray800",cursor:"pointer",padding:"6px $3","&:hover, &.h-event-menu-item-active":{color:"$primary700"}},children:e.children})})},uq=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=il(),{hasFeature:s}=nI(),{isEventAdmin:r,isEventReader:a,hasDelegationCategoryPermission:l,hasPositionPermission:d,numberOfWaitingAccreditations:c,numberOfWaitingAssigments:u,updateLocalEvent:h}=Uv(),m=Gh(),g=(0,F.useCallback)(e=>e.endsWith("/volunteers")||null!==e.match(/\/volunteers\/\d+/)||null!==e.match(/\/member\/\d+/)&&(e.endsWith("informations")||e.endsWith("availabilities")||e.endsWith("positions")||e.endsWith("accreditations")||e.endsWith("actions")||e.endsWith("comments")||e.includes("history")),[]),p=(0,F.useCallback)(e=>null!==e.match(/\/delegations\/\d+/)||null!==e.match(/\/delegation\/\d+/)||null!==e.match(/\/delegation-category\/\d+/),[]),f=(0,F.useCallback)(e=>g(e)||p(e),[g,p]),x=(0,F.useCallback)(e=>(null!==e.match(/\/positions\/\d+/)||null!==e.match(/\/position\/\d+/)||null!==e.match(/\/position-category\/\d+/))&&!e.includes("documents"),[]),_=(0,F.useCallback)(e=>e.endsWith("/assignments")||e.endsWith("/assignments/blank")||null!==e.match(/\/assignment\/\d+/)||null!==e.match(/\/pre-assignment\/\d+/)||null!==e.match(/\/team-assignment\/\w+/),[]),I=(0,F.useCallback)(e=>x(e)||_(e),[x,_]),v=(0,F.useCallback)(e=>null!==e.match(/\/accreditations\/\d+/)||null!==e.match(/\/accreditation\/\d+/)||null!==e.match(/\/accreditation-category\/\d+/),[]),b=(0,F.useCallback)(e=>e.endsWith("/accreditations-assignments")||null!==e.match(/\/edit-accredit\/\d+/),[]),j=(0,F.useCallback)(e=>v(e)||b(e),[v,b]),C=(0,F.useCallback)(e=>e.endsWith("/forms"),[]),y=(0,F.useCallback)(e=>e.endsWith("/campaigns")&&!e.endsWith("/history/campaigns")||null!==e.match(/\/campaign\/\d+/),[]),k=(0,F.useCallback)(e=>e.endsWith("/emails/parameters")||e.endsWith("/emails/templates")||e.endsWith("/emails/dns"),[]),A=(0,F.useCallback)(e=>e.endsWith("/documents")||null!==e.match(/\/documents\//),[]),w=(0,F.useCallback)(e=>C(e)||y(e)||k(e)||A(e),[C,y,k,A]),S=(0,F.useCallback)(e=>e.endsWith("/options/api"),[]),E=(0,F.useCallback)(e=>e.endsWith("options/weezevent-v2"),[]),T=(0,F.useCallback)(e=>e.endsWith("/workflows"),[]),z=(0,F.useCallback)(e=>S(e)||E(e)||T(e),[S,E,T]),$=a,O=(0,F.useMemo)(()=>s(Fe.Delegation)&&l(lb.READ_DELEGATION),[s,l]),R=d(db.READ_POSITION),P=d(db.ASSIGN_MEMBER),D=(0,F.useMemo)(()=>s(Fe.Accreditation)&&a,[s,a]),M=D&&r,N=a,L=a,B=a,V=s(Fe.Api),U=a,W=a||d(db.SEND_CAMPAIGNS),G=N||W||L||B;return(0,i.jsxs)(Ea,{css:{overflowY:e.isOpen?"auto":void 0,paddingTop:"$5",px:"$3"},direction:"column",gap:"5",width:1,children:[(0,i.jsxs)(Ea,{align:"center",css:{bd:"gray300 1",cursor:"pointer",padding:"$2 $3"},gap:"2",onClick:e=>{Il(e),e.target.dispatchEvent(new CustomEvent(lE,{bubbles:!0}))},children:[(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"sparkles"})}),e.isOpen&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray800",css:{flex:"1"},children:t("action_rapide_97952")}),(0,i.jsxs)(Ea,{align:"center",css:{background:"$gray50",bd:"gray200 1",padding:"2px $1"},justify:"center",children:[m?"⌘":"Ctrl","+k"]})]})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:1,children:[$&&(0,i.jsx)(dq,{icon:"objects-column",isMenuOpen:e.isOpen,title:t("tableau_de_bord_24627"),to:So.DASHBOARD(n,o)}),(0,i.jsxs)(dq,{icon:"user-group",isActive:f,isMenuOpen:e.isOpen,title:t("population_38615"),to:So.VOLUNTEERS(n,o),children:[(0,i.jsx)(cq,{isActive:g,to:So.VOLUNTEERS(n,o),onClick:()=>h({volunteersSegmentId:null}),children:t("membres_11310")}),O&&(0,i.jsx)(cq,{isActive:p,to:to.DELEGATIONS({organizationId:n,eventId:o}),onClick:()=>h({delegationsSegmentId:null}),children:t("d_l_gations_78318")})]}),R&&(0,i.jsxs)(dq,{icon:"sitemap",isActive:I,isMenuOpen:e.isOpen,title:t("missions_63972"),to:ao.POSITIONS({organizationId:n,eventId:o}),children:[(0,i.jsx)(cq,{isActive:x,to:ao.POSITIONS({organizationId:n,eventId:o}),onClick:()=>h({positionsSegmentId:null}),children:t("missions_63972")}),P&&(0,i.jsx)(cq,{isActive:_,to:So.ASSIGNMENTS(n,o),children:`${t("affectation_plural")} (${u})`})]}),D&&(0,i.jsxs)(dq,{icon:"badge-check",isActive:j,isMenuOpen:e.isOpen,title:t("accr_ditations_39450"),to:Hi.ACCREDITATIONS({organizationId:n,eventId:o}),children:[(0,i.jsx)(cq,{isActive:v,to:Hi.ACCREDITATIONS({organizationId:n,eventId:o}),onClick:()=>h({accreditationsSegmentId:null}),children:t("accr_ditations_39450")}),M&&(0,i.jsx)(cq,{isActive:b,to:So.ACCREDITATIONS_ASSIGNMENTS(n,o),children:`${t("mod_ration_09947")} (${c})`})]}),G&&(0,i.jsxs)(dq,{icon:"message",isActive:w,isMenuOpen:e.isOpen,title:t("communication_05277"),to:zi.FORMS({organizationId:n,eventId:o}),children:[N&&(0,i.jsx)(cq,{isActive:C,to:zi.FORMS({organizationId:n,eventId:o}),children:t("Form_plural")}),W&&(0,i.jsx)(cq,{isActive:y,to:rI.CAMPAIGNS({organizationId:n,eventId:o}),children:t("Campaigns")}),L&&(0,i.jsx)(cq,{isActive:e=>e.endsWith("/emails/parameters")||e.endsWith("/emails/templates")||e.endsWith("/emails/dns"),to:So.EVENT_EMAILS_PARAMETERS(n,o),children:t("e_mails_09850")}),B&&(0,i.jsx)(cq,{isActive:A,to:So.DOCUMENTS(n,o),children:t("Documents")})]}),U&&(0,i.jsxs)(dq,{icon:"sliders-up",isActive:z,isMenuOpen:e.isOpen,title:t("options_53186"),to:So.OPTIONS_API(n,o),children:[V&&(0,i.jsx)(cq,{isActive:S,to:So.OPTIONS_API(n,o),children:"API"}),(0,i.jsx)(cq,{isActive:E,to:So.OPTIONS_WEEZEVENT_V2(n,o),children:"Weezevent"}),(0,i.jsx)(cq,{isActive:T,to:SI.WORKFLOWS({organizationId:n,eventId:o}),children:t("automatisations_60045")})]})]})]})},hq=e=>{const{translate:t}=il();return(0,i.jsx)(Ea,{align:"center",css:{px:"$4"},height:48,justify:"end",children:(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(pl,{color:"white",css:{border:"none"},leftIcon:"sidebar",size:"sm",onClick:e.onToggle})}),(0,i.jsx)(am,{placement:"top",children:e.isOpen?t("masquer_le_menu_29008"):t("afficher_le_men_91936")})]})})},mq=()=>{const{params:{organizationId:e,eventId:t},translate:n}=il(),{hasFeature:o}=nI(),{event:s,isEventAdmin:r,isEventReader:a,hasDelegationCategoryPermission:l,hasPositionPermission:d}=Uv();Cd(s.name);const[c,u]=wC(e,"isEventMenuOpen",!1),h=d(db.ASSIGN_MEMBER),m=(0,F.useMemo)(()=>o(Fe.Delegation)&&l(lb.READ_DELEGATION),[o,l]),g=(0,F.useMemo)(()=>a||d(db.SEND_CAMPAIGNS),[a,d]),p=(0,F.useMemo)(()=>o(Fe.Accreditation)&&a,[o,a]);return(0,i.jsxs)(Ea,{height:1,width:1,children:[(0,i.jsxs)(Ea,{"aria-label":n("menu_de_l_v_ne_05526"),as:Aa.Nav,css:{borderRight:"1px solid $gray200"},direction:"column",width:c?240:64,children:[(0,i.jsx)(Ea,{css:{flex:"1",overflowY:c?"hidden":void 0},width:1,children:(0,i.jsx)(uq,{isOpen:c})}),(0,i.jsx)(hq,{isOpen:c,onToggle:()=>{u(!c)}})]}),(0,i.jsx)(fr,{css:{flex:"1",height:"100%",overflowX:"hidden"},tabIndex:-1,children:(0,i.jsxs)(_r.dO,{children:[a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.DASHBOARD(":organizationId",":eventId"),children:(0,i.jsx)(dN,{})}),(0,i.jsx)(_r.qh,{path:ao.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(HU,{})}),(0,i.jsx)(_r.qh,{path:ao.POSITION_CATEGORY({organizationId:":organizationId",eventId:":eventId",positionCategoryId:":positionCategoryId"}),children:(0,i.jsx)(pW,{})}),(0,i.jsx)(_r.qh,{path:ao.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(rW,{})}),(0,i.jsx)(_r.qh,{path:So.VOLUNTEERS(":organizationId",":eventId"),children:(0,i.jsx)(VW,{})}),(0,i.jsx)(_r.qh,{path:So.EDIT_USER(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(Lz,{})}),r&&(0,i.jsx)(_r.qh,{path:So.EDIT_USER_DELEGATION(":organizationId",":eventId",":delegationId",":userInfoId"),children:(0,i.jsx)(Lz,{})}),r&&(0,i.jsx)(_r.qh,{path:So.EDIT_USER_ACCREDITATIONS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(vW,{})}),r&&(0,i.jsx)(_r.qh,{path:So.EDIT_USER_MISSIONS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(CW,{})}),(0,i.jsx)(_r.qh,{path:So.EDIT_USER_SLOTS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(AW,{})}),m&&(0,i.jsx)(_r.qh,{path:to.DELEGATIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(CN,{})}),(0,i.jsx)(_r.qh,{path:kI.MEMBER({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(Az,{})}),m&&(0,i.jsx)(_r.qh,{path:to.DELEGATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(Nw,{isEvent:!0})}),m&&(0,i.jsx)(_r.qh,{path:to.DELEGATION({organizationId:":organizationId",eventId:":eventId",delegationId:":delegationId"}),children:(0,i.jsx)(kw,{})}),(a||h)&&(0,i.jsx)(_r.qh,{path:So.ASSIGNMENTS(":organizationId",":eventId"),children:(0,i.jsx)(JM,{})}),h&&(0,i.jsx)(_r.qh,{path:So.ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(qM,{isEdit:!1})}),r&&(0,i.jsx)(_r.qh,{path:So.EDIT_ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(qM,{isEdit:!0})}),r&&(0,i.jsx)(_r.qh,{path:So.TEAM_ASSIGNMENT(":organizationId",":eventId",":teamCode"),children:(0,i.jsx)(sN,{})}),h&&(0,i.jsx)(_r.qh,{path:So.PRE_ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(qM,{isEdit:!1})}),r&&(0,i.jsx)(_r.qh,{path:So.ACCREDITATIONS_ASSIGNMENTS(":organizationId",":eventId"),children:(0,i.jsx)(IM,{})}),r&&(0,i.jsx)(_r.qh,{path:So.ACCREDIT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(hM,{isEdit:!1})}),r&&(0,i.jsx)(_r.qh,{path:So.EDIT_ACCREDIT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(hM,{isEdit:!0})}),a&&(0,i.jsx)(_r.qh,{path:zi.FORMS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(nS,{})}),g&&(0,i.jsx)(_r.qh,{path:rI.CAMPAIGNS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(rN,{})}),g&&(0,i.jsx)(_r.qh,{path:rI.CAMPAIGN({organizationId:":organizationId",eventId:":eventId",campaignId:":campaignId"}),children:(0,i.jsx)(Yb,{})}),a&&(0,i.jsx)(_r.qh,{path:So.EVENT_EMAILS(":organizationId",":eventId"),children:(0,i.jsx)(QB,{})}),a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.DOCUMENTS_USER_PLANNING(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(NB,{})}),a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.DOCUMENTS_USER_PLANNING_LIST(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(WB,{})}),a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.DOCUMENTS_USER_PLANNING_DAYS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(zB,{})}),a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.DOCUMENTS_ASSIGNMENTS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(aB,{})}),a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.DOCUMENTS_VOLUNTEERS_LISTING(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(qB,{})}),a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.DOCUMENTS_BADGE(":organizationId",":eventId",":userInfoId","generic"),children:(0,i.jsx)(cB,{})}),a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.DOCUMENTS_BADGE(":organizationId",":eventId",":userInfoId",":badgeType"),children:(0,i.jsx)(pB,{})}),a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.DOCUMENTS_CERTIFICATE(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(mB,{})}),a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.DOCUMENTS_HOURS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(wB,{})}),a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.DOCUMENTS_POSITION_PLANNING(":organizationId",":eventId",":positionId"),children:(0,i.jsx)(EL,{})}),a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(YL,{})}),a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.DOCUMENTS_POSITION(":organizationId",":eventId",":positionId"),children:(0,i.jsx)(NL,{})}),a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.DOCUMENTS_PLANNING(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(WL,{})}),a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.DOCUMENTS_USERS_PICTURES(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(XB,{})}),a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.DOCUMENTS_USER_CUSTOM_DOCUMENT(":organizationId",":eventId",":userInfoId",":customDocumentId"),children:(0,i.jsx)(jB,{})}),a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.DOCUMENTS(":organizationId",":eventId"),children:(0,i.jsx)(mL,{})}),a&&(0,i.jsx)(_r.qh,{path:So.OPTIONS_WEEZEVENT_V2(":organizationId",":eventId"),children:(0,i.jsx)(CV,{})}),a&&(0,i.jsx)(_r.qh,{path:SI.WORKFLOWS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(q$,{})}),a&&(0,i.jsx)(_r.qh,{path:So.OPTIONS_API(":organizationId",":eventId"),children:(0,i.jsx)(bV,{})}),p&&(0,i.jsx)(_r.qh,{path:Hi.ACCREDITATIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(WD,{})}),p&&(0,i.jsx)(_r.qh,{path:Hi.ACCREDITATION_SLOT({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId",accreditationSlotId:":accreditationSlotId"}),children:(0,i.jsx)(TM,{})}),p&&(0,i.jsx)(_r.qh,{path:Hi.ACCREDITATION({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId"}),children:(0,i.jsx)(FF,{})}),p&&(0,i.jsx)(_r.qh,{path:Hi.ACCREDITATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationCategoryId:":accreditationCategoryId"}),children:(0,i.jsx)(wM,{})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.VOLUNTEERS(e,t),replace:!0})})]})}),(0,i.jsx)(dE,{isAdmin:r,level:"event"})]})},gq=()=>{const{hasFeature:e}=nI(),{isEventAdmin:t,isEventReader:n,hasDelegationCategoryPermissions:o,hasPositionPermissions:s}=Uv(),[r,a]=o([lb.CREATE_DELEGATION,lb.EDIT_DELEGATION]),[l,d,c]=s([db.EDIT_POSITION,db.ASSIGN_MEMBER,db.SEND_CAMPAIGNS]),[u]=s([db.EDIT_POSITION],{positionCategoryId:"ANY"});return(0,i.jsxs)(_r.dO,{children:[u&&(0,i.jsx)(_r.qh,{exact:!0,path:So.CREATE_POSITION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(PV,{})}),l&&(0,i.jsx)(_r.qh,{exact:!0,path:So.EDIT_POSITION(":organizationId",":eventId",":positionId"),children:(0,i.jsx)(DV,{})}),d&&(0,i.jsx)(_r.qh,{path:So.POSITION_SLOT_ASSIGN_VOLUNTEERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(xW,{})}),t&&(0,i.jsx)(_r.qh,{exact:!0,path:rI.CREATE_TEMPLATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(bb,{isAdmin:t,isTemplate:!0})}),c&&(0,i.jsx)(_r.qh,{exact:!0,path:rI.CREATE({organizationId:":organizationId",eventId:":eventId",options:":options?"}),children:(0,i.jsx)(bb,{isAdmin:t,isTemplate:!1})}),c&&(0,i.jsx)(_r.qh,{exact:!0,path:rI.UPDATE({organizationId:":organizationId",eventId:":eventId",campaignId:":campaignId"}),children:(0,i.jsx)(jb,{})}),t&&(0,i.jsx)(_r.qh,{exact:!0,path:So.CREATE_ACCREDITATION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(rD,{})}),t&&(0,i.jsx)(_r.qh,{exact:!0,path:So.EDIT_ACCREDITATION(":organizationId",":eventId",":accreditationId"),children:(0,i.jsx)(aD,{})}),t&&(0,i.jsx)(_r.qh,{path:So.EDIT_CUSTOM_DOCUMENT(":organizationId",":eventId",":customDocumentId"),children:(0,i.jsx)(nL,{})}),r&&(0,i.jsx)(_r.qh,{exact:!0,path:So.CREATE_DELEGATION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(vC,{})}),a&&(0,i.jsx)(_r.qh,{exact:!0,path:So.EDIT_DELEGATION(":organizationId",":eventId",":delegationId"),children:(0,i.jsx)(jC,{})}),n&&(0,i.jsx)(_r.qh,{path:zi.FORM_ELEMENTS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(zS,{})}),n&&(0,i.jsx)(_r.qh,{path:zi.FORM_PARAMETERS_GENERAL({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(QS,{})}),n&&(0,i.jsx)(_r.qh,{path:zi.FORM_PARAMETERS_DESIGN({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(KS,{})}),n&&(0,i.jsx)(_r.qh,{path:zi.FORM_PARAMETERS_AVAILABILITIES({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(mV,{})}),n&&(0,i.jsx)(_r.qh,{path:zi.FORM_PARAMETERS_MISSIONS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(IV,{})}),n&&e(Fe.Accreditation)&&(0,i.jsx)(_r.qh,{path:zi.FORM_PARAMETERS_ACCREDITATIONS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(oV,{})}),n&&(0,i.jsx)(_r.qh,{path:zi.FORM_PARAMETERS_BROADCAST({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(WS,{})}),n&&(0,i.jsx)(_r.qh,{path:zi.FORM_PARAMETERS_STATE({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(nE,{})}),n&&(0,i.jsx)(_r.qh,{path:zi.FORM_INTEGRATION({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(cS,{})}),n&&(0,i.jsx)(_r.qh,{path:zi.FORM_EMAILS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(PS,{})}),n&&(0,i.jsx)(_r.qh,{path:zi.FORM_PREVIEW({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(uS,{})}),t&&(0,i.jsx)(_r.qh,{path:So.EVENT_DELEGATIONS_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(hN,{})}),t&&(0,i.jsx)(_r.qh,{path:So.EVENT_VOLUNTEERS_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(f$,{})}),t&&(0,i.jsx)(_r.qh,{path:ao.POSITION_IMPORT_CSV({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(NV,{})}),t&&(0,i.jsx)(_r.qh,{path:So.EVENT_FILES_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(Yw,{})}),t&&(0,i.jsx)(_r.qh,{path:[kI.CREATE({organizationId:":organizationId",eventId:":eventId",delegationId:":delegationId"}),kI.CREATE({organizationId:":organizationId",eventId:":eventId"})],children:(0,i.jsx)(_T,{})}),t&&(0,i.jsx)(_r.qh,{path:SI.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(R$,{})}),n&&(0,i.jsx)(_r.qh,{path:SI.UPDATE({organizationId:":organizationId",eventId:":eventId",workflowId:":workflowId"}),children:(0,i.jsx)(P$,{})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(SE,{children:(0,i.jsx)(mq,{})})})]})},pq=()=>{const{organizationId:e,eventId:t}=Wn(),{data:n,loader:o}=Vn("query Event($organizationId: OrganizationId!, $eventId: EventId!) {\n    event(id: $eventId) {\n        id\n        organizationId\n        name\n        languages\n\n        accreditationsStats {\n            numberOfWaitingAccreditation\n        }\n\n        assignmentsStats {\n            numberOfWaitingAssignment\n            numberOfPreAssigned\n        }\n    }\n\n    user {\n        ...UserPermissions\n    }\n}\n",{organizationId:e,eventId:t},[Ro.UserPermissionsFragment]),{setSelectedEventId:s}=nI(),r=pc();if((0,F.useEffect)(()=>(s(t),()=>{s()}),[t]),o)return o;{const e=n.event.assignmentsStats;return(0,i.jsx)(Mv,{userPermissions:n.user,children:(0,i.jsx)(Vv,{event:n.event,numberOfWaitingAccreditations:n.event.accreditationsStats.numberOfWaitingAccreditation,numberOfWaitingAssigments:$v(n.user)?e.numberOfWaitingAssignment+e.numberOfPreAssigned:e.numberOfPreAssigned,children:r?(0,i.jsx)(lq,{}):(0,i.jsx)(gq,{})})})}};let fq=class extends zl{documentInputService;constructor(e,t){super(e),this.documentInputService=t}emailSenderInputDefault(e){return{header:e?.header??this.documentInputService.documentInputDefault(),picture:e?.picture??this.documentInputService.documentInputDefault(),footer:e?.footer??this.documentInputService.documentInputDefault(),signature:e?.signature??"",name:e?.name??"",fromEmail:e?.fromEmail??"",fromName:e?.fromName??"",replyTo:e?.replyTo??"",eventsIds:e?.eventsIds??[],isOrganizationDefault:e?.isOrganizationDefault??!1}}emailSenderInputSchema(){return l.Ik().shape({header:this.documentInputService.documentInputSchemaNotRequired(),picture:this.documentInputService.documentInputSchemaNotRequired(),signature:l.Yj(),name:l.Yj().required(this.t("le_label_est_re_86986")),fromEmail:l.Yj().required(this.t("l_e_mail_de_l_56279")),fromName:l.Yj().required(this.t("le_nom_de_l_me_01331")),replyTo:l.Yj()})}createUpdateEmailSenderSchema(){return l.Ik().shape({emailSender:this.emailSenderInputSchema()})}};fq=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn,ej])],fq);const xq=e=>{const{history:t,translate:n,params:{organizationId:o}}=il(),{showNotification:s}=Yv(),r=Nn(fq),a=(0,F.useRef)(null),[l,d]=(0,F.useState)(e.initialValues.emailSender.isOrganizationDefault||Zo(e.initialValues.emailSender.eventsIds)),[c,u]=(0,F.useState)(e.initialValues.emailSender.eventsIds.concat(e.initialValues.emailSender.isOrganizationDefault?["community"]:[]));return(0,i.jsx)(dl,{customErrorRef:a,height:1,initialValues:e.initialValues,render:({handleSubmit:t,submitting:s,values:r})=>{return(0,i.jsx)(bm,{button:e.isEdit&&(0,i.jsx)(pl,{isLoading:s,onClick:t,children:n("mettre_jour_l_14264")}),category:n("_metteur_d_e_ma_51878"),fallbackClosePath:So.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(o),title:e.isEdit?(m=e.initialValues.emailSender,h(m.fromName)?`${m.fromName} (${m.fromEmail})`:m.fromEmail):n("nouvel_metteur_58381"),children:(0,i.jsxs)(Im,{ref:a,children:[(0,i.jsx)(sl,{}),(0,i.jsx)(Cm,{hideToggle:!0,initialIsOpen:!0,title:n("informations_su_10889"),children:(0,i.jsxs)(Ea,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Sl,{label:"Label",name:"emailSender.name"}),(0,i.jsx)(Sl,{hint:n("les_e_mails_ser_70662"),label:n("nom_de_l_mette_49412"),name:"emailSender.fromName"}),(0,i.jsx)(Sl,{hint:n("les_e_mails_ser_62925"),isEmail:!0,label:n("e_mail_de_l_me_98374"),name:"emailSender.fromEmail"}),(0,i.jsx)(Sl,{hint:n("cette_adresse_r_36038",r.emailSender.fromEmail),isEmail:!0,label:(0,i.jsx)(nv,{children:n("adresse_de_r_po_86181")}),name:"emailSender.replyTo"}),(0,i.jsx)(oj,{accept:HI.Images,acl:"public-read",hint:n("chaque_e_mail_c_30386"),label:n("en_t_te_11987"),organizationId:o,prefix:"emailSender.header."}),(0,i.jsx)(Tj,{label:n("photo_de_profil_08618"),organizationId:o,prefix:"emailSender.picture."}),(0,i.jsx)(gv,{label:n("signature_67521"),name:"emailSender.signature"}),(0,i.jsx)(oj,{accept:HI.Images,acl:"public-read",hint:n("chaque_e_mail_c_65078"),label:n("bas_de_page_86491"),organizationId:o,prefix:"emailSender.footer."}),(0,i.jsxs)(Ea,{direction:"column",gap:"3",children:[(0,i.jsx)(nc,{state:l?"checked":"unchecked",onClick:e=>{d("checked"===e)},children:n("utiliser_cet_m_47949")}),l&&(0,i.jsxs)(Ea,{children:[(0,i.jsx)(Pa,{width:"6"}),(0,i.jsxs)(dc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,values:c,onChange:u,children:[(0,i.jsx)("option",{value:"community",children:n("communaut_20896")}),e.events.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})]})]})]})}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(jm,{children:(0,i.jsx)(pl,{isLoading:s,textAlign:"center",onClick:t,children:e.isEdit?n("mettre_jour_l_14264"):n("cr_er_l_metteu_36451")})})]})});var m},schema:r.createUpdateEmailSenderSchema(),width:1,onSubmit:async i=>{const r={...i.emailSender,eventsIds:c.filter(e=>"community"!==e),isOrganizationDefault:c.includes("community")};await e.mutate(r),s(e.isEdit?n("l_metteur_a_t_48335"):n("l_metteur_a_t_67653")),t.push(So.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(o))}})},_q=()=>{const{params:{organizationId:e}}=il(),{data:t,loader:n}=qr({organizationId:e}),o=Nn(fq),{mutate:s}=function(e={}){return Un("mutation EmailSenderCreate($organizationId: OrganizationId!, $emailSender: EmailsSenderInput!) {\n    emailSenderCreate(organizationId: $organizationId, emailSender: $emailSender) {\n        id\n    }\n}\n",e)}();return n||(0,i.jsx)(xq,{events:t.organization.events.nodes,initialValues:{emailSender:o.emailSenderInputDefault()},isEdit:!1,mutate:t=>s({organizationId:e,emailSender:t})})},Iq=()=>{const{params:{organizationId:e,emailSenderId:t}}=il(),n=Nn(fq),{data:o,loader:s}=Vn("query EmailSenderToEdit($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n    organization(id: $organizationId) {\n        emailSender(id: $emailSenderId) {\n            id\n            name\n            signature\n            fromEmail\n            fromName\n            replyTo\n            eventsIds\n            isOrganizationDefault\n            isValidToSendEmail\n\n            header {\n                acl\n                name\n                key\n            }\n\n            picture {\n                acl\n                name\n                key\n            }\n\n            footer {\n                acl\n                name\n                key\n            }\n        }\n\n        events {\n            nodes {\n                id\n                name\n            }\n        }\n    }\n}\n",{organizationId:e,emailSenderId:t},[]),{mutate:r}=function(e={}){return Un("mutation EmailSenderUpdate(\n    $organizationId: OrganizationId!\n    $emailSenderId: EmailsSenderId!\n    $emailSender: EmailsSenderInput!\n) {\n    emailSenderUpdate(\n        organizationId: $organizationId\n        emailSenderId: $emailSenderId\n        emailSender: $emailSender\n    ) {\n        id\n    }\n}\n",e)}();return s||(0,i.jsx)(xq,{events:o.organization.events.nodes,initialValues:{emailSender:n.emailSenderInputDefault(o.organization.emailSender)},isEdit:!0,mutate:n=>r({organizationId:e,emailSenderId:t,emailSender:n})})},vq=()=>{const{translate:e,params:{organizationId:t,emailSenderId:n}}=il(),{data:o,loader:s}=Vn("query EmailSenderPreview($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n    organization(id: $organizationId) {\n        emailSender(id: $emailSenderId) {\n            name\n            from\n            preview\n        }\n    }\n}\n",{organizationId:t,emailSenderId:n},[]),r=(0,F.useMemo)(()=>o.organization?o.organization.emailSender.from:"-",[o.organization]);return(0,i.jsx)(bm,{category:e("aper_u_d_un_me_46930"),fallbackClosePath:So.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t),title:r,children:s||(0,i.jsx)(fr,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsx)(Fb,{content:o.organization.emailSender.preview,from:o.organization.emailSender.from,subject:e("e_mail_test_me_23293")})})})},bq=ar("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),jq=ar("button",{background:"none",border:"none",color:"$error700",fontWeight:"$semiBold"}),Cq=()=>{const{organizationId:e}=Wn(),t=Gn(),{mutate:n}=ea(),o=Ln(),s=()=>{t.push(So.ORGANIZATION_PARAMETERS(e))};return(0,i.jsx)(aG,{onClose:s,children:(0,i.jsxs)(Ea,{align:"center",direction:"column",children:[(0,i.jsx)(mj,{color:"error",icon:"user-slash"}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(bq,{children:o("suppression_de_67160")}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:o("souhaitez_vous_30775")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(pl,{onClick:s,children:o("non_je_ne_souh_99960")}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(jq,{onClick:async()=>{await n({}),Y()},children:o("oui_je_souhait_87268")})]})})},yq=({icon:e,children:t,onClick:n})=>(0,i.jsxs)(Ea,{align:"center",css:{color:"$gray800",fontWeight:"$medium"},gap:"5",onClick:n,children:[(0,i.jsx)(Va,{icon:e}),(0,i.jsx)("span",{children:t})]}),kq=ar(Ea,{background:"$white",borderRadius:"$2",boxShadow:"$sm",gap:"$6",padding:"$4 $3"}),Aq=ar("h3",{color:"$gray500",fontSize:"$textSm",margin:0}),wq=ar(Ea,{backgroundColor:"$gray50",padding:"$6 $3",height:"100%"}),Sq=ar("h1",{color:"$gray800",fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),Eq=({organization:e,user:t})=>{const{history:n,translate:o}=il();return(0,i.jsxs)(wq,{direction:"column",gap:"6",children:[(0,i.jsx)(Sq,{children:o("profil_14444")}),(0,i.jsxs)(Ea,{align:"center",gap:"4",children:[(0,i.jsx)(Fg,{email:t.email,image:t.userInfo.picture?.url,name:t.userInfo.name,size:64}),(0,i.jsx)(AH,{size:64,userInfo:{email:t.email,...t.userInfo}})]}),(0,i.jsx)(kq,{direction:"column",children:(0,i.jsxs)(Ea,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(fr,{css:{color:"$gray800",fontWeight:"$medium"},children:e.name}),(0,i.jsx)(pl,{onClick:()=>{n.push(So.ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH(e.id))},children:o("changer_74000")})]})}),(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(Aq,{children:o("profil_14444")}),(0,i.jsx)(kq,{direction:"column",children:(0,i.jsx)(yq,{icon:"user-gear",onClick:()=>{n.push(So.ORGANIZATION_PARAMETERS_PROFILE(e.id))},children:o("informations_pe_37892")})})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"2",children:[(0,i.jsx)(Aq,{children:o("g_n_ral_64953")}),(0,i.jsxs)(kq,{direction:"column",children:[(0,i.jsx)(yq,{icon:"shield",onClick:()=>{window.open(hd(dd(t?.language,new URL(location.href).searchParams)),"_blank")},children:o("cgu_51460")}),(0,i.jsx)(yq,{icon:"circle-question",onClick:()=>{window.open("https://support.weezevent.com/fr/weezcrew","_blank")},children:o("aide_et_support_49790")})]})]}),(0,i.jsxs)(kq,{direction:"column",children:[(0,i.jsx)(yq,{icon:"arrow-left-from-line",onClick:Y,children:o("se_d_connecter_74151")}),(0,i.jsx)(yq,{icon:"user-xmark",onClick:()=>{n.push(So.ORGANIZATION_PARAMETERS_DELETE_ACCOUNT(e.id))},children:o("supprimer_mon_c_07051")})]})]})},Tq=({organizations:e})=>{const{organizationId:t}=Wn(),[n,o]=(0,F.useState)(t),s=Ln(),r=Gn();return(0,i.jsxs)(Ea,{css:{margin:"0 $4 $7 $4"},direction:"column",children:[(0,i.jsx)(Ea,{direction:"column",gap:"4",children:e.map(e=>(0,i.jsx)(tO,{state:e.id===n?"checked":"unchecked",onClick:()=>o(e.id),children:e.name},e.id))}),(0,i.jsx)(Pa,{height:7}),(0,i.jsx)(pl,{onClick:()=>{r.push(So.ORGANIZATION_PARAMETERS(n))},children:s("s_lectionner_l_18914")})]})},zq=ar("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),$q=()=>{const{loader:e,data:t}=Qr({}),{organization:n}=nI(),o=Ln(),s=Gn();return(0,i.jsxs)(aG,{onClose:()=>{s.push(So.ORGANIZATION_PARAMETERS(n.id))},children:[(0,i.jsx)(zq,{children:o("liste_de_vos_or_87919")}),e||(0,i.jsx)(Tq,{organizations:t.organizations})]})},Oq=({inputName:e})=>{const t=Ln(),n=Ac();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{gap:"$6","@tablet":{gap:"$4","> *":{flexGrow:1,width:"auto"}}},wrap:"wrap",children:[(0,i.jsx)(Sl,{autoComplete:"given-name",label:t("pr_nom_66988"),name:`${e}fields.firstName`}),(0,i.jsx)(Sl,{autoComplete:"family-name",label:t("last_name"),name:`${e}fields.lastName`})]}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Sl,{autoComplete:"email",isEmail:!0,label:t("e_mail_13869"),name:`${e}email`}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(lj,{autoComplete:"language",label:t("Language"),name:`${e}fields.language`,children:n(ad)}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(B_,{label:t("Phone"),prefix:`${e}fields.phone.`})]})},Rq=ar(Ea,{backgroundColor:"$gray900",height:"110px",marginBottom:"$11","> *":{transform:"translateY(50%)",boxShadow:"$md"}}),Pq=()=>{const{user:e}=nI();return(0,i.jsx)(Rq,{align:"end",justify:"center",children:(0,i.jsx)(Fg,{email:e.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:96})})},Dq=()=>{const{organizationId:e}=Wn(),{data:t,loader:n}=Fs({organizationId:e}),o=Nn(EE),s=Nn(za),{user:r}=Zn(),{mutate:a,isLoading:l}=Ms(),d=Ln();return n||(0,i.jsx)(dl,{initialValues:{userInfo:o.userInfoProfileInputDefault(t.user)},render:({handleSubmit:e})=>(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(Pq,{}),(0,i.jsxs)(mG,{children:[(0,i.jsx)(Oq,{inputName:"userInfo."}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(pl,{isLoading:l,textAlign:"center",onClick:e,children:d("enregistrer_06519")})]})]}),validate:s.validateForForm(o.updateProfileSchema()),onSubmit:async e=>{const{userProfileUpdate:{email:n,language:i}}=await a({userId:r.id,userInfoId:t.user.userInfo.id,userInfo:e.userInfo});r.email!==n?Y():r.language!==i&&location.reload()}})},Fq=ar("h1",{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}),Mq=()=>{const{organizationId:e}=Wn(),t=Gn(),n=Ln();return(0,i.jsxs)(fG,{children:[(0,i.jsx)(pG,{back:()=>{t.push(So.ORGANIZATION_PARAMETERS(e))},children:(0,i.jsx)(QG,{children:(0,i.jsx)(Fq,{children:n("informations_pe_37892")})})}),(0,i.jsx)(Dq,{})]})},Nq=()=>{const{organization:e,user:t}=nI();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{path:So.ORGANIZATION_PARAMETERS_PROFILE(":organizationId"),children:(0,i.jsx)(Mq,{})}),Zo(e.events.nodes)&&(0,i.jsx)(_r.qh,{children:(0,i.jsx)(KW,{eventId:e.events.nodes[0].id,user:t,children:(0,i.jsx)(Eq,{organization:e,user:t})})})]}),(0,i.jsx)(_r.dO,{children:(0,i.jsx)(_r.qh,{path:So.ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH(":organizationId"),children:(0,i.jsx)($q,{})})}),(0,i.jsx)(_r.dO,{children:(0,i.jsx)(_r.qh,{path:So.ORGANIZATION_PARAMETERS_DELETE_ACCOUNT(":organizationId"),children:(0,i.jsx)(Cq,{})})})]})};var Lq,Bq;!function(e){e.AccreditationCategoryCreate="AccreditationCategoryCreate",e.AccreditationCategoryDelete="AccreditationCategoryDelete",e.AccreditationCategoryDuplicate="AccreditationCategoryDuplicate",e.AccreditationCategoryUpdate="AccreditationCategoryUpdate",e.AccreditationCreate="AccreditationCreate",e.AccreditationDuplicate="AccreditationDuplicate",e.AccreditationSlotDelete="AccreditationSlotDelete",e.AccreditationSlotUpdate="AccreditationSlotUpdate",e.AccreditationUpdate="AccreditationUpdate",e.AccreditationsEmailsEstimate="AccreditationsEmailsEstimate",e.AccreditationsMassDelete="AccreditationsMassDelete",e.AccreditationsMassEdit="AccreditationsMassEdit",e.AccreditationsSlotsUsersInfosCheckIn="AccreditationsSlotsUsersInfosCheckIn",e.AssignmentsEmailsEstimate="AssignmentsEmailsEstimate",e.BackofficeEventUnarchive="BackofficeEventUnarchive",e.BackofficeInvoiceMarkAsPaid="BackofficeInvoiceMarkAsPaid",e.BackofficeOrganizationUpdate="BackofficeOrganizationUpdate",e.BackofficeOrganizationUserAdd="BackofficeOrganizationUserAdd",e.BackofficeOrganizationUserRemove="BackofficeOrganizationUserRemove",e.CampaignCreate="CampaignCreate",e.CampaignDelete="CampaignDelete",e.CampaignDuplicate="CampaignDuplicate",e.CampaignEstimate="CampaignEstimate",e.CampaignSend="CampaignSend",e.CampaignUpdate="CampaignUpdate",e.CommentCreate="CommentCreate",e.CommentDelete="CommentDelete",e.CreateEvent="CreateEvent",e.CustomDocumentCreate="CustomDocumentCreate",e.CustomDocumentDelete="CustomDocumentDelete",e.CustomDocumentDuplicate="CustomDocumentDuplicate",e.CustomDocumentUpdate="CustomDocumentUpdate",e.CustomFieldCategoryCreate="CustomFieldCategoryCreate",e.CustomFieldCategoryDelete="CustomFieldCategoryDelete",e.CustomFieldCategoryUpdate="CustomFieldCategoryUpdate",e.CustomFieldCreate="CustomFieldCreate",e.CustomFieldDuplicate="CustomFieldDuplicate",e.CustomFieldUpdate="CustomFieldUpdate",e.CustomFieldsMassDelete="CustomFieldsMassDelete",e.CustomFieldsMassEdit="CustomFieldsMassEdit",e.DelegationCategoryCreate="DelegationCategoryCreate",e.DelegationCategoryDelete="DelegationCategoryDelete",e.DelegationCategoryDuplicate="DelegationCategoryDuplicate",e.DelegationCategoryUpdate="DelegationCategoryUpdate",e.DelegationCreate="DelegationCreate",e.DelegationDuplicate="DelegationDuplicate",e.DelegationFormInvite="DelegationFormInvite",e.DelegationUpdate="DelegationUpdate",e.DelegationUpdateFields="DelegationUpdateFields",e.DelegationsCategoriesMassLeadersEdit="DelegationsCategoriesMassLeadersEdit",e.DelegationsExport="DelegationsExport",e.DelegationsImport="DelegationsImport",e.DelegationsImportResult="DelegationsImportResult",e.DelegationsMassDelete="DelegationsMassDelete",e.DelegationsMassEdit="DelegationsMassEdit",e.DelegationsMassLeadersEdit="DelegationsMassLeadersEdit",e.DelegationsMassMove="DelegationsMassMove",e.DomainDkimVerificationRetry="DomainDkimVerificationRetry",e.EmailFormInviteSend="EmailFormInviteSend",e.EmailResend="EmailResend",e.EmailSenderCreate="EmailSenderCreate",e.EmailSenderDelete="EmailSenderDelete",e.EmailSenderDuplicate="EmailSenderDuplicate",e.EmailSenderUpdate="EmailSenderUpdate",e.EmailSenderVerificationResend="EmailSenderVerificationResend",e.EmailTemplateUpdate="EmailTemplateUpdate",e.EmailUpdate="EmailUpdate",e.EventDocumentUpdate="EventDocumentUpdate",e.EventDocumentsExport="EventDocumentsExport",e.EventDocumentsExportResult="EventDocumentsExportResult",e.EventDuplicate="EventDuplicate",e.EventInvite="EventInvite",e.EventLayerUpdate="EventLayerUpdate",e.EventOrganizationCreate="EventOrganizationCreate",e.EventProfilePrivateFieldsUpdate="EventProfilePrivateFieldsUpdate",e.EventUpdate="EventUpdate",e.EventWeezeventUpdate="EventWeezeventUpdate",e.EventsMassArchive="EventsMassArchive",e.EventsMassEdit="EventsMassEdit",e.ExportResult="ExportResult",e.FilesImport="FilesImport",e.FilesImportResult="FilesImportResult",e.FormCreate="FormCreate",e.FormDelete="FormDelete",e.FormDuplicate="FormDuplicate",e.FormElementsUpdate="FormElementsUpdate",e.FormParametersAccreditationsUpdate="FormParametersAccreditationsUpdate",e.FormParametersAvailabilitiesUpdate="FormParametersAvailabilitiesUpdate",e.FormParametersBroadcastUpdate="FormParametersBroadcastUpdate",e.FormParametersDesignUpdate="FormParametersDesignUpdate",e.FormParametersGeneralUpdate="FormParametersGeneralUpdate",e.FormParametersMissionsUpdate="FormParametersMissionsUpdate",e.FormParametersStateUpdate="FormParametersStateUpdate",e.FormRegister="FormRegister",e.LoginCodeEmailCreate="LoginCodeEmailCreate",e.OrganizationCreate="OrganizationCreate",e.OrganizationDelegationSpaceSettingsUpdate="OrganizationDelegationSpaceSettingsUpdate",e.OrganizationDelegationsSpaceDesignUpdate="OrganizationDelegationsSpaceDesignUpdate",e.OrganizationInvite="OrganizationInvite",e.OrganizationMembersSpaceDesignUpdate="OrganizationMembersSpaceDesignUpdate",e.OrganizationMembersSpaceSettingsUpdate="OrganizationMembersSpaceSettingsUpdate",e.OrganizationProfilePrivateFieldsUpdate="OrganizationProfilePrivateFieldsUpdate",e.OrganizationUpdateInfos="OrganizationUpdateInfos",e.PositionCategoryCreate="PositionCategoryCreate",e.PositionCategoryDelete="PositionCategoryDelete",e.PositionCategoryDescriptionUpdate="PositionCategoryDescriptionUpdate",e.PositionCategoryDuplicate="PositionCategoryDuplicate",e.PositionCategoryUpdate="PositionCategoryUpdate",e.PositionCreate="PositionCreate",e.PositionDuplicate="PositionDuplicate",e.PositionSlotCreate="PositionSlotCreate",e.PositionSlotDelete="PositionSlotDelete",e.PositionSlotUpdate="PositionSlotUpdate",e.PositionUpdate="PositionUpdate",e.PositionsCategoriesMassLeadersEdit="PositionsCategoriesMassLeadersEdit",e.PositionsCreate="PositionsCreate",e.PositionsImport="PositionsImport",e.PositionsImportResult="PositionsImportResult",e.PositionsMassConditions="PositionsMassConditions",e.PositionsMassDelete="PositionsMassDelete",e.PositionsMassEdit="PositionsMassEdit",e.PositionsMassLeadersEdit="PositionsMassLeadersEdit",e.PositionsSlotsUsersInfosCheckIn="PositionsSlotsUsersInfosCheckIn",e.RoleCreate="RoleCreate",e.RoleDelete="RoleDelete",e.RoleUpdate="RoleUpdate",e.SegmentCreate="SegmentCreate",e.SegmentDelete="SegmentDelete",e.SegmentFolderCreate="SegmentFolderCreate",e.SegmentFolderDelete="SegmentFolderDelete",e.SegmentFolderMoveDown="SegmentFolderMoveDown",e.SegmentFolderMoveUp="SegmentFolderMoveUp",e.SegmentFolderUpdateName="SegmentFolderUpdateName",e.SegmentMoveDown="SegmentMoveDown",e.SegmentMoveFolder="SegmentMoveFolder",e.SegmentMoveUp="SegmentMoveUp",e.SegmentUpdate="SegmentUpdate",e.SegmentUpdateMetadata="SegmentUpdateMetadata",e.SegmentsFoldersReorder="SegmentsFoldersReorder",e.SendAccreditationsEmails="SendAccreditationsEmails",e.SendAssignmentsEmails="SendAssignmentsEmails",e.SkidataConnectionInfoSeaonEventAdd="SkidataConnectionInfoSeaonEventAdd",e.SkidataConnectionInfoSeaonEventDelete="SkidataConnectionInfoSeaonEventDelete",e.SkidataConnectionInfoSynchronizedEventAdd="SkidataConnectionInfoSynchronizedEventAdd",e.SkidataConnectionInfoSynchronizedEventDelete="SkidataConnectionInfoSynchronizedEventDelete",e.SkidataConnectionInfosDelete="SkidataConnectionInfosDelete",e.SkidataConnectionInfosUpsert="SkidataConnectionInfosUpsert",e.SkidataSynchronize="SkidataSynchronize",e.TagCreate="TagCreate",e.TagDelete="TagDelete",e.TagUpdateName="TagUpdateName",e.TeamAssign="TeamAssign",e.TeamAssignmentRefuse="TeamAssignmentRefuse",e.TextMessageRepliesRead="TextMessageRepliesRead",e.TextMessageSend="TextMessageSend",e.TraceCreate="TraceCreate",e.TraceDelete="TraceDelete",e.TraceUpdate="TraceUpdate",e.TranslationUpdate="TranslationUpdate",e.UserAccessCreate="UserAccessCreate",e.UserAccessDelete="UserAccessDelete",e.UserAccessUpdate="UserAccessUpdate",e.UserCreate="UserCreate",e.UserDelete="UserDelete",e.UserInfoAccreditationsUpdate="UserInfoAccreditationsUpdate",e.UserInfoAdminCreate="UserInfoAdminCreate",e.UserInfoAdminDelete="UserInfoAdminDelete",e.UserInfoAndTermsUpdate="UserInfoAndTermsUpdate",e.UserInfoPositionsUpdate="UserInfoPositionsUpdate",e.UserInfoSlotsUpdate="UserInfoSlotsUpdate",e.UserInfoUpdate="UserInfoUpdate",e.UserInfoUpdateField="UserInfoUpdateField",e.UserProfileUpdate="UserProfileUpdate",e.UserRolesDelete="UserRolesDelete",e.UsersInfosExport="UsersInfosExport",e.UsersInfosMassAddEvent="UsersInfosMassAddEvent",e.UsersInfosMassCampaignSend="UsersInfosMassCampaignSend",e.UsersInfosMassDelegationAdd="UsersInfosMassDelegationAdd",e.UsersInfosMassDelegationDelete="UsersInfosMassDelegationDelete",e.UsersInfosMassDelete="UsersInfosMassDelete",e.UsersInfosMassEdit="UsersInfosMassEdit",e.UsersInfosMassFormAdd="UsersInfosMassFormAdd",e.UsersInfosMassFormRemove="UsersInfosMassFormRemove",e.UsersInfosMerge="UsersInfosMerge",e.VolunteerRegistrationAssignmentRefuse="VolunteerRegistrationAssignmentRefuse",e.VolunteerRegistrationDuplicate="VolunteerRegistrationDuplicate",e.VolunteerRegistrationTicketIdRegenerate="VolunteerRegistrationTicketIdRegenerate",e.VolunteerRegistrationUpdate="VolunteerRegistrationUpdate",e.VolunteerRegistrationUpdateField="VolunteerRegistrationUpdateField",e.VolunteersExport="VolunteersExport",e.VolunteersImport="VolunteersImport",e.VolunteersImportResult="VolunteersImportResult",e.VolunteersRegistrationsAccreditationsValidate="VolunteersRegistrationsAccreditationsValidate",e.VolunteersRegistrationsAdminAdd="VolunteersRegistrationsAdminAdd",e.VolunteersRegistrationsMassAccredit="VolunteersRegistrationsMassAccredit",e.VolunteersRegistrationsMassAccreditationStateUpdate="VolunteersRegistrationsMassAccreditationStateUpdate",e.VolunteersRegistrationsMassAssign="VolunteersRegistrationsMassAssign",e.VolunteersRegistrationsMassDelegationAdd="VolunteersRegistrationsMassDelegationAdd",e.VolunteersRegistrationsMassDelete="VolunteersRegistrationsMassDelete",e.VolunteersRegistrationsMassFormAdd="VolunteersRegistrationsMassFormAdd",e.VolunteersRegistrationsMassFormRemove="VolunteersRegistrationsMassFormRemove",e.VolunteersRegistrationsMassPreAssign="VolunteersRegistrationsMassPreAssign",e.VolunteersRegistrationsMassStateUpdate="VolunteersRegistrationsMassStateUpdate",e.VolunteersRegistrationsMassWishedAccreditationsUpdate="VolunteersRegistrationsMassWishedAccreditationsUpdate",e.WorkflowCreate="WorkflowCreate",e.WorkflowDuplicate="WorkflowDuplicate",e.WorkflowExecute="WorkflowExecute",e.WorkflowUpdate="WorkflowUpdate",e.WorkflowssMassDelete="WorkflowssMassDelete"}(Lq||(Lq={})),function(e){e.AccreditationsEmailsEstimate="AccreditationsEmailsEstimate",e.AssignmentsEmailsEstimate="AssignmentsEmailsEstimate",e.BackofficeEventUnarchive="BackofficeEventUnarchive",e.BackofficeInvoiceMarkAsPaid="BackofficeInvoiceMarkAsPaid",e.BackofficeOrganizationUpdate="BackofficeOrganizationUpdate",e.BackofficeOrganizationUserAdd="BackofficeOrganizationUserAdd",e.BackofficeOrganizationUserRemove="BackofficeOrganizationUserRemove",e.CampaignEstimate="CampaignEstimate",e.DelegationsExport="DelegationsExport",e.DelegationsImportResult="DelegationsImportResult",e.DomainDkimVerificationRetry="DomainDkimVerificationRetry",e.EmailFormInviteSend="EmailFormInviteSend",e.EmailResend="EmailResend",e.EmailSenderVerificationResend="EmailSenderVerificationResend",e.EventDocumentsExport="EventDocumentsExport",e.EventDocumentsExportResult="EventDocumentsExportResult",e.EventLayerUpdate="EventLayerUpdate",e.EventProfilePrivateFieldsUpdate="EventProfilePrivateFieldsUpdate",e.EventWeezeventUpdate="EventWeezeventUpdate",e.ExportResult="ExportResult",e.FormRegister="FormRegister",e.LoginCodeEmailCreate="LoginCodeEmailCreate",e.OrganizationProfilePrivateFieldsUpdate="OrganizationProfilePrivateFieldsUpdate",e.PositionsImportResult="PositionsImportResult",e.SegmentFolderMoveDown="SegmentFolderMoveDown",e.SegmentFolderMoveUp="SegmentFolderMoveUp",e.SegmentMoveDown="SegmentMoveDown",e.SegmentMoveUp="SegmentMoveUp",e.SegmentsFoldersReorder="SegmentsFoldersReorder",e.SkidataConnectionInfoSeaonEventAdd="SkidataConnectionInfoSeaonEventAdd",e.SkidataConnectionInfoSeaonEventDelete="SkidataConnectionInfoSeaonEventDelete",e.SkidataConnectionInfoSynchronizedEventAdd="SkidataConnectionInfoSynchronizedEventAdd",e.SkidataConnectionInfoSynchronizedEventDelete="SkidataConnectionInfoSynchronizedEventDelete",e.SkidataSynchronize="SkidataSynchronize",e.TextMessageRepliesRead="TextMessageRepliesRead",e.TranslationUpdate="TranslationUpdate",e.UserCreate="UserCreate",e.UserDelete="UserDelete",e.UserInfoAdminDelete="UserInfoAdminDelete",e.UserInfoAndTermsUpdate="UserInfoAndTermsUpdate",e.UsersInfosMassDelegationDelete="UsersInfosMassDelegationDelete",e.UserProfileUpdate="UserProfileUpdate",e.UsersInfosExport="UsersInfosExport",e.VolunteersExport="VolunteersExport",e.VolunteersImportResult="VolunteersImportResult"}(Bq||(Bq={}));const Vq=e=>{const t=Nn($c);return(0,i.jsxs)(Cc,{children:[(0,i.jsxs)(xc,{align:"center",gap:"3",children:[(0,i.jsx)(Ea,{align:"center",css:{background:"$primary300",borderRadius:"32px",color:"$primary600",height:"32px",width:"32px"},justify:"center",children:(0,i.jsx)(Va,{icon:e.activity.icon})}),(0,i.jsx)(fr,{font:"gray900 textSm medium",children:e.activity.text})]}),(0,i.jsx)(xc,{children:t.toLocaleString(e.activity.date.toLocal(),Ho.DateTime)})]})},Uq=()=>{const e=Ln(),{organizationId:t}=Wn(),[n,o]=(0,F.useState)([]),[s,r]=(0,F.useState)([]),[a,l]=(0,F.useState)(Fo.c9.invalid("Invalid")),[d,c]=(0,F.useState)(0),{data:u,isLoading:h}=Vn("query Activities(\n    $organizationId: OrganizationId!\n    $operations: [String!]\n    $eventsIds: [EventId!]\n    $date: Date\n    $offset: Int\n) {\n    organization(id: $organizationId) {\n        events {\n            nodes {\n                id\n                name\n            }\n        }\n\n        activities(\n            operations: $operations\n            eventsIds: $eventsIds\n            date: $date\n            limit: 25\n            offset: $offset\n        ) {\n            nodes {\n                date\n                icon\n                text\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{organizationId:t,operations:n,eventsIds:s,date:a,offset:d},[]),{numberOfPages:m,totalCount:g}=lu(u.organization?.activities),p=(0,F.useMemo)(()=>{const t=Object.keys(Bq);return Object.keys(Lq).filter(e=>!t.includes(e)).map(t=>(0,i.jsx)("option",{value:t,children:e(t)},t))},[]);return(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsx)(kC,{children:(0,i.jsx)(fr,{font:"gray900 displayXs semiBold",children:e("activit_95747")})}),(0,i.jsx)(yC,{children:(0,i.jsx)(kc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(dc,{isSearchVisible:!0,multiple:!0,placeholder:e("op_ration_25453"),values:n,onChange:o,children:p})}),(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(dc,{isSearchVisible:!0,multiple:!0,placeholder:e("_v_nement_22345"),values:s,onChange:r,children:(u.organization?.events.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(fr,{width:200,children:(0,i.jsx)(_u,{value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:e("Description")}),(0,i.jsx)(Tc,{children:e("Date")})]}),numberOfPages:m,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{})]}):u.organization.activities.nodes.map((e,t)=>(0,i.jsx)(Vq,{activity:e},t)),setOffset:c,totalCount:g})})]})},Wq=e=>{const{translate:t}=il(),[n,o]=(0,F.useState)(!1),[s,r]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(pm,{children:[(0,i.jsx)(Od,{icon:"pen",onClick:()=>{o(!0)},children:t("renommer_42135")}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(ZP,{accreditationCategory:e.accreditationCategory,eventId:e.accreditationCategory.eventId,onClose:()=>{o(!1)},onSuccess:e.reload}),s&&(0,i.jsx)(vM,{accreditationCategory:e.accreditationCategory,eventId:e.accreditationCategory.eventId,onClose:()=>{r(!1)},onSuccess:e.reload})]})},Gq=()=>{const{translate:e,params:{organizationId:t}}=il(),{isOrganizationAdmin:n}=nI(),[o,s,r]=Ec(""),[a,l]=(0,F.useState)(-1),[d,c]=(0,F.useState)(0),{data:u,isLoading:m,reload:g}=Vn("query OrganizationCategoriesAccreditations(\n    $organizationId: OrganizationId!\n    $name: String\n    $eventId: EventId\n    $offset: Int\n) {\n    organization(id: $organizationId) {\n        events {\n            nodes {\n                id\n                name\n            }\n        }\n\n        accreditationsCategories(name: $name, eventId: $eventId, offset: $offset, limit: 25) {\n            nodes {\n                id\n                eventId\n                name\n                numberOfAccreditations\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{organizationId:t,name:h(s)?s:void 0,eventId:-1!==a?a:void 0,offset:d},[]);const{numberOfPages:p,totalCount:f}=lu(u.organization?.accreditationsCategories),x=(0,F.useMemo)(()=>(0,Zd.A)(u.organization?.events.nodes??[],e=>e.name.toLowerCase()),[u.organization]),_=(0,F.useMemo)(()=>Object.fromEntries(x.map(e=>[e.id,e.name])),[x]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(kc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{width:200,children:(0,i.jsxs)(gu,{shouldParseAsInt:!0,value:a,onChange:e=>{l(e)},children:[(0,i.jsx)("option",{value:"-1",children:e("tous_les_v_nem_16033")}),x.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:o,onChange:r})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Tc,{children:e("_v_nement_22345")}),(0,i.jsx)(Tc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Tc,{width:100})]}),numberOfPages:p,offset:d,rows:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):u.organization.accreditationsCategories.nodes.map(e=>(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(j_,{to:Hi.ACCREDITATION_CATEGORY({organizationId:t,eventId:e.eventId,accreditationCategoryId:e.id}),children:e.name})}),(0,i.jsx)(xc,{children:_[e.eventId]??""}),(0,i.jsx)(xc,{children:e.numberOfAccreditations}),n&&(0,i.jsx)(im,{justify:"center",children:(0,i.jsx)(Wq,{accreditationCategory:e,reload:g})})]},e.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:f})]})},Hq=e=>{const t=Ln(),{mutate:n}=function(e={}){return Un("mutation CustomFieldCategoryDelete(\n    $organizationId: OrganizationId!\n    $customFieldCategoryId: CustomFieldsCategoryId!\n) {\n    customFieldCategoryDelete(\n        organizationId: $organizationId\n        customFieldCategoryId: $customFieldCategoryId\n    ) {\n        id\n    }\n}\n",e)}();return(0,i.jsx)(kk,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_50954")],text:t("suppression_de_73669",e.customFieldCategory.name),onClose:e.onClose,onDelete:async()=>{await n({organizationId:e.organizationId,customFieldCategoryId:e.customFieldCategory.id}),e.onSuccess()}})},qq=e=>{const{mutate:t}=function(e={}){return Un("mutation CustomFieldCategoryUpdate(\n    $organizationId: OrganizationId!\n    $customFieldCategoryId: CustomFieldsCategoryId!\n    $customFieldCategory: CustomFieldsCategoryInput!\n) {\n    customFieldCategoryUpdate(\n        organizationId: $organizationId\n        customFieldCategoryId: $customFieldCategoryId\n        customFieldCategory: $customFieldCategory\n    ) {\n        id\n        name\n    }\n}\n",e)}();return(0,i.jsx)(dC,{initialName:e.customFieldCategory.name,isEdit:!0,mutate:async n=>(await t({organizationId:e.organizationId,customFieldCategoryId:e.customFieldCategory.id,customFieldCategory:{name:n}})).customFieldCategoryUpdate,onClose:e.onClose,onSuccess:e.onSuccess})},Yq=e=>{const{translate:t}=il(),[n,o]=(0,F.useState)(!1),[s,r]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(pm,{children:[(0,i.jsx)(Od,{icon:"pen",onClick:()=>{o(!0)},children:t("renommer_42135")}),(0,i.jsx)(Od,{color:0===e.customFieldCategory.numberOfCustomFields?"red":"disabled",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(qq,{customFieldCategory:e.customFieldCategory,organizationId:e.organizationId,onClose:()=>{o(!1)},onSuccess:e.reload}),s&&(0,i.jsx)(Hq,{customFieldCategory:e.customFieldCategory,organizationId:e.organizationId,onClose:()=>{r(!1)},onSuccess:e.reload})]})},Kq=()=>{const{translate:e,params:{organizationId:t}}=il(),{isOrganizationAdmin:n}=nI(),[o,s,r]=Ec(""),[a,l]=(0,F.useState)(0),{data:d,isLoading:c,reload:u}=Vn("query OrganizationCategoriesCustomFields(\n    $organizationId: OrganizationId!\n    $name: String\n    $offset: Int\n) {\n    organization(id: $organizationId) {\n        customFieldsCategories(name: $name, offset: $offset, limit: 25) {\n            nodes {\n                id\n                name\n                numberOfCustomFields\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{organizationId:t,name:h(s)?s:void 0,offset:a},[]);const{numberOfPages:m,totalCount:g}=lu(d.organization?.customFieldsCategories);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(kc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:o,onChange:r})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Tc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Tc,{width:100})]}),numberOfPages:m,offset:a,rows:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):d.organization.customFieldsCategories.nodes.map(e=>(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{children:e.name}),(0,i.jsx)(xc,{children:e.numberOfCustomFields}),n&&(0,i.jsx)(im,{justify:"end",children:(0,i.jsx)(Yq,{customFieldCategory:e,organizationId:t,reload:u})})]},e.id)),setOffset:l,title:e("liste_des_cat_g_39450"),totalCount:g})]})},Zq=e=>{const{translate:t}=il(),[n,o]=(0,F.useState)(!1),[s,r]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(pm,{children:[(0,i.jsx)(Od,{icon:"pen",onClick:()=>{o(!0)},children:t("renommer_42135")}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(uC,{delegationCategory:e.delegationCategory,eventId:e.delegationCategory.eventId,organizationId:e.delegationCategory.organizationId,onClose:()=>{o(!1)},onSuccess:e.reload}),s&&(0,i.jsx)(Pw,{delegationCategory:e.delegationCategory,eventId:e.delegationCategory.eventId,organizationId:e.delegationCategory.organizationId,onClose:()=>{r(!1)},onSuccess:e.reload})]})},Xq=()=>{const{translate:e,params:{organizationId:t}}=il(),{isOrganizationAdmin:n}=nI(),[o,s,r]=Ec(""),[a,l]=(0,F.useState)(-1),[d,c]=(0,F.useState)(0),{data:u,isLoading:m,reload:g}=Vn("query OrganizationCategoriesDelegations(\n    $organizationId: OrganizationId!\n    $name: String\n    $eventId: EventId\n    $offset: Int\n) {\n    organization(id: $organizationId) {\n        events {\n            nodes {\n                id\n                name\n            }\n        }\n\n        delegationsCategories(\n            level: Both\n            name: $name\n            eventId: $eventId\n            offset: $offset\n            limit: 25\n        ) {\n            nodes {\n                id\n                organizationId\n                eventId\n                name\n                numberOfDelegations\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{organizationId:t,name:h(s)?s:void 0,eventId:-1!==a?a:void 0,offset:d},[]);const{numberOfPages:p,totalCount:f}=lu(u.organization?.delegationsCategories),x=(0,F.useMemo)(()=>(0,Zd.A)(u.organization?.events.nodes??[],e=>e.name.toLowerCase()),[u.organization]),_=(0,F.useMemo)(()=>Object.fromEntries(x.map(e=>[e.id,e.name])),[x]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(kc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{width:200,children:(0,i.jsxs)(gu,{shouldParseAsInt:!0,value:a,onChange:e=>{l(e)},children:[(0,i.jsx)("option",{value:"-1",children:e("tous_les_v_nem_16033")}),x.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:o,onChange:r})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Tc,{children:e("_v_nement_22345")}),(0,i.jsx)(Tc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Tc,{width:100})]}),numberOfPages:p,offset:d,rows:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):u.organization.delegationsCategories.nodes.map(o=>(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(j_,{to:to.DELEGATION_CATEGORY({organizationId:t,eventId:o.eventId,delegationCategoryId:o.id}),children:o.name})}),(0,i.jsx)(xc,{children:o.eventId?_[o.eventId]??"":e("communaut_20896")}),(0,i.jsx)(xc,{children:o.numberOfDelegations}),n&&(0,i.jsx)(im,{justify:"center",children:(0,i.jsx)(Zq,{delegationCategory:o,reload:g})})]},o.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:f})]})},Jq=e=>{const{translate:t}=il(),[n,o]=(0,F.useState)(!1),[s,r]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(pm,{children:[(0,i.jsx)(Od,{icon:"pen",onClick:()=>{o(!0)},children:t("renommer_42135")}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(SV,{eventId:e.positionCategory.eventId,positionCategoryId:e.positionCategory.id,positionCategoryName:e.positionCategory.name,onClose:()=>{o(!1)},onSuccess:e.reload}),s&&(0,i.jsx)(hW,{eventId:e.positionCategory.eventId,positionCategory:e.positionCategory,onClose:()=>{r(!1)},onSuccess:e.reload})]})},Qq=()=>{const{translate:e,params:{organizationId:t}}=il(),{isOrganizationAdmin:n}=nI(),[o,s,r]=Ec(""),[a,l]=(0,F.useState)(-1),[d,c]=(0,F.useState)(0),{data:u,isLoading:m,reload:g}=Vn("query OrganizationCategoriesPositions(\n    $organizationId: OrganizationId!\n    $name: String\n    $eventId: EventId\n    $offset: Int\n) {\n    organization(id: $organizationId) {\n        events {\n            nodes {\n                id\n                name\n            }\n        }\n\n        positionsCategories(name: $name, eventId: $eventId, offset: $offset, limit: 25) {\n            nodes {\n                id\n                eventId\n                name\n                numberOfPositions\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{organizationId:t,name:h(s)?s:void 0,eventId:-1!==a?a:void 0,offset:d},[]);const{numberOfPages:p,totalCount:f}=lu(u.organization?.positionsCategories),x=(0,F.useMemo)(()=>(0,Zd.A)(u.organization?.events.nodes??[],e=>e.name.toLowerCase()),[u.organization]),_=(0,F.useMemo)(()=>Object.fromEntries(x.map(e=>[e.id,e.name])),[x]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(kc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{width:200,children:(0,i.jsxs)(gu,{shouldParseAsInt:!0,value:a,onChange:e=>{l(e)},children:[(0,i.jsx)("option",{value:"-1",children:e("tous_les_v_nem_16033")}),x.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:o,onChange:r})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Tc,{children:e("_v_nement_22345")}),(0,i.jsx)(Tc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Tc,{width:100})]}),numberOfPages:p,offset:d,rows:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):u.organization.positionsCategories.nodes.map(e=>(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(j_,{to:ao.POSITION_CATEGORY({organizationId:t,eventId:e.eventId,positionCategoryId:e.id}),children:e.name})}),(0,i.jsx)(xc,{children:_[e.eventId]??""}),(0,i.jsx)(xc,{children:e.numberOfPositions}),n&&(0,i.jsx)(im,{justify:"center",children:(0,i.jsx)(Jq,{positionCategory:e,reload:g})})]},e.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:f})]})},eY=()=>{const{translate:e,params:{organizationId:t}}=il();return(0,i.jsxs)(Ea,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(fr,{font:"gray900 displayXs semiBold",children:e("cat_gories_24533")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Vy,{children:[(0,i.jsxs)(Ly,{children:[(0,i.jsx)(Ny,{path:So.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(t),children:e("champs_de_formu_64126")}),(0,i.jsx)(Ny,{path:So.ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS(t),children:e("missions_63972")}),(0,i.jsx)(Ny,{path:So.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS(t),children:e("accr_ditations_39450")}),(0,i.jsx)(Ny,{path:So.ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS(t),children:e("d_l_gations_78318")})]}),(0,i.jsx)(By,{path:So.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(":organizationId"),children:(0,i.jsx)(Kq,{})}),(0,i.jsx)(By,{path:So.ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS(":organizationId"),children:(0,i.jsx)(Qq,{})}),(0,i.jsx)(By,{path:So.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS(":organizationId"),children:(0,i.jsx)(Gq,{})}),(0,i.jsx)(By,{path:So.ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS(":organizationId"),children:(0,i.jsx)(Xq,{})})]})]})},tY=e=>{const t=Ln(),n="badge"===e.type?e.badge:e.customDocument.slug;return(0,i.jsxs)(Ea,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4 $6","&:last-child":{borderBottom:"none"}},gap:"3",children:[(0,i.jsx)(Ea,{align:"center",css:{background:"$blueGray100",borderRadius:"12px",color:"$blueGray700"},height:40,justify:"center",width:40,children:(0,i.jsx)(Va,{icon:"file-lines"})}),(0,i.jsx)(fr,{css:{flex:"1"},font:"gray900 textSm medium",children:"badge"===e.type?b_(e.badge):`${e.customDocument.event.name} - ${e.customDocument.name}`}),(0,i.jsx)(su,{value:e.delegationsSpaceCustomBadges.includes(n),onChange:t=>{e.change("delegationsSpaceCustomBadges",Jo(e.delegationsSpaceCustomBadges,n,t))},children:t("document_t_l_ch_56704")})]})},nY=()=>{const{params:{organizationId:e},translate:t}=il(),{data:n,loader:o}=Vn("query OrganizationDelegationSpaceSettings($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        customBadges\n        allowDelegationSpaceDownload\n        delegationsSpaceCustomBadges\n\n        customDocuments {\n            id\n            slug\n            name\n\n            event {\n                id\n                name\n            }\n        }\n    }\n}\n",{organizationId:e},[]),{mutate:s}=function(e={}){return Un("mutation OrganizationDelegationSpaceSettingsUpdate(\n    $organizationId: OrganizationId!\n    $delegationSpaceSettings: DelegationSpaceSettingsInput!\n) {\n    organizationDelegationSpaceSettingsUpdate(\n        organizationId: $organizationId\n        delegationSpaceSettings: $delegationSpaceSettings\n    ) {\n        id\n    }\n}\n",e)}(),r=(0,F.useMemo)(()=>(0,Zd.A)(n.organization?.customDocuments??[],e=>`${e.event.name} - ${e.name}`.toLowerCase()),[n.organization]);return o||(0,i.jsx)(dl,{direction:"column",initialValues:{allowDelegationSpaceDownload:n.organization.allowDelegationSpaceDownload,delegationsSpaceCustomBadges:n.organization.delegationsSpaceCustomBadges},render:({form:e,handleSubmit:o,submitting:s,values:a})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("team_area_setti_29458")}),(0,i.jsx)(fr,{color:"gray500",fontWeight:"medium",children:t("customize_the_s_92329")}),(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",width:320,children:t("allow_documents_96106")}),(0,i.jsx)(zm,{name:"allowDelegationSpaceDownload",children:t("allow_delegatio_08622")})]}),a.allowDelegationSpaceDownload&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",width:320,children:t("documents_dispo_46996")}),(0,i.jsxs)(Ea,{css:{border:"1px solid $gray200",borderRadius:"$2",flex:"1",overflow:"hidden"},direction:"column",children:[n.organization.customBadges.map(t=>(0,i.jsx)(tY,{badge:t,change:e.change,delegationsSpaceCustomBadges:a.delegationsSpaceCustomBadges,type:"badge"},t)),r.map(t=>(0,i.jsx)(tY,{change:e.change,customDocument:t,delegationsSpaceCustomBadges:a.delegationsSpaceCustomBadges,type:"customDocument"},t.id))]})]})]}),(0,i.jsxs)(ub,{rolesTypes:Tv,children:[(0,i.jsx)($u,{height:"5"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{isLoading:s,onClick:o,children:t("enregistrer_06519")})})]})]}),onSubmit:async t=>{await s({organizationId:e,delegationSpaceSettings:t})}})},iY=()=>{const{params:{organizationId:e},translate:t}=il(),n=Nn(HS),{data:o,loader:s}=Vn("query OrganizationDelegationsSpaceDesign($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        delegationsSpaceDesign {\n            banner {\n                acl\n                name\n                key\n            }\n\n            logo {\n                acl\n                name\n                key\n            }\n\n            colors\n        }\n    }\n}\n",{organizationId:e},[]),{mutate:r}=function(e={}){return Un("mutation OrganizationDelegationsSpaceDesignUpdate(\n    $organizationId: OrganizationId!\n    $delegationsSpaceDesign: DesignInput!\n) {\n    organizationDelegationsSpaceDesignUpdate(\n        organizationId: $organizationId\n        delegationsSpaceDesign: $delegationsSpaceDesign\n    ) {\n        id\n    }\n}\n",e)}();return s||(0,i.jsx)(dl,{direction:"column",initialValues:{design:n.organizationDesignInputDefault(o.organization.delegationsSpaceDesign)},render:({handleSubmit:n,submitting:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(qS,{organizationId:e,prefix:"design.",showLogo:!0,title:"Images"}),(0,i.jsxs)(ub,{rolesTypes:Tv,children:[(0,i.jsx)($u,{height:"5"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{isLoading:o,onClick:n,children:t("enregistrer_06519")})})]})]}),onSubmit:async t=>{await r({organizationId:e,delegationsSpaceDesign:t.design})}})},oY=()=>{const{params:{organizationId:e},translate:t}=il(),[n,o]=(0,F.useState)(ze.Code);return(0,i.jsxs)(Ea,{direction:"column",width:1,children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("liste_des_e_mai_73508")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(mc,{children:[(0,i.jsx)(cc,{children:(0,i.jsx)(Tc,{children:t("type_d_e_mail_06577")})}),(0,i.jsx)($S,{isSelected:n===ze.Code,subtitle:t("cet_e_mail_est_80490"),title:t("code_20843"),onClick:()=>o(ze.Code)})]})]}),(0,i.jsx)(fr,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Ea,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(RS,{emailType:n,eventId:null,formId:null,organizationId:e,source:Ze.DelegationsSpace})})]})]})},sY=()=>{const{params:{organizationId:e},translate:t}=il(),{isLoading:n,copy:o}=sS(),s=Gm(e,oi(mi.ORGANIZATION_DELEGATIONS({organizationId:e}))),r=``.replace(/\s+/g," ");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",children:t("lien_de_l_espac_49634")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(j_,{css:{color:"$primary700"},to:s,children:s}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",children:t("code_html_pour_83166")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{css:{"& pre":{border:"1px solid $gray300",borderRadius:"$2",padding:"$3"}},children:(0,i.jsx)("pre",{children:r})}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{isLoading:n,leftIcon:"copy",onClick:()=>o(r),children:t("copier_le_code_99588")})}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",children:t("qr_code_du_lien_34278")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{height:100,width:100,children:(0,i.jsx)("img",{height:"100%",src:Ym(s,{height:100,width:100}),width:"100%"})})]})},rY=()=>{const{translate:e,params:{organizationId:t}}=il();return(0,i.jsxs)(Ea,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(fr,{font:"gray900 displayXs semiBold",children:e("espace_d_l_gati_59251")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Vy,{children:[(0,i.jsxs)(Ly,{children:[(0,i.jsx)(Ny,{path:mi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:t}),children:e("design_15043")}),(0,i.jsx)(Ny,{path:mi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION({organizationId:t}),children:e("int_gration_10662")}),(0,i.jsx)(Ny,{path:mi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES({organizationId:t}),children:e("mod_les_e_mail_91257")}),(0,i.jsx)(Ny,{path:mi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS({organizationId:t}),children:e("param_tres_78420")})]}),(0,i.jsx)(By,{path:mi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(iY,{})}),(0,i.jsx)(By,{path:mi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(sY,{})}),(0,i.jsx)(By,{path:mi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES({organizationId:":organizationId"}),children:(0,i.jsx)(oY,{})}),(0,i.jsx)(By,{path:mi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(nY,{})})]})]})},aY=e=>{const t=Ln(),{isLoading:n,copy:o}=sS(),{isLoading:s,copy:r}=sS();return(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{children:(0,i.jsxs)(Ea,{align:"center",css:{"& i":{cursor:"pointer"}},children:[(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{width:20,children:n?(0,i.jsx)(Va,{icon:"loader"}):(0,i.jsx)(Va,{icon:"copy",onClick:()=>o(e.name)})})}),(0,i.jsx)(am,{placement:"top",children:t("copier_75889")})]}),e.name]})}),(0,i.jsx)(xc,{width:100,children:e.type}),(0,i.jsx)(xc,{children:(0,i.jsxs)(Ea,{align:"center",css:{"& i":{cursor:"pointer"}},gap:"1",children:[(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{width:20,children:s?(0,i.jsx)(Va,{icon:"loader"}):(0,i.jsx)(Va,{icon:"copy",onClick:()=>r(e.value)})})}),(0,i.jsx)(am,{placement:"top",children:t("copier_75889")})]}),e.value]})})]})},lY=e=>{const t=Ln(),{mutate:n,isLoading:o}=function(e={}){return Un("mutation DomainDkimVerificationRetry(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $domain: String!\n) {\n    domainDkimVerificationRetry(organizationId: $organizationId, eventId: $eventId, domain: $domain)\n}\n",e)}();return(0,i.jsx)(kc,{filters:(0,i.jsx)(i.Fragment,{children:e.domain.status===ke.Failed&&(0,i.jsx)(pl,{color:"white",isLoading:o,leftIcon:"arrows-rotate",size:"sm",onClick:async()=>{await n({organizationId:e.organizationId,domain:e.domain.name}),e.reload()},children:t("r_essayer_43543")})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:t("nom_08311")}),(0,i.jsx)(Tc,{width:100,children:t("type_35427")}),(0,i.jsx)(Tc,{children:t("valeur_22437")})]}),numberOfPages:0,offset:0,rows:(0,i.jsxs)(i.Fragment,{children:[e.domain.dnsEntries.map((e,t)=>(0,i.jsx)(aY,{name:e.name,type:e.type,value:e.value},t)),(0,i.jsx)(aY,{name:`_dmarc.${e.domain.name}`,type:"TXT",value:"v=DMARC1; p=quarantine; adkim=r;"})]}),setOffset:Bl.A,title:(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{font:"gray900 textMd semiBold",children:t("liste_des_entr_35559",e.domain.name)}),e.domain.status===ke.Success&&(0,i.jsx)(Gd,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:t("vos_entr_es_dns_05106")}),e.domain.status===ke.Pending&&(0,i.jsx)(Gd,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:t("vos_entr_es_dns_31271")}),e.domain.status===ke.Failed&&(0,i.jsx)(Gd,{color:"error",leftIcon:"circle",leftIconStyle:"solid",children:t("la_v_rification_65771")})]}),totalCount:0})},dY=e=>{const{history:t,translate:n}=il(),{data:o,loader:s,reload:r}=Vn("query OrganizationDomains($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        domains {\n            name\n            status\n\n            dnsEntries {\n                name\n                type\n                value\n            }\n        }\n    }\n}\n",{organizationId:e.organizationId},[]);return s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),0===o.organization.domains.length?(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{height:250,width:1,children:(0,i.jsx)(rk,{imageSrc:sd.DnsBlank,subtitle:n("pour_avoir_acc_02742"),title:n("les_entr_es_dns_52899")})}),(0,i.jsxs)(Ea,{gap:"3",justify:"center",children:[(0,i.jsx)(pl,{color:"white",onClick:()=>{open("https://support.weezevent.com/fr/param%C3%A9trer-ladresse-e-mail-de-lexp%C3%A9diteur")},children:n("lire_la_documen_25597")}),(0,i.jsx)(ub,{rolesTypes:Tv,children:(0,i.jsx)(pl,{onClick:()=>{t.push(So.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:n("ajouter_un_met_38216")})})]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ha,{color:"gray",leftIcon:"circle-exclamation",children:n("les_entr_es_dns_55177")}),o.organization.domains.map((t,n)=>(0,i.jsxs)(F.Fragment,{children:[(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(lY,{domain:t,organizationId:e.organizationId,reload:r})]},n))]})]})},cY=e=>{const{history:t,translate:n}=il(),{mutate:o}=function(e={}){return Un("mutation EmailSenderDuplicate($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n    emailSenderDuplicate(organizationId: $organizationId, emailSenderId: $emailSenderId) {\n        id\n    }\n}\n",e)}(),{mutate:s}=function(e={}){return Un("mutation EmailSenderDelete($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n    emailSenderDelete(organizationId: $organizationId, emailSenderId: $emailSenderId) {\n        id\n    }\n}\n",e)}(),{mutate:r}=function(e={}){return Un("mutation EmailSenderVerificationResend(\n    $organizationId: OrganizationId!\n    $emailSenderId: EmailsSenderId!\n) {\n    emailSenderVerificationResend(organizationId: $organizationId, emailSenderId: $emailSenderId)\n}\n",e)}(),[a,l]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{align:"center",css:{padding:"$3 $4"},gap:"3",children:[(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Ea,{align:"center",gap:"2",children:[(0,i.jsx)(fr,{color:"gray800",fontWeight:"medium",children:e.emailSender.name}),!e.emailSender.isValidToSendEmail&&(0,i.jsx)(Gd,{color:"error",leftIcon:"circle",leftIconStyle:"solid",children:n("e_mail_non_conf_40343")})]}),(0,i.jsx)(fr,{color:"gray500",children:e.emailSender.from})]}),(0,i.jsx)(pl,{color:"white",onClick:()=>{t.push(So.EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId,e.emailSender.id))},children:n("_diter_62574")}),(0,i.jsx)(pl,{color:"white",onClick:()=>{t.push(So.ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW(e.organizationId,e.emailSender.id))},children:n("aper_u_25595")}),(0,i.jsxs)(Ed,{children:[(0,i.jsx)(Dd,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Pd,{placement:"bottom-end",children:[!e.emailSender.isValidToSendEmail&&(0,i.jsx)(Od,{icon:"paper-plane",onClick:async()=>{await r({organizationId:e.organizationId,emailSenderId:e.emailSender.id})},children:n("r_envoyer_l_e_91472")}),(0,i.jsx)(Od,{icon:"clone",onClick:async()=>{await o({organizationId:e.organizationId,emailSenderId:e.emailSender.id}),e.reload()},children:n("dupliquer_28256")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:()=>{l(!0)},children:n("supprimer_43083")})]})," "]})]}),a&&(0,i.jsx)(kk,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_90786"),text:n("suppression_de_73669",e.emailSender.from),onClose:()=>{l(!1)},onDelete:async()=>{await s({organizationId:e.organizationId,emailSenderId:e.emailSender.id}),e.reload()}})]})},uY=e=>{const t=Ln();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{font:"gray900 textLg medium",children:t("liste_des_mett_28960")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Ea,{css:{border:"1px solid $gray200",borderRadius:"$2","& > div:not(:last-child)":{borderBottom:"1px solid $gray200"}},direction:"column",children:e.emailsSenders.map(t=>(0,i.jsx)(cY,{emailSender:t,organizationId:e.organizationId,reload:e.reload},t.id))})]})},hY=e=>{const{history:t,translate:n}=il(),{data:o,loader:s,reload:r}=Vn("query EmailsSenders($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        emailsSenders {\n            id\n            name\n            from\n            fromEmail\n            isValidToSendEmail\n        }\n    }\n}\n",{organizationId:e.organizationId},[]);const[a,l]=(0,F.useState)(null),d=(0,F.useMemo)(()=>(o.organization?.emailsSenders??[]).filter(e=>!e.isValidToSendEmail),[o.organization]);return(0,F.useEffect)(()=>{!s&&o.organization.emailsSenders.length>0&&null===a&&l(o.organization.emailsSenders[0].id)},[s,a,o.organization?.emailsSenders,l]),s||(0===o.organization.emailsSenders.length?(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{height:250,width:1,children:(0,i.jsx)(rk,{subtitle:n("cr_er_des_mett_38995"),title:n("aucun_metteur_96777")})}),(0,i.jsx)(ub,{rolesTypes:Tv,children:(0,i.jsx)(Ea,{justify:"center",children:(0,i.jsx)(pl,{onClick:()=>{t.push(So.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:n("cr_er_un_mette_14030")})})})]}):(0,i.jsxs)(i.Fragment,{children:[Zo(d)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ha,{color:"error",leftIcon:"circle-exclamation",children:[n("veuillez_confir_10865"),(0,i.jsx)("ul",{children:d.map(e=>(0,i.jsx)("li",{children:e.fromEmail},e.id))})]})]}),(0,i.jsx)(uY,{emailsSenders:o.organization.emailsSenders,organizationId:e.organizationId,reload:r})]}))},mY=()=>{const{history:e,translate:t,params:{organizationId:n}}=il(),o=location.pathname.endsWith("emails/senders");return(0,i.jsxs)(Ea,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ea,{children:[(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(fr,{font:"gray900 displayXs semiBold",children:t("e_mails_09850")}),(0,i.jsx)(fr,{color:"gray500",children:t("param_trer_les_39470")})]}),o&&(0,i.jsx)(ub,{rolesTypes:Tv,children:(0,i.jsx)(pl,{onClick:()=>{e.push(So.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n))},children:t("cr_er_une_nouve_77052")})})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Vy,{children:[(0,i.jsxs)(Ly,{children:[(0,i.jsx)(Ny,{path:So.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n),children:t("_metteurs_74545")}),(0,i.jsx)(Ny,{path:So.ORGANIZATION_PARAMETERS_EMAILS_DNS(n),children:t("entr_es_dns_11256")})]}),(0,i.jsx)(By,{path:So.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n),children:(0,i.jsx)(hY,{organizationId:n})}),(0,i.jsx)(By,{path:So.ORGANIZATION_PARAMETERS_EMAILS_DNS(n),children:(0,i.jsx)(dY,{organizationId:n})})]})]})},gY=e=>{const{history:t,translate:n,params:{organizationId:o}}=il(),s=Nn(F_),r=Nn(Hc),{mutate:a,isLoading:l}=function(e={}){return Un("mutation OrganizationUpdateInfos(\n    $organizationId: OrganizationId!\n    $organization: OrganizationInfosInput!\n) {\n    organizationUpdateInfos(organizationId: $organizationId, organization: $organization) {\n        id\n    }\n}\n",e)}(),d=(0,F.useMemo)(()=>({organization:e.initialValues}),[e.initialValues]),c=(0,F.useMemo)(()=>O_.map((e,t)=>(0,i.jsx)("option",{value:e,children:e},t)),[]),u=Fo.c9.now();return(0,i.jsx)(dl,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,initialValues:d,render:({form:s,handleSubmit:a,values:d})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(OE,{change:s.change,changeCity:!0,changeCountry:!0,changeLatLng:!1,changePostalCode:!0,name:"place",prefix:"organization."}),(0,i.jsx)(fr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:n("organisation_71863")}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsx)(fr,{font:"gray700 textSm medium",width:280,children:n("_propos_de_l_o_80406")}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(Sl,{label:n("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(Aj,{addressName:"organization.street",label:n("Address"),placeName:"place"}),(0,i.jsx)(Sl,{label:n("code_postal_40328"),name:"organization.postalCode"}),(0,i.jsx)(Sl,{label:n("ville_67740"),name:"organization.city"}),(0,i.jsx)(Sm,{isSearchVisible:!0,label:n("Country"),name:"organization.country",children:r.getCountriesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Sm,{isSearchVisible:!0,label:n("fuseau_horaire_14654"),name:"organization.timeZone",children:c})]})]}),(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsx)(fr,{font:"gray700 textSm medium",width:280,children:n("responsable_de_20624")}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(Sl,{label:n("nom_du_responsa_44907"),name:"organization.adminName"}),(0,i.jsx)(Sl,{isEmail:!0,label:n("e_mail_du_respo_66060"),name:"organization.adminEmail"})]})]}),(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsx)(fr,{font:"gray700 textSm medium",width:280,children:n("_metteur_de_e_m_77028")}),(0,i.jsx)(Ea,{css:{flex:"1"},direction:"column",gap:"4",children:(0,i.jsx)(Sm,{isCreateVisible:!0,isSearchVisible:!0,label:n("_metteur_des_e_27849"),name:"organization.emailSenderId",onCreateClick:()=>{t.push(So.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(o))},children:e.emailsSenders.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsx)(fr,{font:"gray700 textSm medium",width:280,children:n("date_time_for_13370")}),(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(Sl,{hint:n("rendu_avec_la_d_41897",u.toFormat(d.organization.dateFormat)),label:n("format_de_date_82059"),name:"organization.dateFormat"}),(0,i.jsx)(Sl,{hint:n("rendu_avec_la_d_41897",u.toFormat(d.organization.datetimeFormat)),label:n("format_de_date_24474"),name:"organization.datetimeFormat"}),(0,i.jsx)(Sl,{hint:n("rendu_avec_la_d_41897",u.toFormat(d.organization.timeFormat)),label:n("format_d_heure_46798"),name:"organization.timeFormat"})]})]}),(0,i.jsxs)(ub,{rolesTypes:Tv,children:[(0,i.jsx)($u,{height:"5"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{isLoading:l,onClick:a,children:n("enregistrer_les_30411")})})]})]}),schema:s.updateOrganizationGeneralSchema(),width:1,onSubmit:async e=>{await a({organizationId:o,organization:e.organization})}})},pY=()=>{const e=Nn(F_),{organizationId:t}=Wn(),{data:n,loader:o}=Ts({organizationId:t});return o||(0,i.jsx)(gY,{emailsSenders:n.organization.emailsSenders,initialValues:e.organizationInfosInputDefault(n.organization)})},fY=()=>{const e=Ln(),{organizationId:t}=Wn(),{data:n,loader:o}=Vn("query Invoices($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        invoices {\n            id\n            invoiceNumber\n            amountCents\n            smsAmountCents\n            paidAt\n            url\n            insertedAt\n            isRefunded\n        }\n    }\n}\n",{organizationId:t},[]);return o||(0,i.jsxs)(Ea,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("factures_03552")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(kc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:e("num_ro_de_factu_68150")}),(0,i.jsx)(Tc,{children:e("Date")}),(0,i.jsx)(Tc,{children:e("montant_55595")}),(0,i.jsx)(Tc,{children:e("status_06428")}),(0,i.jsx)(Tc,{})]}),numberOfPages:1,offset:0,rows:(0,i.jsx)(i.Fragment,{children:n.organization.invoices.map((e,t)=>(0,i.jsx)(Fc,{invoice:e,isBackoffice:!1,showColumn:()=>!0},t))}),setOffset:Bl.A,title:e("factures_03552"),totalCount:0})]})},xY=()=>{const{params:{organizationId:e},translate:t}=il(),n=Nn(HS),{data:o,loader:s}=Vn("query OrganizationMembersSpaceDesign($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        membersSpaceDesign {\n            banner {\n                acl\n                name\n                key\n            }\n\n            logo {\n                acl\n                name\n                key\n            }\n\n            colors\n        }\n    }\n}\n",{organizationId:e},[]),{mutate:r}=function(e={}){return Un("mutation OrganizationMembersSpaceDesignUpdate(\n    $organizationId: OrganizationId!\n    $membersSpaceDesign: DesignInput!\n) {\n    organizationMembersSpaceDesignUpdate(\n        organizationId: $organizationId\n        membersSpaceDesign: $membersSpaceDesign\n    ) {\n        id\n    }\n}\n",e)}();return s||(0,i.jsx)(dl,{direction:"column",initialValues:{design:n.organizationDesignInputDefault(o.organization.membersSpaceDesign)},render:({handleSubmit:n,submitting:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(qS,{organizationId:e,prefix:"design.",showLogo:!0,title:t("images_de_votre_51694")}),(0,i.jsxs)(ub,{rolesTypes:Tv,children:[(0,i.jsx)($u,{height:"5"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{isLoading:o,onClick:n,children:t("enregistrer_06519")})})]})]}),onSubmit:async t=>{await r({organizationId:e,membersSpaceDesign:t.design})}})},_Y=()=>{const{params:{organizationId:e},translate:t}=il(),[n,o]=(0,F.useState)(ze.Code);return(0,i.jsxs)(Ea,{direction:"column",width:1,children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsxs)(Ea,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("liste_des_e_mai_73508")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsxs)(mc,{children:[(0,i.jsx)(cc,{children:(0,i.jsx)(Tc,{children:t("type_d_e_mail_06577")})}),(0,i.jsx)($S,{isSelected:n===ze.Code,subtitle:t("cet_e_mail_est_80490"),title:t("code_20843"),onClick:()=>o(ze.Code)})]})]}),(0,i.jsx)(fr,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Ea,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(RS,{emailType:n,eventId:null,formId:null,organizationId:e,source:Ze.MembersSpace})})]})]})},IY=()=>{const{params:{organizationId:e},translate:t}=il(),{isLoading:n,copy:o}=sS(),s=Gm(e,oi(mi.ORGANIZATION({organizationId:e}))),r=``.replace(/\s+/g," ");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",children:t("lien_de_l_espac_08307")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(j_,{css:{color:"$primary700"},to:s,children:s}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",children:t("code_html_pour_79518")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{css:{"& pre":{border:"1px solid $gray300",borderRadius:"$2",padding:"$3"}},children:(0,i.jsx)("pre",{children:r})}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{isLoading:n,leftIcon:"copy",onClick:()=>{o(r)},children:t("copier_le_code_99588")})}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",children:t("qr_code_du_lien_34278")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{height:100,width:100,children:(0,i.jsx)("img",{height:"100%",src:Ym(s,{height:100,width:100}),width:"100%"})})]})},vY=()=>{const{params:{organizationId:e},translate:t}=il(),{data:n,loader:o}=Vn("query OrganizationMembersSpaceSettings($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        hideAssignmentsUntilConfirmationEmailSent\n        hideAccreditationsUntilConfirmationEmailSent\n    }\n}\n",{organizationId:e},[]),{mutate:s}=function(e={}){return Un("mutation OrganizationMembersSpaceSettingsUpdate(\n    $organizationId: OrganizationId!\n    $membersSpaceSettings: MembersSpaceSettingsInput!\n) {\n    organizationMembersSpaceSettingsUpdate(\n        organizationId: $organizationId\n        membersSpaceSettings: $membersSpaceSettings\n    ) {\n        id\n    }\n}\n",e)}();return o||(0,i.jsx)(dl,{direction:"column",initialValues:{hideAssignmentsUntilConfirmationEmailSent:n.organization.hideAssignmentsUntilConfirmationEmailSent,hideAccreditationsUntilConfirmationEmailSent:n.organization.hideAccreditationsUntilConfirmationEmailSent},render:({handleSubmit:e,submitting:n})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("param_tres_de_l_83556")}),(0,i.jsx)(fr,{color:"gray500",fontWeight:"medium",children:t("personnalisez_l_44387")}),(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",width:300,children:t("diffusion_des_a_83706")}),(0,i.jsx)(zm,{name:"hideAssignmentsUntilConfirmationEmailSent",children:t("afficher_les_af_06759")})]}),(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{gap:"7",children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",width:300,children:t("diffusion_des_a_32535")}),(0,i.jsx)(zm,{name:"hideAccreditationsUntilConfirmationEmailSent",children:t("afficher_les_ac_55704")})]}),(0,i.jsxs)(ub,{rolesTypes:Tv,children:[(0,i.jsx)($u,{height:"5"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{isLoading:n,onClick:e,children:t("enregistrer_06519")})})]})]}),onSubmit:async t=>{await s({organizationId:e,membersSpaceSettings:t})}})},bY=()=>{const{translate:e,params:{organizationId:t}}=il();return(0,i.jsxs)(Ea,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(fr,{font:"gray900 displayXs semiBold",children:e("espace_membres_90896")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Vy,{children:[(0,i.jsxs)(Ly,{children:[(0,i.jsx)(Ny,{path:mi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:t}),children:e("design_15043")}),(0,i.jsx)(Ny,{path:mi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION({organizationId:t}),children:e("int_gration_10662")}),(0,i.jsx)(Ny,{path:mi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES({organizationId:t}),children:e("mod_les_e_mail_91257")}),(0,i.jsx)(Ny,{path:mi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS({organizationId:t}),children:e("param_tres_78420")})]}),(0,i.jsx)(By,{path:mi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(xY,{})}),(0,i.jsx)(By,{path:mi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(IY,{})}),(0,i.jsx)(By,{path:mi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES({organizationId:":organizationId"}),children:(0,i.jsx)(_Y,{})}),(0,i.jsx)(By,{path:mi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(vY,{})})]})]})},jY=e=>{const t=Hn(),n=e.isActive?e.isActive(t.pathname):t.pathname===e.path;return(0,i.jsx)(La,{to:e.path,children:(0,i.jsxs)(sj,{active:n,css:{gap:"$3",justifyContent:"flex-start",px:"$3",width:"100%"},children:[(0,i.jsx)(fr,{width:20,children:(0,i.jsx)(Va,{icon:e.icon})}),(0,i.jsx)(fr,{children:e.title})]})})},CY=e=>{const{localOrganization:t,updateLocalOrganization:n}=nI(),[o,s]=F.useState(t?.areParametersMenuSectionsOpen?.[e.name]??!0),r=F.useCallback(async i=>{s(i),await n({areParametersMenuSectionsOpen:(0,Fa.A)(t?.areParametersMenuSectionsOpen,{[e.name]:i})})},[t,o,s]);return(0,i.jsxs)(Ea,{css:{borderBottom:"1px solid $gray200",paddingBottom:"$1",paddingTop:"$4"},direction:"column",children:[(0,i.jsxs)(Ea,{align:"center",css:{color:"$gray800",cursor:"pointer",px:"$5"},gap:"3",onClick:async()=>{await r(!o)},children:[(0,i.jsx)(fr,{css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"semiBold",children:e.title}),(0,i.jsx)(fr,{css:{fontSize:"10px"},children:(0,i.jsx)(Va,{icon:o?"chevron-down":"chevron-up"})})]}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(Ea,{css:{px:"$3"},direction:"column",children:e.children})]})]})},yY=()=>{const{translate:e,params:{organizationId:t}}=il(),{data:n,loader:o}=Fs({organizationId:t}),s=Nn(EE),r=Nn(za),{mutate:a,isLoading:l}=Ms(),{mutate:d}=ea(),{user:c}=Zn(),{reload:u}=nI(),[h,m]=(0,F.useState)(!1);return o||(0,i.jsx)(dl,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,initialValues:{userInfo:s.userInfoProfileInputDefault(n.user)},render:({handleSubmit:n})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("mon_profil_48224")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textLg",fontWeight:"semiBold",children:e("informations_pe_37892")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(oj,{accept:HI.Images,acl:"public-read",allowCrop:!0,label:e("photo_de_profil_08618"),organizationId:t,prefix:"userInfo.fields.picture."}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(Oq,{inputName:"userInfo."}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"gray800",fontSize:"textLg",fontWeight:"semiBold",children:e("compte_16579")}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(fr,{color:"error700",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{m(!0)},children:e("supprimer_mon_c_07051")}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{isLoading:l,onClick:n,children:e("enregistrer_les_30411")})}),h&&(0,i.jsx)(kk,{buttonText:"Supprimer",subtext:e("_tes_vous_s_r_d_50084"),text:e("supprimer_mon_c_07051"),onClose:()=>{m(!1)},onDelete:async()=>{await d({}),Y()}})]}),validate:r.validateForForm(s.updateProfileSchema()),width:1,onSubmit:async e=>{const{userProfileUpdate:{email:t,language:i}}=await a({userId:c.id,userInfoId:n.user.userInfo.id,userInfo:e.userInfo});c.email!==t||c.language!==i?Y():u()}})},kY=()=>{const{organizationId:e}=Wn(),t=Ln();return(0,i.jsxs)(Ea,{align:"center",gap:"6",children:[(0,i.jsx)(fr,{color:"gray900",css:{flexGrow:1},fontSize:"displayXs",fontWeight:"semiBold",children:t("r_les_et_permis_27853")}),(0,i.jsx)(pl,{to:So.CREATE_ORGANIZATION_PARAMETERS_ROLE(e),children:t("cr_er_un_nouvea_53551")})]})};function AY(e){return e.type===pt.Custom}const wY=({role:e})=>{const{organizationId:t}=Wn(),n=Ln(),{data:o,isLoading:s}=Vn("query RoleUses($organizationId: OrganizationId!, $roleId: RoleId!) {\n    organization(id: $organizationId) {\n        role(id: $roleId) {\n            uses {\n                __typename\n\n                ... on UsersPosition {\n                    userInfo {\n                        id\n                        name\n                    }\n                    position {\n                        id\n                        name\n                    }\n                }\n\n                ... on UsersPositionsCategory {\n                    userInfo {\n                        id\n                        name\n                    }\n                    positionCategory {\n                        id\n                        name\n                    }\n                }\n\n                ... on UsersDelegationsCategory {\n                    userInfo {\n                        id\n                        name\n                    }\n                    delegationCategory {\n                        id\n                        name\n                    }\n                }\n            }\n        }\n    }\n}\n",{organizationId:t,roleId:e.id},[]);if(s)return(0,i.jsx)(qd,{borderRadius:"$1",height:18,width:160});{const e=o.organization.role.uses;if(0===e.length)return(0,i.jsx)("div",{children:n("ce_r_le_n_est_p_61959")});{const t=(0,Kd.A)(e,e=>e.userInfo.id);return(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{children:n("les_responsable_31151")}),Object.entries(t).map(([e,t])=>(0,i.jsxs)("dl",{children:[(0,i.jsx)("dt",{children:n("_1_sur_84610",t[0].userInfo.name)}),t.map(e=>"UsersPosition"===e.__typename?(0,i.jsx)("dd",{children:n("la_mission_1_50232",e.position.name)},e.position.id):"UsersPositionsCategory"===e.__typename?(0,i.jsx)("dd",{children:n("la_cat_gorie_1_00613",e.positionCategory.name)},e.positionCategory.id):(0,i.jsx)("dd",{children:n("la_cat_gorie_1_00613",e.delegationCategory.name)},e.delegationCategory.id))]},e))]})}}},SY=({onClose:e,onDelete:t,role:n})=>{const o=Ln(),{organizationId:s}=Wn(),{mutate:r}=function(e={}){return Un("mutation RoleDelete($organizationId: OrganizationId!, $roleId: RoleId!) {\n    roleDelete(organizationId: $organizationId, roleId: $roleId) {\n        id\n    }\n}\n",e)}();return(0,i.jsx)(kk,{buttonText:o("supprimer_43083"),text:o("suppression_de_73669",n.name),onClose:e,onDelete:()=>r({organizationId:s,roleId:n.id}).then(e=>(t(),e)),children:(0,i.jsx)(wY,{role:n})})},EY=({onDelete:e,role:t})=>{const{organizationId:n}=Wn(),o=Ln(),s=Gn(),[r,a]=F.useState(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(pm,{children:[AY(t)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Od,{icon:"pen",onClick:()=>{s.push(So.EDIT_ORGANIZATION_PARAMETERS_ROLE(n,t.id))},children:o("_diter_62574")}),(0,i.jsx)(Od,{icon:"clone",onClick:()=>{s.push(So.DUPLICATE_ORGANIZATION_PARAMETERS_ROLE(n,t.id))},children:o("dupliquer_28256")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:e=>{wd(e.target),a(!0)},children:o("supprimer_43083")})]}),!AY(t)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Od,{icon:"eye",onClick:()=>{s.push(So.EDIT_ORGANIZATION_PARAMETERS_ROLE(n,t.id))},children:o("voir_36533")}),(0,i.jsx)(Od,{icon:"clone",onClick:()=>{s.push(So.DUPLICATE_ORGANIZATION_PARAMETERS_ROLE(n,t.id))},children:o("dupliquer_28256")})]})]}),r&&(0,i.jsx)(SY,{role:t,onClose:()=>{a(!1)},onDelete:e})]})},TY=()=>{const{organizationId:e}=Wn(),t=Ln(),n=Gn(),{data:o,isLoading:s,reload:r}=Vn("query Roles($organizationId: OrganizationId!, $types: [RoleType!]) {\n    organization(id: $organizationId) {\n        roles(types: $types) {\n            id\n            name\n            description\n            type\n        }\n    }\n}\n",{organizationId:e,types:[pt.DelegationCategoryLeader,pt.PositionEditor,pt.PositionReader,pt.Custom]},[]);const{showNotification:a}=Yv(),l=()=>{a({color:"success",text:t("le_r_le_a_bien_53462")}),r()};return(0,i.jsx)(nm,{"aria-busy":s,css:{height:"auto",overflow:"visible","& > div:first-child":{borderRadius:"$2 $2 0 0"},"& > div:last-child":{borderBottom:"1px solid $gray200",borderRadius:"0 0 $2 $2"}},headerRow:(0,i.jsxs)(cc,{children:[(0,i.jsx)(Tc,{children:t("nom_du_r_le_38492")}),(0,i.jsx)(Tc,{css:{flexGrow:2},children:t("description_du_94520")}),(0,i.jsx)(Tc,{width:100})]}),children:s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{}),(0,i.jsx)(zc,{css:{borderBottom:"none"}})]}):o.organization.roles.map(t=>(0,i.jsxs)(Cc,{css:{cursor:"pointer","&:hover":{background:"$gray100"},"&:last-child":{borderBottom:"none"}},onClick:()=>{n.push(So.EDIT_ORGANIZATION_PARAMETERS_ROLE(e,t.id))},onMouseLeave:e=>{wd(e.target)},children:[(0,i.jsx)(xc,{css:{mindWidth:0},children:(0,i.jsx)(fr,{ellipsis:!0,title:t.name,children:t.name})}),(0,i.jsx)(xc,{css:{flexGrow:2,minWidth:0},children:(0,i.jsx)(fr,{ellipsis:!0,title:t.description,children:t.description})}),(0,i.jsx)(im,{justify:"end",children:(0,i.jsx)(EY,{role:t,onDelete:l})})]},t.id))})},zY=()=>{const e=Ln();return(0,i.jsxs)(Ea,{css:{overflowY:"auto",padding:"$6 $7"},direction:"column",gap:"6",height:1,children:[(0,i.jsx)(kY,{}),(0,i.jsx)(qa.Root,{children:(0,i.jsxs)(qa.Titled,{children:[(0,i.jsx)(qa.Title,{icon:"circle-info",children:e("contr_ler_les_p_50104")}),(0,i.jsx)(qa.Text,{children:e("les_r_les_aiden_19371")})]})}),(0,i.jsx)(TY,{})]})};let $Y=class extends zl{constructor(e){super(e)}connectionInfosInputDefault(e){return{url:e?.url??"",issuer:e?.issuer??"",receiver:e?.receiver??"",synchronizedEventsIds:e?.synchronizedEventsIds??[],seasonEventsIds:e?.seasonEventsIds??[],place:e?.place??""}}};$Y=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],$Y);const OY=e=>{const t=Ln(),n=Nn($c),{mutate:o}=function(e={}){return Un("mutation SkidataConnectionInfoSeaonEventAdd($organizationId: OrganizationId!, $eventId: EventId!) {\n    skidataConnectionInfoSeaonEventAdd(organizationId: $organizationId, eventId: $eventId) {\n        organizationId\n    }\n}\n",e)}(),{mutate:s}=function(e={}){return Un("mutation SkidataConnectionInfoSeaonEventDelete(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n) {\n    skidataConnectionInfoSeaonEventDelete(organizationId: $organizationId, eventId: $eventId) {\n        organizationId\n    }\n}\n",e)}(),{mutate:r}=function(e={}){return Un("mutation SkidataConnectionInfoSynchronizedEventAdd(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n) {\n    skidataConnectionInfoSynchronizedEventAdd(organizationId: $organizationId, eventId: $eventId) {\n        organizationId\n    }\n}\n",e)}(),{mutate:a}=function(e={}){return Un("mutation SkidataConnectionInfoSynchronizedEventDelete(\n    $organizationId: OrganizationId!\n    $eventId: EventId!\n) {\n    skidataConnectionInfoSynchronizedEventDelete(\n        organizationId: $organizationId\n        eventId: $eventId\n    ) {\n        organizationId\n    }\n}\n",e)}();return(0,i.jsxs)(Ea,{gap:"3",width:1,children:[(0,i.jsxs)(Ea,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",children:e.title}),(0,i.jsx)(fr,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(fr,{width:1,children:(0,i.jsxs)(mc,{children:[(0,i.jsxs)(cc,{children:[(0,i.jsx)(Tc,{children:t("nom_de_l_v_nem_08711")}),(0,i.jsx)(Tc,{children:t("Date")}),"all"===e.eventType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{}),(0,i.jsx)(Tc,{})]}),"synchronized"===e.eventType&&(0,i.jsx)(Tc,{}),"season"===e.eventType&&(0,i.jsx)(Tc,{})]}),Zo(e.events)?e.events.map(l=>(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(fr,{color:"gray800",width:1,children:l.name})}),(0,i.jsx)(xc,{children:C_(n,l.startAt,l.endAt)}),"all"===e.eventType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{onClick:async()=>{await r({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(fr,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("synchroniser_34754")})}),(0,i.jsx)(xc,{onClick:async()=>{await o({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(fr,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("_v_nement_saiso_67885")})})]}),"synchronized"===e.eventType&&(0,i.jsx)(xc,{onClick:async()=>{await a({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(fr,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("supprimer_43083")})}),"season"===e.eventType&&(0,i.jsx)(xc,{onClick:async()=>{await s({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(fr,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("supprimer_43083")})})]},l.id)):(0,i.jsx)(Cc,{css:{height:"auto"},children:(0,i.jsx)(xc,{children:(0,i.jsxs)(Ea,{align:"center",css:{padding:"$8"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(mj,{color:"primary",icon:"magnifying-glass"}),(0,i.jsx)(fr,{fontSize:"textMd",fontWeight:"medium",children:t("aucun_v_nement_39620")})]})})})]})})]})},RY=()=>{const e=Ln(),{organizationId:t}=Wn(),n=Nn($Y),{data:o,loader:s,reload:r}=Vn("query SkidataConnectionInfos($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        events(states: [Ongoing, Upcoming]) {\n            nodes {\n                id\n                name\n                startAt\n                endAt\n            }\n        }\n\n        skidataConnectionInfos {\n            url\n            issuer\n            receiver\n            seasonEventsIds\n            synchronizedEventsIds\n            place\n        }\n    }\n}\n",{organizationId:t},[]),{mutate:a}=function(e={}){return Un("mutation SkidataConnectionInfosDelete($organizationId: OrganizationId!) {\n    skidataConnectionInfosDelete(organizationId: $organizationId) {\n        organizationId\n    }\n}\n",e)}(),{mutate:l,isLoading:d}=function(e={}){return Un("mutation SkidataConnectionInfosUpsert(\n    $organizationId: OrganizationId!\n    $connectionInfos: SkidataConnectionInfoInput!\n) {\n    skidataConnectionInfosUpsert(\n        organizationId: $organizationId\n        connectionInfos: $connectionInfos\n    ) {\n        organizationId\n    }\n}\n",e)}(),{mutate:c,isLoading:u}=function(e={}){return Un("mutation SkidataSynchronize($organizationId: OrganizationId!) {\n    skidataSynchronize(organizationId: $organizationId)\n}\n",e)}(),h=(0,F.useMemo)(()=>o.organization?.events.nodes??[],[o.organization]),m=(0,F.useMemo)(()=>h.map(({id:e})=>e),[h]),g=(0,F.useMemo)(()=>o.organization?.skidataConnectionInfos?.synchronizedEventsIds??[],[o.organization]),p=(0,F.useMemo)(()=>o.organization?.skidataConnectionInfos?.seasonEventsIds??[],[o.organization]),f=(0,F.useMemo)(()=>{const e=(0,Jd.A)(m,g.concat(p));return h.filter(t=>e.includes(t.id))},[h,g,p]),x=(0,F.useMemo)(()=>h.filter(e=>g.includes(e.id)),[h]),_=(0,F.useMemo)(()=>h.filter(e=>p.includes(e.id)),[h,p]);return s||(0,i.jsx)(dl,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,initialValues:{connectionInfos:n.connectionInfosInputDefault(o.organization.skidataConnectionInfos)},render:({handleSubmit:n})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{gap:"3",children:[(0,i.jsx)(fr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:"Skidata"}),o.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pl,{isLoading:d,onClick:n,children:e("enregistrer_06519")}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:u?(0,i.jsx)(pl,{color:"white",leftIcon:"loader"}):(0,i.jsx)(pl,{color:"white",leftIcon:"arrows-rotate",onClick:async()=>{await c({organizationId:t})}})})}),(0,i.jsx)(am,{placement:"top",children:e("synchroniser_34754")})]}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(pl,{color:"white",leftIcon:"arrow-right-from-bracket",onClick:async()=>{await a({organizationId:t}),r()}})})}),(0,i.jsx)(am,{placement:"top",children:e("se_d_connecter_74151")})]})]})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsxs)(Ea,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",width:280,children:e("adresse_du_web_92125")}),(0,i.jsx)(Sl,{name:"connectionInfos.url"})]}),(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",width:280,children:"Issuer"}),(0,i.jsx)(Sl,{name:"connectionInfos.issuer"})]}),(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",width:280,children:"Receiver"}),(0,i.jsx)(Sl,{name:"connectionInfos.receiver"})]}),(0,i.jsx)($u,{height:"5"}),(0,i.jsxs)(Ea,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(fr,{color:"gray700",fontWeight:"medium",width:280,children:e("lieu_20541")}),(0,i.jsx)(Sl,{name:"connectionInfos.place"})]}),o.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(zu,{direction:"horizontal"}),(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(OY,{eventType:"all",events:f,organizationId:t,reload:r,subtitle:"",title:e("liste_des_v_ne_29929")}),(0,i.jsx)($u,{height:"5"}),(0,i.jsx)(OY,{eventType:"synchronized",events:x,organizationId:t,reload:r,subtitle:e("ces_v_nements_58722"),title:e("liste_des_v_ne_09741")}),(0,i.jsx)($u,{height:"5"}),(0,i.jsx)(OY,{eventType:"season",events:_,organizationId:t,reload:r,subtitle:e("ces_v_nements_24479"),title:e("liste_des_v_ne_73078")})]}),!o.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"5"}),(0,i.jsx)(Ea,{justify:"end",children:(0,i.jsx)(pl,{isLoading:d,onClick:n,children:e("se_connecter_63820")})})]})]}),width:1,onSubmit:async e=>{await l({organizationId:t,connectionInfos:e.connectionInfos}),r()}})},PY=e=>{const t=Ln(),{mutate:n}=function(e={}){return Un("mutation TagUpdateName($organizationId: OrganizationId!, $tagId: TagId!, $name: String!) {\n    tagUpdateName(organizationId: $organizationId, tagId: $tagId, name: $name) {\n        id\n    }\n}\n",e)}();return(0,i.jsx)(gj,{buttonText:t("renommer_42135"),icon:"tag",initialValues:{name:e.name},title:t("renommer_1_40542",e.name),onClose:e.onClose,onSubmit:async t=>{await n({organizationId:e.organizationId,tagId:e.tagId,name:t.name}),e.onSuccess(),e.onClose()},children:(0,i.jsx)(Sl,{label:t("nom_du_tag_95054"),name:"name"})})},DY=e=>{const t=Ln(),{isOrganizationAdmin:n}=nI(),{mutate:o}=function(e={}){return Un("mutation TagDelete($organizationId: OrganizationId!, $tagId: TagId!) {\n    tagDelete(organizationId: $organizationId, tagId: $tagId) {\n        id\n    }\n}\n",e)}(),[s,r]=(0,F.useState)(!1),[a,l]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Cc,{css:{"&:hover":{background:"$gray100"}},children:[(0,i.jsx)(xc,{css:{color:"$gray800"},children:e.tag.name}),(0,i.jsx)(xc,{children:e.tag.numberOfTimesUsed}),n&&(0,i.jsxs)(im,{justify:"center",children:[(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{children:(0,i.jsx)(Va,{icon:"pen",onClick:()=>{r(!0)}})})}),(0,i.jsx)(am,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsxs)(sm,{children:[(0,i.jsx)(lm,{children:(0,i.jsx)(fr,{color:"error700",children:(0,i.jsx)(Va,{icon:"trash-can",onClick:()=>{l(!0)}})})}),(0,i.jsx)(am,{placement:"top",children:t("supprimer_02105")})]})]})]}),s&&(0,i.jsx)(PY,{name:e.tag.name,organizationId:e.organizationId,tagId:e.tag.id,onClose:()=>{r(!1)},onSuccess:e.reload}),a&&(0,i.jsx)(kk,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_70200"),text:t("suppression_de_73669",e.tag.name),onClose:()=>{l(!1)},onDelete:async()=>{await o({organizationId:e.organizationId,tagId:e.tag.id}),e.reload()}})]})},FY=()=>{const{translate:e,params:{organizationId:t}}=il(),{isOrganizationAdmin:n}=nI(),[o,s,r]=Ec(""),[a,l]=(0,F.useState)(0),{data:d,isLoading:c,reload:u}=Vn("query OrganizationTags($organizationId: OrganizationId!, $name: String, $offset: Int) {\n    organization(id: $organizationId) {\n        tags(name: $name, offset: $offset, limit: 25) {\n            nodes {\n                id\n                name\n                numberOfTimesUsed\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{organizationId:t,name:h(s)?s:void 0,offset:a},[]);const{numberOfPages:m,totalCount:g}=lu(d.organization?.tags),[p,f]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,children:[(0,i.jsxs)(Ea,{gap:"3",children:[(0,i.jsx)(fr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:e("tags_79499")}),(0,i.jsx)(ub,{rolesTypes:Tv,children:(0,i.jsx)(pl,{onClick:()=>{f(!0)},children:e("cr_er_un_nouvea_56617")})})]}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(kc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fr,{width:320,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:e("rechercher_un_t_34829"),value:o,onChange:r})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:e("nom_08311")}),(0,i.jsx)(Tc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Tc,{width:100})]}),numberOfPages:m,offset:a,rows:c?(0,i.jsx)(i.Fragment,{}):d.organization.tags.nodes.map(e=>(0,i.jsx)(DY,{organizationId:t,reload:u,tag:e},e.id)),setOffset:l,title:e("liste_des_tags_83521"),totalCount:g})]}),p&&(0,i.jsx)(pj,{organizationId:t,onClose:()=>{f(!1)},onSuccess:u})]})};function MY(e,t){const n=e[`${t.toLowerCase()}String`];return h(n)?n:h(e.enString)?e.enString:h(e.frString)?e.frString:h(e.esString)?e.esString:h(e.deString)?e.deString:h(e.nlString)?e.nlString:""}const NY=e=>{const{translate:t,params:{organizationId:n}}=il(),{user:o}=Zn(),{mutate:s,isLoading:r}=function(e={}){return Un("mutation TranslationUpdate(\n    $organizationId: OrganizationId!\n    $translationId: TranslationId!\n    $translation: TranslationInput!\n) {\n    translationUpdate(\n        organizationId: $organizationId\n        translationId: $translationId\n        translation: $translation\n    ) {\n        id\n    }\n}\n",e)}(),[a,l]=(0,F.useState)(!1),[d,c]=(0,F.useState)(Object.fromEntries(e.languages.map(t=>[t,e.translation[t.toLowerCase()]||""]))),u=o.language,h=e.languages.every(t=>e.translation[`is${t}Translated`]);return(0,i.jsxs)(Ea,{css:{border:"1px solid $gray200",borderBottom:e.isLast?"1px solid $gray200":"none",borderBottomLeftRadius:e.isLast?"$2":"0",borderBottomRightRadius:e.isLast?"$2":"0",borderTopLeftRadius:e.isFirst?"$2":"0",borderTopRightRadius:e.isFirst?"$2":"0",overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Ea,{align:"center",css:{background:"white",cursor:"pointer",padding:"$4",userSelect:"none"},gap:"2",width:1,onClick:()=>{l(!a)},children:[(0,i.jsx)(pl,{color:"invisible",css:{color:"$gray700"},leftIcon:a?"chevron-down":"chevron-right"}),(0,i.jsx)(fr,{css:{flex:"1"},font:"gray800 textMd medium",children:MY(e.translation,u)}),(0,i.jsxs)(Ea,{gap:"3",children:[(0,i.jsx)(Gd,{children:t(e.translation.module)}),h?(0,i.jsx)(Gd,{color:"success",children:t("Translated")}):(0,i.jsx)(Gd,{color:"warning",children:t("NotTranslated")})]})]}),a&&(0,i.jsxs)(Ea,{css:{background:"$gray100",padding:"$6"},direction:"column",gap:"6",children:[e.languages.map(t=>{const n=`Version ${t}`;return e.translation.translationType===At.RichText?(0,i.jsx)(mv,{initialValue:d[t],label:n,onChange:e=>{c({...d,[t]:e})}},t):(0,i.jsx)(wl,{label:n,value:d[t],onChange:e=>{c({...d,[t]:e})}},t)}),(0,i.jsx)(ub,{rolesTypes:Tv,children:(0,i.jsx)(Ea,{children:(0,i.jsx)(pl,{isLoading:r,onClick:async()=>{await s({organizationId:n,translationId:e.translation.id,translation:Object.fromEntries(Object.entries(d).map(([e,t])=>[e.toLowerCase(),t]))})},children:t("mettre_jour_85141")})})})]})]})},LY=e=>{const t=Ln(),n=Ac(),[o,s]=(0,F.useState)(!1),[r,a]=(0,F.useState)(e.eventsIds),[l,d]=(0,F.useState)(e.modules),[c,u]=(0,F.useState)(e.translationStatus),h=(0,F.useMemo)(()=>(0,Zd.A)(e.organization.events.nodes,e=>e.name.toLowerCase()),[e.organization]);return(0,i.jsxs)(Ea,{css:{background:"white",bd:!0,padding:"$4"},gap:"3",children:[(0,i.jsx)(wl,{icon:"search",placeholder:t("rechercher_une_22159"),value:e.content,onChange:e.setContent}),(0,i.jsxs)(Dj,{apply:()=>{e.setEventsIds(r),e.setModules(l),e.setTranslationStatus(c),s(!1)},color:"gray",isOpen:o,reinit:()=>{e.setEventsIds([]),a([]),e.setModules([]),d([]),e.setTranslationStatus(kt.TranslatedAndNotTranslated),u(kt.TranslatedAndNotTranslated),s(!1)},showButtons:!0,onStateChange:s,children:[(0,i.jsx)(dc,{isSearchVisible:!0,label:t("_v_nements_53672"),multiple:!0,renderOnPortal:!0,values:r,onChange:a,children:h.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(dc,{isSearchVisible:!0,label:t("module_67984"),multiple:!0,renderOnPortal:!0,values:l,onChange:d,children:n(kn)}),(0,i.jsx)(gu,{label:t("statut_de_tradu_58384"),value:c,onChange:u,children:n(An)})]})]})},BY=e=>(0,i.jsx)(Ea,{css:{background:"white",border:"1px solid $gray200",borderBottom:e.isLast?"1px solid $gray200":"none",borderBottomLeftRadius:e.isLast?"$2":"0",borderBottomRightRadius:e.isLast?"$2":"0",borderTopLeftRadius:e.isFirst?"$2":"0",borderTopRightRadius:e.isFirst?"$2":"0",padding:"$4"},children:(0,i.jsx)(qd,{borderRadius:"$2",height:32,width:1})}),VY=e=>{const{translate:t}=il(),n=e.organization.translations.totalCount-e.organization.translated.totalCount;return(0,i.jsxs)(Ea,{css:{height:"fit-content"},gap:"6",width:1,children:[(0,i.jsx)(fr,{width:.3,children:(0,i.jsx)(mM,{css:{height:"100%"},children:(0,i.jsxs)(Ea,{direction:"column",gap:"4",children:[(0,i.jsx)(fr,{font:"gray500 textSm medium",children:t("nombre_de_langu_75924")}),(0,i.jsx)(fr,{font:"gray900 displayMd medium",children:e.organization.languages.length})]})})}),(0,i.jsx)(fr,{css:{flex:"1"},children:(0,i.jsx)(mM,{children:(0,i.jsxs)(Ea,{gap:"6",justify:"between",children:[(0,i.jsxs)(Ea,{direction:"column",gap:"4",children:[(0,i.jsx)(fr,{font:"gray500 textSm medium",children:t("nombre_de_champ_26560")}),(0,i.jsx)(fr,{font:"gray900 displayMd medium",children:e.organization.translations.totalCount})]}),(0,i.jsxs)(Ea,{direction:"column",gap:"3",children:[(0,i.jsx)(fr,{font:"gray700 textXs semiBold",children:t("dont_10477")}),(0,i.jsxs)(Ea,{align:"center",gap:"8",justify:"between",children:[(0,i.jsx)(fr,{font:"gray500 textSm medium",children:t("champs_tradui_47609")}),(0,i.jsx)(fr,{font:"gray900 textMd semiBold",children:n})]}),(0,i.jsxs)(Ea,{align:"center",gap:"8",justify:"between",children:[(0,i.jsx)(fr,{font:"gray500 textSm medium",children:t("champs_traduits_03119")}),(0,i.jsx)(fr,{font:"gray900 textMd semiBold",children:e.organization.translated.totalCount})]})]})]})})})]})},UY=e=>{const{translate:t,params:{organizationId:n}}=il(),[o,s,r]=Ec(""),[a,l]=(0,F.useState)([]),[d,c]=(0,F.useState)(kt.TranslatedAndNotTranslated),[u,m]=(0,F.useState)([]),[g,p]=(0,F.useState)(0),{data:f,isLoading:x}=Vn("query OrganizationTranslations(\n    $organizationId: OrganizationId!\n    $content: String\n    $status: TranslationStatus\n    $eventsIds: [EventId!]\n    $modules: [TranslationModule!]\n    $offset: Int\n) {\n    organization(id: $organizationId) {\n        translations(\n            content: $content\n            status: $status\n            eventsIds: $eventsIds\n            modules: $modules\n            limit: 25\n            offset: $offset\n        ) {\n            nodes {\n                ...Translation\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{organizationId:n,content:h(s)?s:null,eventsIds:a,modules:u,status:d,offset:g},[Ro.TranslationFragment]);const{numberOfPages:_,totalCount:I}=lu(f.organization?.translations),v=f.organization?.translations.nodes??[];return(0,i.jsxs)(Ea,{css:{overflowY:"auto"},direction:"column",height:1,children:[(0,i.jsxs)(Ea,{css:{borderBottom:"1px solid $gray200",padding:"$6 $7"},direction:"column",children:[(0,i.jsx)(fr,{font:"gray900 textXl medium",children:t("traductions_88349")}),(0,i.jsx)(fr,{color:"gray500",children:t("g_rer_toutes_le_39107")})]}),(0,i.jsxs)(Ea,{css:{background:"$gray50",flex:"1",padding:"$7"},direction:"column",children:[(0,i.jsx)(VY,{organization:e.organization}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(LY,{content:o,eventsIds:a,modules:u,organization:e.organization,setContent:r,setEventsIds:l,setModules:m,setTranslationStatus:c,translationStatus:d}),(0,i.jsx)(Pa,{height:"4"}),x?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(BY,{isFirst:!0,isLast:!1}),(0,i.jsx)(BY,{isFirst:!1,isLast:!1}),(0,i.jsx)(BY,{isFirst:!1,isLast:!0})]}):v.map((t,n)=>(0,i.jsx)(NY,{isFirst:0===n,isLast:n===v.length-1,languages:e.organization.languages,translation:t},t.id)),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(jc,{numberOfPages:_,offset:g,setOffset:p,totalCount:I})]})]})},WY=()=>{const{params:{organizationId:e}}=il(),{data:t,loader:n}=Vn("query OrganizationTranslationsStats($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        languages\n\n        events {\n            nodes {\n                id\n                name\n            }\n        }\n\n        translations {\n            totalCount\n        }\n\n        translated: translations(status: Translated) {\n            totalCount\n        }\n    }\n}\n",{organizationId:e},[]);return n||(0,i.jsx)(UY,{organization:t.organization})},GY=e=>{const{translate:t,params:{organizationId:n}}=il(),{showNotification:o}=Yv(),{mutate:s}=function(e={}){return Un("mutation UserRolesDelete($organizationId: OrganizationId!, $userId: UserId!) {\n    userRolesDelete(organizationId: $organizationId, userId: $userId)\n}\n",e)}(),r=function(e,t){const{mutate:n}=Ns();return(0,F.useCallback)(()=>Promise.all([ze.PositionCategoryLeaderAssign,ze.PositionLeaderAssign,ze.DelegationCategoryLeaderAssign,ze.DelegationLeaderAssign,ze.EventInvite,ze.OrganizationInvite].map(i=>n({organizationId:e,userInfoId:t,emailType:i}))),[n,e,t])}(n,e.userInfo.id),[a,l]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(pm,{children:[(0,i.jsx)(Od,{icon:"paper-plane",onClick:async e=>{wd(e.target),await r()},children:t("r_envoyer_l_e_96215")}),(0,i.jsx)(zu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Od,{color:"red",icon:"trash-can",onClick:e=>{wd(e.target),l(!0)},children:t("supprimer_l_acc_85342")})]}),a&&(0,i.jsx)(kk,{buttonText:t("supprimer_les_a_96621"),subtext:t("_tes_vous_s_r_d_35776",e.userInfo.nameOrEmail),text:t("supprimer_l_acc_85342"),onClose:()=>l(!1),onDelete:async()=>{await s({organizationId:n,userId:e.userInfo.userId}),o(t("tous_les_acc_s_26440",e.userInfo.nameOrEmail)),e.reload()}})]})};var HY;!function(e){e[e.Delegations=0]="Delegations",e[e.DelegationsCategories=1]="DelegationsCategories",e[e.Positions=2]="Positions",e[e.PositionsCategories=3]="PositionsCategories"}(HY||(HY={}));const qY=e=>{const{translate:t}=il(),n=(0,F.useMemo)(()=>e.level??(e.eventId?et.Event:et.Both),[e.eventId,e.level]),[o,s]=(0,F.useState)(!1),[r,a]=(0,F.useState)(null),[l,d,c]=Ec("");(0,F.useEffect)(()=>{(async()=>{if(s(!0),e.resource===HY.Delegations){const{organization:o}=await(t={organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,level:n,name:h(d)?d:void 0,ids:e.ids},i=await H(),ss('query DelegationsSearch(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $hasSelected: Boolean!\n    $level: OrganizationEventLevel!\n    $ids: [DelegationId!]!\n    $name: String\n) {\n    organization(id: $organizationId) {\n        name\n\n        list: delegations(\n            level: $level\n            eventId: $eventId\n            name: $name\n            limit: 50\n            sort: { attribute: "Name", direction: Asc }\n        ) {\n            nodes {\n                id\n                name\n\n                event {\n                    id\n                    name\n                }\n            }\n        }\n\n        selected: delegations(level: $level, ids: $ids) @include(if: $hasSelected) {\n            nodes {\n                id\n                name\n\n                event {\n                    id\n                    name\n                }\n            }\n        }\n    }\n}\n',{variables:t,token:i||void 0,fragments:[]}));a(o)}else if(e.resource===HY.DelegationsCategories){const{organization:t}=await function(e,t){return ss('query DelegationsCategoriesSearch(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $hasSelected: Boolean!\n    $level: OrganizationEventLevel!\n    $ids: [DelegationsCategoryId!]!\n    $name: String\n) {\n    organization(id: $organizationId) {\n        name\n\n        list: delegationsCategories(\n            level: $level\n            eventId: $eventId\n            name: $name\n            limit: 50\n            sort: { attribute: "Name", direction: Asc }\n        ) {\n            nodes {\n                id\n                name\n\n                event {\n                    id\n                    name\n                }\n            }\n        }\n\n        selected: delegationsCategories(level: $level, ids: $ids) @include(if: $hasSelected) {\n            nodes {\n                id\n                name\n\n                event {\n                    id\n                    name\n                }\n            }\n        }\n    }\n}\n',{variables:e,token:t||void 0,fragments:[]})}({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,level:n,name:h(d)?d:void 0,ids:e.ids},await H());a(t)}else if(e.resource===HY.Positions){const{organization:t}=await function(e,t){return ss(ds,{variables:e,token:t||void 0,fragments:[]})}({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,name:h(d)?d:void 0,ids:e.ids},await H());a(t)}else if(e.resource===HY.PositionsCategories){const{organization:t}=await function(e,t){return ss('query PositionsCategoriesSearch(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $hasSelected: Boolean!\n    $ids: [DelegationsCategoryId!]!\n    $name: String\n) {\n    organization(id: $organizationId) {\n        name\n\n        list: positionsCategories(\n            eventId: $eventId\n            name: $name\n            limit: 50\n            sort: { attribute: "Name", direction: Asc }\n        ) {\n            nodes {\n                id\n                name\n\n                event {\n                    id\n                    name\n                }\n            }\n        }\n\n        selected: positionsCategories(ids: $ids) @include(if: $hasSelected) {\n            nodes {\n                id\n                name\n\n                event {\n                    id\n                    name\n                }\n            }\n        }\n    }\n}\n',{variables:e,token:t||void 0,fragments:[]})}({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,name:h(d)?d:void 0,ids:e.ids},await H());a(t)}var t,i;s(!1)})()},[n,d,e.eventId,e.hasSelected,e.organizationId,e.resource]);const u=(0,F.useMemo)(()=>{if(r){const t=(0,Zd.A)((0,Ju.A)(r.list.nodes.concat(r.selected.nodes),e=>e.id),e=>e.name.toLowerCase());return n!==et.Both&&e.eventId?t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)):Object.values((0,Kd.A)(t,e=>e.event?.id??-1)).map(e=>{const t=e[0];return(0,i.jsx)("optgroup",{label:t.event?.name??r.name,children:e.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},t.event?.id??-1)})}return(0,i.jsx)(i.Fragment,{})},[e.eventId,n,r]);return(0,i.jsx)(dc,{isSearchLoading:o,isSearchVisible:!0,renderOnPortal:!0,searchElement:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:l,onChange:c}),values:e.ids,onChange:e.onChange,children:u})},YY=e=>{const{translate:t,params:{organizationId:n}}=il();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:e.accessScope===te.DelegationCategory?"checked":"unchecked",onClick:()=>e.setAccessScope(te.DelegationCategory),children:t("r_le_sur_une_ca_31475")}),e.accessScope===te.DelegationCategory&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(fr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(qY,{hasSelected:!0,ids:[e.resourceId],level:et.Event,organizationId:n,resource:HY.DelegationsCategories,onChange:t=>{Zo(t)&&e.setResourceId(t[0])}})}),(0,i.jsx)(fr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(gu,{shouldParseAsInt:!0,value:e.roleId,onChange:e.setRoleId,children:e.delegationCategoryRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]})]})]})},KY=e=>{const{translate:t,params:{organizationId:n}}=il();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:e.accessScope===te.Delegation?"checked":"unchecked",onClick:()=>e.setAccessScope(te.Delegation),children:t("r_le_sur_une_d_10967")}),e.accessScope===te.Delegation&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(Ea,{css:{paddingLeft:"$6"},gap:"4",children:(0,i.jsx)(qY,{hasSelected:!0,ids:[e.resourceId],level:et.Both,organizationId:n,resource:HY.Delegations,onChange:t=>{Zo(t)&&e.setResourceId(t[0])}})})]})]})},ZY=e=>{const{translate:t}=il(),{organization:n}=nI();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:e.accessScope===te.Event?"checked":"unchecked",onClick:()=>e.setAccessScope(te.Event),children:t("r_le_sur_un_v_89523")}),e.accessScope===te.Event&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(fr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(gu,{shouldParseAsInt:!0,value:e.resourceId,onChange:e.setResourceId,children:n.events.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(fr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(gu,{shouldParseAsInt:!0,value:e.roleId,onChange:e.setRoleId,children:e.eventRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]})]})]})},XY=e=>{const{translate:t,params:{organizationId:n}}=il();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:e.accessScope===te.PositionCategory?"checked":"unchecked",onClick:()=>e.setAccessScope(te.PositionCategory),children:t("r_le_sur_une_ca_13181")}),e.accessScope===te.PositionCategory&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(fr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(qY,{hasSelected:!0,ids:[e.resourceId],organizationId:n,resource:HY.PositionsCategories,onChange:t=>{Zo(t)&&e.setResourceId(t[0])}})}),(0,i.jsx)(fr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(gu,{shouldParseAsInt:!0,value:e.roleId,onChange:e.setRoleId,children:e.positionCategoryRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]})]})]})},JY=e=>{const{translate:t,params:{organizationId:n}}=il();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:e.accessScope===te.Position?"checked":"unchecked",onClick:()=>e.setAccessScope(te.Position),children:t("r_le_sur_une_mi_92313")}),e.accessScope===te.Position&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsxs)(Ea,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(fr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(qY,{hasSelected:!0,ids:[e.resourceId],organizationId:n,resource:HY.Positions,onChange:t=>{Zo(t)&&e.setResourceId(t[0])}})}),(0,i.jsx)(fr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(gu,{shouldParseAsInt:!0,value:e.roleId,onChange:e.setRoleId,children:e.positionRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]})]})]})},QY=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(qd,{borderRadius:"$1",height:20,width:1})]}),eK=e=>{const{translate:t,params:{organizationId:n}}=il(),{organization:o,roles:s}=nI(),{mutate:r}=function(e={}){return Un("mutation UserAccessCreate(\n    $organizationId: OrganizationId!\n    $scope: AccessScope!\n    $userInfoId: UsersInfoId!\n    $resourceId: Int!\n    $roleId: RoleId\n) {\n    userAccessCreate(\n        organizationId: $organizationId\n        scope: $scope\n        userInfoId: $userInfoId\n        resourceId: $resourceId\n        roleId: $roleId\n    )\n}\n",e)}(),{data:a,isLoading:l}=Vn('query OrganizationUserAddRole($organizationId: OrganizationId!) {\n    organization(id: $organizationId) {\n        delegations(level: Both, limit: 1, sort: { attribute: "Name", direction: Asc }) {\n            nodes {\n                id\n            }\n        }\n\n        delegationsCategories(level: Event, limit: 1, sort: { attribute: "Name", direction: Asc }) {\n            nodes {\n                id\n            }\n        }\n\n        positions(limit: 1, sort: { attribute: "Name", direction: Asc }) {\n            nodes {\n                id\n            }\n        }\n\n        positionsCategories(limit: 1, sort: { attribute: "Name", direction: Asc }) {\n            nodes {\n                id\n            }\n        }\n    }\n}\n',{organizationId:n},[]),[d,c]=(0,F.useState)(te.Organization),[u,h]=(0,F.useState)(s.organizationRoles[0].id),[m,g]=(0,F.useState)(-1),p=e=>{e===te.Organization?h(s.organizationRoles[0].id):e===te.Event?(h(s.eventRoles[0].id),g(o.events.nodes[0].id)):e===te.Delegation?(h(-1),g(a.organization.delegations.nodes[0].id)):e===te.DelegationCategory?(h(s.delegationCategoryRoles[0].id),g(a.organization.delegationsCategories.nodes[0].id)):e===te.Position?(h(s.positionRoles[0].id),g(a.organization.positions.nodes[0].id)):e===te.PositionCategory&&(h(s.positionRoles[0].id),g(a.organization.positionsCategories.nodes[0].id)),c(e)};return(0,i.jsxs)(nb,{children:[(0,i.jsx)(ib,{children:(0,i.jsx)(pl,{color:"invisible",leftIcon:"plus",children:t("ajouter_un_r_le_19073")})}),(0,i.jsxs)(tb,{children:[(0,i.jsx)(eb,{icon:"user-lock",children:t("ajouter_un_r_le_19073")}),(0,i.jsx)(Qv,{children:l?(0,i.jsx)(QY,{}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sc,{state:d===te.Organization?"checked":"unchecked",onClick:()=>p(te.Organization),children:t("r_le_sur_l_orga_15663")}),d===te.Organization&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(Ea,{css:{paddingLeft:"$6"},children:(0,i.jsx)(gu,{shouldParseAsInt:!0,value:u,onChange:h,children:s.organizationRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),Zo(o.events.nodes)&&(0,i.jsx)(ZY,{accessScope:d,eventRoles:s.eventRoles,resourceId:m,roleId:u,setAccessScope:p,setResourceId:g,setRoleId:h}),Zo(a.organization?.delegations.nodes)&&(0,i.jsx)(KY,{accessScope:d,resourceId:m,setAccessScope:p,setResourceId:g}),Zo(a.organization?.delegationsCategories.nodes)&&(0,i.jsx)(YY,{accessScope:d,delegationCategoryRoles:s.delegationCategoryRoles,resourceId:m,roleId:u,setAccessScope:p,setResourceId:g,setRoleId:h}),Zo(a.organization?.positions.nodes)&&(0,i.jsx)(JY,{accessScope:d,positionRoles:s.positionRoles,resourceId:m,roleId:u,setAccessScope:p,setResourceId:g,setRoleId:h}),Zo(a.organization?.positionsCategories.nodes)&&(0,i.jsx)(XY,{accessScope:d,positionCategoryRoles:s.positionRoles,resourceId:m,roleId:u,setAccessScope:p,setResourceId:g,setRoleId:h})]})}),(0,i.jsx)(Jv,{children:(0,i.jsx)(pl,{onClick:async()=>{await r({organizationId:n,scope:d,resourceId:d===te.Organization?n:m,roleId:d===te.Delegation?void 0:u,userInfoId:e.userInfoId}),e.onClose()},children:t("ajouter_97327")})})]})]})},tK=e=>{const{organization:t}=nI(),{mutate:n}=oa(),[o,s]=(0,F.useState)(e.roleId);return(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(gu,{shouldParseAsInt:!0,value:o,onChange:i=>(s(i),(i=>n({organizationId:t.id,scope:e.scope,id:e.id,roleId:i}))(i)),children:e.roles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(xc,{children:e.resource}),(0,i.jsx)(im,{justify:"center",children:(0,i.jsx)(fr,{color:"error700",onClick:async()=>{e.onDelete(e.scope,e.id)},children:(0,i.jsx)(Va,{icon:"trash-can"})})})]})},nK=e=>{const{translate:t}=il(),{organization:n,roles:o}=nI(),{mutate:s}=ia(),[r,a]=(0,F.useState)(e.userInfo.usersEvents.filter(t=>t.event.id===e.event.id)),[l,d]=(0,F.useState)(e.userInfo.usersDelegations.filter(t=>t.eventId===e.event.id)),[c,u]=(0,F.useState)(e.userInfo.usersDelegationsCategories.filter(t=>t.eventId===e.event.id)),[h,m]=(0,F.useState)(e.userInfo.usersPositions.filter(t=>t.eventId===e.event.id)),[g,p]=(0,F.useState)(e.userInfo.usersPositionsCategories.filter(t=>t.eventId===e.event.id)),f=async(e,t)=>{await s({organizationId:n.id,scope:e,id:t}),a(e=>e.filter(e=>e.id!==t)),d(e=>e.filter(e=>e.id!==t)),u(e=>e.filter(e=>e.id!==t)),m(e=>e.filter(e=>e.id!==t)),p(e=>e.filter(e=>e.id!==t))};return Zo(r)||Zo(l)||Zo(c)||Zo(h)||Zo(g)?(0,i.jsx)(kc,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:t("r_le_59302")}),(0,i.jsx)(Tc,{}),(0,i.jsx)(Tc,{width:100})]}),rows:(0,i.jsxs)(i.Fragment,{children:[r.map(t=>(0,i.jsx)(tK,{id:t.id,resource:"-",roleId:t.role.id,roles:o.eventRoles,scope:te.Event,userId:e.userInfo.userId,onDelete:f},t.id)),l.map(e=>(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{children:t("responsable_de_70462")}),(0,i.jsx)(xc,{children:e.delegation.name}),(0,i.jsx)(im,{justify:"center",children:(0,i.jsx)(fr,{color:"error700",onClick:()=>f(te.Delegation,e.id),children:(0,i.jsx)(Va,{icon:"trash-can"})})})]},e.id)),c.map(t=>(0,i.jsx)(tK,{id:t.id,resource:t.delegationCategory.name,roleId:t.role.id,roles:o.delegationCategoryRoles,scope:te.DelegationCategory,userId:e.userInfo.userId,onDelete:f},t.id)),h.map(t=>(0,i.jsx)(tK,{id:t.id,resource:t.position.name,roleId:t.role.id,roles:o.positionRoles,scope:te.Position,userId:e.userInfo.userId,onDelete:f},t.id)),g.map(t=>(0,i.jsx)(tK,{id:t.id,resource:t.positionCategory.name,roleId:t.role.id,roles:o.positionRoles,scope:te.PositionCategory,userId:e.userInfo.userId,onDelete:f},t.id))]}),title:e.event.name}):null},iK=e=>{const{translate:t}=il(),{organization:n}=nI(),{mutate:o}=oa(),{mutate:s}=ia(),r=n.roles.filter(e=>e.type===pt.OrganizationAdmin||e.type===pt.OrganizationReader),[a,l]=(0,F.useState)(e.userOrganization.role.id),[d,c]=(0,F.useState)(e.userOrganization.sendNotifications),u=(t,i)=>o({organizationId:n.id,scope:te.Organization,id:e.userOrganization.id,sendNotifications:t,roleId:i});return(0,i.jsxs)(Cc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(gu,{shouldParseAsInt:!0,value:a,onChange:e=>(l(e),u(d,e)),children:r.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(xc,{children:(0,i.jsx)(su,{value:d,onChange:e=>(c(e),u(e,a)),children:t("activer_38612")})}),(0,i.jsx)(im,{justify:"center",children:(0,i.jsx)(fr,{color:"error700",onClick:async()=>{await s({organizationId:n.id,scope:te.Organization,id:e.userOrganization.id}),e.onDelete(e.userOrganization.id)},children:(0,i.jsx)(Va,{icon:"trash-can"})})})]})},oK=e=>{const{translate:t}=il(),{organization:n}=nI(),[o,s]=(0,F.useState)(e.userInfo.usersOrganizations),r=e=>{s(t=>t.filter(t=>t.id!==e))};return(0,i.jsx)(kc,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:t("r_le_59302")}),(0,i.jsx)(Tc,{children:t("notifications_98765")}),(0,i.jsx)(Tc,{width:100})]}),rows:(0,i.jsx)(i.Fragment,{children:o.map((t,n)=>(0,i.jsx)(iK,{userId:e.userInfo.userId,userOrganization:t,onDelete:r},n))}),title:n.name})},sK=e=>{const{translate:t}=il(),{organization:n}=nI();return(0,i.jsxs)(eu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Lb,{children:e.userInfo.nameOrEmail}),(0,i.jsxs)(tu,{css:{gap:"$4",py:"$6"},children:[Zo(e.userInfo.usersOrganizations)&&(0,i.jsx)(oK,{userInfo:e.userInfo}),n.events.nodes.map(t=>(0,i.jsx)(nK,{event:t,userInfo:e.userInfo},t.id)),(0,i.jsx)(eK,{userInfoId:e.userInfo.id,onClose:e.onClose})]}),(0,i.jsx)(nu,{children:(0,i.jsx)(Ea,{gap:"3",justify:"end",children:(0,i.jsx)(pl,{color:"white",onClick:e.onClose,children:t("fermer_62479")})})})]})},rK=e=>{const[t,n]=(0,F.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Cc,{css:{cursor:"pointer",userSelect:"none","&:hover":{background:"$gray100"}},onClick:()=>n(!0),children:[(0,i.jsx)(xc,{children:(0,i.jsx)(Eb,{isClickDisabled:!0,size:32,userInfo:e.userInfo})}),(0,i.jsx)(ty,{userPermissions:e.userInfo}),(0,i.jsx)(ub,{rolesTypes:[pt.OrganizationAdmin],children:(0,i.jsx)(im,{justify:"end",children:(0,i.jsx)(GY,{reload:e.reload,userInfo:e.userInfo})})})]}),t&&(0,i.jsx)(sK,{userInfo:e.userInfo,onClose:()=>{e.reloadUserInfo(e.userInfo.id),n(!1)}})]})},aK=e=>{const{translate:t}=il(),{organization:n}=nI(),{showNotification:o}=Yv(),{onClose:s}=Zv(),{mutate:r,isLoading:a}=function(e={}){return Un("mutation OrganizationInvite(\n    $organizationId: OrganizationId!\n    $email: UserEmail!\n    $roleId: RoleId!\n) {\n    organizationInvite(organizationId: $organizationId, email: $email, roleId: $roleId) {\n        id\n    }\n}\n",e)}(),{mutate:d,isLoading:c}=function(e={}){return Un("mutation EventInvite($eventId: EventId!, $email: UserEmail!, $roleId: RoleId!) {\n    eventInvite(eventId: $eventId, email: $email, roleId: $roleId) {\n        id\n    }\n}\n",e)}(),u=n.roles.find(e=>e.type===pt.OrganizationAdmin),h=n.roles.find(e=>e.type===pt.OrganizationReader),m=n.roles.find(e=>e.type===pt.EventAdmin),g=n.roles.find(e=>e.type===pt.EventReader),[p,f]=(0,F.useState)(""),[x,_]=(0,F.useState)(u.id),I=n.events.nodes,[v,b]=(0,F.useState)(I[0]?.id),j=(0,F.useMemo)(()=>I.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[I]),C=function(e){return l.Yj().email().required().isValidSync(e)}(p);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eb,{icon:"user-plus",children:t("inviter_un_util_06611")}),(0,i.jsxs)(Qv,{gap:"6",children:[(0,i.jsx)(wl,{isEmail:!0,label:t("Email"),value:p,onChange:f}),(0,i.jsxs)(Ea,{direction:"column",children:[(0,i.jsx)(fr,{font:"gray800 textSm medium",children:t("quel_r_le_souha_92592")}),(0,i.jsx)(Pa,{height:"2"}),(0,i.jsx)(sc,{state:x===u.id?"checked":"unchecked",onClick:()=>_(u.id),children:u.name}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:x===h.id?"checked":"unchecked",onClick:()=>_(h.id),children:h.name}),Zo(I)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:x===m.id?"checked":"unchecked",onClick:()=>_(m.id),children:m.name}),x===m.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(Ea,{css:{paddingLeft:"$6"},children:(0,i.jsx)(gu,{shouldParseAsInt:!0,value:v,onChange:b,children:j})})]}),(0,i.jsx)(Pa,{height:"3"}),(0,i.jsx)(sc,{state:x===g.id?"checked":"unchecked",onClick:()=>_(g.id),children:g.name}),x===g.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(Ea,{css:{paddingLeft:"$6"},children:(0,i.jsx)(gu,{shouldParseAsInt:!0,value:v,onChange:b,children:j})})]})]})]})]}),(0,i.jsx)(Jv,{children:(0,i.jsx)(pl,{disabled:!C,isLoading:a||c,onClick:async()=>{const i=n.roles.find(e=>e.id===x);if(x===u.id||x===h.id)await r({organizationId:n.id,email:p,roleId:x}),o(t("_1_a_t_invit_38156",p,i.name));else{const e=I.find(e=>e.id===v);await d({eventId:v,email:p,roleId:x}),o(t("_1_a_t_invit_15646",p,i.name,e.name))}e.reload(),s()},children:t("inviter_35349")})})]})},lK=e=>{const{translate:t}=il();return(0,i.jsxs)(kC,{gap:"6",children:[(0,i.jsx)(fr,{css:{flex:"1"},font:"gray900 displayXs medium",children:t("utilisateurs_04975")}),(0,i.jsx)(ub,{rolesTypes:[pt.OrganizationAdmin],children:(0,i.jsxs)(nb,{children:[(0,i.jsx)(ib,{children:(0,i.jsx)(pl,{children:t("inviter_un_util_06611")})}),(0,i.jsx)(tb,{children:(0,i.jsx)(aK,{reload:e.reload})})]})})]})},dK=()=>{const{translate:e,params:{organizationId:t}}=il(),{organization:n}=nI(),[o,s]=(0,F.useState)(!0),[r,a,l]=Ec(""),[d,c]=(0,F.useState)(-1),[u,m]=(0,F.useState)(-1),[g,p]=(0,F.useState)(_c),[f,x]=(0,F.useState)(0),{data:_,isLoading:I,reload:v}=Vn("query OrganizationUsers(\n    $organizationId: OrganizationId!\n    $hasRole: Boolean!\n    $name: String\n    $roleId: RoleId\n    $eventId: EventId\n    $limit: Int\n    $offset: Int\n) {\n    organization(id: $organizationId) {\n        usersInfos(\n            hasRole: $hasRole\n            name: $name\n            roleId: $roleId\n            eventId: $eventId\n            limit: $limit\n            offset: $offset\n        ) {\n            nodes {\n                ...UserInfoOrganization\n            }\n\n            numberOfPages\n            totalCount\n        }\n    }\n}\n",{organizationId:t,hasRole:o,name:h(a)?a:void 0,roleId:-1!==d?d:void 0,eventId:-1!==u?u:void 0,limit:g,offset:f},[Ro.UserInfoOrganizationFragment]);const{numberOfPages:b,totalCount:j}=lu(_.organization?.usersInfos),[C,y]=(0,F.useState)([]),[k,A]=(0,F.useState)({}),w=(0,F.useCallback)(async e=>{A(t=>({...t,[e]:!0}));const{organization:{userInfo:t}}=await function(e,t){return ss("query OrganizationUsersUser(\n    $organizationId: OrganizationId!\n    $eventId: EventId\n    $userInfoId: UsersInfoId!\n) {\n    organization(id: $organizationId) {\n        userInfo(id: $userInfoId) {\n            ...UserInfoOrganization\n        }\n    }\n}\n",{variables:e,token:t||void 0,fragments:[Ro.UserInfoOrganizationFragment]})}({organizationId:n.id,userInfoId:e},await H());y(n=>n.map(n=>n.id===e?t:n)),A(t=>({...t,[e]:!1}))},[n]);return(0,F.useEffect)(()=>{y(_.organization?.usersInfos.nodes??[])},[_.organization]),(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsx)(lK,{reload:v}),(0,i.jsx)(yC,{children:(0,i.jsx)(kc,{filters:(0,i.jsxs)(Ea,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(fr,{width:300,children:(0,i.jsx)(wl,{icon:"magnifying-glass",placeholder:e("rechercher_un_m_05904"),value:r,onChange:l})}),(0,i.jsx)(fr,{css:{flex:"1"}}),(0,i.jsx)(nc,{state:o?"checked":"unchecked",onClick:e=>s("checked"===e),children:e("seulement_les_u_63675")}),(0,i.jsx)(fr,{width:240,children:(0,i.jsxs)(gu,{shouldParseAsInt:!0,value:d,onChange:c,children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_r_les_18736")}),n.roles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(fr,{width:240,children:(0,i.jsxs)(gu,{shouldParseAsInt:!0,value:u,onChange:m,children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_v_nem_16033")}),n.events.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{children:e("full_name")}),(0,i.jsx)(Tc,{children:e("r_les_61679")}),(0,i.jsx)(ub,{rolesTypes:[pt.OrganizationAdmin],children:(0,i.jsx)(Tc,{width:100})})]}),limit:g,numberOfPages:b,offset:f,rows:I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0}),(0,i.jsx)(zc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:C.map(e=>k[e.id]?(0,i.jsx)(zc,{bx:!0},e.id):(0,i.jsx)(rK,{reload:v,reloadUserInfo:w,userInfo:e},e.id))}),setLimit:p,setOffset:x,totalCount:j})})]})},cK=()=>{const e=Ln();Cd(e("param_tres_78420"));const{organizationId:t}=Wn(),{isOrganizationAdmin:n,isOrganizationReader:o,hasFeature:s}=nI();return(0,i.jsxs)(Ea,{height:1,width:1,children:[(0,i.jsx)(Ea,{as:Aa.Nav,css:{background:"$gray100",overflowY:"auto",py:"$2"},height:1,children:(0,i.jsxs)(Ea,{"aria-orientation":"vertical",direction:"column",role:"menubar",width:240,children:[(0,i.jsxs)(CY,{name:"general",title:e("g_n_ral_64953"),children:[(0,i.jsx)(jY,{icon:"user",path:So.ORGANIZATION_PARAMETERS_PROFILE(t),title:e("mon_profil_48224")}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jY,{icon:"building",path:So.ORGANIZATION_PARAMETERS_INFOS(t),title:e("organisation_71863")}),(0,i.jsx)(jY,{icon:"wave-pulse",path:So.ORGANIZATION_PARAMETERS_ACTIVITY(t),title:e("activit_95747")})]})]}),o&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(CY,{name:"parameters",title:e("param_tres_78420"),children:[(0,i.jsx)(jY,{icon:"address-card",isActive:e=>e.includes(mi.ORGANIZATION_SETTINGS_MEMBERS_SPACE({organizationId:t})),path:mi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:t}),title:e("espace_membres_90896")}),s(Fe.Delegation)&&(0,i.jsx)(jY,{icon:"users",isActive:e=>e.includes(mi.ORGANIZATION_SETTINGS_DELEGATION_SPACE({organizationId:t})),path:mi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:t}),title:e("espace_d_l_gati_59251")}),(0,i.jsx)(jY,{icon:"at",isActive:e=>e.includes(So.ORGANIZATION_PARAMETERS_EMAILS(t)),path:So.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t),title:e("e_mails_09850")}),(0,i.jsx)(jY,{icon:"layer-group",isActive:e=>e.includes(So.ORGANIZATION_PARAMETERS_CATEGORIES(t)),path:So.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(t),title:e("cat_gories_24533")}),(0,i.jsx)(jY,{icon:"tag",path:So.ORGANIZATION_PARAMETERS_TAGS(t),title:e("tags_79499")}),(0,i.jsx)(jY,{icon:"language",path:So.ORGANIZATION_PARAMETERS_TRANSLATIONS(t),title:e("traductions_88349")})]})}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(CY,{name:"users",title:e("utilisateurs_04975"),children:[(0,i.jsx)(jY,{icon:"user-group",path:So.ORGANIZATION_PARAMETERS_TEAM(t),title:e("utilisateurs_04975")}),(0,i.jsx)(jY,{icon:"shield",path:So.ORGANIZATION_PARAMETERS_ROLES(t),title:e("r_les_et_permis_27853")})]}),(0,i.jsx)(CY,{name:"subscription",title:e("abonnement_98940"),children:(0,i.jsx)(jY,{icon:"receipt",path:So.ORGANIZATION_PARAMETERS_INVOICES(t),title:e("factures_03552")})})]}),o&&(0,i.jsx)(i.Fragment,{children:s(Fe.Skidata)&&(0,i.jsx)(CY,{name:"integrations",title:e("int_grations_88619"),children:(0,i.jsx)(jY,{icon:"person-skiing",path:So.ORGANIZATION_PARAMETERS_SKIDATA(t),title:"Skidata"})})})]})}),(0,i.jsx)(fr,{css:{flex:"1"},height:1,children:(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{exact:!0,path:So.ORGANIZATION_PARAMETERS_PROFILE(":organizationId"),children:(0,i.jsx)(yY,{})}),o&&(0,i.jsx)(_r.qh,{exact:!0,path:So.ORGANIZATION_PARAMETERS_INFOS(":organizationId"),children:(0,i.jsx)(pY,{})}),n&&(0,i.jsx)(_r.qh,{exact:!0,path:So.ORGANIZATION_PARAMETERS_TEAM(":organizationId"),children:(0,i.jsx)(dK,{})}),n&&(0,i.jsx)(_r.qh,{exact:!0,path:So.ORGANIZATION_PARAMETERS_ROLES(":organizationId"),children:(0,i.jsx)(zY,{})}),o&&(0,i.jsx)(_r.qh,{path:So.ORGANIZATION_PARAMETERS_EMAILS(":organizationId"),children:(0,i.jsx)(mY,{})}),o&&(0,i.jsx)(_r.qh,{path:mi.ORGANIZATION_SETTINGS_MEMBERS_SPACE({organizationId:":organizationId"}),children:(0,i.jsx)(bY,{})}),o&&s(Fe.Delegation)&&(0,i.jsx)(_r.qh,{path:mi.ORGANIZATION_SETTINGS_DELEGATION_SPACE({organizationId:":organizationId"}),children:(0,i.jsx)(rY,{})}),o&&(0,i.jsx)(_r.qh,{path:So.ORGANIZATION_PARAMETERS_CATEGORIES(":organizationId"),children:(0,i.jsx)(eY,{})}),o&&(0,i.jsx)(_r.qh,{exact:!0,path:So.ORGANIZATION_PARAMETERS_TAGS(":organizationId"),children:(0,i.jsx)(FY,{})}),o&&(0,i.jsx)(_r.qh,{path:So.ORGANIZATION_PARAMETERS_TRANSLATIONS(":organizationId"),children:(0,i.jsx)(WY,{})}),n&&(0,i.jsx)(_r.qh,{exact:!0,path:So.ORGANIZATION_PARAMETERS_INVOICES(":organizationId"),children:(0,i.jsx)(fY,{})}),o&&(0,i.jsx)(_r.qh,{exact:!0,path:So.ORGANIZATION_PARAMETERS_ACTIVITY(":organizationId"),children:(0,i.jsx)(Uq,{})}),o&&(0,i.jsx)(_r.qh,{exact:!0,path:So.ORGANIZATION_PARAMETERS_SKIDATA(":organizationId"),children:(0,i.jsx)(RY,{})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.ORGANIZATION_PARAMETERS_PROFILE(t)})})]})})]})};let uK=class{get(){return{[pt.OrganizationAdmin]:{delegationCategoryPermissions:"11111",positionPermissions:"111111111",nameKey:"administrateur_11083",descriptionKey:"a_acc_s_toute_73520"},[pt.OrganizationReader]:{delegationCategoryPermissions:"10000",positionPermissions:"100010000",nameKey:"acc_s_en_lectur_30252",descriptionKey:"a_acc_s_l_org_94388"},[pt.EventAdmin]:{delegationCategoryPermissions:"11111",positionPermissions:"111111111",nameKey:"administrateur_24785",descriptionKey:"a_acc_s_toute_25473"},[pt.EventReader]:{delegationCategoryPermissions:"10000",positionPermissions:"100010000",nameKey:"acc_s_en_lectur_33482",descriptionKey:"a_acc_s_l_v_17476"},[pt.PositionEditor]:{delegationCategoryPermissions:"00000",positionPermissions:"110010011",nameKey:"responsable_de_95683",descriptionKey:"peut_modifier_s_82832"},[pt.PositionReader]:{delegationCategoryPermissions:"00000",positionPermissions:"100010000",nameKey:"responsable_de_72569",descriptionKey:"a_acc_s_ses_m_09741"},[pt.DelegationCategoryLeader]:{delegationCategoryPermissions:"11110",positionPermissions:"100010000",nameKey:"responsable_de_32820",descriptionKey:"a_acc_s_aux_d_l_87634"}}}};uK=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)()],uK);let hK=class extends zl{baseRolesService;constructor(e,t){super(t),this.baseRolesService=e}default(){return{role:{delegationCategoryPermissions:"00000",positionPermissions:"000000000",name:"",description:""}}}schema(){return l.Ik().shape({role:l.Ik().shape({delegationCategoryPermissions:this.delegationPermissions().required(this.t("le_format_des_p_68818")),positionPermissions:this.positionPermissions().required(this.t("le_format_des_p_68818")),name:l.Yj().required(this.t("le_nom_est_requ_61536")),description:l.Yj().required(this.t("la_description_46559"))}).required()}).required()}delegationPermissions(){return l.Yj().matches(new RegExp(`^[01]{${this.baseRolesService.get().DelegationCategoryLeader.delegationCategoryPermissions.length}}$`),this.t("le_format_des_p_68818"))}positionPermissions(){return l.Yj().matches(new RegExp(`^[01]{${this.baseRolesService.get().PositionReader.positionPermissions.length}}$`),this.t("le_format_des_p_68818"))}};hK=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[uK,Dn])],hK);const mK=ar("div",{display:"grid",gap:"$4 $7",gridTemplateColumns:"280px auto"}),gK=ar("div",{fontWeight:"$medium",gridColumn:1}),pK=({children:e,disabled:t,permission:n,subtext:o,value:s,onChange:r})=>(0,i.jsx)("div",{style:{gridColumn:2},children:(0,i.jsx)(su,{css:{alignItems:"start","> *:first-child":{margin:"2px 0"}},disabled:t,subtext:o,value:"1"===s[n],onChange:e=>r([...s].toSpliced(n,1,e?"1":"0").join("")),children:e})}),fK=({children:e,...t})=>(0,i.jsx)(Cm,{css:{"legend + div":{minHeight:"32px"}},initialIsOpen:!0,...t,children:e}),xK=({disabled:e})=>{const t=Ln();return(0,i.jsx)(fK,{subtitle:t("communication_a_64203"),title:t("communication_05277"),children:(0,i.jsx)(Oa.D0,{name:"role.positionPermissions",children:({input:n})=>(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(mK,{children:[(0,i.jsx)(gK,{children:t("Campaigns")}),(0,i.jsx)(pK,{disabled:e,permission:db.SEND_CAMPAIGNS,value:n.value,onChange:n.onChange,children:t("envoyer_une_cam_35768")})]})})})})},_K=()=>{const e=Ln();return(0,i.jsx)(fK,{subtitle:e("communication_a_64203"),title:e("communication_05277"),children:(0,i.jsxs)(mK,{children:[(0,i.jsx)(gK,{children:e("Campaigns")}),(0,i.jsx)(qd,{borderRadius:"$1",css:{gridColumn:2},height:20})]})})},IK=({disabled:e})=>{const t=Ln();return(0,i.jsx)(fK,{subtitle:t("permissions_rel_86993"),title:t("d_l_gations_78318"),children:(0,i.jsx)(Oa.D0,{name:"role.delegationCategoryPermissions",children:({input:n})=>(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(mK,{children:[(0,i.jsx)(gK,{children:t("d_l_gations_78318")}),(0,i.jsx)(pK,{disabled:e,permission:lb.CREATE_DELEGATION,value:n.value,onChange:n.onChange,children:t("cr_er_une_d_l_g_23035")}),(0,i.jsx)(pK,{disabled:e,permission:lb.EDIT_DELEGATION,value:n.value,onChange:n.onChange,children:t("mettre_jour_u_00445")}),(0,i.jsx)(pK,{disabled:e,permission:lb.DELETE_DELEGATION,value:n.value,onChange:n.onChange,children:t("supprimer_une_d_22643")}),(0,i.jsx)(pK,{disabled:e,permission:lb.VALIDATE_MEMBERS_ACCREDITATIONS,value:n.value,onChange:n.onChange,children:t("valider_les_acc_74530")})]})})})})},vK=()=>{const{translate:e}=il();return(0,i.jsx)(fK,{subtitle:e("permissions_rel_86993"),title:e("d_l_gations_78318"),children:(0,i.jsxs)(mK,{children:[(0,i.jsx)(gK,{children:"coucou"}),(0,i.jsx)(qd,{borderRadius:"$1",css:{gridColumn:2},height:60})]})})},bK=({disabled:e})=>{const t=Ln();return(0,i.jsx)(fK,{hideToggle:!0,title:t("informations_su_20567"),children:(0,i.jsxs)(Ea,{direction:"column",gap:"6",children:[(0,i.jsx)(Sl,{disabled:e,label:t("nom_du_r_le_38492"),name:"role.name"}),(0,i.jsx)(Tm,{disabled:e,label:t("Description"),name:"role.description"})]})})},jK=()=>{const e=Ln();return(0,i.jsx)(fK,{hideToggle:!0,title:e("informations_su_20567"),children:(0,i.jsxs)(Ea,{direction:"column",gap:"6",children:[(0,i.jsx)(qd,{borderRadius:"$2",height:64,width:"100%"}),(0,i.jsx)(qd,{borderRadius:"$2",height:126,width:"100%"})]})})},CK=({disabled:e})=>{const t=Ln();return(0,i.jsx)(fK,{hideToggle:!0,subtitle:t("permissions_rel_37045"),title:t("membres_11310"),children:(0,i.jsx)(Oa.D0,{name:"role.positionPermissions",children:({input:n})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(mK,{children:[(0,i.jsx)(gK,{children:t("profil_du_membr_68116")}),(0,i.jsx)(pK,{disabled:e,permission:db.EDIT_MEMBER,value:n.value,onChange:n.onChange,children:t("_diter_les_info_17721")})]}),(0,i.jsx)($u,{height:"6"}),(0,i.jsxs)(mK,{children:[(0,i.jsx)(gK,{children:t("commentaires_96492")}),(0,i.jsx)(pK,{disabled:e,permission:db.READ_COMMENTS,subtext:t("sans_cette_perm_08373",t("Private")),value:n.value,onChange:n.onChange,children:t("lire_les_commen_55215")}),(0,i.jsx)(pK,{disabled:e,permission:db.ADD_COMMENTS,value:n.value,onChange:n.onChange,children:t("ajouter_et_supp_32493")})]}),(0,i.jsx)($u,{height:"6"}),(0,i.jsxs)(mK,{children:[(0,i.jsx)(gK,{children:t("disponibilit_s_49923")}),(0,i.jsx)(pK,{disabled:e,permission:db.EDIT_AVAILABILITIES,value:n.value,onChange:n.onChange,children:t("_diter_les_disp_75220")})]})]})})})},yK=()=>{const e=Ln();return(0,i.jsxs)(fK,{hideToggle:!0,subtitle:e("permissions_rel_37045"),title:e("membres_11310"),children:[(0,i.jsxs)(mK,{children:[(0,i.jsx)(gK,{children:e("profil_du_membr_68116")}),(0,i.jsx)(qd,{borderRadius:"$1",css:{gridColumn:2},height:20})]}),(0,i.jsx)($u,{height:"6"}),(0,i.jsxs)(mK,{children:[(0,i.jsx)(gK,{children:e("commentaires_96492")}),(0,i.jsx)(qd,{borderRadius:"$1",css:{gridColumn:2},height:40}),(0,i.jsx)(qd,{borderRadius:"$1",css:{gridColumn:2},height:20})]}),(0,i.jsx)($u,{height:"6"}),(0,i.jsxs)(mK,{children:[(0,i.jsx)(gK,{children:e("disponibilit_s_49923")}),(0,i.jsx)(qd,{borderRadius:"$1",css:{gridColumn:2},height:20})]})]})},kK=({disabled:e})=>{const t=Ln();return(0,i.jsx)(fK,{subtitle:t("permissions_rel_18662"),title:t("missions_63972"),children:(0,i.jsx)(Oa.D0,{name:"role.positionPermissions",children:({input:n})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(mK,{children:[(0,i.jsx)(gK,{children:t("informations_su_61022")}),(0,i.jsx)(pK,{disabled:e,permission:db.EDIT_POSITION,subtext:t("si_le_r_le_est_05344"),value:n.value,onChange:n.onChange,children:t("_diter_la_missi_86663")})]}),(0,i.jsx)($u,{height:"6"}),(0,i.jsxs)(mK,{children:[(0,i.jsx)(gK,{children:t("affectation")}),(0,i.jsx)(pK,{disabled:e,permission:db.ASSIGN_MEMBER,value:n.value,onChange:n.onChange,children:t("affecter_des_me_26669")}),(0,i.jsx)(pK,{disabled:e,permission:db.EDIT_ASSIGNMENT_STATE,subtext:t("permet_notammen_90746",t("PreAssigned")),value:n.value,onChange:n.onChange,children:t("changer_le_stat_34124")})]})]})})})},AK=()=>{const e=Ln();return(0,i.jsxs)(fK,{subtitle:e("permissions_rel_18662"),title:e("missions_63972"),children:[(0,i.jsxs)(mK,{children:[(0,i.jsx)(gK,{children:e("informations_su_61022")}),(0,i.jsx)(qd,{borderRadius:"$1",css:{gridColumn:2},height:60})]}),(0,i.jsx)($u,{height:"6"}),(0,i.jsxs)(mK,{children:[(0,i.jsx)(gK,{children:e("affectation")}),(0,i.jsx)(qd,{borderRadius:"$1",css:{gridColumn:2},height:20}),(0,i.jsx)(qd,{borderRadius:"$1",css:{gridColumn:2},height:40})]})]})},wK=ar("span",{"& a":{display:"inline-flex !important"}}),SK=({children:e,disabled:t=!1})=>{const n=Ln(),{organizationId:o,roleId:s}=Wn();return(0,i.jsxs)(Ea,{direction:"column",gap:"4",children:[(0,i.jsx)(sl,{}),t&&(0,i.jsx)(qa.Root,{color:"warning",children:(0,i.jsxs)(qa.Titled,{children:[(0,i.jsx)(qa.Title,{icon:"circle-exclamation",children:n("impossible_de_m_46897")}),(0,i.jsxs)(qa.Text,{children:[`${n("ce_r_le_est_pr_71742")} `,(0,i.jsx)(wK,{children:(0,i.jsx)(pl,{color:"white",size:"sm",to:So.DUPLICATE_ORGANIZATION_PARAMETERS_ROLE(o,s),children:n("dupliquer_28256")})})]})]})}),(0,i.jsx)(bK,{disabled:t}),(0,i.jsx)(CK,{disabled:t}),(0,i.jsx)(kK,{disabled:t}),(0,i.jsx)(xK,{disabled:t}),(0,i.jsx)(IK,{disabled:t}),e]})},EK=({children:e})=>(0,i.jsxs)(Ea,{direction:"column",gap:"4",children:[(0,i.jsx)(jK,{}),(0,i.jsx)(yK,{}),(0,i.jsx)(AK,{}),(0,i.jsx)(_K,{}),(0,i.jsx)(vK,{}),e]}),TK=()=>{const{history:e,translate:t,params:{organizationId:n}}=il(),o=(0,F.useRef)(null),s=Nn(hK),{mutate:r}=na(),{showNotification:a}=Yv();return(0,i.jsx)(dl,{customErrorRef:o,height:1,initialValues:s.default(),render:({handleSubmit:e,submitting:s})=>(0,i.jsx)(bm,{button:(0,i.jsx)(pl,{css:{flexShrink:0},isLoading:s,onClick:e,children:t("cr_er_le_r_le_55678")}),color:"dark",fallbackClosePath:So.ORGANIZATION_PARAMETERS_ROLES(n),title:t("nouveau_r_le_20981"),children:(0,i.jsx)(Im,{ref:o,children:(0,i.jsx)(SK,{children:(0,i.jsx)(jm,{children:(0,i.jsx)(pl,{isLoading:s,textAlign:"center",onClick:e,children:t("cr_er_le_r_le_55678")})})})})}),schema:s.schema(),onSubmit:async({role:i})=>{await r({organizationId:n,role:i}),a({color:"success",text:t("le_r_le_a_bien_55424")}),e.goBack(So.ORGANIZATION_PARAMETERS_ROLES(n))}})},zK=()=>{const{history:e,translate:t,params:{organizationId:n,roleId:o}}=il(),s=(0,F.useRef)(null),r=Nn(hK),{mutate:a}=na(),{data:l,isLoading:d}=ta({organizationId:n,roleId:o}),{showNotification:c}=Yv();return d?(0,i.jsx)($K,{}):(0,i.jsx)(dl,{customErrorRef:s,height:1,initialValues:(({delegationCategoryPermissions:e,positionPermissions:n,name:i,description:o})=>({role:{delegationCategoryPermissions:e,positionPermissions:n,name:t("copie_de_1_62900",i),description:o}}))(l.organization.role),render:({handleSubmit:e,submitting:o})=>(0,i.jsx)(bm,{button:(0,i.jsx)(pl,{isLoading:o,onClick:e,children:t("cr_er_la_copie_80352")}),category:t("copie_du_r_le_84419"),color:"dark",fallbackClosePath:So.ORGANIZATION_PARAMETERS_ROLES(n),title:l.organization.role.name,children:(0,i.jsx)(Im,{ref:s,children:(0,i.jsx)(SK,{children:(0,i.jsx)(jm,{children:(0,i.jsx)(pl,{isLoading:o,textAlign:"center",onClick:e,children:t("cr_er_la_copie_80352")})})})})}),schema:r.schema(),onSubmit:async({role:i})=>{await a({organizationId:n,role:i}),c({color:"success",text:t("le_r_le_a_bien_55424")}),e.goBack(So.ORGANIZATION_PARAMETERS_ROLES(n))}})},$K=()=>{const e=Ln(),{organizationId:t}=Wn();return(0,i.jsx)(bm,{button:(0,i.jsx)(pl,{children:e("cr_er_la_copie_80352")}),category:e("copie_du_r_le_84419"),fallbackClosePath:So.ORGANIZATION_PARAMETERS_ROLES(t),title:(0,i.jsx)(qd,{borderRadius:"$1",height:23,width:400}),children:(0,i.jsx)(Im,{children:(0,i.jsx)(EK,{children:(0,i.jsx)(jm,{children:(0,i.jsx)(pl,{textAlign:"center",children:e("cr_er_la_copie_80352")})})})})})},OK=()=>{const{history:e,translate:t,params:{organizationId:n,roleId:o}}=il(),s=(0,F.useRef)(null),r=Nn(hK),{mutate:a}=function(e={}){return Un("mutation RoleUpdate($organizationId: OrganizationId!, $roleId: RoleId!, $role: RoleInput!) {\n    roleUpdate(organizationId: $organizationId, roleId: $roleId, role: $role) {\n        id\n    }\n}\n",e)}(),{data:l,isLoading:d}=ta({organizationId:n,roleId:o}),{showNotification:c}=Yv();return d?(0,i.jsx)(RK,{}):(0,i.jsx)(dl,{customErrorRef:s,height:1,initialValues:(({delegationCategoryPermissions:e,positionPermissions:t,name:n,description:i})=>({role:{delegationCategoryPermissions:e,positionPermissions:t,name:n,description:i}}))(l.organization.role),render:({handleSubmit:e,submitting:o})=>(0,i.jsx)(bm,{button:AY(l.organization.role)?(0,i.jsx)(pl,{css:{flexShrink:0},isLoading:o,onClick:e,children:t("modifier_le_r_l_58957")}):void 0,category:AY(l.organization.role)?t("modification_du_29490"):t("r_le_pr_d_fini_14582"),color:"dark",fallbackClosePath:So.ORGANIZATION_PARAMETERS_ROLES(n),title:l.organization.role.name,children:(0,i.jsx)(Im,{ref:s,children:(0,i.jsx)(SK,{disabled:!AY(l.organization.role),children:AY(l.organization.role)&&(0,i.jsx)(jm,{children:(0,i.jsx)(pl,{isLoading:o,textAlign:"center",onClick:e,children:t("modifier_le_r_l_58957")})})})})}),schema:r.schema(),onSubmit:async({role:i})=>{AY(l.organization.role)&&(await a({organizationId:n,roleId:o,role:i}),c({color:"success",text:t("le_r_le_a_bien_48312")}),e.goBack(So.ORGANIZATION_PARAMETERS_ROLES(n)))}})},RK=()=>{const{organizationId:e}=Wn();return(0,i.jsx)(bm,{fallbackClosePath:So.ORGANIZATION_PARAMETERS_ROLES(e),title:(0,i.jsx)(qd,{borderRadius:"$1",height:39,width:400}),children:(0,i.jsx)(Im,{children:(0,i.jsx)(EK,{})})})};var PK,DK,FK,MK,NK,LK,BK,VK,UK,WK,GK,HK,qK,YK,KK,ZK,XK,JK,QK,eZ,tZ,nZ,iZ,oZ,sZ,rZ,aZ,lZ,dZ,cZ,uZ,hZ,mZ,gZ,pZ,fZ,xZ,_Z,IZ,vZ,bZ,jZ,CZ,yZ,kZ,AZ,wZ,SZ,EZ,TZ,zZ,$Z,OZ,RZ,PZ,DZ,FZ,MZ,NZ,LZ,BZ,VZ,UZ,WZ,GZ,HZ,qZ,YZ,KZ,ZZ,XZ,JZ,QZ,eX,tX,nX,iX,oX,sX,rX,aX,lX,dX,cX,uX,hX,mX,gX,pX,fX,xX,_X,IX,vX,bX,jX,CX,yX,kX,AX,wX,SX,EX,TX,zX,$X,OX,RX,PX,DX,FX,MX,NX,LX,BX,VX,UX,WX,GX,HX,qX,YX,KX,ZX,XX,JX,QX,eJ,tJ,nJ,iJ,oJ,sJ,rJ,aJ,lJ,dJ,cJ,uJ,hJ,mJ,gJ,pJ,fJ,xJ,_J,IJ,vJ,bJ,jJ,CJ,yJ,kJ,AJ,wJ,SJ,EJ,TJ,zJ,$J,OJ,RJ,PJ,DJ,FJ,MJ;function NJ(){return NJ=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const e=Ln();return(0,i.jsx)(Ea,{align:"center",css:{background:"$gray50"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Ea,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$xs",padding:"$9"},direction:"column",gap:"2",justify:"center",width:840,children:[(0,i.jsx)(fr,{css:{"& svg":{height:"100%",width:"100%"}},height:140,width:180,children:(0,i.jsx)(LJ,{})}),(0,i.jsx)(fr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("votre_compte_1_85226",cd)}),(0,i.jsxs)(fr,{color:"gray500",textAlign:"center",children:[e("ne_vous_inqui_t_38880")," ",(0,i.jsx)("br",{}),e("contactez_nous_35526",ud,cd)]})]})})};var VJ;function UJ(){return UJ=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const e=Ln();return(0,i.jsx)(Ea,{align:"center",css:{background:"$gray50"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Ea,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$xs",padding:"$9"},direction:"column",gap:"2",justify:"center",width:840,children:[(0,i.jsx)(WJ,{}),(0,i.jsx)(fr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("votre_compte_1_64779",cd)}),(0,i.jsxs)(fr,{color:"gray500",textAlign:"center",children:[e("ne_vous_inqui_t_38880")," ",(0,i.jsx)("br",{}),e("contactez_nous_35526",ud,cd)]})]})})},HJ=()=>{const e=Ln(),{user:t}=Zn();return(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e("accepter_a_hre_50341",hd(dd(t?.language,new URL(location.href).searchParams)),cd)}})},qJ=()=>{const{history:e,translate:t,params:{organizationId:n}}=il(),{data:o,loader:s}=Vn('query UserInfo($organizationId: OrganizationId!) {\n    user {\n        userInfo(organizationId: $organizationId) {\n            id\n            firstName: fieldValue(slug: "firstName")\n            lastName: fieldValue(slug: "lastName")\n            phone: fieldValue(slug: "phone")\n        }\n    }\n}\n',{organizationId:n},[]),r=Nn(EE),a=Nn(za),{mutate:l}=function(e={}){return Un("mutation UserInfoAndTermsUpdate(\n    $userInfoId: UsersInfoId!\n    $userInfoAndTermsInput: UserInfoAndTermsInput!\n) {\n    userInfoAndTermsUpdate(userInfoId: $userInfoId, userInfoAndTermsInput: $userInfoAndTermsInput) {\n        id\n    }\n}\n",e)}(),d=(0,F.useRef)(null),{reload:c}=nI();return s||(0,i.jsx)(dl,{customErrorRef:d,height:1,initialValues:{userInfoAndTerms:r.userInfoAndTermsInputDefault(o.user)},render:({handleSubmit:e})=>(0,i.jsxs)($_,{ref:d,onClose:Y,children:[(0,i.jsx)(sl,{}),(0,i.jsxs)(Cm,{centerTitleAndSubtitle:!0,hideToggle:!0,initialIsOpen:!0,subtitle:t("accepter_nos_co_49122"),title:t("conditions_g_n_79662"),children:[(0,i.jsx)(ym,{name:"userInfoAndTerms.termsAccepted",shouldPreventDefault:!1,children:(0,i.jsx)(HJ,{})}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsxs)(Ea,{gap:"4",children:[(0,i.jsx)(Sl,{label:(0,i.jsx)(nv,{children:t("pr_nom_66988")}),name:"userInfoAndTerms.firstName"}),(0,i.jsx)(Sl,{label:(0,i.jsx)(nv,{children:t("last_name")}),name:"userInfoAndTerms.lastName"})]}),(0,i.jsx)(Pa,{height:"4"}),(0,i.jsx)(B_,{label:(0,i.jsx)(nv,{children:t("Phone")}),prefix:"userInfoAndTerms.phone."})]}),(0,i.jsx)(jm,{children:(0,i.jsx)(pl,{textAlign:"center",onClick:e,children:t("mettre_jour_85141")})})]}),validate:a.validateForForm(r.updateUserInfoAndTermsSchema()),width:1,onSubmit:async t=>{await l({userInfoId:o.user.userInfo.id,userInfoAndTermsInput:t.userInfoAndTerms}),c(),e.location.state?e.push(e.location.state):e.push(mi.ORGANIZATION({organizationId:n}))}})},YJ=()=>{const{isOrganizationAdmin:e,isOrganizationReader:t,organization:n}=nI(),o=pc();return(0,i.jsxs)(_r.dO,{children:[e&&(0,i.jsx)(_r.qh,{exact:!0,path:So.CREATE_EVENT(":organizationId"),children:(0,i.jsx)(gP,{})}),e&&(0,i.jsx)(_r.qh,{exact:!0,path:So.EDIT_EVENT(":organizationId",":eventId"),children:(0,i.jsx)(pP,{})}),(0,i.jsx)(_r.qh,{path:Pi.EVENTS({organizationId:":organizationId"}),children:o?(0,i.jsx)(VP,{}):(0,i.jsx)(SE,{children:(0,i.jsx)(BP,{})})}),(0,i.jsx)(_r.qh,{path:Pi.EVENT({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(pq,{})}),t&&(0,i.jsx)(_r.qh,{path:So.CUSTOM_FIELDS(":organizationId"),children:(0,i.jsx)(SE,{children:(0,i.jsx)(rP,{})})}),e&&(0,i.jsx)(_r.qh,{path:So.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(":organizationId"),children:(0,i.jsx)(_q,{})}),e&&(0,i.jsx)(_r.qh,{path:So.EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(":organizationId",":emailSenderId"),children:(0,i.jsx)(Iq,{})}),t&&(0,i.jsx)(_r.qh,{path:So.ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW(":organizationId",":emailSenderId"),children:(0,i.jsx)(vq,{})}),e&&(0,i.jsx)(_r.qh,{path:So.CREATE_ORGANIZATION_PARAMETERS_ROLE(":organizationId"),children:(0,i.jsx)(TK,{})}),e&&(0,i.jsx)(_r.qh,{path:So.EDIT_ORGANIZATION_PARAMETERS_ROLE(":organizationId",":roleId"),children:(0,i.jsx)(OK,{})}),e&&(0,i.jsx)(_r.qh,{path:So.DUPLICATE_ORGANIZATION_PARAMETERS_ROLE(":organizationId",":roleId"),children:(0,i.jsx)(zK,{})}),(0,i.jsx)(_r.qh,{path:So.ORGANIZATION_PARAMETERS(":organizationId"),children:o?(0,i.jsx)(Nq,{}):(0,i.jsx)(SE,{children:(0,i.jsx)(cK,{})})}),(0,i.jsx)(_r.qh,{path:fi.COMMUNITY({organizationId:":organizationId"}),children:(0,i.jsx)(BR,{})}),(0,i.jsx)(_r.qh,{path:mi.IS_EXPIRED(mi.ORGANIZATION({organizationId:":organizationId"})),children:(0,i.jsx)(SE,{children:(0,i.jsx)(GJ,{})})}),(0,i.jsx)(_r.qh,{path:mi.IS_BLOCKED(mi.ORGANIZATION({organizationId:":organizationId"})),children:(0,i.jsx)(SE,{children:(0,i.jsx)(BJ,{})})}),(0,i.jsx)(_r.qh,{exact:!0,path:So.ACCEPT_TERMS_AND_CONDITIONS(":organizationId"),children:(0,i.jsx)(qJ,{})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:Pi.EVENTS({organizationId:n.id}),replace:!0})})]})},KJ=()=>(0,i.jsx)(Q_,{children:(0,i.jsx)(tI,{children:(0,i.jsx)(YJ,{})})}),ZJ=()=>{const e=JSON.parse(window.HEAVENT_EXPORT_POSITIONS_MAP_DATA),[t,n]=(0,F.useState)(!1),{searchParams:o}=new URL(location.href),s=function(e){if(h(e)){const[t,n]=e.split(",");if(h(t)&&h(n)){const e=parseFloat(t),i=parseFloat(n);return isNaN(e)||isNaN(i)?null:{lat:e,lng:i}}return null}return null}(o.get("center")),r=o.get("acronymIcon")||"icon",a=o.get("zoom"),l=o.get("hiddenTracesIds")?.split(",").map(e=>parseInt(e,10))??[];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(_U,{acronymIcon:r,hiddenTracesIds:l,initialCenter:s,initialZoom:a?parseInt(a,10):null,layer:e.layer,mapOptions:{zoomControl:!1},positions:e.positions.nodes,showMarker:!1,traces:e.traces,onMapTilesloaded:()=>{n(!0)}})}),t&&(0,i.jsx)(zr,{})]})},XJ=()=>{const{eventId:e,positionId:t}=Wn(),{data:n,loader:o}=Vn("query PositionMap($eventId: EventId!, $positionId: PositionId!) {\n    eventPublic(id: $eventId) {\n        position(id: $positionId) {\n            layer\n            latitude\n            longitude\n            zoom\n\n            traces {\n                ...Trace\n            }\n        }\n    }\n}\n",{eventId:e,positionId:t},[Ro.TraceFragment]),[s,r]=(0,F.useState)(!1);if(o)return o;{const e=n.eventPublic.position;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fr,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(Tr,{initialZoom:e.zoom,layer:e.layer,mapOptions:{disableDefaultUI:!0,keyboardShortcuts:!1},point:kr(e),traces:e.traces,onTilesloaded:()=>{r(!0)}})}),s&&(0,i.jsx)(zr,{})]})}},JJ=()=>{const e=Ln(),t=new URL(location.href).searchParams,n=t.get("eventName")||t.get("organizationName")||"",o=`${R.HEAVENT_API_URL}/users/${t.get("userId")||""}/`,s=t.get("eventId")?`${o}blacklist-event?eventId=${t.get("eventId")}`:`${o}blacklist-organization?organizationId=${t.get("organizationId")}`;return(0,i.jsx)(Ea,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Ea,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:[(0,i.jsx)(fr,{font:"gray900 textXl semiBold",children:e("d_sinscription_61475")}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:e("vous_tes_sur_l_71517",n)}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(fr,{width:1,children:(0,i.jsx)(pl,{color:"error",textAlign:"center",onClick:()=>{window.open(s,"_blank")},children:e("oui_je_souhait_20141")})})]})})},QJ=()=>{const{translate:e,params:{organizationId:t,userInfoId:n,customFieldSlug:o,value:s}}=il(),{data:r,loader:a}=ma({organizationId:t,slug:o}),[l,d]=(0,F.useState)(!1),[c,u]=(0,F.useState)(!1),h=r.organization?.customField.name??"",m=r.organization?.customField.description??"",g=`${R.HEAVENT_API_URL}/users/${n}/field/${o}/update/${s}`;return(0,i.jsx)(Ea,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:a||(0,i.jsxs)(Ea,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:[(0,i.jsx)(fr,{font:"gray900 textXl semiBold",children:h}),(0,i.jsx)(Pa,{height:"1"}),(0,i.jsx)(fr,{color:"gray500",textAlign:"center",children:m}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{justify:"center",width:1,children:c?(0,i.jsx)(Gd,{color:"success",leftIcon:"check",children:e("votre_r_ponse_a_83191")}):(0,i.jsx)(pl,{isLoading:l,leftIcon:"check",textAlign:"center",onClick:async()=>{d(!0),await fetch(g),u(!0),d(!1)},children:h})})]})})},eQ=()=>{const{translate:e,params:{organizationId:t,customFieldSlug:n}}=il(),{data:o,loader:s}=ma({organizationId:t,slug:n}),[r,a]=(0,F.useState)(!1),[l,d]=(0,F.useState)(!1),[c,u]=(0,F.useState)(!1),[h,m]=(0,F.useState)(""),[g,p]=(0,F.useState)(""),f=o.organization?.customField.name??"",x=o.organization?.customField.description??"",_=`${R.HEAVENT_API_URL}/users/organization/${t}/update-by-ticket-id`;return(0,i.jsx)(Ea,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:s||(0,i.jsxs)(Ea,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:[l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ea,{width:1,children:(0,i.jsx)(Ha,{color:"success",leftIcon:"check",rightIcon:"xmark",rightIconClick:()=>{d(!1)},width:1,children:e("le_champ_1_36490",f)})}),(0,i.jsx)(Pa,{height:"6"})]}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ea,{width:1,children:(0,i.jsx)(Ha,{color:"error",leftIcon:"circle-exclamation",rightIcon:"xmark",rightIconClick:()=>{u(!1)},width:1,children:e("le_champ_1_46567",f)})}),(0,i.jsx)(Pa,{height:"6"})]}),(0,i.jsx)(wl,{label:e("TicketId"),value:h,onChange:m}),(0,i.jsx)(Pa,{height:"6"}),(0,i.jsx)(wl,{hint:x,label:f,value:g,onChange:p}),(0,i.jsx)(Pa,{height:"7"}),(0,i.jsx)(Ea,{justify:"center",width:1,children:(0,i.jsx)(pl,{isLoading:r,textAlign:"center",onClick:async()=>{a(!0),d(!1),u(!1),200===(await fetch(_,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticketId:h,slug:n,value:g})})).status?(d(!0),m(""),p("")):u(!0),a(!1)},children:e("mettre_jour_34131",f)})})]})})},tQ=e=>(0,i.jsx)(Xn,{getRedirectPath:()=>So.AUTH_SIGN_IN,shouldHaveUser:!0,children:e.children}),nQ=e=>(0,i.jsx)(Xn,{getRedirectPath:()=>So.HOME,shouldHaveUser:!1,children:e.children});const iQ=async()=>{const{user:e}=await(async()=>{try{const e=await async function(){const e=await H();if(h(e)){const{user:t}=await function(e,t){return ss("query CurrentUser {\n    user {\n        id\n        email\n        language\n        insertedAt\n        hubspotToken\n        profile\n        termsAcceptedAt\n    }\n}\n",{variables:{},token:t||void 0,fragments:[]})}(0,e);return{user:t}}throw new Error("No token")}();return Fo.wB.defaultLocale=e.user.language.toLowerCase(),e}catch{return{user:null}}})();return await(e=>{const t=new URL(location.href).searchParams.get("lang");let n=null;e&&(n=e.language.toLowerCase()),h(t)&&(n=t);const i=n?`lang=${n}`:"";return MI(`${R.HEAVENT_API_URL}/translation/language.js?${i}`)})(e),{user:e}},oQ=e=>{const[t,n]=(0,F.useState)(null);return(0,F.useEffect)(()=>{let e=!0;return iQ().then(t=>{e&&n(t)}).catch(()=>{alert("Could not load application, please try again.")}),()=>{e=!1}},[]),t?e.render(t):(0,i.jsx)(ul,{})},sQ=window.matchMedia("(max-width: 1200px)"),rQ=F.createContext({isMobile:!1}),aQ=e=>{const[t,n]=F.useState(!1);return F.useEffect(()=>{n(sQ.matches),sQ.addListener(e=>{n(e.matches)})},[]),(0,i.jsx)(rQ.Provider,{value:{isMobile:t},children:e.children})},lQ=(0,i.jsx)(ul,{});function dQ(e,{redirectOnSuccess:t}={}){const[n,i]=(0,F.useState)(!1),{setIsError:o}=(0,F.useContext)(vG);let s=null;return n&&(s=lQ),{isLoading:n,loader:s,mutate:async(n,s)=>{i(!0);try{const r=await H(),a=await((e,t,n)=>ss(e,{variables:t,token:n||void 0}))(e,n,s||r);return!0!==t&&(i(!1),o(!1)),a}catch(e){throw o(!0,Zo(e)?e:[]),e}}}}const cQ=(0,i.jsx)(ul,{});function uQ(e,t,n){const[i,o]=(0,F.useState)(!0),[s,r]=(0,F.useState)({}),[a,l]=(0,F.useState)(0),{setIsError:d}=(0,F.useContext)(vG),c=Object.keys(t).sort().map(e=>{const n=t[e];return`"${e}":${JSON.stringify(n)}`}).join(",");(0,F.useEffect)(()=>{let i=!1;var s;return o(!0),s=c,H().then(i=>ss(e,{reloadOnNewVersion:!0,variables:t,token:i,fragments:n})).then(e=>{i||s!==c||(r(e),d(!1),o(!1))},()=>{i||s!==c||d(!0)}),()=>{i=!0}},[e,c,a]);let u=null;return i&&(u=cQ),{data:s,isLoading:i,loader:u,reload(){l(a+1)}}}function hQ(){return function(e,t={}){return Object.fromEntries(Object.entries(e).map(([e,n])=>e.endsWith("Id")||"id"===e?[e,parseInt(n,10)]:t[e]?[e,t[e](n)]:[e,n]))}((0,_r.g)())}function mQ(){const e=(0,_r.W6)();return{...e,goBack:t=>{"POP"===e.action&&e.length<=2?e.push(t):e.goBack()}}}function gQ(){return(0,_r.zy)()}function pQ(){try{return{clear:window.localStorage.clear.bind(window.localStorage),setItem:window.localStorage.setItem.bind(window.localStorage),getItem:window.localStorage.getItem.bind(window.localStorage),removeItem:window.localStorage.removeItem.bind(window.localStorage),key:window.localStorage.key.bind(window.localStorage),get length(){return window.localStorage.length},getItemInt(e){const t=parseInt(window.window.localStorage.getItem(e),10);return isNaN(t)?null:t}}}catch{return{clear(){},setItem(){},getItem:()=>null,removeItem(){},key:()=>null,get length(){return 0},getItemInt:()=>null}}}let fQ=class extends zl{constructor(e){super(e)}delegationFormInviteValuesDefault(){return{usersInfos:[{email:"",fields:{firstName:"",lastName:""}}]}}delegationFormInviteValuesSchema(){return l.Ik().shape({usersInfos:l.YO().of(l.Ik().shape({email:l.Yj().email(this.t("l_e_mail_est_re_04856")).required(this.t("l_e_mail_est_re_04856")),fields:l.gl()})).min(1,"Vous devez invité au moins une personne.")})}};fQ=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],fQ);let xQ=class extends zl{translationService;constructor(e){super(e),this.translationService=e}massStateUpdateSchema(){return l.Ik().shape({state:l.Yj().required(this.t("le_statut_est_r_13164")).oneOf([Et.NotApplicable,Et.PreAssigned,Et.Refused,Et.WaitingAssignment],this.t("le_statut_est_r_13164"))})}massAccreditationStateUpdateSchema(){return l.Ik().shape({state:l.Yj().required(this.t("le_statut_est_r_13164")).oneOf([ae.NotApplicable,ae.Refused,ae.WaitingAccreditation],this.t("le_statut_est_r_13164"))})}};xQ=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],xQ);let _Q=class extends zl{translationService;constructor(e){super(e),this.translationService=e}};_Q=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Dn])],_Q);let IQ=class{translationInputDefault(e){return{fr:this.default(e.translationType,e.fr),en:this.default(e.translationType,e.en),es:this.default(e.translationType,e.es),de:this.default(e.translationType,e.de),nl:this.default(e.translationType,e.nl)}}default(e,t){switch(e){case At.String:return h(t)?t:"";case At.StringArray:return Array.isArray(t)?t:[];case At.RichText:return h(t)?t:"";default:return Za()}}};IQ=function(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}([(0,Bt._G)()],IQ);const vQ=new Bt.i0(e=>{e(uK).toSelf().inSingletonScope(),e(Hc).toSelf().inSingletonScope(),e($c).toSelf().inSingletonScope(),e(Ng).toSelf().inSingletonScope(),e(Ku).toSelf().inSingletonScope(),e(Hk).toSelf().inSingletonScope(),e(JA).toSelf().inSingletonScope(),e(za).toSelf().inSingletonScope()}),bQ=new Bt.i0(e=>{e(GP).toSelf().inSingletonScope(),e(UP).toSelf().inSingletonScope(),e(WP).toSelf().inSingletonScope(),e(Vw).toSelf().inSingletonScope(),e(Dl).toSelf().inSingletonScope(),e(Om).toSelf().inSingletonScope(),e(Ev).toSelf().inSingletonScope(),e(IT).toSelf().inSingletonScope(),e(Hz).toSelf().inSingletonScope(),e(yN).toSelf().inSingletonScope(),e(fS).toSelf().inSingletonScope(),e(rV).toSelf().inSingletonScope(),e(aV).toSelf().inSingletonScope(),e(fQ).toSelf().inSingletonScope(),e(HS).toSelf().inSingletonScope(),e(uN).toSelf().inSingletonScope(),e(Xb).toSelf().inSingletonScope(),e(ej).toSelf().inSingletonScope(),e(fq).toSelf().inSingletonScope(),e(OS).toSelf().inSingletonScope(),e(bP).toSelf().inSingletonScope(),e(M_).toSelf().inSingletonScope(),e(yj).toSelf().inSingletonScope(),e(Uw).toSelf().inSingletonScope(),e(Zl).toSelf().inSingletonScope(),e(Xw).toSelf().inSingletonScope(),e(eV).toSelf().inSingletonScope(),e(lV).toSelf().inSingletonScope(),e(DS).toSelf().inSingletonScope(),e(ZS).toSelf().inSingletonScope(),e(gV).toSelf().inSingletonScope(),e(eE).toSelf().inSingletonScope(),e($E).toSelf().inSingletonScope(),e(c$).toSelf().inSingletonScope(),e(u$).toSelf().inSingletonScope(),e(Fk).toSelf().inSingletonScope(),e(zR).toSelf().inSingletonScope(),e(_F).toSelf().inSingletonScope(),e(sU).toSelf().inSingletonScope(),e(AF).toSelf().inSingletonScope(),e(xQ).toSelf().inSingletonScope(),e(F_).toSelf().inSingletonScope(),e(D_).toSelf().inSingletonScope(),e(AV).toSelf().inSingletonScope(),e(MV).toSelf().inSingletonScope(),e(yV).toSelf().inSingletonScope(),e(kV).toSelf().inSingletonScope(),e(hK).toSelf().inSingletonScope(),e(K$).toSelf().inSingletonScope(),e(_Q).toSelf().inSingletonScope(),e(Fl).toSelf().inSingletonScope(),e(gd).toSelf().inSingletonScope(),e($Y).toSelf().inSingletonScope(),e(tw).toSelf().inSingletonScope(),e(jU).toSelf().inSingletonScope(),e(IQ).toSelf().inSingletonScope(),e(EE).toSelf().inSingletonScope(),e(zE).toSelf().inSingletonScope(),e(TE).toSelf().inSingletonScope(),e(m$).toSelf().inSingletonScope(),e(x$).toSelf().inSingletonScope()}),jQ=new Bt.i0(e=>{e(vj).toSelf().inSingletonScope(),e(Xc).toSelf().inSingletonScope(),e(dD).toSelf().inSingletonScope(),e(hm).toSelf().inSingletonScope(),e(hO).toSelf().inSingletonScope(),e(VR).toSelf().inSingletonScope(),e($O).toSelf().inSingletonScope(),e(xP).toSelf().inSingletonScope(),e(mA).toSelf().inSingletonScope(),e(BV).toSelf().inSingletonScope(),e(Eh).toSelf().inSingletonScope(),e(M$).toSelf().inSingletonScope()});function CQ(){const e=new Bt.mc,t=window.HEAVENT_TRANSLATIONS||{},n=window.HEAVENT_LANGUAGE;if(0===Object.keys(t).length)throw new Error("window.HEAVENT_TRANSLATIONS does not exist");if(!ld(n))throw new Error("window.HEAVENT_LANGUAGE is not valid");return e.bind(Dn).toConstantValue(new Dn(ld(n),t)),e.load(vQ,bQ,jQ),e}const yQ=e=>(0,i.jsx)(Fn.Provider,{value:{container:CQ(),useQuery:uQ,useMutation:dQ,useExecuteQuery:rs,useParams:hQ,useHistory:mQ,useLocation:gQ,useLocalStorage:pQ},children:e.children});var kQ=n(6751);const AQ=F.createContext({}),wQ=e=>{const t=F.useCallback((e,t)=>{R.USE_MIXPANEL&&kQ.A.track(e,t)},[]);return F.useEffect(()=>{R.USE_MIXPANEL&&kQ.A.init(R.MIXPANEL_TOKEN,{debug:!0})},[]),(0,i.jsx)(AQ.Provider,{value:{track:t},children:e.children})},SQ=F.createContext({active:!1,enable:Bl.A,disable:Bl.A}),EQ=()=>{const{user:e}=Zn(),t=pc(),n=qn(),{active:i}=F.useContext(SQ);return F.useEffect(()=>{if(R.USE_HUBSPOT&&h(e?.hubspotToken)){window.hsConversationsSettings={identificationEmail:e.email,identificationToken:e.hubspotToken};try{if(t||"true"===n.getItem(El.HIDE_HUBSPOT)||!i){const{loaded:e}=window.HubSpotConversations.widget.status();e?window.HubSpotConversations.widget.remove():window.HubSpotConversations.on("widgetLoaded",()=>{window.HubSpotConversations.widget.remove()})}else window.HubSpotConversations.clear({resetWidget:!0})}catch{}}},[t,i]),null};(0,ee.render)((0,i.jsx)(F.StrictMode,{children:(0,i.jsxs)(({children:e})=>(0,i.jsx)(oQ,{render:t=>(0,i.jsx)(Kn.Provider,{value:t,children:(0,i.jsx)(yQ,{children:(0,i.jsx)(aQ,{children:(0,i.jsx)(bG,{children:(0,i.jsx)(qv,{children:(0,i.jsx)(wQ,{children:(0,i.jsx)(i.Fragment,{children:e})})})})})})})}),{children:[(0,i.jsx)(()=>((0,F.useEffect)(()=>{H().then(e=>{"true"===R.LOG_TOKEN&&console.log(`"${D}": "${e||""}"`)})},[]),null),{}),(0,i.jsx)(({children:e})=>{const[t,n]=F.useState(!0);return(0,i.jsxs)(SQ.Provider,{value:{active:t,enable:()=>{n(!0)},disable:()=>{n(!1)}},children:[(0,i.jsx)(EQ,{}),e]})},{children:(0,i.jsx)(()=>(0,i.jsx)(fr,{className:gr,css:{color:"$gray800",height:"100%",overflow:"hidden",position:"relative",width:"100%"},children:(0,i.jsx)(xr.Kd,{basename:R.HEAVENT_APP_URL.pathnameOptional,children:(0,i.jsxs)(_r.dO,{children:[(0,i.jsx)(_r.qh,{exact:!0,path:So.HOME,children:(0,i.jsx)(tQ,{children:(0,i.jsx)(H_,{})})}),(0,i.jsx)(_r.qh,{path:So.USER_UPDATE_BY_TICKET_ID(":organizationId",":customFieldSlug"),children:(0,i.jsx)(eQ,{})}),(0,i.jsx)(_r.qh,{path:So.USER_FIELD_UPDATE(":organizationId",":userInfoId",":customFieldSlug",":value"),children:(0,i.jsx)(QJ,{})}),(0,i.jsx)(_r.qh,{path:So.BACKOFFICE,children:(0,i.jsx)(tQ,{children:(0,i.jsx)(E_,{})})}),(0,i.jsx)(_r.qh,{path:So.POSITION_MAP(":eventId",":positionId"),children:(0,i.jsx)(XJ,{})}),(0,i.jsx)(_r.qh,{path:So.ACCREDITATION_MAP(":eventId",":accreditationId"),children:(0,i.jsx)(ka,{})}),(0,i.jsx)(_r.qh,{path:So.EXPORT_POSITIONS_MAP(":eventId",":segmentId"),children:(0,i.jsx)(ZJ,{})}),(0,i.jsx)(_r.qh,{path:si(mi.ORGANIZATIONS),children:(0,i.jsx)(tQ,{children:(0,i.jsx)(q_,{})})}),(0,i.jsx)(_r.qh,{exact:!0,path:So.CREATE_EVENT_WITH_ORGANIZATION,children:(0,i.jsx)(tQ,{children:(0,i.jsx)(G_,{})})}),(0,i.jsx)(_r.qh,{path:mi.ORGANIZATION({organizationId:":organizationId"}),children:(0,i.jsx)(tQ,{children:(0,i.jsx)(KJ,{})})}),(0,i.jsx)(_r.qh,{path:So.AUTH,children:(0,i.jsx)(nQ,{children:(0,i.jsx)(_d,{})})}),(0,i.jsx)(_r.qh,{path:So.COGNITO_CALLBACK,children:(0,i.jsx)(nQ,{children:(0,i.jsx)(vd,{})})}),(0,i.jsx)(_r.qh,{path:So.MAGIC_LINK(":code",":source"),children:(0,i.jsx)(nQ,{children:(0,i.jsx)(er,{})})}),(0,i.jsx)(_r.qh,{path:So.UNSUBSCRIBE_EMAIL,children:(0,i.jsx)(JJ,{})}),(0,i.jsx)(_r.qh,{children:(0,i.jsx)(Yn,{path:So.HOME})})]})})}),{})})]})}),document.getElementById("heavent-react-hook"))},8652:(e,t,n)=>{"use strict";e.exports=n.p+"svg/done-d3eb25606e0846af3988.svg"},8798:(e,t,n)=>{"use strict";e.exports=n.p+"svg/recrewteerMarker-a76de3956f8adec5ded2.svg"},9191:()=>{},9844:()=>{!function(e){const t=e.es=e.es||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 de %1","Align center":"Centrar","Align left":"Alinear a la izquierda","Align right":"Alinear a la derecha",Aquamarine:"Aguamarina",Black:"Negro","Block quote":"Cita de bloque",Blue:"Azul",Bold:"Negrita","Break text":"Permitir quebrar texto","Bulleted List":"Lista con viñetas",Cancel:"Cancelar","Centered image":"Imagen centrada","Change image text alternative":"Cambiar el texto alternativo de la imagen","Choose heading":"Elegir Encabezado","Dim grey":"Gris Oscuro","Document colors":"Colores del documento",Downloadable:"Descargable","Dropdown toolbar":"Barra de herramientas desplegable","Edit block":"Cuadro de edición","Edit link":"Editar enlace","Editor toolbar":"Barra de herramientas de edición","Font Background Color":"Color de Fondo","Font Color":"Color de Fuente","Full size image":"Imagen a tamaño completo",Green:"Verde",Grey:"Gris",Heading:"Encabezado","Heading 1":"Encabezado 1","Heading 2":"Encabezado 2","Heading 3":"Encabezado 3","Heading 4":"Encabezado 4","Heading 5":"Encabezado 5","Heading 6":"Encabezado 6","Image resize list":"Listado para redimensionar imagen","Image toolbar":"Barra de herramientas de imagen","image widget":"Widget de imagen","In line":"En línea","Insert image":"Insertar imagen","Insert paragraph after block":"Insertar párrafo después del bloque","Insert paragraph before block":"Insertar párrafo antes del bloque",Italic:"Cursiva",Justify:"Justificar","Left aligned image":"Imagen alineada a la izquierda","Light blue":"Azul Claro","Light green":"Verde Claro","Light grey":"Gris Claro",Link:"Enlace","Link URL":"URL del enlace",Next:"Siguiente","Numbered List":"Lista numerada","Open in a new tab":"Abrir en una pestaña nueva ","Open link in new tab":"Abrir enlace en una pestaña nueva",Orange:"Anaranjado",Original:"Original",Paragraph:"Párrafo",Previous:"Anterior",Purple:"Morado",Red:"Rojo",Redo:"Rehacer","Remove color":"Quitar color","Resize image":"Redimensionar imagen","Resize image to %0":"Redimensionar imagen al %0","Resize image to the original size":"Redimensionar imagen al tamaño original","Rich Text Editor":"Editor de Texto Enriquecido","Rich Text Editor, %0":"Editor de Texto Enriquecido, %0","Right aligned image":"Imagen alineada a la derecha",Save:"Guardar","Select all":"Seleccionar todo","Show more items":"Mostrar más elementos","Side image":"Imagen lateral","Text alignment":"Alineación del texto","Text alignment toolbar":"Barra de herramientas de alineación del texto","Text alternative":"Texto alternativo","This link has no URL":"Este enlace no tiene URL",Turquoise:"Turquesa",Underline:"Subrayado",Undo:"Deshacer",Unlink:"Quitar enlace","Upload failed":"Fallo en la subida","Upload in progress":"Subida en progreso",White:"Blanco","Widget toolbar":"Barra de herramientas del widget","Wrap text":"Mantener texto unido",Yellow:"Amarillo"}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}))},9882:(e,t,n)=>{"use strict";e.exports=n.p+"img/ign-3cfd31ba578060a32efa.png"}},e=>{e.O(0,[121],()=>e(e.s=8631)),e.O()}]);
//# sourceMappingURL=app-25739dcbb2a2d5a78a4c.cjs.map