(\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",vh(i.content))),"cut"==i.method&&e.model.deleteContent(t.selection)},{priority:"low"})}}class jh{constructor(){this._stack=[]}add(e,t){const n=this._stack,i=n[0];this._insertDescriptor(e);const o=n[0];i===o||Ch(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||Ch(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(Ch(e,t[n]))return;n>-1&&t.splice(n,1);let i=0;for(;t[i]&&yh(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 Ch(e,t){return e&&t&&e.priority==t.priority&&Ah(e.classes)==Ah(t.classes)}function yh(e,t){return e.priority>t.priority||!(e.priorityAh(t.classes)}function Ah(e){return Array.isArray(e)?e.sort().join(","):e}st(jh,x);const Sh="ck-widget_selected";function kh(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function wh(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=Oh,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 mc;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=Eh,i=Th){const o=new jh;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 Eh(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 Th(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 Rh(e){const t=e.getCustomProperty("widgetLabel");return t?"function"==typeof t?t():t:""}function Oh(){return null}const Dh="widget-type-around";function zh(e,t,n){return e&&kh(e)&&!n.isInline(t)}function $h(e){return e.getAttribute(Dh)}var Ph=s(137);rs()(Ph.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Ph.Z.locals;const Mh=["before","after"],Fh=(new DOMParser).parseFromString(' ',"image/svg+xml").firstChild,Nh="ck-widget__type-around_disabled";class Lh extends rt{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[Em,Hm]}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(Nh,n):e.addClass(Nh,n)}),o||e.model.change(e=>{e.removeSelectionAttribute(Dh)})}),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=$h(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);zh(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 Mh){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(Fh,!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:[kh,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",(t,n)=>{n.directChange&&e.model.change(e=>{e.removeSelectionAttribute(Dh)})}),this._listenToIfEnabled(t.document,"change:data",()=>{const t=n.getSelectedElement();t&&zh(e.editing.mapper.toViewElement(t),t,i)||e.model.change(e=>{e.removeSelectionAttribute(Dh)})}),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(Mh.map(s),e),this._currentFakeCaretModelElement=null)}const r=t.selection.getSelectedElement();if(!r)return;const a=n.mapper.toViewElement(r);if(!zh(a,r,i))return;const l=$h(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(Dh)})})}_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=Ao(e,t);return"down"===n||"right"===n}(t.keyCode,n.locale.contentLanguageDirection),l=r.document.selection.getSelectedElement();let d;zh(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=$h(t.document.selection);return t.change(t=>n?n!==(e?"after":"before")&&(t.removeSelectionAttribute(Dh),!0):(t.setSelectionAttribute(Dh,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!!zh(t.editing.mapper.toViewElement(s),s,i)&&(n.change(t=>{o._setSelectionOverElement(s),t.setSelectionAttribute(Dh,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!!zh(o.toViewElement(r),r,i)&&(n.change(t=>{t.setSelection(r,"on"),t.setSelectionAttribute(Dh,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:zh(s,o,r)&&(this._insertParagraph(o,i.isSoft?"before":"after"),a=!0),a&&(i.preventDefault(),n.stop())},{context:kh})}_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)||Lm(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=$h(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:kh})}_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=$h(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=$h(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")||$h(t)&&e.stop()},{priority:"high"})}}function Bh(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 Vh(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 Uh=s(507);rs()(Uh.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Uh.Z.locals;class Wh extends rt{static get pluginName(){return"Widget"}static get requires(){return[Lh,Hm]}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);kh(a)&&i.consumable.consume(s,"selection")&&o.setSelection(o.createRangeOn(a),{fake:!0,label:Rh(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;kh(e)&&!Gh(e,s)&&(i.addClass(Sh,e),this._previouslySelected.add(e),s=e)}},{priority:"low"}),t.addObserver(Hu),this.listenTo(n,"mousedown",(...e)=>this._onMousedown(...e)),this.listenTo(n,"arrowKey",(...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)},{context:[kh,"$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=Bh(i,e,"forward");if(!n)return null;const o=i.createRange(e,n),s=Vh(i.schema,o,"backward");return s?i.createRange(e,s):null}{const e=t.isCollapsed?t.focus:t.getFirstPosition(),n=Bh(i,e,"backward");if(!n)return null;const o=i.createRange(n,e),s=Vh(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(kh(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(!kh(s)&&(s=s.findAncestor(kh),!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=Ao(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(Sh,t);this._previouslySelected.clear()}}function Gh(e,t){return!!t&&Array.from(e.getAncestors()).includes(t)}const qh=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return k(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 Hh=s(390);rs()(Hh.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Hh.Z.locals;class Kh extends rt{static get pluginName(){return"DragDrop"}static get requires(){return[bh,Wh]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=qh(e=>this._updateDropMarker(e),40),this._removeDropMarkerDelayed=Xh(()=>this._removeDropMarker(),40),this._clearDraggableAttributesDelayed=Xh(()=>this._clearDraggableAttributes(),40),t.addObserver(xh),t.addObserver(Hu),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?Jh(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&&kh(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=Yh(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=Yh(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"==Zh(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(bh);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"==Zh(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=Jh(o.target);if(fo.isBlink&&!e.isReadOnly&&!s&&!n.selection.isCollapsed){const e=n.selection.getSelectedElement();e&&kh(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 Yh(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(kh(t))return n.createRangeOn(i.toModelElement(t));if(!t.is("editableElement")){const e=t.findAncestor(e=>kh(e)||e.is("editableElement"));if(kh(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 Zh(e){return fo.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function Xh(e,t){let n;function i(...o){i.cancel(),n=setTimeout(()=>e(...o),t)}return i.cancel=()=>{clearTimeout(n)},i}function Jh(e){if(e.is("editableElement"))return null;if(e.hasClass("ck-widget__selection-handle"))return e.findAncestor(kh);if(kh(e))return e;const t=e.findAncestor(e=>kh(e)||e.is("editableElement"));return kh(t)?t:null}class Qh extends rt{static get pluginName(){return"PastePlainText"}static get requires(){return[bh]}init(){const e=this.editor,t=e.model,n=e.editing.view,i=n.document,o=t.document.selection;let s=!1;n.addObserver(xh),this.listenTo(i,"keydown",(e,t)=>{s=t.shiftKey}),e.plugins.get(bh).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[bh,Kh,Qh]}}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 mg 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 hg=' ',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?hg:gg,o="ltr"==t.uiLanguageDirection?gg:hg;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[mg,pg]}static get pluginName(){return"Undo"}}class _g 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 xg 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(xg,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 $r,this.keystrokes=new Pr,this.set("selectedColor"),this.removeButtonLabel=i,this.columns=n,this.documentColors=new xg,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 Ac(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 Ac(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 Ag extends _g{constructor(e){super(e,jg)}}class Sg 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(cm),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 Ag(e)),e.model.schema.extend("$text",{allowAttributes:jg}),e.model.schema.setAttributeProperties(jg,{isFormatting:!0,copyOnEnter:!0})}}class kg 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=Yc(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 wg extends kg{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 _g{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 Rg extends kg{constructor(e){const t=e.locale.t;super(e,{commandName:bg,componentName:bg,icon:' ',dropdownLabel:t("Font Color")})}static get pluginName(){return"FontColorUI"}}class Og extends lt{refresh(){const e=this.editor.model,t=zr(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&Dg(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")&&Dg(e,t.schema)&&i.rename(e,"paragraph")})}}function Dg(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class zg 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 $g extends rt{static get pluginName(){return"Paragraph"}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new Og(e)),e.commands.add("insertParagraph",new zg(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(e,{writer:t})=>$g.paragraphLikeElements.has(e.name)?e.isEmpty?null:t.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}$g.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class Pg extends lt{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=zr(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>Mg(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=>Mg(e,i,t.schema));for(const t of o)t.is("element",i)||e.rename(t,i)})}}function Mg(e,t,n){return n.checkChild(e.parent,t)&&!n.isObject(e)}const Fg="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[$g]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const i of t)i.model!==Fg&&(e.model.schema.register(i.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new Pg(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",Fg)&&0===o.childCount&&i.writer.rename(o,Fg)})}_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 hu({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=Yc(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 ${qg(n)}`}}).render())}_appendSizeUI(e){this._sizeView=new Wg,this._sizeView.render(),e.appendChild(this._sizeView.element)}}function qg(e){return`ck-widget__resizer__handle-${e}`}st(Gg,Qe);var Hg=s(263);rs()(Hg.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Hg.Z.locals;class Kg extends rt{static get pluginName(){return"WidgetResize"}init(){const e=this.editor.editing,t=ms.window.document;this.set("visibleResizer",null),this.set("_activeResizer",null),this._resizers=new Map,e.view.addObserver(Hu),this._observer=Object.create(ks),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=qh(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(ms.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(Kg,Qe);class Yg 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=zr(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=$h(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),wh(e,t,{label:()=>{const t=this.findViewImgElement(e).getAttribute("alt");return t?`${t} ${n}`:n}})}isImageWidget(e){return!!e.getCustomProperty("image")&&kh(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 Yg(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 $r,this.keystrokes=new Pr,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),$d,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),zd,"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]}),Md(this)}render(){super.render(),this.keystrokes.listenTo(this.element),Fd({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=xu.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)}),Pd({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&&m("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||"inline"===t&&m("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 mp 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 hp 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[mp,Qg,bh]}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 hp(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=zr(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 Ku(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,Wh,ap]}static get pluginName(){return"ImageBlock"}}class _p extends rt{static get requires(){return[mp,Qg,bh]}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 hp(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 Ku(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 xp extends rt{static get requires(){return[_p,Wh,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=Yc(o,Sc),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 hu({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)/,Ap="image_resized";class Sp extends rt{static get requires(){return[Kg]}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(Kg).getResizerByViewElement(s);if(r)return void r.redraw();const a=e.editing.mapper,l=a.toModelElement(s);r=e.plugins.get(Kg).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(Ap,s)}),e.execute("resizeImage",{width:n})}}),r.on("updateSize",()=>{s.hasClass(Ap)||t.change(e=>{e.addClass(Ap,s)})}),r.bind("isEnabled").to(this)})}}var kp=s(43);rs()(kp.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),kp.Z.locals;class wp{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(wp,Qe);class Ep extends rt{static get pluginName(){return"FileRepository"}static get requires(){return[Dd]}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 m("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(Dd);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 wp,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 Rp extends Bd{constructor(e){super(e),this.buttonView=new fc(e),this._fileInputView=new Op(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 Op 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 Dp{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 zp(e){const t=e.map(e=>e.replace("+","\\+"));return new RegExp(`^image\\/(${t.join("|")})$`)}function $p(e){return new Promise((t,n)=>{const i=e.getAttribute("src");fetch(i).then(e=>e.blob()).then(e=>{const n=Pp(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=ms.document.createElement("img");i.addEventListener("load",()=>{const e=ms.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=Pp(t,e),i=n.replace("image/","");return new File([t],`image.${i}`,{type:n})})}(i).then(t).catch(n):n(e))})}function Pp(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class Mp extends rt{static get pluginName(){return"ImageUploadUI"}init(){const e=this.editor,t=e.t,n=n=>{const i=new Rp(n),o=e.commands.get("uploadImage"),s=e.config.get("image.upload.types"),r=zp(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 Fp=s(870);rs()(Fp.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Fp.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){qp(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),qp(e,t,"placeholder")}function Gp(e,t){for(const n of e.getChildren())if(n.getCustomProperty(t))return n}function qp(e,t,n){const i=Gp(e,n);i&&t.remove(t.createRangeOn(i))}class Hp 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 Kp extends rt{static get requires(){return[Ep,mu,bh,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=zp(e.config.get("image.upload.types")),r=new Hp(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:$p(e.item),imageElement:e.item}));if(!s.length)return;const r=new Ku(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 Yp(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(mu),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 Yp(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 mh(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+")?",mf="[\\ufe0e\\ufe0f]?",hf=mf+uf+"(?:\\u200d(?:"+[lf,df,cf].join("|")+")"+mf+uf+")*",gf="(?:"+[lf+rf+"?",rf,df,cf,sf].join("|")+")",pf=RegExp(af+"(?="+af+")|"+gf+hf,"g");const ff=function(e){return nf(e)?function(e){return e.match(pf)||[]}(e):function(e){return e.split("")}(e)},_f=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"),xf=/[\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(xf,"").match(If)}(e=String(e))?e:"#"}function Af(e,t){return!!e&&t.checkAttribute(e.name,"linkHref")}function Sf(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 kf(e){window.open(e,"_blank","noopener")}class wf 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()||zr(t.getSelectedBlocks());Af(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=ih(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 Af(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();Af(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?[ih(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 Rf=s(399);rs()(Rf.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Rf.Z.locals;const Of="automatic",Df=/^(https?:)?\/\//;class zf extends rt{static get pluginName(){return"LinkEditing"}static get requires(){return[Xm,Wm,bh]}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 wf(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${_f(n)}`});t.push(e)}return t}(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter(e=>e.mode===Of)),this._enableManualDecorators(t.filter(e=>"manual"===e.mode)),e.plugins.get(Xm).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=ih(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:Of,callback:e=>Df.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(),kf(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(),kf(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=>{$f(t,Mf(e.schema))}))},{priority:"low"})}_enableClickingAfterLink(){const e=this.editor,t=e.model;e.editing.view.addObserver(Hu);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=ih(i,"linkHref",e.getAttribute("linkHref"),t);(i.isTouching(o.start)||i.isTouching(o.end))&&t.change(e=>{$f(e,Mf(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:Pf(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 ih(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,Pf(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=ih(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=>{$f(e,Mf(t.schema))}))},{priority:"low"})}}function $f(e,t){e.removeSelectionAttribute("linkHref");for(const n of t)e.removeSelectionAttribute(n)}function Pf(e){return e.model.change(e=>e.batch).isTyping}function Mf(e){return e.getDefinition("$text").allowAttributes.filter(e=>e.startsWith("link"))}var Ff=s(827);rs()(Ff.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Ff.Z.locals;class Nf extends Bd{constructor(e,t){super(e);const n=e.t;this.focusTracker=new $r,this.keystrokes=new Pr,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),$d,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),zd,"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}),Md(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>(e[t.name]=t.isOn,e),{})}render(){super.render(),Fd({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 xc(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 $r,this.keystrokes=new Pr,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(qu),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=Sf(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())}),Pd({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&&kh(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 qf extends rt{static get requires(){return[Hm]}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 Zm(e.model,e=>{if(!function(e){return e.length>4&&" "===e[e.length-1]&&" "!==e[e.length-2]}(e))return;const t=Hf(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}=Ym(e,t),o=Hf(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=Sf(e,s);o.setAttribute("linkHref",r,t),n.enqueueChange(()=>{i.requestUndoOnBackspace()})})}}function Hf(e){const t=Gf.exec(e);return t?t[2]:null}class Kf 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=zr(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=t_(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=e_(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 e_(e){return e.getLastMatchingPosition(e=>e.item.is("uiElement"))}function t_(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 n_(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 i_(){const e=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||e?0:Vi.call(this)}function o_(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=i_,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 s_(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 r_(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 a_(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 l_(e,t,n){const i=n.mapper.toViewPosition(t.position),o=i.nodeBefore,s=i.nodeAfter;Qf(n.writer,o,s)}function d_(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:g_(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 c_(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")&&!f_(t)&&t._remove()}}function u_(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&&!f_(t)&&t._remove(),f_(t)&&(n=!0)}}function m_(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(f_),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 h_(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 g_(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 p_(e,t,n,i,o,s){const r=t_(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=e_(c);for(const e of[...i.getChildren()])f_(e)&&(c=l.move(l.createRangeOn(e),c).end,Qf(l,e,e.nextSibling),Qf(l,e.previousSibling,e))}function f_(e){return e.is("element","ol")||e.is("element","ul")}class __ extends rt{static get pluginName(){return"ListEditing"}static get requires(){return[Em,Hm]}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",m_(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&&f_(l);)a+=s.getModelLength(l),l=l.previousSibling;n.modelPosition=e.createPositionBefore(r).getShiftedBy(a),t.stop()}}}(e.model)),t.mapper.on("modelToViewPosition",m_(n.view)),e.conversion.for("editingDowncast").add(t=>{t.on("insert",a_,{priority:"high"}),t.on("insert:listItem",o_(e.model)),t.on("attribute:listType:listItem",s_,{priority:"high"}),t.on("attribute:listType:listItem",r_,{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),p_(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),p_(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",l_,{priority:"low"})}),e.conversion.for("dataDowncast").add(t=>{t.on("insert",a_,{priority:"high"}),t.on("insert:listItem",o_(e.model))}),e.conversion.for("upcast").add(e=>{e.on("element:ul",c_,{priority:"high"}),e.on("element:ol",c_,{priority:"high"}),e.on("element:li",u_,{priority:"high"}),e.on("element:li",d_)}),e.model.on("insertContent",h_,{priority:"high"}),e.commands.add("numberedList",new Kf(e,"numbered")),e.commands.add("bulletedList",new Kf(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 I_ extends rt{static get pluginName(){return"ListUI"}init(){const e=this.editor.t;n_(this.editor,"numberedList",e("Numbered List"),' '),n_(this.editor,"bulletedList",e("Bulleted List"),' ')}}const v_="underline";class b_ extends rt{static get pluginName(){return"UnderlineEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:v_}),e.model.schema.setAttributeProperties(v_,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:v_,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),e.commands.add(v_,new mh(e,v_)),e.keystrokes.set("CTRL+U","underline")}}const j_="underline";class C_ extends rt{static get pluginName(){return"UnderlineUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(j_,n=>{const i=e.commands.get(j_),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(j_),e.editing.view.focus()}),o})}}class y_ extends pm{}y_.builtinPlugins=[class extends rt{static get requires(){return[jm,ym]}static get pluginName(){return"Alignment"}},class extends rt{static get requires(){return[dh,uh]}static get pluginName(){return"BlockQuote"}},class extends rt{static get requires(){return[gh,fh]}static get pluginName(){return"Bold"}},class extends rt{static get requires(){return[eg,Em,rg,Dm,Km,fg]}static get pluginName(){return"Essentials"}},class extends rt{static get requires(){return[Sg,wg]}static get pluginName(){return"FontBackgroundColor"}},class extends rt{static get requires(){return[Tg,Rg]}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,xp]}static get pluginName(){return"Image"}},class extends rt{static get requires(){return[vp,Sp,jp]}static get pluginName(){return"ImageResize"}},class extends rt{static get pluginName(){return"ImageUpload"}static get requires(){return[Kp,Mp,Bp]}},class extends rt{static get requires(){return[Xp,Qp]}static get pluginName(){return"Italic"}},class extends rt{static get requires(){return[zf,Uf,qf]}static get pluginName(){return"Link"}},class extends rt{static get requires(){return[__,I_]}static get pluginName(){return"List"}},$g,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 Dp(t,e):m("simple-upload-adapter-missing-uploadurl"))}},class extends rt{static get requires(){return[b_,C_]}static get pluginName(){return"Underline"}}],y_.defaultConfig={toolbar:{items:["bold","italic","underline","|","heading","fontColor","fontBackgroundColor","alignment","|","blockQuote","bulletedList","numberedList","|","link","imageUpload","|","undo","redo"]},language:"fr"};const A_=y_})(),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"},6400:(e,t,n)=>{"use strict";e.exports=n.p+"img/weezConstruction-fb73dc7a26ba038c44b3.png"},6687:(e,t,n)=>{"use strict";e.exports=n.p+"svg/weezeventBlankMessages-76d6e6c79babc98388e9.svg"},6751:(e,t,n)=>{"use strict";e.exports=n.p+"svg/fileJPG-aed94d931a32b62e488d.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"},6959:(e,t,n)=>{"use strict";e.exports=n.p+"svg/filePNG-c7dc0a7230035611ad34.svg"},7008:(e,t,n)=>{"use strict";e.exports=n.p+"img/accreditation-7f66e46aebab965fa566.png"},7619:(e,t,n)=>{"use strict";e.exports=n.p+"svg/fileBlank-8285380bb91a4d9e73d7.svg"},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-e46035697a28c8d248e6.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"},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:()=>{},9192:(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,d=n(2347),c=n(2664);function u(e){return(0,d.A)(e.normalize("NFD").replace(/\p{Diacritic}/gu,""))}function m(e){return(0,d.A)((e||"").trim().toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu,""))}function h(e,t={}){const n=t.replacer??l.Dash,i=u(e).trim().toLowerCase().replace(/['"]+/gi,"");let o;return o=n===l.Dash?i.replace(/[^a-z0-9\\-]+/gu,"-").replace(/-+$/,"").replace(/^-+/,""):n===l.Underscore?i.replace(/[^a-z0-9_]+/gu,"_").replace(/_+$/,"").replace(/^_+/,""):i.replace(/[^a-z0-9]+/gu,"").trim(),t?.replaceStartingNumber?o.replace(/^(\d)/,"_$1"):o}function g(e){return Array.isArray(e)&&"production"!==a.Production&&console.warn("Array passed to `isNonEmptyString()`, did you mean to use `isNonEmptyArray()` instead?"),"string"==typeof e&&e.trim().length>0}function p(e){return!g(e)}!function(e){e.Development="development",e.Production="production",e.Test="test"}(a||(a={})),function(e){e[e.Dash=0]="Dash",e[e.Empty=1]="Empty",e[e.Underscore=2]="Underscore"}(l||(l={}));const f={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:'"'},_=["hm","hrh","him","hih","hh","hsh","hgdh","kg","lg","kt","lt","sm","sar","sai","sas","sagd"],x=e=>g(e)?e[0].toUpperCase()+e.slice(1):"";function I(e){return(e??"").trim().toLowerCase().replace(/\s+/g," ").split(" ").map(e=>_.includes(e.toLowerCase())?e.toUpperCase():x(e.trim())).join(" ").split("-").map(e=>_.includes(e.toLowerCase())?e.toUpperCase():x(e.trim())).join("-")}function v(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!==C?.[e])return C[e];throw new Error(`Missing env. var. ${e}`)},A=e=>"object"==typeof window&&void 0!==window[e]?window[e]:void 0!==C?.[e]?C[e]:void 0,S=e=>{const t=y(e);return"boolean"==typeof t?t:"true"===t},k=y("HEAVENT_APPLICATION_DOMAIN"),w=A("HEAVENT_RESOURCES_DOMAIN")??k,E=A("HEAVENT_ASSETS_DOMAIN")??w,T=A("HEAVENT_APP_SUBDOMAIN")??"admin",R=A("HEAVENT_API_SUBDOMAIN")??"api",O=A("HEAVENT_PUBLIC_SUBDOMAIN")??"widget",D=A("HEAVENT_INVOICES_SUBDOMAIN")??"invoices",z=A("HEAVENT_ASSETS_SUBDOMAIN")??"assets",$=A("HEAVENT_UPLOADS_SUBDOMAIN")??"uploads",P=A("HEAVENT_APPLICATION_BASENAME")??"crew",M=A("HEAVENT_RESOURCES_BASENAME")??"",F={ADMINS:y("HEAVENT_ADMINS"),EMAIL_FROM:y("HEAVENT_EMAIL_FROM"),EMAIL_FROM_NAME:y("HEAVENT_EMAIL_FROM_NAME"),EMAIL_PICTURE_LINK:y("HEAVENT_EMAIL_PICTURE_LINK"),HEAVENT_APPLICATION_DOMAIN:k,HEAVENT_RESOURCES_DOMAIN:w,HEAVENT_ASSETS_DOMAIN:E,HEAVENT_APPLICATION_BASENAME:P,HEAVENT_APP_URL:new b(A("HEAVENT_APP_DOMAIN")??k,void 0,T,A("HEAVENT_APP_BASENAME")??P),HEAVENT_API_URL:new b(A("HEAVENT_API_DOMAIN")??k,void 0,R,A("HEAVENT_API_BASENAME")??P),HEAVENT_PUBLIC_URL:new b(A("HEAVENT_PUBLIC_DOMAIN")??k,void 0,O,A("HEAVENT_PUBLIC_BASENAME")??P),HEAVENT_ASSETS_URL:new b(E,void 0,z,A("HEAVENT_ASSETS_BASENAME")??M),HEAVENT_INVOICES_URL:new b(A("HEAVENT_INVOICES_DOMAIN")??w,void 0,D,A("HEAVENT_INVOICES_BASENAME")??M),HEAVENT_UPLOADS_URL:new b(A("HEAVENT_UPLOADS_DOMAIN")??w,void 0,$,A("HEAVENT_UPLOADS_BASENAME")??M),USE_HUBSPOT:S("HEAVENT_USE_HUBSPOT"),USE_INTERCOM:S("HEAVENT_USE_INTERCOM"),FORCE_WHITE_LABEL_FOR_ORGANIZATION_ID:A("HEAVENT_FORCE_WHITE_LABEL_FOR_ORGANIZATION_ID"),HIGHLIGHT_CUSTOM_COLOURS:(()=>{const e=A("HEAVENT_HIGHLIGHT_CUSTOM_COLOURS");return void 0!==e?"boolean"==typeof e?e:"true"===e:void 0})(),COGNITO_USER_POOL_ID:y("HEAVENT_COGNITO_USER_POOL_ID"),COGNITO_USER_POOL_CLIENT_ID:y("HEAVENT_COGNITO_USER_POOL_CLIENT_ID"),COGNITO_DOMAIN_URL:y("HEAVENT_COGNITO_DOMAIN_URL"),COGNITO_CLIENT_CALLBACK_URL:y("HEAVENT_COGNITO_CLIENT_CALLBACK_URL")[0],USE_MIXPANEL:S("HEAVENT_USE_MIXPANEL"),MIXPANEL_TOKEN:S("HEAVENT_MIXPANEL_TOKEN"),HEAVENT_AWS_UPLOADS_BUCKET:y("HEAVENT_AWS_UPLOADS_BUCKET"),LOG_TOKEN:y("HEAVENT_LOG_TOKEN"),WEEZEVENT_DOMAIN:y("HEAVENT_WEEZEVENT_DOMAIN")},N="x-heavent-commit-sha",L="x-heavent-request-uuid",B="x-user-token";var V=n(6540),U=n(5002);function W(){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 G="heavent-user-session-key",q="heavent-user-email",H="UserNotFoundException";let K=null;const Y=()=>(null===K&&(K=new U.NE({UserPoolId:F.COGNITO_USER_POOL_ID,ClientId:F.COGNITO_USER_POOL_CLIENT_ID})),K);function Z(){return new Promise((e,t)=>{const n=Y().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 X(){try{const e=localStorage.getItem("heavent-test-token");return g(e)?e:(await Z()).token}catch{return}}function J(e,t){const n=e.trim().toLowerCase();return new Promise((e,i)=>{const o=[new U.HB({Name:"email",Value:n})];Y().signUp(n,t,o,[],(t,n)=>{t?i(t):e(n.user)})})}function Q(){Z().then(({user:e})=>{e.signOut(),location.reload()}).catch(()=>{alert("Something wrong happened ")})}function ee(e,t,n){return new Promise((i,o)=>{const s=new U.TU({Username:e,Pool:Y()}),r=new U.By({Username:e}),a={onSuccess(e){t(e.getIdToken().getJwtToken())},onFailure(e){e.code===H?o(H):n(e)},customChallenge(){localStorage.setItem(q,e),localStorage.setItem(G,s.Session),i({user:s,callbacks:a})}};s.setAuthenticationFlowType("CUSTOM_AUTH"),s.initiateAuth(r,a)})}function te(e,t){return new Promise((n,i)=>{new U.TU({Username:e,Pool:Y()}).authenticateUser(new U.By({Username:e,Password:t}),{onSuccess(e){n(e.getIdToken().getJwtToken())},onFailure(e){i(e)}})})}function ne(e){return new Promise((t,n)=>{new U.TU({Username:e,Pool:Y()}).forgotPassword({onSuccess(){t(!0)},async onFailure(i){if(i.code===H)try{await J(e,W().toString()),await ne(e),t(!0)}catch(e){n(e)}else n(i)}})})}function ie(e,t,n){return new Promise((i,o)=>{new U.TU({Username:e,Pool:Y()}).confirmPassword(t,n,{async onSuccess(){i(await te(e,n))},onFailure(e){o(e)}})})}var oe,se,re,ae,le,de,ce,ue,me,he,ge,pe,fe,_e,xe,Ie,ve,be,je,Ce,ye,Ae,Se,ke,we,Ee,Te,Re,Oe,De,ze,$e,Pe,Me,Fe,Ne,Le,Be,Ve,Ue,We,Ge,qe,He,Ke,Ye,Ze,Xe,Je,Qe,et,tt,nt,it,ot,st,rt,at,lt,dt,ct,ut,mt,ht,gt,pt,ft,_t,xt,It,vt,bt,jt,Ct,yt,At,St,kt,wt,Et,Tt,Rt,Ot,Dt,zt,$t,Pt,Mt,Ft,Nt,Lt,Bt,Vt,Ut,Wt,Gt,qt,Ht,Kt,Yt,Zt,Xt,Jt,Qt,en,tn,nn,on,sn,rn,an,ln,dn,cn,un,mn,hn,gn,pn=n(961),fn=n(1519);(gn=oe||(oe={})).Archived="Archived",gn.Done="Done",gn.Ongoing="Ongoing",gn.Upcoming="Upcoming",function(e){e.CreatedAt="CreatedAt",e.EndAt="EndAt",e.Id="Id",e.Name="Name",e.StartAt="StartAt"}(se||(se={})),function(e){e.Asc="Asc",e.Desc="Desc"}(re||(re={})),(hn=ae||(ae={})).De="De",hn.En="En",hn.Es="Es",hn.Fr="Fr",hn.Keys="Keys",hn.Nl="Nl",function(e){e.Backpack="Backpack",e.BadgeCheck="BadgeCheck",e.BagShopping="BagShopping",e.Bed="Bed",e.BedBunk="BedBunk",e.Bicycle="Bicycle",e.BriefcaseMedical="BriefcaseMedical",e.BurgerSoda="BurgerSoda",e.CakeCandles="CakeCandles",e.Camera="Camera",e.Car="Car",e.CircleParking="CircleParking",e.CircleQuestion="CircleQuestion",e.Computer="Computer",e.Droplet="Droplet",e.ForkKnife="ForkKnife",e.HatCowboy="HatCowboy",e.House="House",e.LocationDot="LocationDot",e.MartiniGlass="MartiniGlass",e.Megaphone="Megaphone",e.Motorcycle="Motorcycle",e.PersonBiking="PersonBiking",e.PersonHiking="PersonHiking",e.Phone="Phone",e.ScrewdriverWrench="ScrewdriverWrench",e.Shirt="Shirt",e.SignsPost="SignsPost",e.Star="Star",e.Ticket="Ticket",e.UserPolice="UserPolice",e.WalkieTalkie="WalkieTalkie"}(le||(le={})),function(e){e.Google="Google",e.GoogleSatellite="GoogleSatellite",e.IgnPlan="IgnPlan"}(de||(de={})),function(e){e.None="None",e.Backward="Backward",e.Forward="Forward"}(ce||(ce={})),function(e){e.Email="Email",e.Sms="Sms"}(ue||(ue={})),function(e){e.Done="Done",e.Draft="Draft",e.InProgress="InProgress",e.Scheduled="Scheduled",e.Template="Template"}(me||(me={})),function(e){e.Failed="FAILED",e.Pending="PENDING",e.Success="SUCCESS"}(he||(he={})),function(e){e.DoesNotExist="DoesNotExist",e.NotVerified="NotVerified",e.Verified="Verified"}(ge||(ge={})),function(e){e.NoSchedule="NoSchedule",e.Datetime="Datetime",e.Anchor="Anchor"}(pe||(pe={})),function(e){e.EventStart="EventStart",e.EventEnd="EventEnd"}(fe||(fe={})),function(e){e.Before="Before",e.After="After"}(_e||(_e={})),function(e){e.Calendar="Calendar",e.List="List",e.Radio="Radio"}(xe||(xe={})),function(e){e.And="And",e.Or="Or"}(Ie||(Ie={})),function(e){e.Assigned="Assigned",e.NotApplicable="NotApplicable",e.PreAssigned="PreAssigned",e.Refused="Refused",e.WaitingAssignment="WaitingAssignment"}(ve||(ve={})),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"}(be||(be={})),function(e){e.DelegationCategory="DelegationCategory",e.Event="Event",e.Organization="Organization",e.Position="Position"}(je||(je={})),function(e){e.Car="Car",e.Moto="Moto"}(Ce||(Ce={})),function(e){e.DelegationSpace="DelegationSpace",e.EventsShowcase="EventsShowcase",e.MembersSpace="MembersSpace"}(ye||(ye={})),function(e){e.Accreditation="Accreditation",e.Api="Api",e.Beta="Beta",e.Community="Community",e.Criblage="Criblage",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"}(Ae||(Ae={})),function(e){e.Animajeconvention="Animajeconvention",e.Asoassignment="Asoassignment",e.Hbcldc="Hbcldc",e.Hbclnh="Hbclnh",e.P2nassignment="P2nassignment",e.P2nassignmentmontagedemontage="P2nassignmentmontagedemontage",e.Paris20km="Paris20km",e.Paris20kmassignment="Paris20kmassignment",e.Paris20kmcontremarque="Paris20kmcontremarque",e.Playground="Playground",e.T24assignment="T24assignment"}(Se||(Se={})),function(e){e.Both="Both",e.Event="Event",e.Organization="Organization"}(ke||(ke={})),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.ThisDayMonth="thisDayMonth",e.Today="today"}(we||(we={})),function(e){e.InsertedAt="InsertedAt",e.Name="Name",e.State="State",e.Type="Type"}(Ee||(Ee={})),(mn=Te||(Te={})).Accreditation="Accreditation",mn.Delegation="Delegation",mn.Event="Event",mn.Position="Position",mn.UserInfo="UserInfo",function(e){e.All="All",e.Public="Public",e.Private="Private"}(Re||(Re={})),(un=Oe||(Oe={})).Address="Address",un.Checkbox="Checkbox",un.Country="Country",un.Date="Date",un.Datetime="Datetime",un.File="File",un.Language="Language",un.Nationality="Nationality",un.Number="Number",un.Phone="Phone",un.Select="Select",un.Sex="Sex",un.Text="Text",un.Textarea="Textarea",un.Time="Time",un.Validation="Validation",function(e){e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Label="Label",e.Name="Name",e.Status="Status",e.Type="Type"}(De||(De={})),function(e){e.Accreditations="Accreditations",e.AccreditationsImport="AccreditationsImport",e.AccreditationsProfilesImport="AccreditationsProfilesImport",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.EventsImport="EventsImport",e.Export="Export",e.FilesImport="FilesImport",e.FormInvite="FormInvite",e.FormSubmit="FormSubmit",e.MembersImport="MembersImport",e.NewMember="NewMember",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.App="App",e.DelegationsSpace="DelegationsSpace",e.MembersSpace="MembersSpace",e.VolunteerAssignments="VolunteerAssignments",e.VolunteerRegister="VolunteerRegister"}($e||($e={})),function(e){e.Overdue="Overdue",e.Paid="Paid",e.Refunded="Refunded",e.Waiting="Waiting",e.WrittenOff="WrittenOff"}(Pe||(Pe={})),function(e){e.Accreditations="Accreditations",e.AccreditationsProfiles="AccreditationsProfiles",e.Campaigns="Campaigns",e.CustomFields="CustomFields",e.Delegations="Delegations",e.Events="Events",e.Positions="Positions",e.Volunteers="Volunteers",e.Workflows="Workflows"}(Me||(Me={})),function(e){e.Accreditations="Accreditations",e.Delegations="Delegations",e.Events="Events",e.Positions="Positions",e.UsersInfos="UsersInfos"}(Fe||(Fe={})),function(e){e.Delivered="Delivered",e.InvalidNumber="InvalidNumber",e.Other="Other",e.Refused="Refused",e.Sent="Sent",e.Undelivered="Undelivered",e.Waiting="Waiting"}(Ne||(Ne={})),function(e){e.NotTranslated="NotTranslated",e.Translated="Translated",e.TranslatedAndNotTranslated="TranslatedAndNotTranslated"}(Le||(Le={})),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"}(Be||(Be={})),function(e){e.String="String",e.StringArray="StringArray",e.RichText="RichText"}(Ve||(Ve={})),function(e){e.Admin="Admin",e.Leader="Leader"}(Ue||(Ue={})),function(e){e.Accredited="Accredited",e.AutoAccredited="AutoAccredited",e.NotApplicable="NotApplicable",e.Refused="Refused",e.WaitingAccreditation="WaitingAccreditation"}(We||(We={})),function(e){e.Active="Active",e.Error="Error",e.Paused="Paused"}(Ge||(Ge={})),(cn=qe||(qe={})).Assigned="Assigned",cn.DelegationsSegment="DelegationsSegment",cn.FormSubmit="FormSubmit",cn.VolunteersSegment="VolunteersSegment",function(e){e.AddAccreditations="AddAccreditations",e.AddDelegationPermissions="AddDelegationPermissions",e.AddEvent="AddEvent",e.CreateDelegation="CreateDelegation",e.DeleteAccreditations="DeleteAccreditations",e.DeleteDelegationPermissions="DeleteDelegationPermissions",e.DuplicateMember="DuplicateMember",e.LockDelegation="LockDelegation",e.SendCampaign="SendCampaign",e.SetCustomField="SetCustomField",e.UnlockDelegation="UnlockDelegation"}(He||(He={})),function(e){e.Campaigns="Campaigns",e.CanLeadersAddMembers="CanLeadersAddMembers",e.CanLeadersDeleteMembers="CanLeadersDeleteMembers",e.CanLeadersDuplicateMembers="CanLeadersDuplicateMembers",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.DelegationsSpaceLayout="DelegationsSpaceLayout",e.Description="Description",e.Documents="Documents",e.Form="Form",e.IsLocked="IsLocked",e.MaxResources="MaxResources",e.Name="Name",e.Parent="Parent",e.ShowAllAccreditations="ShowAllAccreditations",e.ShowFormLinkInDelegationSpace="ShowFormLinkInDelegationSpace",e.ShowInDelegationSpace="ShowInDelegationSpace",e.Tag="Tag"}(Ke||(Ke={})),function(e){e.DelegationsLeaders="DelegationsLeaders",e.PositionsLeaders="PositionsLeaders",e.UsersInfosIds="UsersInfosIds",e.View="View"}(Ye||(Ye={})),function(e){e.EveryMinute="EveryMinute",e.Every2Minutes="Every2Minutes",e.Every5Minutes="Every5Minutes",e.Every10Minutes="Every10Minutes"}(Ze||(Ze={})),function(e){e.Revert="Revert",e.Keep="Keep"}(Xe||(Xe={})),function(e){e.CloseWhenEventDone="CloseWhenEventDone",e.Closed="Closed",e.ClosedAt="ClosedAt",e.Open="Open"}(Je||(Je={})),(dn=Qe||(Qe={})).Calendar="Calendar",dn.Custom="Custom",dn.Display="Display",dn.DisplayDays="DisplayDays",dn.Hide="Hide",function(e){e.AllDays="AllDays",e.DaysWithSlots="DaysWithSlots"}(et||(et={})),function(e){e.Category="Category",e.Position="Position",e.Slot="Slot",e.None="None"}(tt||(tt={})),function(e){e.FilterWithSlots="FilterWithSlots",e.None="None"}(nt||(nt={})),function(e){e.Ranked="Ranked",e.Unranked="Unranked"}(it||(it={})),function(e){e.Accreditation="Accreditation",e.None="None"}(ot||(ot={})),function(e){e.Field="Field",e.Section="Section",e.Text="Text"}(st||(st={})),function(e){e.Expired="Expired",e.Full="Full",e.Locked="Locked",e.Ongoing="Ongoing"}(rt||(rt={})),function(e){e.Empty="Empty",e.Partial="Partial",e.Full="Full"}(at||(at={})),function(e){e.Waiting="Waiting",e.CheckedIn="CheckedIn",e.CheckedOut="CheckedOut"}(lt||(lt={})),function(e){e.Bounced="Bounced",e.Delivered="Delivered",e.Opened="Opened",e.Queued="Queued",e.Sent="Sent",e.Waiting="Waiting"}(dt||(dt={})),function(e){e.WithReplies="WithReplies",e.WithUnreadReplies="WithUnreadReplies",e.WithoutReplies="WithoutReplies"}(ct||(ct={})),function(e){e.Name="Name"}(ut||(ut={})),function(e){e.Freeform="Freeform",e.Iban="Iban",e.Avs="Avs",e.Eid="Eid"}(mt||(mt={})),function(e){e.Default="Default",e.Dot="Dot",e.Badge="Badge"}(ht||(ht={})),function(e){e.Default="Default",e.Picture="Picture"}(gt||(gt={})),function(e){e.BirthCity="birthCity",e.BirthCountry="birthCountry",e.BirthPostalCode="birthPostalCode",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"}(pt||(pt={})),function(e){e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(ft||(ft={})),function(e){e.AsoPaxManifest="AsoPaxManifest",e.Assignments="Assignments",e.Badge="Badge",e.Certificate="Certificate",e.CustomBadge="CustomBadge",e.DelegationCalendar="DelegationCalendar",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"}(_t||(_t={})),function(e){e.Paper="Paper",e.Ticket="Ticket",e.Wristband="Wristband"}(xt||(xt={})),function(e){e.C10012713_1K="C10012713_1K",e.C10012713_2K="C10012713_2K",e.C10012713_3K="C10012713_3K",e.C10012713_4K="C10012713_4K",e.C10012713_5K="C10012713_5K",e.C10012713_6K="C10012713_6K",e.C10012713_7K="C10012713_7K",e.C10012713_1="C10012713_1",e.C10012713_2="C10012713_2",e.C10012713_3="C10012713_3",e.C10012713_4="C10012713_4",e.C10012713_5="C10012713_5",e.C10012713_6="C10012713_6",e.C10012713_7="C10012713_7",e.C10012717_1K="C10012717_1K",e.C10012717_2K="C10012717_2K",e.C10012717_3K="C10012717_3K",e.C10012717_4K="C10012717_4K",e.C10012717_5K="C10012717_5K",e.C10012717_6K="C10012717_6K",e.C10012717_7K="C10012717_7K",e.C10012717_1="C10012717_1",e.C10012717_2="C10012717_2",e.C10012717_3="C10012717_3",e.C10012717_4="C10012717_4",e.C10012717_5="C10012717_5",e.C10012717_6="C10012717_6",e.C10012717_7="C10012717_7",e.C10006995K="C10006995K",e.C10006995_1K="C10006995_1K",e.C10006995_2K="C10006995_2K",e.C10006995_3K="C10006995_3K",e.C10006995_4K="C10006995_4K",e.C10006995_5K="C10006995_5K",e.C10006995_6K="C10006995_6K",e.C10006995_7K="C10006995_7K",e.C10006995="C10006995",e.C10006995_1="C10006995_1",e.C10006995_2="C10006995_2",e.C10006995_3="C10006995_3",e.C10006995_4="C10006995_4",e.C10006995_5="C10006995_5",e.C10006995_6="C10006995_6",e.C10006995_7="C10006995_7",e.C10010951K="C10010951K",e.C10010951_1K="C10010951_1K",e.C10010951_2K="C10010951_2K",e.C10010951_3K="C10010951_3K",e.C10010951_4K="C10010951_4K",e.C10010951_5K="C10010951_5K",e.C10010951_6K="C10010951_6K",e.C10010951_7K="C10010951_7K",e.C10010951="C10010951",e.C10010951_1="C10010951_1",e.C10010951_2="C10010951_2",e.C10010951_3="C10010951_3",e.C10010951_4="C10010951_4",e.C10010951_5="C10010951_5",e.C10010951_6="C10010951_6",e.C10010951_7="C10010951_7",e.C10006999="C10006999",e.C10006999_1="C10006999_1",e.C10006999_2="C10006999_2",e.C10006999_3="C10006999_3",e.C10006999_4="C10006999_4",e.C10006999_5="C10006999_5",e.C10006999_6="C10006999_6",e.C10006999_7="C10006999_7",e.C10006999K="C10006999K",e.C10006999_1K="C10006999_1K",e.C10006999_2K="C10006999_2K",e.C10006999_3K="C10006999_3K",e.C10006999_4K="C10006999_4K",e.C10006999_5K="C10006999_5K",e.C10006999_6K="C10006999_6K",e.C10006999_7K="C10006999_7K",e.C10015355K="C10015355K",e.C10015355_1K="C10015355_1K",e.C10015355_2K="C10015355_2K",e.C10015355_3K="C10015355_3K",e.C10015355_4K="C10015355_4K",e.C10015355_5K="C10015355_5K",e.C10015355_6K="C10015355_6K",e.C10015355_7K="C10015355_7K",e.C10015355="C10015355",e.C10015355_1="C10015355_1",e.C10015355_2="C10015355_2",e.C10015355_3="C10015355_3",e.C10015355_4="C10015355_4",e.C10015355_5="C10015355_5",e.C10015355_6="C10015355_6",e.C10015355_7="C10015355_7"}(It||(It={})),function(e){e.Id="Id",e.InsertedAt="InsertedAt",e.PeriodEndAt="PeriodEndAt",e.WeezeventOrganizationId="WeezeventOrganizationId"}(vt||(vt={})),function(e){e.Excel="Excel",e.Csv="CSV"}(bt||(bt={})),function(e){e.Create="Create",e.Upsert="Upsert",e.Update="Update"}(jt||(jt={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Ct||(Ct={})),function(e){e.Add="Add",e.Delete="Delete",e.Replace="Replace"}(yt||(yt={})),function(e){e.BreakTime="BreakTime",e.CheckIn="CheckIn",e.CheckInOut="CheckInOut",e.CheckOut="CheckOut",e.Reset="Reset"}(At||(At={})),function(e){e.Done="Done",e.Waiting="Waiting"}(St||(St={})),function(e){e.Done="Done",e.Waiting="Waiting"}(kt||(kt={})),function(e){e.Accredited="Accredited",e.Everyone="Everyone",e.Members="Members",e.Refused="Refused",e.Segments="Segments"}(wt||(wt={})),function(e){e.Assigned="Assigned",e.Everyone="Everyone",e.Members="Members",e.Refused="Refused",e.Segments="Segments"}(Et||(Et={})),function(e){e.OnePerPage="OnePerPage",e.GroupedA4="GroupedA4"}(Tt||(Tt={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Rt||(Rt={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Ot||(Ot={})),function(e){e.Admin="Admin",e.DelegationsSpace="DelegationsSpace",e.Form="Form"}(Dt||(Dt={})),function(e){e.Done="Done",e.Waiting="Waiting"}(zt||(zt={})),function(e){e.Add="Add",e.Replace="Replace",e.Reset="Reset"}($t||($t={})),function(e){e.EndDate="EndDate",e.EndTime="EndTime",e.Resources="Resources",e.StartDate="StartDate",e.StartTime="StartTime"}(Pt||(Pt={})),function(e){e.Add="Add",e.Replace="Replace",e.Subtract="Subtract"}(Mt||(Mt={})),function(e){e.Delegation="Delegation",e.DelegationCategory="DelegationCategory",e.Event="Event",e.Organization="Organization",e.Position="Position",e.PositionCategory="PositionCategory"}(Ft||(Ft={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Nt||(Nt={})),function(e){e.Categories="Categories",e.Positions="Positions"}(Lt||(Lt={})),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"}(Bt||(Bt={})),function(e){e.Acronym="Acronym",e.Category="Category",e.Color="Color",e.Description="Description",e.Icon="Icon",e.Name="Name"}(Vt||(Vt={})),function(e){e.Accreditation="Accreditation",e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Date="Date",e.Id="Id",e.Name="Name"}(Ut||(Ut={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Index="Index",e.Name="Name"}(Wt||(Wt={})),function(e){e.A4Portrait="A4Portrait",e.A4Landscape="A4Landscape",e.A5Portrait="A5Portrait",e.A6Portrait="A6Portrait"}(Gt||(Gt={})),function(e){e.Category="Category",e.Label="Label",e.Name="Name",e.Privacy="Privacy"}(qt||(qt={})),function(e){e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(Ht||(Ht={})),function(e){e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.MaxResources="MaxResources",e.Name="Name"}(Kt||(Kt={})),function(e){e.Description="Description",e.EndAt="EndAt",e.Name="Name",e.StartAt="StartAt",e.Tag="Tag"}(Yt||(Yt={})),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"}(Zt||(Zt={})),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"}(Xt||(Xt={})),function(e){e.Acronym="Acronym",e.Address="Address",e.Category="Category",e.Color="Color",e.Description="Description",e.Icon="Icon",e.Latitude="Latitude",e.Layer="Layer",e.Longitude="Longitude",e.Name="Name",e.Tag="Tag",e.Traces="Traces",e.WeezeventIsSynchronized="WeezeventIsSynchronized",e.Zoom="Zoom"}(Jt||(Jt={})),function(e){e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(Qt||(Qt={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name",e.Position="Position",e.Range="Range"}(en||(en={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name",e.Slot="Slot"}(tn||(tn={})),function(e){e.CreatedAt="CreatedAt",e.Id="Id"}(nn||(nn={})),function(e){e.Female="Female",e.Male="Male",e.Nonbinary="Nonbinary",e.Notsay="Notsay",e.Other="Other"}(on||(on={})),function(e){e.Email="Email",e.FirstName="FirstName",e.Id="Id",e.InsertedAt="InsertedAt",e.LastName="LastName",e.LastSeenAt="LastSeenAt",e.LocalId="LocalId",e.Name="Name",e.UpdatedAt="UpdatedAt"}(sn||(sn={})),function(e){e.AccreditationState="AccreditationState",e.Delegation="Delegation",e.Email="Email",e.FirstName="FirstName",e.Id="Id",e.InsertedAt="InsertedAt",e.LastName="LastName",e.LocalId="LocalId",e.Name="Name",e.PairedAt="PairedAt",e.State="State",e.TeamCode="TeamCode",e.UpdatedAt="UpdatedAt"}(rn||(rn={})),function(e){e.Frequency="Frequency",e.Name="Name",e.State="State"}(an||(an={})),function(e){e.CreatedAt="CreatedAt",e.ExecutedAt="ExecutedAt",e.Id="Id",e.Name="Name",e.VolunteersSegment="VolunteersSegment"}(ln||(ln={})),Object.keys(Ft);const _n=Object.keys(xe),xn=Object.keys(Bt),In=(Object.keys(wt),Object.keys(Ct),Object.keys(Vt)),vn=(Object.keys(ft),Object.keys(Ut),Object.keys(Wt),Object.keys(We)),bn=Object.keys(Ce),jn=(Object.keys(Et),Object.keys(fe)),Cn=Object.keys(_e),yn=(Object.keys(pe),Object.keys(Ee),Object.keys(me)),An=Object.keys(ue),Sn=(Object.keys(It),Object.keys(lt)),kn=(Object.keys(At),Object.keys(Ie),Object.keys(Se)),wn=(Object.keys(Re),Object.keys(qt)),En=(Object.keys(De),Object.keys(Te)),Tn=Object.keys(Ke),Rn=(Object.keys(Ht),Object.keys(kt),Object.keys(Kt),Object.keys(rt)),On=(Object.keys(he),Object.keys(Tt)),Dn=(Object.keys(ut),Object.keys(_t),Object.keys(dt)),zn=(Object.keys(ge),Object.keys(ze)),$n=(Object.keys(Yt),Object.keys(St),Object.keys(se),Object.keys(oe)),Pn=(Object.keys(bt),Object.keys(Rt),Object.keys(Ae)),Mn=(Object.keys(pt),Object.keys(mt)),Fn=Object.keys(Oe),Nn=(Object.keys(Ot),Object.keys(gt)),Ln=(Object.keys(Zt),Object.keys(st),Object.keys(it)),Bn=(Object.keys(Dt),Object.keys(Je)),Vn=Object.keys(le),Un=Object.keys(jt),Wn=Object.keys(Pe),Gn=Object.keys(Xt),qn=Object.keys(ht),Hn=(Object.keys($e),Object.keys(de)),Kn=Object.keys(yt),Yn=Object.keys($t),Zn=Object.keys(Lt),Xn=(Object.keys(ke),Object.keys(vt),Object.keys(Gt),Object.keys(Jt)),Jn=(Object.keys(Qt),Object.keys(zt),Object.keys(Pt)),Qn=Object.keys(Mt),ei=(Object.keys(en),Object.keys(tn),Object.keys(at)),ti=(Object.keys(we),Object.keys(xt),Object.keys(nn),Object.keys(ot)),ni=Object.keys(et),ii=Object.keys(tt),oi=Object.keys(nt),si=Object.keys(Qe),ri=Object.keys(je),ai=(Object.keys(be),Object.keys(Me),Object.keys(on)),li=Object.keys(re),di=(Object.keys(ye),Object.keys(ae),Object.keys(Fe),Object.keys(ct)),ci=Object.keys(Ne),ui=(Object.keys(ce),Object.keys(Be)),mi=Object.keys(Le),hi=(Object.keys(Ve),Object.keys(Ue),Object.keys(sn),Object.keys(ve)),gi=(Object.keys(Nt),Object.keys(rn)),pi=Object.keys(He),fi=Object.keys(Ze),_i=Object.keys(Xe),xi=Object.keys(an),Ii=Object.keys(Ye),vi=(Object.keys(ln),Object.keys(Ge)),bi=Object.keys(qe),ji=["insertedAt","updatedAt","checkInAt","date","sentAt","scheduledAt","deletedAt","lockedAt","bouncedAt","complaintAt","deliveredAt","rejectedAt","openedAt","clickedAt","queuedAt","closedAt","periodEndAt","checkOutAt","validatedAt","receptionDate","startAt","termsAcceptedAt","lastSeenAt","registrationDate","pairedAt","executedAt"],Ci=["date","calendarInviteStartDate","calendarInviteEndDate","startDate","endDate","deadlineDate","minAccreditationSlotDate","startAt","endAt","paidAt"],yi=["range","ranges","activationRange"],Ai=["assignedDuration","duration"];let Si=class{language;translations;constructor(e,t){this.language=e,this.translations=t}translate(e,...t){if("production"!==a.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)(V.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)}};Si=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[String,Object])],Si);const ki=(0,V.createContext)({}),wi=ki.Consumer;function Ei(e){return(0,V.useContext)(ki).container.get(e)}function Ti(){const e=(0,V.useContext)(ki).container.get(Si);return e.translate.bind(e)}function Ri(){const e=(0,V.useContext)(ki).container.get(Si);return e.interpolateWithComponents.bind(e)}function Oi(e,t,n=[]){const i="production"!==a.Test?e:e.loc.source.body;return(0,V.useContext)(ki).useQuery(i,t,n)}function Di(e,t={}){return(0,V.useContext)(ki).useMutation(e,t)}function zi(){return(0,V.useContext)(ki).useParams()}function $i(){return(0,V.useContext)(ki).useHistory()}function Pi(){return(0,V.useContext)(ki).useLocation()}function Mi(){return(0,V.useContext)(ki).useLocalStorage()}const Fi=e=>{const t=zi(),n=$i();return(0,V.useEffect)(()=>{g(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",{})},Ni=(0,V.createContext)({user:null});function Li(){return(0,V.useContext)(Ni)}const Bi=e=>{const t=zi(),{user:n}=Li();return n&&e.shouldHaveUser||!n&&!e.shouldHaveUser?(0,i.jsx)(i.Fragment,{children:e.children}):(0,i.jsx)(Fi,{path:e.getRedirectPath(t),replace:!0})};function Vi(...e){console.log(...e)}const Ui=e=>e.join("/"),Wi=F.HEAVENT_APPLICATION_BASENAME,Gi={FIELDS:{PLURAL:"fields",SINGLE:"field"}},qi={AUTH:"auth",EDIT:"edit",CREATE:"create",EXPORT:"export",EXPORT_BASIC:"export/basic",EXPORT_API:"export/api",IMPORT:"import",INVITE:"invite"},Hi={INFORMATION:"information",DASHBOARD:"dashboard",REGISTRATION:"registration",DOCUMENTS:"documents",PROFILE:"profile",REPORTING:"reporting",FORMS:"forms",FORM:"form",MEMBER:"member",MEMBERS:"members",PREVIEW:"preview"},Ki=e=>Ui([e,qi.AUTH]),Yi=e=>Ui([e,qi.CREATE]),Zi=e=>Ui([e,qi.EDIT]),Xi={PLURAL:"/organizations",SINGLE:"/organization"},Ji="delegations",Qi={_BASE:"parameters",COMMON:{DESIGN:"design",INTEGRATION:"integration",EMAIL_TEMPLATES:"emails",SETTINGS:"settings"},EVENTS_SHOWCASE:{_BASE:"events-showcase"},MEMBERS_SPACE:{_BASE:"members-space"},DELEGATION_SPACE:{_BASE:"delegation-space"}},eo="blocked",to="expired",no={ORGANIZATIONS:Xi.PLURAL,ORGANIZATION:e=>Ui([Xi.SINGLE,e])},io={ORGANIZATIONS:no.ORGANIZATIONS,ORGANIZATION:({organizationId:e})=>no.ORGANIZATION(e),ORGANIZATION_SETTINGS:e=>Ui([io.ORGANIZATION(e),Qi._BASE]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE:e=>Ui([io.ORGANIZATION_SETTINGS(e),Qi.EVENTS_SHOWCASE._BASE]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN:e=>Ui([io.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),Qi.COMMON.DESIGN]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION:e=>Ui([io.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),Qi.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS:e=>Ui([io.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),Qi.COMMON.SETTINGS]),ORGANIZATION_SETTINGS_MEMBERS_SPACE:e=>Ui([io.ORGANIZATION_SETTINGS(e),Qi.MEMBERS_SPACE._BASE]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN:e=>Ui([io.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),Qi.COMMON.DESIGN]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION:e=>Ui([io.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),Qi.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES:e=>Ui([io.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),Qi.COMMON.EMAIL_TEMPLATES]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS:e=>Ui([io.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),Qi.COMMON.SETTINGS]),ORGANIZATION_SETTINGS_DELEGATION_SPACE:e=>Ui([io.ORGANIZATION_SETTINGS(e),Qi.DELEGATION_SPACE._BASE]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN:e=>Ui([io.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),Qi.COMMON.DESIGN]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION:e=>Ui([io.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),Qi.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES:e=>Ui([io.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),Qi.COMMON.EMAIL_TEMPLATES]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS:e=>Ui([io.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),Qi.COMMON.SETTINGS]),ORGANIZATION_DELEGATIONS:e=>Ui([io.ORGANIZATION(e),Ji]),IS_BLOCKED:e=>Ui([e,eo]),IS_EXPIRED:e=>Ui([e,to]),ORGANIZATION_FORM:e=>jo.FORM(e)},oo="dashboard",so="users",ro={COMMUNITY:e=>Ui([io.ORGANIZATION(e),"community"]),COMMUNITY_DASHBOARD:e=>Ui([ro.COMMUNITY(e),oo]),COMMUNITY_USERS:e=>Ui([ro.COMMUNITY(e),so])},ao={PLURAL:"forms",SINGLE:"form"},lo="elements",co="emails",uo="integration",mo="parameters",ho="preview",go="general",po="design",fo="availabilities",_o="missions",xo="accreditations",Io="broadcast",vo="state",bo={FORMS:ao.PLURAL,FORM:e=>Ui([ao.SINGLE,e])},jo={FORMS:({eventId:e,...t})=>Ui([e?So.EVENT({...t,eventId:e}):ro.COMMUNITY(t),bo.FORMS]),FORM:({formId:e,...t})=>Ui(["eventId"in t&&t.eventId?So.EVENT(t):ro.COMMUNITY(t),bo.FORM(e)]),CREATE:e=>Yi(jo.FORMS(e)),FORM_ELEMENTS:e=>Ui([jo.FORM(e),lo]),FORM_INTEGRATION:e=>Ui([jo.FORM(e),uo]),FORM_EMAILS:e=>Ui([jo.FORM(e),co]),FORM_PREVIEW:e=>Ui([jo.FORM(e),ho]),FORM_PARAMETERS:e=>Ui([jo.FORM(e),mo]),FORM_PARAMETERS_GENERAL:e=>Ui([jo.FORM_PARAMETERS(e),go]),FORM_PARAMETERS_DESIGN:e=>Ui([jo.FORM_PARAMETERS(e),po]),FORM_PARAMETERS_AVAILABILITIES:e=>Ui([jo.FORM_PARAMETERS(e),fo]),FORM_PARAMETERS_MISSIONS:e=>Ui([jo.FORM_PARAMETERS(e),_o]),FORM_PARAMETERS_ACCREDITATIONS:e=>Ui([jo.FORM_PARAMETERS(e),xo]),FORM_PARAMETERS_BROADCAST:e=>Ui([jo.FORM_PARAMETERS(e),Io]),FORM_PARAMETERS_STATE:e=>Ui([jo.FORM_PARAMETERS(e),vo])},Co={PLURAL:"events",SINGLE:"event"},yo={PLURAL:"teams",SINGLE:"team"},Ao={EVENTS:Co.PLURAL,EVENT:e=>Ui([Co.SINGLE,e]),TEAM:e=>Ui([yo.SINGLE,e])},So={EVENTS_IMPORT:e=>Ui([io.ORGANIZATION(e),Ao.EVENTS,qi.IMPORT]),EVENTS:e=>Ui([io.ORGANIZATION(e),Ao.EVENTS]),EVENT:({eventId:e,...t})=>Ui([io.ORGANIZATION(t),Ao.EVENT(e)]),EVENT_FORM:e=>Ui([jo.FORM(e)]),EVENT_TEAM_FORM:({teamCode:e,...t})=>Ui([So.EVENT_FORM(t),Ao.TEAM(e)])},ko={PLURAL:"accreditation-categories",SINGLE:"accreditation-category"},wo={PLURAL:"accreditations",SINGLE:"accreditation"},Eo={PLURAL:"slots",SINGLE:"slot"},To="dashboard",Ro="member",Oo="members",Do={ACCREDITATION_CATEGORIES:ko.PLURAL,ACCREDITATION_CATEGORY:e=>Ui([ko.SINGLE,e]),ACCREDITATIONS:wo.PLURAL,ACCREDITATION:e=>Ui([wo.SINGLE,e]),ACCREDITATION_SLOTS:Eo.PLURAL,ACCREDITATION_SLOT:e=>Ui([Eo.SINGLE,e])},zo={ACCREDITATION_CATEGORY:({accreditationCategoryId:e,...t})=>Ui([So.EVENT(t),Do.ACCREDITATION_CATEGORY(e)]),ACCREDITATION_CATEGORY_DASHBOARD:e=>Ui([zo.ACCREDITATION_CATEGORY(e),To]),ACCREDITATION_CATEGORY_MEMBERS:e=>Ui([zo.ACCREDITATION_CATEGORY(e),Oo])},$o={ACCREDITATIONS_IMPORT:e=>Ui([So.EVENT(e),Do.ACCREDITATIONS,qi.IMPORT]),ACCREDITATIONS:e=>Ui([So.EVENT(e),Do.ACCREDITATIONS]),ACCREDITATION:({accreditationId:e,...t})=>Ui([So.EVENT(t),Do.ACCREDITATION(e)]),ACCREDITATION_DASHBOARD:e=>Ui([$o.ACCREDITATION(e),To]),ACCREDITATION_MEMBERS:e=>Ui([$o.ACCREDITATION(e),Oo]),ACCREDITATION_MEMBER:({userInfoId:e,...t})=>Ui([$o.ACCREDITATION_MEMBERS(t),Ro,e]),ACCREDITATION_MEMBER_INFORMATION:e=>Ui([$o.ACCREDITATION_MEMBER(e),Hi.INFORMATION])},Po={ACCREDITATION_SLOT:({accreditationSlotId:e,...t})=>Ui([Mo.ACCREDITATION(t),Do.ACCREDITATION_SLOT(e)]),ACCREDITATION_SLOT_DASHBOARD:e=>Ui([Po.ACCREDITATION_SLOT(e),To]),ACCREDITATION_SLOT_MEMBERS:e=>Ui([Po.ACCREDITATION_SLOT(e),Oo])},Mo={...zo,...$o,...Po},Fo={PLURAL:"delegations-categories",SINGLE:"delegation-category"},No={PLURAL:"delegations",SINGLE:"delegation"},Lo="accreditations",Bo="availabilities",Vo="positions",Uo={DELEGATIONS_CATEGORIES:Fo.PLURAL,DELEGATION_CATEGORY:e=>Ui([Fo.SINGLE,e]),DELEGATIONS:No.PLURAL,DELEGATION:e=>Ui([No.SINGLE,e])},Wo={DELEGATION_CATEGORY:({delegationCategoryId:e,...t})=>Ui(["eventId"in t&&t.eventId?So.EVENT(t):ro.COMMUNITY(t),Uo.DELEGATION_CATEGORY(e)]),DELEGATION_CATEGORY_DASHBOARD:e=>Ui([Wo.DELEGATION_CATEGORY(e),Hi.DASHBOARD]),DELEGATION_CATEGORY_MEMBERS:e=>Ui([Wo.DELEGATION_CATEGORY(e),Hi.MEMBERS]),DELEGATION_CATEGORY_UPDATE:e=>Zi(Wo.DELEGATION_CATEGORY(e))},Go={DELEGATIONS:e=>Ui(["eventId"in e&&e.eventId?So.EVENT(e):ro.COMMUNITY(e),Uo.DELEGATIONS]),DELEGATION:({delegationId:e,...t})=>Ui(["eventId"in t&&t.eventId?So.EVENT(t):ro.COMMUNITY(t),Uo.DELEGATION(e)]),DELEGATION_DASHBOARD:e=>Ui([Go.DELEGATION(e),Hi.DASHBOARD]),DELEGATION_MEMBERS:e=>Ui([Go.DELEGATION(e),Hi.MEMBERS]),DELEGATION_ACCREDITATIONS:e=>Ui([Go.DELEGATION(e),Lo]),DELEGATION_REPORTING:e=>Ui([Go.DELEGATION(e),Hi.REPORTING]),DELEGATION_DOCUMENTS:e=>Ui([Go.DELEGATION(e),Hi.DOCUMENTS]),DELEGATION_TAB:e=>Ui([Go.DELEGATION(e),e.slug]),DELEGATION_MEMBERS_IMPORT:e=>Ui([Go.DELEGATION(e),qi.IMPORT]),DELEGATION_MEMBER:({userInfoId:e,slug:t,...n})=>Ui([g(t)?Go.DELEGATION_TAB({...n,slug:t}):Go.DELEGATION_MEMBERS(n),Hi.MEMBER,e]),DELEGATION_MEMBER_INFORMATION:e=>Ui([Go.DELEGATION_MEMBER(e),Hi.INFORMATION]),DELEGATION_MEMBER_ACCREDITATIONS:e=>Ui([Go.DELEGATION_MEMBER(e),Lo]),DELEGATION_MEMBER_AVAILABILITIES:e=>Ui([Go.DELEGATION_MEMBER(e),Bo]),DELEGATION_MEMBER_POSITIONS:e=>Ui([Go.DELEGATION_MEMBER(e),Vo]),MEMBERS_INVITE:e=>Ui([Go.DELEGATION(e),Hi.MEMBERS,qi.INVITE]),MEMBER_CREATE:({formId:e,...t})=>Yi(Ui([Go.DELEGATION(t),Hi.MEMBER,Hi.FORM,e])),MEMBER_EDIT:({formId:e,...t})=>Zi(Ui([Go.DELEGATION_MEMBER(t),Hi.FORM,e])),DELEGATION_PROFILE:e=>Ui([Go.DELEGATION(e),Hi.PROFILE]),FIELDS_EDIT:e=>Zi(Ui([Go.DELEGATION(e),Gi.FIELDS.PLURAL])),DELEGATION_FORM:({delegationId:e,...t})=>Ui([jo.FORM(t),Uo.DELEGATION(e)])},qo={...Wo,...Go},Ho={ITEMS:{POSITIONS_CATEGORIES:{PLURAL:"position-categories",SINGLE:"position-category"},POSITIONS:{PLURAL:"positions",SINGLE:"position"},POSITION_SLOTS:{PLURAL:"slots",SINGLE:"slot"}},ACTIONS:{IMPORT:{CSV:`${qi.IMPORT}/csv`}},SECTIONS:{PREASSIGNED_MEMBERS:"preassigned-members",PLANNING:"planning"}},Ko={POSITION_CATEGORIES:Ho.ITEMS.POSITIONS_CATEGORIES.PLURAL,POSITION_CATEGORY:e=>Ui([Ho.ITEMS.POSITIONS_CATEGORIES.SINGLE,e]),POSITIONS:Ho.ITEMS.POSITIONS.PLURAL,POSITION:e=>Ui([Ho.ITEMS.POSITIONS.SINGLE,e]),POSITION_SLOTS:Ho.ITEMS.POSITION_SLOTS.PLURAL,POSITION_SLOT:e=>Ui([Ho.ITEMS.POSITION_SLOTS.SINGLE,e])},Yo={POSITION_CATEGORY:({positionCategoryId:e,...t})=>Ui([So.EVENT(t),Ko.POSITION_CATEGORY(e)]),POSITION_CATEGORY_DASHBOARD:e=>Ui([Yo.POSITION_CATEGORY(e),Hi.DASHBOARD]),POSITION_CATEGORY_MEMBERS:e=>Ui([Yo.POSITION_CATEGORY(e),Hi.MEMBERS]),POSITION_CATEGORY_PREASSIGNED_MEMBERS:e=>Ui([Yo.POSITION_CATEGORY(e),Ho.SECTIONS.PREASSIGNED_MEMBERS])},Zo={POSITIONS:e=>Ui([So.EVENT(e),Ko.POSITIONS]),POSITION:({positionId:e,positionCategoryId:t,...n})=>Ui(t?[Yo.POSITION_CATEGORY({positionCategoryId:t,...n}),Ko.POSITION(e)]:[So.EVENT(n),Ko.POSITION(e)]),POSITION_DASHBOARD:e=>Ui([Zo.POSITION(e),Hi.DASHBOARD]),POSITION_MEMBERS:e=>Ui([Zo.POSITION(e),Hi.MEMBERS]),POSITION_PREASSIGNED_MEMBERS:e=>Ui([Zo.POSITION(e),Ho.SECTIONS.PREASSIGNED_MEMBERS]),POSITION_PLANNING:e=>Ui([Zo.POSITION(e),Ho.SECTIONS.PLANNING]),POSITION_MEMBER:({userInfoId:e,...t})=>Ui([Zo.POSITION_MEMBERS(t),Hi.MEMBER,e]),POSITION_MEMBER_INFORMATION:e=>Ui([Zo.POSITION_MEMBER(e),Hi.INFORMATION]),POSITION_IMPORT_CSV:e=>Ui([So.EVENT(e),Ho.ACTIONS.IMPORT.CSV])},Xo={POSITION_SLOTS:e=>Ui([Zo.POSITION(e),Ko.POSITION_SLOTS]),POSITION_SLOT:({positionSlotId:e,...t})=>Ui([Zo.POSITION(t),Ko.POSITION_SLOT(e)])},Jo={...Yo,...Zo,...Xo},Qo="/auth",es=`${Qo}/sign-in`,ts=`${Qo}/sign-up`,ns="/backoffice",is=e=>`${io.ORGANIZATION({organizationId:e})}/parameters`,os=(e,t,n,i)=>`${Jo.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/check-members`,ss=(e,t,n,i)=>`${Jo.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/members`,rs=(e,t)=>`${So.EVENT({organizationId:e,eventId:t})}/volunteers`,as=(e,t)=>`${rs(e,t)}/search`,ls=(e,t,n)=>`${as(e,t)}/volunteer/${n}`,ds=(e,t,n)=>`${rs(e,t)}/${n}`,cs=(e,t,n,i)=>`${ds(e,t,n)}/volunteer/${i}`,us=(e,t,n,i)=>`${ds(e,t,n)}/volunteer-panel/${i}`,ms=(e,t)=>`${So.EVENT({organizationId:e,eventId:t})}/emails`,hs=(e,t)=>`${So.EVENT({organizationId:e,eventId:t})}/documents`,gs=(e,t)=>`${So.EVENT({organizationId:e,eventId:t})}/options`,ps=(e,t)=>`${So.EVENT({organizationId:e,eventId:t})}/dashboard`,fs={HOME:`/${Wi}`,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}`,USER_EVENT_UNREGISTER:(e,t,n)=>`/organization/${e}/user/${t}/event/${n}/unregister`,USER_CHECK_IN:(e,t)=>`/organization/${e}/user/${t}/check-in`,USER_CHECK_OUT:(e,t)=>`/organization/${e}/user/${t}/check-out`,AUTH:Qo,AUTH_FORGOT_PASSWORD:`${Qo}/forgot-password`,AUTH_SIGN_IN:es,AUTH_SIGN_UP:ts,AUTH_SIGN_IN_EMAIL:`${es}/email`,AUTH_SIGN_IN_CODE:`${es}/code`,AUTH_SIGN_UP_CREDENTIALS:`${ts}/credentials`,AUTH_SIGN_UP_CODE:`${ts}/code`,COGNITO_CALLBACK:"/cognito-callback",MAGIC_LINK:(e,t)=>`/magic-link/${e}/${t}`,ACCEPT_TERMS_AND_CONDITIONS:e=>`${io.ORGANIZATION({organizationId:e})}/accept-terms-and-conditions`,BACKOFFICE:ns,BACKOFFICE_ORGANIZATIONS:`${ns}/organizations`,EDIT_BACKOFFICE_ORGANIZATION:e=>`${ns}/organization/${e}/edit`,BACKOFFICE_INVOICES:`${ns}/invoices`,ORGANIZATION_PARAMETERS:is,ORGANIZATION_PARAMETERS_PROFILE:e=>`${is(e)}/profile`,ORGANIZATION_PARAMETERS_INFOS:e=>`${is(e)}/general`,ORGANIZATION_PARAMETERS_TEAM:e=>`${is(e)}/team`,ORGANIZATION_PARAMETERS_GROUPS:e=>`${is(e)}/groups`,CREATE_ORGANIZATION_PARAMETERS_GROUP:e=>`${is(e)}/groups/create`,EDIT_ORGANIZATION_PARAMETERS_GROUP:(e,t)=>`${is(e)}/groups/group/${t}/edit`,ORGANIZATION_PARAMETERS_ROLES:e=>`${is(e)}/roles`,CREATE_ORGANIZATION_PARAMETERS_ROLE:e=>`${is(e)}/roles/create`,EDIT_ORGANIZATION_PARAMETERS_ROLE:(e,t)=>`${is(e)}/roles/role/${t}/edit`,ORGANIZATION_PARAMETERS_EMAILS:e=>`${is(e)}/emails`,CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS:e=>`${is(e)}/emails/senders/create`,EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS:(e,t)=>`${is(e)}/emails/senders/${t}/edit`,ORGANIZATION_PARAMETERS_EMAILS_SENDERS:e=>`${is(e)}/emails/senders`,ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW:(e,t)=>`${is(e)}/emails/senders/${t}/preview`,ORGANIZATION_PARAMETERS_EMAILS_DNS:e=>`${is(e)}/emails/dns`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE:e=>`${is(e)}/delegations-space`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_DESIGN:e=>`${is(e)}/delegations-space/design`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_INTEGRATION:e=>`${is(e)}/delegations-space/integration`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_EMAILS:e=>`${is(e)}/delegations-space/emails`,ORGANIZATION_PARAMETERS_CATEGORIES:e=>`${is(e)}/categories`,ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS:e=>`${is(e)}/categories/custom-fields`,ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS:e=>`${is(e)}/categories/positions`,ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS:e=>`${is(e)}/categories/accreditations`,ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS_PROFILES:e=>`${is(e)}/categories/accreditation-profiles`,ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS:e=>`${is(e)}/categories/delegations`,ORGANIZATION_PARAMETERS_TAGS:e=>`${is(e)}/tags`,ORGANIZATION_PARAMETERS_TRANSLATIONS:e=>`${is(e)}/translations`,ORGANIZATION_PARAMETERS_INVOICES:e=>`${is(e)}/invoices`,ORGANIZATION_PARAMETERS_ACTIVITY:e=>`${is(e)}/activity`,ORGANIZATION_PARAMETERS_SKIDATA:e=>`${is(e)}/skidata`,ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH:e=>`${is(e)}/organization-switch`,ORGANIZATION_PARAMETERS_DELETE_ACCOUNT:e=>`${is(e)}/delete-account`,COMMUNITY_USERS_SEGMENT:(e,t)=>`${io.ORGANIZATION({organizationId:e})}/community/users/${t}`,COMMUNITY_USERS_USER:(e,t,n)=>`${io.ORGANIZATION({organizationId:e})}/community/users/${t}/user/${n}`,COMMUNITY_USERS_USER_INFORMATIONS:(e,t,n)=>`${io.ORGANIZATION({organizationId:e})}/community/users/${t}/user/${n}/${Hi.INFORMATION}`,COMMUNITY_USERS_DUPLICATES:e=>`${io.ORGANIZATION({organizationId:e})}/community/users-duplicates`,COMMUNITY_EDIT_USER:(e,t)=>`${io.ORGANIZATION({organizationId:e})}/community/user/${t}/edit`,COMMUNITY_EDIT_USER_FORM:(e,t,n)=>`${io.ORGANIZATION({organizationId:e})}/community/user/${t}/edit/form/${n}`,COMMUNITY_VOLUNTEERS_IMPORT:e=>`${io.ORGANIZATION({organizationId:e})}/community/import`,COMMUNITY_FILES_IMPORT:e=>`${io.ORGANIZATION({organizationId:e})}/community/documents-import`,COMMUNITY_DELEGATIONS:e=>`${io.ORGANIZATION({organizationId:e})}/community/delegations`,COMMUNITY_DELEGATIONS_SEGMENT:(e,t)=>`${io.ORGANIZATION({organizationId:e})}/community/delegations/${t}`,COMMUNITY_DELEGATION:(e,t)=>`${io.ORGANIZATION({organizationId:e})}/community/delegation/${t}`,COMMUNITY_CREATE_DELEGATION(e,t){let n=`${io.ORGANIZATION({organizationId:e})}/community/create-delegation`;return t&&(n=`${n}/${t}`),n},COMMUNITY_EDIT_DELEGATION:(e,t)=>`${io.ORGANIZATION({organizationId:e})}/community/delegation/${t}/edit`,CREATE_EVENT_WITH_ORGANIZATION(e){let t="/create-event";return e&&(t=`${t}/${e}`),t},CREATE_EVENT:e=>`${io.ORGANIZATION({organizationId:e})}/create-event`,EVENTS_SEGMENT:(e,t)=>`${io.ORGANIZATION({organizationId:e})}/events/${t}`,EVENT_DELEGATIONS_IMPORT:(e,t)=>`${So.EVENT({organizationId:e,eventId:t})}/delegations-import`,EVENT_VOLUNTEERS_IMPORT:(e,t)=>`${So.EVENT({organizationId:e,eventId:t})}/members-import`,EVENT_FILES_IMPORT:(e,t)=>`${So.EVENT({organizationId:e,eventId:t})}/documents-import`,EDIT_EVENT:(e,t)=>`${So.EVENT({organizationId:e,eventId:t})}/edit`,DASHBOARD:ps,DASHBOARD_EVENT_SWITCH:(e,t)=>`${ps(e,t)}/event-switch`,POSITION_MEMBERS_USER:(e,t,n,i,o)=>`${Jo.POSITION_MEMBERS({organizationId:e,eventId:t,positionCategoryId:n,positionId:i})}/${o}`,POSITION_MEMBERS_USER_INFORMATIONS:(e,t,n,i,o)=>`${Jo.POSITION_MEMBERS({organizationId:e,eventId:t,positionCategoryId:n,positionId:i})}/${o}/${Hi.INFORMATION}`,EXPORT_POSITIONS_MAP:(e,t)=>`/export/event/${e}/positions/${t}/map`,POSITIONS_SEARCH:(e,t)=>`${Jo.POSITIONS({organizationId:e,eventId:t})}/search`,POSITIONS_SEGMENT:(e,t,n)=>`${Jo.POSITIONS({organizationId:e,eventId:t})}/${n}`,CREATE_POSITION(e,t,n){let i=`${So.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)=>`${Jo.POSITION({organizationId:e,eventId:t,positionId:n})}/settings`,EDIT_POSITION:(e,t,n)=>`${Jo.POSITION({organizationId:e,eventId:t,positionId:n})}/edit`,POSITION_SLOT_ASSIGN_VOLUNTEERS:(e,t,n,i)=>`${Jo.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/assign-volunteers`,POSITION_SLOT_MEMBERS:ss,POSITION_SLOT_MEMBERS_USER:(e,t,n,i,o)=>`${ss(e,t,n,i)}/${o}`,POSITION_SLOT_MEMBERS_USER_INFORMATIONS:(e,t,n,i,o)=>`${ss(e,t,n,i)}/${o}/${Hi.INFORMATION}`,POSITION_SLOT_MEMBERS_CHECK_OPTIONS:(e,t,n,i)=>`${ss(e,t,n,i)}/check-options`,POSITION_SLOT_CHECK_MEMBERS_CHECK_IN:(e,t,n,i)=>`${os(e,t,n,i)}/check-in`,POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT:(e,t,n,i)=>`${os(e,t,n,i)}/check-out`,POSITION_SLOT_CHECK_MEMBERS_RESET:(e,t,n,i)=>`${os(e,t,n,i)}/reset`,VOLUNTEERS:rs,VOLUNTEERS_SEARCH:as,VOLUNTEERS_SEARCH_USER:ls,VOLUNTEERS_SEARCH_USER_INFORMATIONS:(e,t,n)=>`${ls(e,t,n)}/${Hi.INFORMATION}`,VOLUNTEERS_SEGMENT:(e,t,n)=>`${rs(e,t)}/${n}`,VOLUNTEERS_LIST_USER:cs,VOLUNTEERS_LIST_USER_INFORMATIONS:(e,t,n,i)=>`${cs(e,t,n,i)}/${Hi.INFORMATION}`,VOLUNTEERS_LIST_USER_PANEL:us,VOLUNTEERS_LIST_USER_PANEL_ACCREDITATIONS:(e,t,n,i)=>`${us(e,t,n,i)}/accreditations`,VOLUNTEERS_LIST_USER_PANEL_AVAILABILITIES:(e,t,n,i)=>`${us(e,t,n,i)}/availabilities`,VOLUNTEERS_LIST_USER_PANEL_POSITIONS:(e,t,n,i)=>`${us(e,t,n,i)}/positions`,VOLUNTEERS_LIST_USER_PANEL_TEAM:(e,t,n,i,o)=>`${us(e,t,n,i)}/team/${o}`,EDIT_USER:(e,t,n)=>`${So.EVENT({organizationId:e,eventId:t})}/user/${n}/edit`,EDIT_USER_FORM:(e,t,n,i)=>`${So.EVENT({organizationId:e,eventId:t})}/user/${n}/edit/form/${i}`,EDIT_USER_MISSIONS:(e,t,n)=>`${So.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-missions`,EDIT_USER_MISSIONS_FORM:(e,t,n,i)=>`${So.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-missions/form/${i}`,EDIT_USER_SLOTS:(e,t,n)=>`${So.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-slots`,EDIT_USER_SLOTS_FORM:(e,t,n,i)=>`${So.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-slots/form/${i}`,EDIT_USER_ACCREDITATIONS:(e,t,n)=>`${So.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-accreditations`,EDIT_USER_ACCREDITATIONS_FORM:(e,t,n,i)=>`${So.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-accreditations/form/${i}`,ASSIGNMENTS:(e,t)=>`${So.EVENT({organizationId:e,eventId:t})}/assignments`,ASSIGNMENT:(e,t,n)=>`${So.EVENT({organizationId:e,eventId:t})}/assignment/${n}`,EDIT_ASSIGNMENT:(e,t,n)=>`${So.EVENT({organizationId:e,eventId:t})}/edit-assignment/${n}`,TEAM_ASSIGNMENT:(e,t,n)=>`${So.EVENT({organizationId:e,eventId:t})}/team-assignment/${n}`,PRE_ASSIGNMENT:(e,t,n)=>`${So.EVENT({organizationId:e,eventId:t})}/pre-assignment/${n}`,ACCREDITATIONS_ASSIGNMENTS:(e,t)=>`${So.EVENT({organizationId:e,eventId:t})}/accreditations-assignments`,ACCREDIT:(e,t,n)=>`${So.EVENT({organizationId:e,eventId:t})}/accredit/${n}`,EDIT_ACCREDIT:(e,t,n)=>`${So.EVENT({organizationId:e,eventId:t})}/edit-accredit/${n}`,EVENT_EMAILS:ms,EVENT_EMAILS_PARAMETERS:(e,t)=>`${ms(e,t)}/parameters`,CREATE_CUSTOM_DOCUMENT:(e,t)=>`${hs(e,t)}/create`,EDIT_CUSTOM_DOCUMENT:(e,t,n)=>`${So.EVENT({organizationId:e,eventId:t})}/custom-document/${n}/edit`,DOCUMENTS:hs,DOCUMENTS_USER_PLANNING:(e,t,n)=>`${hs(e,t)}/user-planning/${n}`,DOCUMENTS_USER_PLANNING_LIST:(e,t,n)=>`${hs(e,t)}/user-planning-list/${n}`,DOCUMENTS_USER_PLANNING_DAYS:(e,t,n)=>`${hs(e,t)}/user-planning-days/${n}`,DOCUMENTS_ASSIGNMENTS:(e,t,n)=>`${hs(e,t)}/assignments/${n}`,DOCUMENTS_VOLUNTEERS_LISTING:(e,t,n)=>`${hs(e,t)}/volunteers-listing/${n}`,DOCUMENTS_BADGE:(e,t,n,i)=>`${hs(e,t)}/user/${n}/badge/${i}`,DOCUMENTS_CERTIFICATE:(e,t,n)=>`${hs(e,t)}/user/${n}/certificate`,DOCUMENTS_ASO_PAX_MANIFEST:(e,t,n)=>`${hs(e,t)}/aso-pax-manifest/${n}`,DOCUMENTS_DELEGATION_CALENDAR:(e,t,n)=>`${hs(e,t)}/delegation/${n}/calendar`,DOCUMENTS_HOURS:(e,t,n)=>`${hs(e,t)}/user/${n}/hours`,DOCUMENTS_POSITION_PLANNING:(e,t,n)=>`${hs(e,t)}/position-planning/${n}`,DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING:(e,t,n)=>`${hs(e,t)}/positions-volunteers-planning/${n}`,DOCUMENTS_POSITION:(e,t,n)=>`${hs(e,t)}/position/${n}`,DOCUMENTS_PLANNING:(e,t,n)=>`${hs(e,t)}/planning/${n}`,DOCUMENTS_USER_CUSTOM_DOCUMENT:(e,t,n,i)=>`${hs(e,t)}/user/${n}/custom-document/${i}`,DOCUMENTS_USERS_PICTURES:(e,t,n)=>`${hs(e,t)}/users-pictures/${n}`,OPTIONS:gs,OPTIONS_API:(e,t)=>`${gs(e,t)}/api`,OPTIONS_WEEZEVENT_V2:(e,t)=>`${gs(e,t)}/weezevent-v2`,ACCREDITATIONS_SEGMENT:(e,t,n)=>`${Mo.ACCREDITATIONS({organizationId:e,eventId:t})}/${n}`,CREATE_ACCREDITATION(e,t,n){let i=`${So.EVENT({organizationId:e,eventId:t})}/create-accreditation`;return n&&(i=`${i}/${n}`),i},EDIT_ACCREDITATION:(e,t,n)=>`${Mo.ACCREDITATION({organizationId:e,eventId:t,accreditationId:n})}/edit`,ACCREDITATION_MAP:(e,t)=>`/accreditation/${e}-${t}/map`,DELEGATIONS_SEGMENT:(e,t,n)=>`${qo.DELEGATIONS({organizationId:e,eventId:t})}/${n}`,CREATE_DELEGATION(e,t,n){let i=`${So.EVENT({organizationId:e,eventId:t})}/create-delegation`;return n&&(i=`${i}/${n}`),i},EDIT_DELEGATION:(e,t,n)=>`${qo.DELEGATION({organizationId:e,eventId:t,delegationId:n})}/edit`},_s=(e,t)=>`/volunteers/${e}-${t}`,xs=(e,t)=>`${_s(e,t)}/assignments`,Is=(e,t)=>`${_s(e,t)}/register`,vs=xs;var bs=n(1343);const js={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 id\n name\n }\n\n accreditation {\n id\n eventId\n name\n acronym\n description\n icon\n color\n address\n latitude\n longitude\n fields\n }\n\n accreditationSlot {\n id\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:[]},AccreditationProfileFragment:{code:"fragment AccreditationProfile on AccreditationsProfile {\n id\n accreditationProfileCategoryId\n name\n description\n acronym\n color\n icon\n\n accreditationProfileCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationProfileEmailFragment:{code:"fragment AccreditationProfileEmail on AccreditationsProfile {\n id\n name\n\n accreditationProfileCategory {\n name\n }\n}\n",fragments:[]},AccreditationProfileImportFragment:{code:"fragment AccreditationProfileImport on AccreditationsProfile {\n id\n name\n\n accreditationProfileCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationProfileMatrixFragment:{code:"fragment AccreditationProfileMatrix on AccreditationsProfile {\n id\n name\n color\n assignedResources\n\n accreditationProfileCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationProfileVolunteerRegistrationFragment:{code:"fragment AccreditationProfileVolunteerRegistration on AccreditationsProfile {\n id\n name\n acronym\n color\n icon\n\n accreditationProfileCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationSlotMatrixFragment:{code:"fragment AccreditationSlotMatrix on AccreditationsSlot {\n id\n name\n date\n assignedResources\n maxResources\n isBlocked\n\n accreditation {\n id\n accreditationCategoryName\n accreditationDisplay\n acronym\n color\n index\n name\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationSlotStatsFragment:{code:"fragment AccreditationSlotStats on AccreditationsSlot {\n assignedResources\n maxResources\n scannedResources\n wishedResources\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 fields\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationsAccreditationFragment:{code:"fragment AccreditationsAccreditation on Accreditation {\n id\n accreditationCategoryId\n index\n name\n description @include(if: $includeDescription)\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 hasDateSlots\n insertedAt\n numberOfSlots\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 accreditationCategoryId\n accreditationId\n name\n date\n assignedResources\n fillingRate\n insertedAt\n isHidden\n maxResources\n resourcesByFields(slugs: $customFieldsSlugs) @include(if: $includeResources)\n scannedResources @include(if: $includeResources)\n weezeventChecklistId\n wishedResources @include(if: $includeResources)\n\n accreditation {\n ...AccreditationsAccreditation\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:["AccreditationsAccreditationFragment"]},AccreditationsProfilesProfileFragment:{code:"fragment AccreditationsProfilesProfile on AccreditationsProfile {\n id\n name\n description @include(if: $includeDescription)\n acronym\n color\n icon\n insertedAt\n\n accreditationsSlots @include(if: $includeAccreditations) {\n ...AccreditationSlotVolunteerRegistration\n }\n\n accreditationProfileCategory {\n id\n name\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n}\n",fragments:["AccreditationSlotVolunteerRegistrationFragment"]},AccreditationsSlotFragment:{code:"fragment AccreditationsSlot on AccreditationsSlot {\n id\n accreditationCategoryId\n accreditationId\n eventId\n name\n date\n assignedResources\n maxResources\n isBlocked\n isFull\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 timeDifferenceMinutes\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 includeDuplicateMembersAttachments\n hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\n scheduleType\n scheduleAnchor\n scheduleOffsetDays\n scheduleBeforeAfter\n scheduleSendTime\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 includeDuplicateMembersAttachments\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 id\n email\n\n userInfo(organizationId: $organizationId) {\n ...UserInfoNameAndPicture\n nameOrEmail\n }\n }\n}\n",fragments:["UserInfoNameAndPictureFragment"]},ConditionCustomFieldFragment:{code:"fragment ConditionCustomField on CustomField {\n id\n name\n slug\n fieldType\n canSelectMultiple\n\n values {\n id\n value\n }\n}\n",fragments:[]},ConditionsCustomFieldsFragment:{code:"fragment ConditionsCustomFields on Organization {\n conditionsCustomFields: customFields(\n eventId: $eventId\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:[]},CreateAccreditationProfileEventFragment:{code:"fragment CreateAccreditationProfileEvent on Event {\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n acronym\n accreditationDisplay\n index\n color\n icon\n hasSlots\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n }\n }\n\n accreditationsProfilesCategories {\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 eventId: $eventId\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 listType\n\n values {\n id\n value\n color\n }\n }\n }\n\n customFieldsCategories {\n nodes {\n id\n name\n }\n }\n}\n",fragments:[]},CreateDelegationEventFragment:{code:"fragment CreateDelegationEvent on Event {\n campaigns(states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n customDocuments {\n slug\n name\n }\n\n delegationsSpaceLayouts {\n id\n name\n }\n\n forms {\n nodes {\n ...CreateDelegationForm\n }\n }\n\n accreditationsProfilesCategories {\n id\n name\n\n accreditationsProfiles {\n id\n name\n color\n icon\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 isWeezeventConnected\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(isValidToSendEmail: true) {\n id\n name\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n\n groups {\n nodes {\n id\n name\n }\n }\n}\n",fragments:["AttachCustomFieldFragment"]},CreateUpdateMemberFormFragment:{code:"fragment CreateUpdateMemberForm on Form {\n id\n name\n isEditableInMemberSpace\n description\n positionTitle\n positionSubtitle\n accreditationTitle\n accreditationSubtitle\n informationTitle\n registerButtonText\n\n ...FormSlotsOptions\n ...FormMissionsOptions\n ...FormAccreditationsOptions\n\n elements {\n ...FormElementDisplay\n }\n\n customSlotsPeriods {\n ...FormRegisterCustomSlotPeriod\n }\n}\n",fragments:["FormSlotsOptionsFragment","FormMissionsOptionsFragment","FormAccreditationsOptionsFragment","FormElementDisplayFragment","FormRegisterCustomSlotPeriodFragment"]},CreatedByFragment:{code:"fragment CreatedBy on UsersInfo {\n ...UserInfoContactInformation\n}\n",fragments:["UserInfoContactInformationFragment"]},CustomBadgeVolunteerRegistrationFragment:{code:"fragment CustomBadgeVolunteerRegistration on VolunteersRegistration {\n localId\n state\n isLeader\n utid\n ticketId\n weezevent\n segmentsIds(usedInCustomDocument: true)\n\n userInfo {\n id\n localId\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 accreditationProfile {\n ...AccreditationProfileEmail\n }\n\n delegation {\n ...DelegationEmail\n }\n\n accreditationsUsersInfos {\n ...AccreditationEmail\n }\n\n positionsSlotsUsersInfos {\n ...AssigmentEmail\n }\n}\n",fragments:["UserInfoLinksFragment","AccreditationProfileEmailFragment","DelegationEmailFragment","AccreditationEmailFragment","AssigmentEmailFragment"]},CustomDocumentPopulationFragment:{code:"fragment CustomDocumentPopulation on CustomDocument {\n id\n slug\n name\n populationsIds\n shouldRegenerateTicketIdOnDownload\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 isEncrypted\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 ...CreatedBy\n }\n\n values {\n id\n value\n }\n}\n",fragments:["CreatedByFragment"]},CustomFieldImportFragment:{code:"fragment CustomFieldImport on CustomField {\n id\n name\n slug\n fieldType\n fieldSubtype\n listType\n fileType\n fieldProperty\n canSelectMultiple\n validationRules\n\n category {\n id\n name\n }\n\n values {\n id\n value\n color\n }\n}\n",fragments:[]},CustomFieldWithConditionFragment:{code:"fragment CustomFieldWithCondition on CustomField {\n id\n name\n label\n description\n fieldType\n fieldSubtype\n listType\n fileType\n fieldProperty\n isPrivate\n hasCondition\n conditionValue\n canSelectMultiple\n slug\n isSelectV2\n canBeUpdatedByUrl\n validationRules\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 color\n }\n}\n",fragments:[]},DelegationAccreditationProfileFragment:{code:"fragment DelegationAccreditationProfile on DelegationAccreditationProfile {\n accreditationProfileId\n assignedResources\n isFull\n maxResources\n}\n",fragments:[]},DelegationAccreditationProfileStatsFragment:{code:"fragment DelegationAccreditationProfileStats on DelegationAccreditationProfile {\n accreditationProfileId\n assignedResources\n maxResources\n wishedResources\n}\n",fragments:[]},DelegationAccreditationSlotFragment:{code:"fragment DelegationAccreditationSlot on DelegationAccreditationSlot {\n accreditationCategoryId\n accreditationId\n accreditationSlotId\n isDefault\n isFull\n isVisible\n assignedResources\n maxResources\n willAutoAccredit\n\n accreditationSlot {\n date\n isBlocked\n isFull\n }\n}\n",fragments:[]},DelegationAccreditationSlotStatsFragment:{code:"fragment DelegationAccreditationSlotStats on DelegationAccreditationSlot {\n accreditationCategoryId\n accreditationSlotId\n accreditationId\n assignedResources\n maxResources\n resourcesByFields\n scannedResources\n wishedResources\n}\n",fragments:[]},DelegationAccreditationsSlotsFragment:{code:"fragment DelegationAccreditationsSlots on Delegation {\n accreditationsProfiles {\n ...DelegationAccreditationProfile\n }\n\n accreditationsSlots {\n ...DelegationAccreditationSlot\n }\n}\n",fragments:["DelegationAccreditationProfileFragment","DelegationAccreditationSlotFragment"]},DelegationEmailFragment:{code:'fragment DelegationEmail on Delegation {\n id\n organizationId\n eventId\n formId\n name\n fields\n\n category: delegationCategory {\n id\n name\n }\n\n leaders {\n email\n name\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\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 description @include(if: $includeDescription)\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 canLeadersDuplicateMembers\n canLeadersEditColumns\n canLeadersEditCustomFields\n canLeadersImportMembers\n canLeadersSeeHiddenAccreditationsSlots\n showFormLinkInDelegationSpace\n showAllAccreditations\n lockedAt\n usedCustomFieldsFilled @include(if: $includeUsedCustomFieldsFilled)\n insertedAt\n\n accreditationsSlots @include(if: $includeAccreditations) {\n accreditationSlot {\n ...AccreditationSlotVolunteerRegistration\n }\n }\n\n accreditationsProfiles @include(if: $includeAccreditationsProfiles) {\n ...DelegationAccreditationProfileStats\n\n accreditationProfile {\n ...AccreditationProfileVolunteerRegistration\n }\n }\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 parent @include(if: $includeParent) {\n id\n name\n }\n\n customDocuments @include(if: $includeDocuments) {\n slug\n name\n }\n\n delegationCategory {\n id\n name\n\n leaders @include(if: $includeLeaders) {\n userInfo {\n id\n email\n name\n nameOrEmail\n }\n }\n }\n\n delegationsSpaceLayout @include(if: $includeLayout) {\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 allAccreditationsSlots @include(if: $includeAccreditationsSlots) {\n ...DelegationAccreditationSlotStats\n }\n}\n",fragments:["AccreditationSlotVolunteerRegistrationFragment","DelegationAccreditationProfileStatsFragment","AccreditationProfileVolunteerRegistrationFragment","DelegationAccreditationSlotStatsFragment"]},DelegationsSpaceLayoutTabFragment:{code:"fragment DelegationsSpaceLayoutTab on DelegationsSpaceLayoutsTab {\n id\n name\n description\n slug\n isVisible\n isPinned\n segmentType\n rendering\n infos\n}\n",fragments:[]},DesignColorsFragment:{code:"fragment DesignColors on Design {\n colors {\n grayCustom50\n grayCustom500\n grayCustom700\n grayCustom800\n grayCustom900\n primaryCustom500\n primaryCustom600\n }\n}\n",fragments:[]},DocumentAsoPaxManifestFragment:{code:"fragment DocumentAsoPaxManifest on Query {\n event(id: $eventId) {\n name\n\n accreditationSlot(id: $accreditationSlotId) {\n id\n name\n date\n maxResources\n\n accreditation {\n id\n name\n }\n\n links {\n asoPaxManifestLink\n }\n\n volunteersRegistrations {\n id\n\n userInfo {\n id\n fields(expand: true)\n }\n }\n }\n }\n}\n",fragments:[]},DocumentDelegationCalendarFragment:{code:"fragment DocumentDelegationCalendar on Event {\n startAt\n endAt\n\n document(documentType: DelegationCalendar) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n delegation(id: $delegationId) {\n ...DelegationEmail\n\n allAccreditationsSlots(onlyVisible: $onlyVisible) {\n assignedResources\n\n accreditationSlot {\n id\n date\n name\n }\n\n accreditation {\n name\n color\n index\n }\n }\n\n links {\n delegationCalendarLink\n }\n }\n}\n",fragments:["DelegationEmailFragment"]},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 startAt\n endAt\n dayStartTime\n\n document(documentType: PositionPlanning) {\n id\n options\n }\n\n position(id: $positionId) {\n name\n range\n color\n\n links {\n positionPlanningLink\n }\n\n slots {\n id\n name\n range\n }\n }\n\n volunteersRegistrations(positionId: $positionId, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n\n userInfo {\n name\n\n phone {\n internationalFormat\n }\n }\n\n positionsSlotsUsersInfos {\n positionSlotId\n }\n }\n }\n}\n',fragments:[]},DocumentPositionSheetFragment:{code:"fragment DocumentPositionSheet on Query {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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 links {\n positionSheetLink\n }\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 ...UserInfoContactInformation\n }\n\n positionsSlotsUsersInfos {\n positionSlotId\n }\n }\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},DocumentUserAssignmentsFragment:{code:"fragment DocumentUserAssignments on Query {\n organization(id: $organizationId) {\n id\n\n customFields(eventId: $eventId, 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 ...UserInfoContactInformation\n nameOrEmail\n language: fieldValue(slug: "language")\n\n links(eventId: $eventId) {\n userBadgeLink\n }\n }\n\n positionsSlotsUsersInfos {\n position {\n name\n }\n\n positionSlot {\n range\n }\n }\n }\n}\n',fragments:["UserInfoContactInformationFragment"]},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 fields\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(eventId: $eventId, 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 organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\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 ...UserInfoContactInformation\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n fields\n }\n }\n }\n }\n}\n',fragments:["CustomFieldWithConditionFragment","UserInfoContactInformationFragment"]},DocumentUsersPlanningFragment:{code:"fragment DocumentUsersPlanning on VolunteersRegistration {\n id\n state\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n\n positionsSlotsUsersInfos(positionId: $positionId) {\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:["UserInfoContactInformationFragment"]},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 hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\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:[]},EventCreateUpdateMemberFragment:{code:"fragment EventCreateUpdateMember on Event {\n startAt\n endAt\n dayStartTime\n ranges(formId: $formId, delegationId: $delegationId)\n country\n\n accreditationsCategories {\n ...FormRegisterAccreditationCategory\n }\n\n accreditationsProfilesCategories {\n ...FormRegisterAccreditationProfileCategory\n }\n\n positionsCategories {\n ...FormRegisterCategory\n }\n}\n",fragments:["FormRegisterAccreditationCategoryFragment","FormRegisterAccreditationProfileCategoryFragment","FormRegisterCategoryFragment"]},EventDelegationsExportFragment:{code:"fragment EventDelegationsExport on Event {\n languages\n\n segmentsFolders(segmentType: Delegations) {\n id\n name\n\n segments {\n id\n name\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 fields\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 description @include(if: $includeDescription)\n state\n startAt\n endAt\n fields\n insertedAt\n numberOfMembers @include(if: $includeNumberOfMembers)\n numberOfMembersAccredited @include(if: $includeNumberOfMembers)\n numberOfMembersAssigned @include(if: $includeNumberOfMembers)\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n tags {\n id\n name\n }\n}\n",fragments:[]},ExistingVolunteerFragment:{code:"fragment ExistingVolunteer on UsersInfo {\n id\n ...UserInfoContactInformation\n nameOrEmail\n}\n",fragments:["UserInfoContactInformationFragment"]},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 eventId\n name\n label\n fieldType\n listType\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 color\n }\n}\n",fragments:[]},FormCustomFieldsFragment:{code:"fragment FormCustomFields on Organization {\n formCustomFields: customFields(\n eventId: $eventId\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 hiddenPositionsTagsIds\n displayedPositionsCategoriesIds\n displayedPositionsIds\n displayedPositionsSlotsIds\n displayedPositionsTagsIds\n showPositionCategoryDescription\n showPositionDescription\n slotDisplay\n willAutoAssign\n}\n",fragments:[]},FormRegisterAccreditationFragment:{code:"fragment FormRegisterAccreditation on IAccreditation {\n id\n accreditationCategoryId\n name\n description\n color\n icon\n hiddenSlotId\n hasSlots\n accreditationDisplay\n conditionsOperator\n index\n\n slots(includeHidden: true) {\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"]},FormRegisterAccreditationProfileFragment:{code:"fragment FormRegisterAccreditationProfile on AccreditationsProfile{\n id\n name\n description\n color\n icon\n}\n",fragments:[]},FormRegisterAccreditationProfileCategoryFragment:{code:"fragment FormRegisterAccreditationProfileCategory on AccreditationsProfilesCategory {\n id\n name\n\n accreditationsProfiles {\n ...FormRegisterAccreditationProfile\n }\n}\n",fragments:["FormRegisterAccreditationProfileFragment"]},FormRegisterAccreditationSlotFragment:{code:"fragment FormRegisterAccreditationSlot on IAccreditationsSlot {\n id\n accreditationId\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 id\n name\n startDate\n endDate\n hideNameDates\n displayAsCalendar\n hasCondition\n conditionCustomFieldId\n conditionValue\n\n conditionCustomField {\n ...CustomFieldWithCondition\n }\n\n customSlots {\n ...FormRegisterCustomSlot\n }\n}\n",fragments:["CustomFieldWithConditionFragment","FormRegisterCustomSlotFragment"]},FormRegisterPositionFragment:{code:"fragment FormRegisterPosition on IPosition {\n id\n positionCategoryId\n name\n description\n acronym\n isVisible\n conditionsOperator\n tagsIds\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 positionId\n name\n range\n nameOrRange\n isFull\n}\n",fragments:[]},FormSlotsOptionsFragment:{code:"fragment FormSlotsOptions on Form {\n slotDisplay\n minNumberOfSlots\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 accreditationProfileId\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 positionCategory {\n name\n }\n }\n\n positions {\n id\n name\n range\n\n category {\n name\n }\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 ...UserInfoContactInformation\n nameOrEmail\n}\n",fragments:["UserInfoContactInformationFragment"]},MassEditCustomFieldFragment:{code:"fragment MassEditCustomField on CustomField {\n id\n name\n label\n slug\n fieldType\n fieldSubtype\n listType\n fileType\n fieldProperty\n canSelectMultiple\n validationRules\n\n category {\n id\n name\n }\n\n values {\n id\n value\n color\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 ...UserInfoContactInformation\n nameOrEmail\n fields\n}\n",fragments:["UserInfoContactInformationFragment"]},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(isValidToSendEmail: true) {\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(eventId: $eventId, 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: spaceDesign(spaceType: DelegationSpace) {\n ...DesignColors\n\n logo {\n url\n }\n\n banner {\n url\n }\n }\n}\n",fragments:["DesignColorsFragment"]},OrganizationEmailRendererFragment:{code:"fragment OrganizationEmailRenderer on Organization {\n id\n name\n dateFormat\n datetimeFormat\n timeZone\n customBadges\n}\n",fragments:[]},OrganizationEventsShowcaseFragment:{code:"fragment OrganizationEventsShowcase on OrganizationPublic {\n eventsShowcaseDesign: spaceDesign(spaceType: EventsShowcase) {\n ...DesignColors\n\n logo {\n url\n }\n\n banner {\n url\n }\n }\n}\n",fragments:["DesignColorsFragment"]},OrganizationMemberFragment:{code:"fragment OrganizationMember on VolunteersRegistration {\n id\n ticketId\n exportedCustomDocumentsSlugs @include(if: $includeCustomDocuments)\n\n delegation {\n name\n }\n\n event {\n id\n name\n }\n\n positionsSlotsUsersInfos{\n positionSlot {\n name\n range\n }\n\n position {\n name\n }\n }\n\n userInfo {\n id\n name\n email\n fields\n\n picture {\n url\n }\n }\n}\n",fragments:[]},OrganizationMemberCustomDocumentFragment:{code:"fragment OrganizationMemberCustomDocument on CustomDocument {\n id\n eventId\n slug\n name\n populationsIds\n shouldRegenerateTicketIdOnDownload\n}\n",fragments:[]},OrganizationMembersSpaceFragment:{code:"fragment OrganizationMembersSpace on Organization {\n name\n\n membersSpaceDesign: spaceDesign(spaceType: MembersSpace) {\n ...DesignColors\n\n logo {\n url\n }\n\n banner {\n url\n }\n }\n\n hideAssignmentsUntilConfirmationEmailSent\n hideAccreditationsUntilConfirmationEmailSent\n membersSpaceExcludeAccreditations\n showMembersSpaceCommunity\n}\n",fragments:["DesignColorsFragment"]},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 acronym\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 description @include(if: $includeDescription)\n range\n resources\n assignedResources\n address\n layer\n zoom\n latitude\n longitude\n acronym\n color\n icon\n isVisible\n state\n fillingRate\n numberOfSlots\n fields\n weezeventIsSynchronized\n insertedAt\n\n checkedInRate @include(if: $includeCheckedInRate)\n checkedOutRate @include(if: $includeCheckedOutRate)\n\n category {\n id\n name\n\n leaders @include(if: $includeLeaders) {\n userInfo {\n id\n name\n email\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 name\n email\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 traces @include(if: $includePositionTraces) {\n id\n name\n color\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 weezeventChecklistId\n insertedAt\n\n checkedInRate @include(if: $includeCheckedInRate)\n checkedOutRate @include(if: $includeCheckedOutRate)\n\n position {\n ...PositionsPosition\n }\n\n positionCategory {\n id\n name\n }\n}\n",fragments:["PositionsPositionFragment"]},PrintTriggersPrintTriggerFragment:{code:"fragment PrintTriggersPrintTrigger on PrintTrigger {\n id\n\n document {\n __typename\n ... on CustomDocument {\n name\n }\n ... on EventsDocument {\n documentType\n }\n ... on ZplDocument {\n name\n }\n }\n}\n",fragments:[]},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 fieldSubtype\n listType\n fileType\n fieldProperty\n canSelectMultiple\n isSelectV2\n isEncrypted\n validationRules\n\n category {\n id\n name\n }\n\n values {\n id\n value\n color\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:[]},SpaceDesignFragment:{code:"fragment SpaceDesign on Design {\n banner {\n acl\n name\n key\n }\n\n logo {\n acl\n name\n key\n }\n\n ...DesignColors\n}\n",fragments:["DesignColorsFragment"]},TraceFragment:{code:"fragment Trace on Trace {\n id\n name\n color\n points\n direction\n startAt\n firstRunnerPace\n lastRunnerPace\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 group {\n id\n name\n }\n\n role {\n id\n name\n type\n }\n }\n\n usersEvents(eventId: $eventId) {\n id\n\n group {\n id\n name\n }\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 group {\n id\n name\n }\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 group {\n id\n name\n }\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 group {\n id\n name\n }\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 localId\n name\n email\n nameOrEmail\n fields\n lastSeenAt\n insertedAt\n phone: fieldValue(slug: "phone")\n\n ...UserAllPermissions @include(if: $includeRoles)\n\n picture {\n url\n }\n\n comments @include(if: $includeComments) {\n content\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 emails(emailTypes: [Campaign], level: Organization) @include(if: $includeEmails) {\n id\n state\n\n campaign {\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"]},UserInfoContactInformationFragment:{code:"fragment UserInfoContactInformation on UsersInfo {\n ...UserInfoNameAndPicture\n email\n phone {\n internationalFormat\n }\n}\n",fragments:["UserInfoNameAndPictureFragment"]},UserInfoDocumentFragment:{code:'fragment UserInfoDocument on UsersInfo {\n id\n localId\n ...UserInfoContactInformation\n nameOrEmail\n language: fieldValue(slug: "language")\n fields(expand: true)\n registrationDate(eventId: $eventId)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n}\n',fragments:["UserInfoContactInformationFragment","UserInfoLinksFragment"]},UserInfoEmailRendererFragment:{code:"fragment UserInfoEmailRenderer on UsersInfo {\n id\n localId\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 localId\n email\n nameOrEmail\n fields\n registrationDate(eventId: $eventId)\n canAccess(formId: $formId)\n}\n",fragments:[]},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:[]},UserInfoNameAndPictureFragment:{code:"fragment UserInfoNameAndPicture on UsersInfo {\n name\n picture {\n url\n }\n}\n",fragments:[]},UserInfoOrganizationFragment:{code:"fragment UserInfoOrganization on UsersInfo {\n id\n userId\n name\n email\n nameOrEmail\n\n ...UserAllPermissions\n\n groups {\n id\n name\n }\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 ...UserInfoContactInformation\n}\n",fragments:["UserInfoContactInformationFragment"]},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 ...UserInfoContactInformation\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},UserInfoUpdateMemberFragment:{code:"fragment UserInfoUpdateMember on UsersInfo {\n id\n email\n name\n fields\n userId\n\n picture {\n url\n }\n\n formUserInfo(formId: $formId) {\n positionsCategoriesIds\n positionsIds\n positionsSlotsIds\n accreditationProfileId\n accreditationsSlotsIds\n\n slots {\n startDate\n startTime\n endDate\n endTime\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 form {\n ...CreateUpdateMemberForm\n }\n }\n\n volunteerRegistration(eventId: $eventId) {\n accreditationsUsersInfos {\n accreditationSlotId\n checkInAt\n }\n }\n}\n",fragments:["CreateUpdateMemberFormFragment"]},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 accreditationProfile {\n id\n name\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 accessLevel\n type\n permissions\n }\n\n usersDelegationsCategories(eventId: $eventId) {\n delegationCategoryId\n roleId\n }\n\n usersEvents(eventId: $eventId) {\n eventId\n roleId\n }\n\n usersPositionsCategories(eventId: $eventId) {\n positionCategoryId\n roleId\n }\n\n usersPositions(eventId: $eventId) {\n positionId\n roleId\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 positionSlotId\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 delegation {\n name\n }\n\n teams {\n teamCode\n }\n\n userInfo {\n id\n ...UserInfoContactInformation\n fields\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationFragment:{code:"fragment VolunteerRegistration on VolunteersRegistration {\n id\n localId\n ticketId\n ticketIdVersion\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 pairedAt\n volunteerMinutes @include(if: $includeVolunteerMinutes)\n weezeventPayUrl @include(if: $includeWeezeventUrls)\n weezeventTicketUrl @include(if: $includeWeezeventUrls)\n delegationBannerNumber @include(if: $includeDelegation)\n exportedCustomDocumentsSlugs @include(if: $includeCustomDocuments)\n accreditationProfileId\n wishedAccreditationProfileId @include(if: $includeAccreditationsMatrix)\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 email\n name\n nameOrEmail\n fields\n isEditable @include(if: $includeIsEditable)\n insertedAt\n\n picture @include(if: $includePicture) {\n url\n }\n\n ...UserAllPermissions @include(if: $includeRoles)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n\n comments @include(if: $includeComments) {\n content\n }\n\n emails(\n emailTypes: [Campaign]\n level: Event\n eventId: $eventId\n delegationId: $delegationId\n ) @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 accreditationProfile @include(if: $includeAccreditationProfile) {\n ...AccreditationProfileVolunteerRegistration\n }\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 accreditationProfile @include(if: $includeAccreditationProfile) {\n ...AccreditationProfileVolunteerRegistration\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 accreditationProfileId\n checkInAt\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 duplicatedFrom @include(if: $includeDuplicatedFrom) {\n userInfo {\n id\n email\n name\n\n picture {\n url\n }\n }\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","AccreditationProfileVolunteerRegistrationFragment","UserInfoTeamMemberFragment","AccreditationSlotVolunteerRegistrationFragment","UserPositionSlotUserInfoFragment"]},VolunteerRegistrationDelegationAccreditationProfileFragment:{code:"fragment VolunteerRegistrationDelegationAccreditationProfile on VolunteersRegistration {\n id\n accreditationProfileId\n wishedAccreditationProfileId\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},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 ...UserInfoContactInformation\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationEmailRendererFragment:{code:"fragment VolunteerRegistrationEmailRenderer on VolunteersRegistration {\n localId\n ticketId\n weezevent\n\n accreditationProfile {\n ...AccreditationProfileEmail\n }\n\n delegation {\n ...DelegationEmail\n }\n}\n",fragments:["AccreditationProfileEmailFragment","DelegationEmailFragment"]},VolunteerRegistrationWaitingAssignmentFragment:{code:"fragment VolunteerRegistrationWaitingAssignment on VolunteersRegistration {\n insertedAt\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationWeezeventFragment:{code:"fragment VolunteerRegistrationWeezevent on VolunteersRegistration {\n id\n localId\n state\n accreditationState\n ticketId\n weezevent\n\n accreditationProfile {\n name\n\n accreditationProfileCategory {\n name\n }\n }\n\n accreditationsUsersInfos {\n accreditationSlotId\n accreditationCategoryId\n\n accreditation {\n id\n name\n fields\n }\n }\n\n positionsSlotsUsersInfos {\n positionSlotId\n\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 localId\n ...UserInfoContactInformation\n fieldsExpanded: fields(expand: true)\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationZplRendererFragment:{code:"fragment VolunteerRegistrationZplRenderer on VolunteersRegistration {\n localId\n ticketId\n weezevent\n\n accreditationsUsersInfos {\n accreditation {\n id\n }\n accreditationSlot {\n id\n }\n }\n\n delegation {\n ...DelegationEmail\n }\n\n userInfo {\n id\n localId\n email\n fields\n registrationDate\n }\n}\n",fragments:["DelegationEmailFragment"]},WishesEmailFragment:{code:"fragment WishesEmail on FormsUsersInfo {\n form {\n slotDisplay\n }\n\n positionsCategories {\n name\n }\n\n positions {\n name\n }\n\n positionsSlots {\n name\n range\n\n position {\n name\n }\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 frequency\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 segment {\n id\n name\n segmentType\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 Cs(e){return e.flatMap(e=>[e.code].concat(Cs(e.fragments.map(e=>js[e]))))}function ys(e){return(0,bs.A)(Cs(e)).join(" ")}var As=n(8097);const Ss="yyyy-MM-dd",ks="yyyy-MM-dd'T'HH:mm",ws="yyyy-MM-dd'T'HH:mm:ss";function Es(e){const[t,n]=JSON.parse(e);return As.IX.fromDateTimes(As.c9.fromISO(t,{zone:"UTC"}),As.c9.fromISO(n,{zone:"UTC"}))}function Ts({startDate:e,startTime:t,endDate:n,endTime:i}){try{const[o,s]=t.split(":"),[r,a]=i.split(":");return As.IX.fromDateTimes(e.set({hour:parseInt(o,10),minute:parseInt(s,10)}),n.set({hour:parseInt(r,10),minute:parseInt(a,10)}))}catch{return As.IX.invalid("Invalid")}}function Rs(e){return As.IX.isInterval(e)?e:Ts(e)}function Os(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 Ds=(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(),zs={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 $s(e){return"string"==typeof e?As.c9.fromISO(e,{setZone:!0}):e}function Ps(){return As.c9.utc().toLocal().zoneName}function Ms(e){return"string"==typeof e&&e.startsWith("[")}function Fs(e){if(!0===Array.isArray(e))return e.map(e=>null!=e&&"object"==typeof e?Fs(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];Ci.includes(n)||ji.includes(n)?t[n]=i&&As.c9.fromISO(i,{zone:"UTC"}):yi.includes(n)?Array.isArray(i)?t[n]=i.map(e=>Ms(e)?Es(e):e):t[n]=Ms(i)?Es(i):i:Ai.includes(n)?t[n]=i&&As.dw.fromISO(i):t[n]=null!=i&&"object"==typeof i?Fs(i):i}),t}}const Ns=[];function Ls(e){return null==e?[]:Array.isArray(e)?e:[e]}function Bs(e){return Array.isArray(e)&&e.length>0}function Vs(e){return!Bs(e)}function Us(e,t,n){const i=new Set(e);return n?i.add(t):i.delete(t),Array.from(i)}function Ws(e,t){const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),Array.from(n)}function Gs(e,t,n){const i=[...e],[o]=i.splice(t,1);return i.splice(n,0,o),i}function qs(e,t){return e.filter((e,n)=>n!==t)}const Hs="0b29194d5abc5a98843cb72bcb5d188cb268afae\n".trim();var Ks=n(7405);const Ys="heaventRequestUuid";function Zs(e,t){return"object"==typeof e&&null!==e&&Object.defineProperty(e,Ys,{value:t}),e}const Xs="h-new-version";async function Js(e,t={}){let n=F.HEAVENT_API_URL.href;const i=new URL(location.href).searchParams,o=`${e} ${Bs(t.fragments)?ys(t.fragments):""}`,s=W(),r={"Content-Type":"application/json",[N]:Hs,[L]:s};i.has("lang")&&(n=`${n}?lang=${i.get("lang")}`),t.token&&(r[B]=t.token);const a=await fetch(n,{method:"post",headers:r,body:JSON.stringify({query:o,variables:t.variables||{}})});if(a.ok){t.reloadOnNewVersion&&"true"===a.headers.get("x-heavent-new-version")&&document.body.dispatchEvent(new CustomEvent(Xs,{bubbles:!0}));const e=await a.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 Zs(e.errors,s)}{const t=(0,Ks.A)(e.data),n={};return t.forEach(t=>{n[t]=Fs(e.data[t])}),n}}throw Zs(new Error(a.statusText),s)}function Qs(e,t,n){const i=Object.keys(t).sort().map(e=>{const n=t[e];return`"${e}":${JSON.stringify(n)}`}).join(",");return(0,V.useMemo)(()=>X().then(i=>Js(e,{variables:t,token:i||void 0,fragments:n})),[e,i])}const er="query CustomFieldsMassEditInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFieldsCategories {\n nodes {\n id\n name\n }\n }\n }\n}\n",tr="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(\n eventId: $eventId\n variety: Delegation\n sort: { attribute: Name, direction: Asc }\n ) {\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 delegationsSpaceLayouts {\n id\n name\n }\n }\n }\n}\n",nr='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',ir='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',or="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",sr="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 $includeComments: Boolean!\n $includeDelegations: Boolean!\n $includeEmails: 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",rr="query EventAccreditationsProfiles($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfilesCategories {\n id\n name\n\n accreditationsProfiles {\n id\n name\n color\n icon\n }\n }\n }\n}\n",ar="query EventAccreditationsSlots($eventId: EventId!, $loadIsBlocked: Boolean!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n acronym\n accreditationDisplay\n index\n\n slots(includeHidden: true) {\n id\n name\n date\n isBlocked @include(if: $loadIsBlocked)\n }\n }\n }\n }\n}\n",lr="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 $accreditationsCategoriesIds: [AccreditationsCategoryId!]\n $accreditationsIds: [AccreditationId!]\n $accreditationsSlotsIds: [AccreditationsSlotId!]\n $accreditationsProfilesCategoriesIds: [AccreditationsProfilesCategoryId!]\n $accreditationsProfilesIds: [AccreditationsProfileId!]\n $delegationCategoryId: DelegationsCategoryId\n $delegationId: DelegationId\n $hasCoordinates: Boolean\n $includeAccreditationProfile: Boolean!\n $onlyVisibleAccreditationsSlots: Boolean\n $includeAccreditations: Boolean!\n $includeAccreditationsMatrix: Boolean!\n $includeAvailability: Boolean!\n $includeCanRegistrationStateUpdate: Boolean!\n $includeComments: Boolean!\n $includeCustomDocuments: Boolean!\n $includeDelegation: Boolean!\n $includeDuplicatedFrom: 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 $includePicture: Boolean!\n $includePositions: Boolean!\n $includeRoles: Boolean!\n $includeTags: Boolean!\n $includeTeam: Boolean!\n $includeTraces: Boolean!\n $includeVolunteerMinutes: Boolean!\n $includeWishedPositions: Boolean!\n $includePreassignedPositions: Boolean!\n $includeWeezeventChecklists: Boolean!\n $includeWeezeventUrls: Boolean!\n) {\n data: event(id: $eventId) {\n layer\n latitude\n longitude\n\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 accreditationsCategoriesIds: $accreditationsCategoriesIds\n accreditationsIds: $accreditationsIds\n accreditationsSlotsIds: $accreditationsSlotsIds\n accreditationsProfilesCategoriesIds: $accreditationsProfilesCategoriesIds\n accreditationsProfilesIds: $accreditationsProfilesIds\n delegationCategoryId: $delegationCategoryId\n delegationId: $delegationId\n hasCoordinates: $hasCoordinates\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...VolunteerRegistration\n }\n\n numberOfPages\n totalCount\n }\n\n traces @include(if: $includeTraces) {\n ...Trace\n }\n }\n}\n",dr="mutation UserCreate {\n userCreate {\n id\n email\n }\n}\n";function cr(e){return Oi('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,[js.VolunteerRegistrationWaitingAssignmentFragment])}function ur(e={}){return Di("mutation VolunteersRegistrationsMassAccreditationProfileUpdate(\n $eventId: EventId!\n $massProfileUpdate: MassAccreditationProfileUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAccreditationProfileUpdate(\n eventId: $eventId\n massProfileUpdate: $massProfileUpdate\n )\n}\n",e)}function mr(e={}){return Di("mutation AccreditationsProfilesMassAccreditationsEdit(\n $eventId: EventId!\n $massAccreditations: MassAccreditationsInput!\n) {\n numberOfAccreditationsProfiles: accreditationsProfilesMassAccreditationsEdit(\n eventId: $eventId\n massAccreditations: $massAccreditations\n )\n}\n",e)}function hr(e={}){return Di("mutation VolunteersRegistrationsMassAccredit(\n $eventId: EventId!\n $massAccredit: MassAccreditInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAccredit(\n eventId: $eventId\n massAccredit: $massAccredit\n )\n}\n",e)}function gr(e={}){return Di("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 pr(e={}){return Di("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 fr(e){return Oi("query CreateCampaignInfos(\n $organizationId: OrganizationId!\n $eventId: EventId\n $userInfoId: UsersInfoId\n) {\n organization(id: $organizationId) {\n adminEmail\n emailSenderId\n timeZone\n\n customFields(\n eventId: $eventId\n variety: UserInfo\n fieldTypes: [Checkbox, Select, Validation]\n onlyUpdatableByUrl: true\n ) {\n nodes {\n ...CustomField\n }\n }\n\n emailsSenders(isValidToSendEmail: true) {\n ...CreateCampaignEmailSender\n }\n\n event: eventMaybe(id: $eventId) {\n hasDuplicatedMembers\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,[js.CustomFieldFragment,js.CreateCampaignEmailSenderFragment])}function _r(e={}){return Di("mutation EventLayerUpdate($eventId: EventId!, $layer: MapLayer!) {\n eventLayerUpdate(eventId: $eventId, layer: $layer) {\n id\n }\n}\n",e)}function xr(e={}){return Di("mutation AccreditationsMassEdit($eventId: EventId!, $massEdit: MassEditInput!) {\n numberOfEdited: accreditationsMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}function Ir(e={}){return Di("mutation AccreditationsProfilesMassEdit($eventId: EventId!, $massEdit: MassEditInput!) {\n numberOfEdited: accreditationsProfilesMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}function vr(e={}){return Di("mutation CustomFieldsMassEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $massEdit: MassEditInput!\n) {\n numberOfEdited: customFieldsMassEdit(\n organizationId: $organizationId\n eventId: $eventId\n massEdit: $massEdit\n )\n}\n",e)}function br(e,t){return Js(er,{variables:e,token:t||void 0,fragments:[]})}function jr(e={}){return Di("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 Cr(e,t){return Js(tr,{variables:e,token:t||void 0,fragments:[js.MassEditCustomFieldFragment]})}function yr(e={}){return Di("mutation EventsMassEdit($organizationId: OrganizationId!, $massEdit: MassEditInput!) {\n eventsMassEdit(organizationId: $organizationId, massEdit: $massEdit)\n}\n",e)}function Ar(e={}){return Di("mutation PositionsMassEdit($eventId: EventId!, $massEdit: MassEditInput!) {\n numberOfEdited: positionsMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}function Sr(e={}){return Di("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 kr(e={}){return Di("mutation WorkflowsMassEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $massEdit: MassEditInput!\n) {\n numberOfEdited: workflowsMassEdit(\n organizationId: $organizationId\n eventId: $eventId\n massEdit: $massEdit\n )\n}\n",e)}function wr(e,t){return Js("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:[js.DelegationAccreditationSlotStatsFragment]})}function Er(e){return Oi("query AllEvents($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n }\n}\n",e,[])}function Tr(e={}){return Di("mutation EventDocumentsExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId\n $documentsExport: DocumentsExportInput!\n) {\n jobId: eventDocumentsExport(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n documentsExport: $documentsExport\n )\n}\n",e)}function Rr(e={}){return Di("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 Or(e){return Oi("query OrganizationParametersInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...OrganizationAdminInfos\n }\n}\n",e,[js.OrganizationAdminInfosFragment])}function Dr(e={}){return Di("mutation PositionsSlotsUsersInfosCheckIn($eventId: EventId!, $checkIn: PositionSlotCheckInInput!) {\n numberOfMembers: positionsSlotsUsersInfosCheckIn(eventId: $eventId, checkIn: $checkIn)\n}\n",e)}function zr(e){return Oi("query UserPositions(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n hideAssignmentsUntilConfirmationEmailSent\n\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 isAssignmentsEmailSent\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,[js.FormsUsersInfosWishedFragment,js.UserPositionSlotUserInfoFragment])}function $r(e,t){return Js("query ConditionsCustomFields(\n $organizationId: OrganizationId!\n $eventId: EventId\n $fieldTypes: [FieldType!]\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo, privacy: All, fieldTypes: $fieldTypes) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}function Pr(e,t){return Js(or,{variables:e,token:t||void 0,fragments:[]})}function Mr(e={}){return Di("mutation VolunteersRegistrationsMassDelete(\n $eventId: EventId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: volunteersRegistrationsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function Fr(e,t){return Js("query User(\n $organizationId: OrganizationId!\n $eventId: EventId\n $id: UsersInfoId!\n $includeComments: Boolean!\n $includeDelegations: Boolean!\n $includeEmails: 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:[js.UserInfoCommunityFragment]})}function Nr(e={}){return Di("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)}function Lr(e,t){return Js(sr,{variables:e,token:t||void 0,fragments:[js.UserInfoCommunityFragment]})}function Br(e){return Oi("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 Vr(e={}){return Di("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 Ur(e={}){return Di("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)}function Wr(e){return Oi(rr,e,[])}function Gr(e){return Oi(ar,e,[])}function qr(e,t){return Js(ar,{variables:e,token:t||void 0,fragments:[]})}function Hr(e,t){return Js("query EventPositionsSlots($eventId: EventId!) {\n event(id: $eventId) {\n positionsCategories {\n id\n name\n\n positions {\n id\n name\n acronym\n\n slots {\n id\n name\n range\n }\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}function Kr(e={}){return Di("mutation VolunteersRegistrationsMassDuplicate(\n $eventId: EventId!\n $delegationId: DelegationId\n $selecteds: MassActionSelectedsInput!\n $numberOfCopies: Int!\n) {\n numberOfCreatedMembers: volunteersRegistrationsMassDuplicate(\n eventId: $eventId\n delegationId: $delegationId\n selecteds: $selecteds\n numberOfCopies: $numberOfCopies\n )\n}\n",e)}function Yr(e={}){return Di("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 Zr(e){return Oi("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,[js.FormsUsersInfosWishedFragment])}function Xr(e={}){return Di("mutation VolunteersRegistrationsAccreditationsValidate(\n $eventId: EventId!\n $delegationId: DelegationId\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: volunteersRegistrationsAccreditationsValidate(\n eventId: $eventId\n delegationId: $delegationId\n selecteds: $selecteds\n )\n}\n",e)}function Jr(e={}){return Di("mutation VolunteersRegistrationsMassAccreditationStateUpdate(\n $eventId: EventId!\n $massStateUpdate: MassAccreditationStateUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAccreditationStateUpdate(\n eventId: $eventId\n massStateUpdate: $massStateUpdate\n )\n}\n",e)}function Qr(e={}){return Di("mutation VolunteersRegistrationsMassAssign($eventId: EventId!, $massAssign: MassAssignInput!) {\n numberOfMembers: volunteersRegistrationsMassAssign(eventId: $eventId, massAssign: $massAssign)\n}\n",e)}function ea(e={}){return Di("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 ta(e={}){return Di("mutation VolunteersRegistrationsMassStateUpdate(\n $eventId: EventId!\n $massStateUpdate: MassStateUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassStateUpdate(\n eventId: $eventId\n massStateUpdate: $massStateUpdate\n )\n}\n",e)}function na(e){return Oi("query VolunteersSegments(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $privacy: CustomFieldPrivacy!\n $loadCustomDocuments: Boolean!\n $loadForms: Boolean!\n $loadSegments: Boolean!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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 customDocuments @include(if: $loadCustomDocuments) {\n ...CustomDocumentPopulation\n }\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,[js.SegmentCustomFieldFragment,js.CustomDocumentPopulationFragment,js.SegmentsFoldersSegmentsFragment])}function ia(e,t){return Js("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 oa(e={}){return Di("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 sa(e,t){return Js("query Volunteer(\n $eventId: EventId!\n $id: VolunteersRegistrationId!\n $delegationId: DelegationId\n $includeAccreditationProfile: Boolean!\n $onlyVisibleAccreditationsSlots: Boolean\n $includeAccreditations: Boolean!\n $includeAccreditationsMatrix: Boolean!\n $includeAvailability: Boolean!\n $includeCanRegistrationStateUpdate: Boolean!\n $includeComments: Boolean!\n $includeCustomDocuments: Boolean!\n $includeDelegation: Boolean!\n $includeDuplicatedFrom: 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 $includePicture: 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 $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:[js.VolunteerRegistrationFragment]})}function ra(e){return Oi(lr,e,[js.VolunteerRegistrationFragment,js.TraceFragment])}function aa(e,t){return Js(lr,{variables:e,token:t||void 0,fragments:[js.VolunteerRegistrationFragment,js.TraceFragment]})}function la(e={}){return Di("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 da(e={}){return Di("mutation VolunteersRegistrationsMassWishedAccreditationsUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n $massAccredit: MassAccreditInput!\n) {\n volunteersRegistrationsMassWishedAccreditationsUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n massAccredit: $massAccredit\n )\n}\n",e)}function ca(e={}){return Di("mutation VolunteersRegistrationsMassWishedProfileUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n $massProfileUpdate: MassAccreditationProfileUpdateInput!\n) {\n volunteersRegistrationsMassWishedProfileUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n massProfileUpdate: $massProfileUpdate\n )\n}\n",e)}const ua=()=>{const{code:e,source:t,organizationId:n,eventId:i}=zi();return(0,V.useEffect)(()=>{const o=localStorage.getItem(q),s=localStorage.getItem(G);if(g(o)&&g(s)&&g(e)&&g(t)){localStorage.removeItem(q),localStorage.removeItem(G);const r=new U.TU({Username:o,Pool:Y()});r.Session=s,r.setAuthenticationFlowType("CUSTOM_AUTH"),r.sendCustomChallengeAnswer(e,{async onSuccess(e){const o=e.getIdToken().getJwtToken();await Js(dr,{token:o}),n&&i&&t===$e.VolunteerRegister?location.href=Is(n,i):n&&i&&t===$e.VolunteerAssignments?location.href=vs(n,i):t===$e.App?location.href=fs.HOME:location.href="/"},onFailure(e){Vi("Could not sendCustomChallengeAnswer",e),location.href="/"}})}else location.href="/"},[]),null};var ma=n(5126);function ha(e){if(e){const[t,n,i]=e.split(" ");return{color:t,fontSize:n,fontWeight:i}}return{}}function ga(e){return"string"==typeof e?e:"number"==typeof e?e<=1?100*e+"%":`${e}px`:void 0}var pa=n(3345);const fa={mobile:"screen and (max-width: 743px)",tablet:"screen and (min-width: 744px)",desktop:"screen and (min-width: 1280px)"},_a="-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'",{styled:xa,theme:Ia,config:va,getCssText:ba,createTheme:ja,keyframes:Ca,reset:ya}=(0,pa.GC)({theme:{colors:{gray25:"#fcfcfd",gray50:"#f9fafb",grayCustom50:"var(--colors-gray50)",gray100:"#f2f4f7",gray200:"#e4e7ec",gray300:"#d0d5dd",gray400:"#98a2b3",gray500:"#667085",grayCustom500:"var(--colors-gray500)",gray600:"#475467",gray700:"#344054",grayCustom700:"var(--colors-gray700)",gray800:"#1d2939",grayCustom800:"var(--colors-gray800)",gray900:"#101828",grayCustom900:"var(--colors-gray900)",grayDark50:"#f0f3f4",grayDark100:"#dfe4e7",grayDark500:"#667c8a",grayDark700:"#3d4a52",primary50:"#F0EBF9",primary100:"#E0D8F3",primary200:"#C4B4E9",primary300:"#A58DDD",primary400:"#8666D1",primary500:"#6941C6",primaryCustom500:"var(--colors-primary500)",primary600:"#5230A1",primaryCustom600:"var(--colors-primary600)",primary700:"#3E257A",primary800:"#2A1952",primary900:"#140C27",primary950:"#0A0614",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",inherit:"inherit",blueGray25:"#ff08ce",cyan:"#ff08ce",primary25:"#ff08ce",blueGray200:"#ff08ce",blueGray300:"#ff08ce",blueGray400:"#ff08ce",blueGray800:"#ff08ce",blueLight400:"#ff08ce",blueLight900:"#ff08ce",orange400:"#ff08ce",orange600:"#ff08ce",indigo100:"#ff08ce",indigo600:"#ff08ce"},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', ${_a}`,grafik:`Graphik, ${_a}`,montserrat:`Montserrat, ${_a}`,anton:`Anton, ${_a}`,roboto:`Roboto, ${_a}`,poppins:`Poppins, ${_a}`,inter:`Inter, ${_a}`,unbounded:`Unbounded, ${_a}`,rubik:`Rubik, ${_a}`,firaSans:`"Fira Sans", ${_a}`,arimo:`Arimo, ${_a}`,zuumeMedium:`"Zuume Medium", ${_a}`,zuumeBold:`"Zuume Bold", ${_a}`,formulaCondensedBold:`FormulaCondensedBold, ${_a}`,raleway:`Raleway, ${_a}`,avenir:`Avenir, ${_a}`,movement:`Movement, ${_a}`,atrament:`Atrament, ${_a}`,lato:`Lato, ${_a}`,helveticaNeue97BlackCondensed:`HelveticaNeue97BlackCondensed, ${_a}`,graphie:`Graphie, ${_a}`,archerBoldPro:`ArcherBoldPro, ${_a}`,acumin:`Acumin, ${_a}`,chillax:`Chillax, ${_a}`,neufileGrotesk:`NeufileGrotesk, ${_a}`},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:fa,utils:{bd:e=>{let t="$gray200",n="$2",i="$xs";if(g(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.toString(10),"-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})}}),Aa=ja("weezcrew-theme",{}),Sa=xa("div",{variants:{color:{inherit:{color:"inherit"},cyan:{color:"$cyan"},gray25:{color:"$gray25"},gray50:{color:"$gray50"},grayCustom50:{color:"$grayCustom50"},gray100:{color:"$gray100"},gray200:{color:"$gray200"},gray300:{color:"$gray300"},gray400:{color:"$gray400"},gray500:{color:"$gray500"},grayCustom500:{color:"$grayCustom500"},gray600:{color:"$gray600"},gray700:{color:"$gray700"},grayCustom700:{color:"$grayCustom700"},gray800:{color:"$gray800"},grayCustom800:{color:"$grayCustom800"},gray900:{color:"$gray900"},grayCustom900:{color:"$grayCustom900"},grayDark50:{color:"$grayDark50"},grayDark100:{color:"$grayDark100"},grayDark500:{color:"$grayDark500"},grayDark700:{color:"$grayDark700"},primary25:{color:"$primary25"},primary50:{color:"$primary50"},primary100:{color:"$primary100"},primary200:{color:"$primary200"},primary300:{color:"$primary300"},primary400:{color:"$primary400"},primary500:{color:"$primary500"},primaryCustom500:{color:"$primaryCustom500"},primary600:{color:"$primary600"},primaryCustom600:{color:"$primaryCustom600"},primary700:{color:"$primary700"},primary800:{color:"$primary800"},primary900:{color:"$primary900"},primary950:{color:"$primary950"},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"},blueLight50:{color:"$blueLight50"},blueLight100:{color:"$blueLight100"},blueLight400:{color:"$blueLight400"},blueLight500:{color:"$blueLight500"},blueLight600:{color:"$blueLight600"},blueLight700:{color:"$blueLight700"},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"},purpleLight50:{color:"$purpleLight50"},purpleLight100:{color:"$purpleLight100"},purpleLight500:{color:"$purpleLight500"},purpleLight700:{color:"$purpleLight700"},purpleDark50:{color:"$purpleDark50"},purpleDark100:{color:"$purpleDark100"},purpleDark500:{color:"$purpleDark500"},purpleDark700:{color:"$purpleDark700"},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"},orange50:{color:"$orange50"},orange100:{color:"$orange100"},orange400:{color:"$orange400"},orange500:{color:"$orange500"},orange600:{color:"$orange600"},orange700:{color:"$orange700"},redLight50:{color:"$redLight50"},redLight100:{color:"$redLight100"},redLight500:{color:"$redLight500"},redLight700:{color:"$redLight700"},redDark50:{color:"$redDark50"},redDark100:{color:"$redDark100"},redDark500:{color:"$redDark500"},redDark700:{color:"$redDark700"},green50:{color:"$green50"},green100:{color:"$green100"},green500:{color:"$green500"},green700:{color:"$green700"},greenDark50:{color:"$greenDark50"},greenDark100:{color:"$greenDark100"},greenDark500:{color:"$greenDark500"},greenDark700:{color:"$greenDark700"},brown50:{color:"$brown50"},brown100:{color:"$brown100"},brown500:{color:"$brown500"},brown700:{color:"$brown700"},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"}}),ka=V.forwardRef((e,t)=>{const n={};return e.height&&(n.height=ga(e.height)),e.width&&(n.width=ga(e.width)),(0,i.jsx)(Sa,{...(0,ma.A)(e,"font"),...ha(e.font),ref:t,css:{...n,...e.css}})});ka.displayName="Box";var wa=n(4625),Ea=n(6347),Ta=n(8542);function Ra(e){return"number"==typeof e&&!isNaN(e)}function Oa(e,t=96){return Math.round(25.4*e/t)}function Da(e){return"number"==typeof e&&Number.isInteger(e)&&e>0}function za(e){return e?{lat:e.latitude,lng:e.longitude}:null}const $a=za({latitude:43.6087733,longitude:3.87963579999996}),Pa=13;function Ma(e,t,n){return{center:e??$a,zoom:t??Pa,fullscreenControl:!1,mapTypeControl:!1,streetViewControl:!1,mapTypeId:Na(n),styles:[{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"poi.government",stylers:[{visibility:"on"}]},{featureType:"poi.park",stylers:[{visibility:"on"}]}]}}function Fa(e){return Ra(e.latitude)&&Ra(e.longitude)?(0,Ta.A)(e,["latitude","longitude"]):void 0}function Na(e){return e===de.GoogleSatellite?"satellite":e===de.Google?"roadmap":e??de.Google}var La=n(6996),Ba=n(2096);function Va(){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:de.IgnPlan,maxZoom:18})}const Ua=(0,V.memo)(e=>{const t=(0,V.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??Pa,center:za(e.center)||$a,gestureHandling:"cooperative",mapTypeControl:!1,streetViewControl:!1,mapTypeId:Na(e.layer),...e.mapOptions||{}}),n.current.mapTypes.set(de.IgnPlan,Va()),n.current.addListener("zoom_changed",()=>{e.coordinatesFieldsProps&&e.coordinatesFieldsProps.zoomProps.input.onChange(n.current.getZoom())}),n.current.addListener("tilesloaded",()=>{e.onTilesloaded?.()}),r())},[]),n=(0,V.useRef)(null),o=(0,V.useRef)(null),s=(0,V.useRef)([]),r=()=>{s.current.forEach(e=>e.setMap(null)),Bs(e.traces)?s.current=e.traces.map(e=>{const t=e.points.map(([e,t])=>({lat:e,lng:t})),i=e.direction===ce.None?[]:[{icon:{path:e.direction===ce.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,V.useEffect)(()=>{(()=>{if(o.current&&o.current.setMap(null),e.point&&n.current){const t=za(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,V.useEffect)(()=>{n.current?.setMapTypeId(Na(e.layer))},[e.layer]),(0,V.useEffect)(()=>{r()},[JSON.stringify(e.traces||[])]),(0,i.jsx)(ka,{ref:t,height:1,width:1,children:e.coordinatesFieldsProps?.zoomProps&&(0,i.jsx)(Ba.Yr,{name:e.coordinatesFieldsProps.zoomProps.input.name,children:e=>{n.current?.setZoom(e)}})})},La.A);Ua.displayName="Map";const Wa=()=>(0,pn.createPortal)((0,i.jsx)(ka,{className:"h-map-loaded",css:{background:"transparent",height:"1px",left:"-100px",position:"absolute",top:"-100px",width:"1px"}}),document.body),Ga="query BackofficeOrganization($organizationId: OrganizationId!) {\n data: backoffice {\n row: organization(id: $organizationId) {\n ...OrganizationBackoffice\n }\n }\n}\n",qa="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",Ha="query VolunteersPlanning(\n $eventId: EventId!\n $positionId: PositionId\n $predicates: [Predicate!]!\n $name: String\n $limit: Int\n $offset: Int\n) {\n data: event(id: $eventId) {\n dayStartTime\n startAt\n endAt\n\n rows: volunteersRegistrations(\n positionId: $positionId\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";function Ka(e,t){return Js("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 Ya(e={}){return Di("mutation AccreditationsMassDelete($eventId: EventId!, $selecteds: MassActionSelectedsInput!) {\n numberOfAccreditations: accreditationsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function Za(e={}){return Di("mutation AccreditationSlotDelete($eventId: EventId!, $accreditationSlotId: AccreditationsSlotId!) {\n accreditationSlotDelete(eventId: $eventId, accreditationSlotId: $accreditationSlotId) {\n id\n }\n}\n",e)}function Xa(e={}){return Di("mutation AccreditationsProfilesMassDelete(\n $eventId: EventId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfAccreditationsProfiles: accreditationsProfilesMassDelete(\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function Ja(e={}){return Di("mutation AccreditationProfileDuplicate(\n $eventId: EventId!\n $accreditationProfileId : AccreditationsProfileId!\n){\n accreditationProfileDuplicate(eventId: $eventId, accreditationProfileId: $accreditationProfileId) {\n id\n }\n}\n",e)}function Qa(e={}){return Di("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 el(e){return Oi("query AccreditationsSlotsList(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $name: String\n $predicates: [Predicate!]\n $columnsSearch: [String!]\n $customFieldsSlugs: [CustomFieldSlug!]\n $limit: Int\n $offset: Int\n $sort: AccreditationsSlotsSort\n $includeConditions: Boolean!\n $includeCustomFields: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeResources: Boolean!\n $includeTags: Boolean!\n $onlyWithDate: Boolean\n) {\n organization(id: $organizationId) @include(if: $includeCustomFields) {\n customFields(eventId: $eventId, fieldTypes: [Select]) {\n nodes {\n ...ConditionCustomField\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n\n accreditationsSlots(\n name: $name\n predicates: $predicates\n includeHidden: true\n onlyWithDate: $onlyWithDate\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",e,[js.ConditionCustomFieldFragment,js.AccreditationsAccreditationSlotFragment])}function tl(e){return Oi('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 nl(e,t){return Js(Ga,{variables:e,token:t||void 0,fragments:[js.OrganizationBackofficeFragment]})}function il(e,t){return Js("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:[js.OrganizationBackofficeFragment]})}function ol(e){return Oi("query CampaignPreview(\n $organizationId: OrganizationId!\n $campaignId: CampaignId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n campaign(id: $campaignId) {\n sendToEveryone\n preview(userInfoId: $userInfoId)\n subject: subjectPreview(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,[js.DocumentEmailPreviewFragment])}function sl(e){return Oi("query ImportInfos(\n $organizationId: OrganizationId!\n $eventId: EventId\n $variety: CustomFieldVariety\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: $variety) {\n nodes {\n ...CustomFieldImport\n }\n }\n\n event: eventMaybe(id: $eventId) {\n accreditations {\n nodes {\n ...AccreditationImport\n }\n }\n\n accreditationsProfiles {\n nodes {\n ...AccreditationProfileImport\n }\n }\n }\n }\n}\n",e,[js.CustomFieldImportFragment,js.AccreditationImportFragment,js.AccreditationProfileImportFragment])}function rl(e){return Oi("query SpaceDesign(\n $organizationId: OrganizationId!\n $eventId: EventId\n $includeIntro: Boolean!\n $spaceType: SpaceType!\n) {\n organization(id: $organizationId) {\n spaceDesign(spaceType: $spaceType) {\n ...SpaceDesign\n }\n\n event: eventMaybe(id: $eventId) {\n spaceDesign(spaceType: $spaceType) {\n ...SpaceDesign\n }\n }\n\n eventsShowcaseSettings @include(if: $includeIntro) {\n title\n intro\n }\n }\n}\n",e,[js.SpaceDesignFragment])}function al(e={}){return Di("mutation UsersInfosMerge(\n $organizationId: OrganizationId!\n $eventId: EventId\n $mainUserInfoId: UsersInfoId!\n $toMergeUsersInfosIds: [UsersInfoId!]!\n) {\n usersInfosMerge(\n organizationId: $organizationId\n eventId: $eventId\n mainUserInfoId: $mainUserInfoId\n toMergeUsersInfosIds: $toMergeUsersInfosIds\n ) {\n id\n }\n}\n",e)}function ll(e={}){return Di("mutation CustomFieldsMassDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfCustomFields: customFieldsMassDelete(\n organizationId: $organizationId\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function dl(e={}){return Di("mutation CustomFieldsMassDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n customFieldsMassDuplicate(\n organizationId: $organizationId\n eventId: $eventId\n selecteds: $selecteds\n ) {\n id\n }\n}\n",e)}function cl(e){return Oi("query CustomFieldsSegments(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n $predicates: [Predicate!]!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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: $level, eventId: $eventId, segmentType: CustomFields) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",e,[js.SegmentsFoldersSegmentsFragment])}function ul(e={}){return Di("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 ml(e={}){return Di("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 hl(e={}){return Di("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 gl(e){return Oi("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 $includeAccreditations: Boolean!\n $includeAccreditationsProfiles: Boolean!\n $includeAccreditationsSlots: Boolean!\n $includeCampaigns: Boolean!\n $includeChildren: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeDocuments: Boolean!\n $includeLayout: Boolean!\n $includeLeaders: Boolean!\n $includeParent: 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,[js.DelegationsDelegationFragment])}function pl(e={}){return Di("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 fl(e={}){return Di("mutation DelegationsMassLeadersEmailSend(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfDelegations: delegationsMassLeadersEmailSend(\n organizationId: $organizationId\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function _l(e,t){return Js(qa,{variables:e,token:t||void 0,fragments:[]})}function xl(e={}){return Di("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)}function Il(e){return Oi("query Events(\n $organizationId: OrganizationId!\n $name: String\n $predicates: [Predicate!]\n $limit: Int\n $offset: Int\n $sort: EventsSort\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeNumberOfMembers: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: events(\n name: $name\n whereUserIsLeader: true\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,[js.EventsEventFragment])}function vl(e){return Oi("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,[js.FormListFragment])}function bl(e){return Oi("query Form($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n }\n }\n}\n",e,[])}function jl(e={}){return Di("mutation PositionsMassLeadersEdit($eventId: EventId!, $massLeaders: MassLeadersInput!) {\n numberOfPositions: positionsMassLeadersEdit(eventId: $eventId, massLeaders: $massLeaders)\n}\n",e)}function Cl(e){return Oi("query Organizations {\n organizations {\n id\n name\n }\n\n user {\n roles {\n organizationId\n type\n }\n }\n}\n",e,[])}function yl(e,t){return Js("query OrganizationMember(\n $organizationId: OrganizationId!\n $id: VolunteersRegistrationId!\n $includeCustomDocuments: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: volunteerRegistration(id: $id) {\n ...OrganizationMember\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[js.OrganizationMemberFragment]})}function Al(e,t){return Js("query OrganizationMembers(\n $organizationId: OrganizationId!\n $name: String\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: VolunteersRegistrationsSort\n $includeCustomDocuments: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: volunteersRegistrations(\n name: $name\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...OrganizationMember\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[js.OrganizationMemberFragment]})}function Sl(e={}){return Di("mutation OrganizationSpaceDesignUpdate(\n $organizationId: OrganizationId!\n $spaceDesign: DesignInput!\n $settings: EventsShowcaseSettingsDesignInput\n $spaceType: SpaceType!\n) {\n organizationSpaceDesignUpdate(\n organizationId: $organizationId\n spaceDesign: $spaceDesign\n settings: $settings\n spaceType: $spaceType\n ) {\n id\n }\n}\n",e)}function kl(e={}){return Di("mutation UserDelete {\n userDelete {\n id\n }\n}\n",e)}function wl(e={}){return Di("mutation UserAccessDelete($organizationId: OrganizationId!, $scope: AccessScope!, $id: Int!) {\n userAccessDelete(organizationId: $organizationId, scope: $scope, id: $id)\n}\n",e)}function El(e={}){return Di("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 Tl(e,t){return Js("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 Rl(e={}){return Di("mutation PositionsMassDelete($eventId: EventId!, $selecteds: MassActionSelectedsInput!) {\n numberOfPositions: positionsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function Ol(e){return Oi("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 $includeCheckedOutRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includePositionTraces: 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,[js.PositionsPositionFragment,js.TraceFragment])}function Dl(e,t){return Js('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:[js.LeaderInfosFragment,js.FullPageInfoFragment]})}function zl(e,t){return Js('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:[js.FullPageInfoFragment]})}function $l(e,t){return Js("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:[js.PositionPositionSlotFragment,js.FullPageInfoFragment]})}function Pl(e){return Oi("query PositionDashboard(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $positionId: PositionId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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 numberOfSlots\n\n slots {\n id\n fillingRate\n name\n range\n }\n\n links {\n positionPlanningLink\n positionSheetLink\n }\n\n traces {\n ...Trace\n }\n\n customFields: positionsCustomFields {\n customField {\n slug\n name\n fieldType\n listType\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,[js.CustomFieldWithConditionFragment,js.TraceFragment,js.LeaderInfosFragment])}function Ml(e,t){return Js("query VolunteerPlanning(\n $id: VolunteersRegistrationId!\n $eventId: EventId!\n $positionId: PositionId\n) {\n data: event(id: $eventId) {\n row: volunteerRegistration(id: $id) {\n ...DocumentUsersPlanning\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[js.DocumentUsersPlanningFragment]})}function Fl(e={}){return Di("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 Nl(e){return Oi("query UserFieldUpdate($organizationId: OrganizationId!, $slug: CustomFieldSlug!) {\n organization: organizationPublic(id: $organizationId) {\n customField: customFieldBySlug(slug: $slug) {\n name\n description\n fieldType\n\n values {\n id\n value\n }\n }\n }\n}\n",e,[])}function Ll(e,t){return Js("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 accreditationsProfiles {\n ...DelegationAccreditationProfile\n }\n\n accreditationsSlots(onlyVisible: true) {\n ...DelegationAccreditationSlot\n }\n }\n\n event: eventMaybe(id: $eventId) {\n startAt\n endAt\n dayStartTime\n ranges(formId: $formId, delegationId: $delegationId)\n country\n\n accreditationsProfilesCategories {\n ...FormRegisterAccreditationProfileCategory\n }\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:[js.DelegationAccreditationProfileFragment,js.DelegationAccreditationSlotFragment,js.FormRegisterAccreditationProfileCategoryFragment,js.FormRegisterAccreditationCategoryFragment,js.FormRegisterCategoryFragment,js.CreateUpdateMemberFormFragment]})}function Bl(e={}){return Di("mutation UserInfoAdminCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $email: UserEmail!\n $userInfo: UsersInfoInput!\n $sendNotificationEmail: Boolean!\n) {\n userInfoAdminCreate(\n organizationId: $organizationId\n eventId: $eventId\n email: $email\n userInfo: $userInfo\n sendNotificationEmail: $sendNotificationEmail\n ) {\n id\n }\n}\n",e)}function Vl(e={}){return Di("mutation VolunteersRegistrationsMassTicketIdRegenerate(\n $eventId: EventId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfEdited: volunteersRegistrationsMassTicketIdRegenerate(\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function Ul(e={}){return Di("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 Wl(e){return Oi("query Comments($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n comments {\n ...Comment\n }\n }\n }\n}\n",e,[js.CommentFragment])}function Gl(e){return Oi("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,[js.ExistingVolunteerFragment])}function ql(e={}){return Di("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 Hl(e){return Oi(Ha,e,[js.DocumentUsersPlanningFragment])}function Kl(e,t){return Js(Ha,{variables:e,token:t||void 0,fragments:[js.DocumentUsersPlanningFragment]})}function Yl(e={}){return Di("mutation VolunteersRegistrationsMassPreAssign(\n $eventId: EventId!\n $massPreAssign: MassPreAssignInput!\n) {\n numberOfMembers: volunteersRegistrationsMassPreAssign(\n eventId: $eventId\n massPreAssign: $massPreAssign\n )\n}\n",e)}function Zl(e={}){return Di("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 Xl(e,t){return Js("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:[js.FullPageInfoFragment]})}function Jl(e){return Oi("query WorkflowCustomFields(\n $organizationId: OrganizationId!\n $eventId: EventId\n $variety: CustomFieldVariety!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: $variety, privacy: All) {\n nodes {\n ...MassEditCustomField\n }\n }\n }\n}\n",e,[js.MassEditCustomFieldFragment])}function Ql(e={}){return Di("mutation WorkflowssMassDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n workflowssMassDelete(organizationId: $organizationId, eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function ed(e={}){return Di("mutation WorkflowsMassExecute(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfExecuted: workflowsMassExecute(\n organizationId: $organizationId\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function td(e){return Oi("query WorkflowsSegments(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n segmentsFolders(level: $level, eventId: $eventId, segmentType: Workflows) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",e,[js.SegmentsFoldersSegmentsFragment])}const nd=()=>{const{eventId:e,accreditationId:t}=zi(),{data:n,loader:o}=Oi("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,V.useState)(!1);if(o)return o;{const e=n.eventPublic.accreditation;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(Ua,{initialZoom:e.zoom,layer:e.layer,mapOptions:{disableDefaultUI:!0,keyboardShortcuts:!1},point:Fa(e),onTilesloaded:()=>{r(!0)}})}),s&&(0,i.jsx)(Wa,{})]})}};var id;function od(e){return(0,Ta.A)(e,["direction","align","justify","wrap","gap","css","height","width"])}!function(e){e.Nav="nav",e.Header="header",e.Footer="footer",e.Main="main",e.Section="section"}(id||(id={}));const sd=xa("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"}}),rd=V.forwardRef(({onClick:e,...t},n)=>{const o={};return t.height&&(o.height=ga(t.height)),t.width&&(o.width=ga(t.width)),(0,i.jsx)(sd,{...t,ref:n,css:{...o,...t.css},onClick:e})});rd.displayName="Flex";var ad=n(7356);let ld=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,ad.Oe)(e,t.path,t.message),{})}}}errorToObject(e){return e.inner.reduce((e,t)=>({...e,[t.path]:t.message}),{})}};ld=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,fn._G)()],ld);var dd=n(924),cd=n(952);const ud=(0,V.createContext)({}),md=xa("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 hd=n(9241),gd=n(2695),pd=n(8174);const fd=["access","ticket","pay"],_d=({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=ga(t)),r&&(d.width=ga(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||fd.includes(l.pathname.split("/")[1])?(0,i.jsx)("a",{href:l.href,rel:"noreferrer",style:c,target:"_blank",...a,children:e}):(0,i.jsx)(wa.N_,{replace:n,style:c,to:{pathname:g(F.HEAVENT_APPLICATION_BASENAME)?l.pathname.replace(new RegExp(`^/${F.HEAVENT_APPLICATION_BASENAME}`,"gm"),""):l.pathname,hash:l.hash,search:l.search},...a,children:e})};function xd(e){return(0,pd.A)(e)}_d.displayName="LinkWrapper";const Id=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)(_d,{target:e.target,to:e.to,onClick:e.onClick,children:o()}):o()};function vd(e){throw new Error("Didn't expect to get here")}function bd(){return{history:$i(),params:zi(),translate:Ti()}}const jd=e=>(0,V.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,V.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,V.createElement)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 50 50;360 50 50",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}))),Cd=(0,V.memo)(function(){return(0,i.jsx)(rd,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(jd,{color:"#162131",height:"200px",strokeWidth:"2",width:"200px"})})}),yd={alignItems:"center",borderRadius:"$1",cursor:"pointer",display:"flex",fontWeight:"$semiBold",gap:"$2",padding:"$1 $4",userSelect:"none","& .loader":{borderRadius:"$1"},variants:{color:{primary:{background:"$primaryCustom500",border:"1px solid $primaryCustom500",color:"white","&:hover":{background:"$primaryCustom600",border:"1px solid $primaryCustom600"},"& .loader":{background:"$primaryCustom500",border:"1px solid $primaryCustom500"},"& .loader:hover":{background:"$primary600",border:"1px solid $primary600"}},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:"$grayCustom700","&:hover":{background:"$grayCustom50",color:"$grayCustom800"},"& .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:"$primaryCustom500",fontSize:"$textSm",fontWeight:"$medium",padding:"$1 $2","&:hover":{color:"$primaryCustom600"},"& .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:"$gray50",border:"1px solid $gray50",color:"$gray400","&:hover":{background:"$gray50",border:"1px solid $gray50"},"& .loader":{background:"$gray50",border:"1px solid $gray50"},"& .loader:hover":{background:"$gray50",border:"1px solid $gray50"}}},{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"}},Ad=xa("button",yd),Sd=xa("div",yd),kd=V.forwardRef(({children:e,className:t,color:n,css:o,disabled:s,featureFlags:r,isLoading:a,leftIcon:l,onClick:d,to:c,rightIcon:u,size:m,textAlign:h=(r?.isV4?"center":void 0),title:g,...p},f)=>{const _=!!l&&!e&&!u||!l&&!e&&!!u,x={className:`button ${t||""}`,color:n,css:{width:r?.isV4?"100%":void 0,...o,position:"relative"},disabled:s,iconOnly:_,size:m,title:g},I={children:e,color:n,leftIcon:l,isLoading:a,rightIcon:u,textAlign:h};return c&&!s?(0,i.jsx)(_d,{style:r?.isV4?{flex:"1"}:void 0,title:g,to:c,onClick:e=>{s||a||d&&d(e)},...p,children:(0,i.jsx)(Sd,{...x,ref:f,children:(0,i.jsx)(wd,{...I})})}):(0,i.jsx)(Ad,{...x,ref:f,type:"button",onClick:e=>{s||a||d&&d(e)},...p,children:(0,i.jsx)(wd,{...I})})});kd.displayName="Button",kd.toString=()=>".button";const wd=({children:e,color:t,isLoading:n,leftIcon:o,rightIcon:s,textAlign:r})=>(0,i.jsxs)(i.Fragment,{children:[o&&(0,i.jsx)(rd,{children:(0,i.jsx)(Id,{icon:o})}),e&&(0,i.jsx)(ka,{className:"h-button-content",css:{flex:"1"},textAlign:r,children:e}),s&&(0,i.jsx)(rd,{children:(0,i.jsx)(Id,{icon:s})}),n&&(0,i.jsx)(rd,{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)(jd,{color:t&&"primary"!==t&&"error"!==t?Ia.colors.gray800.value:"white",height:"40px",strokeWidth:"3",width:"40px"})})]}),Ed=e=>{const t={iconStyle:"solid"};switch(e.iconStyle){case"error":return(0,i.jsx)(Id,{className:"h-alert-icon",icon:"circle-exclamation",...t});case"warning":return(0,i.jsx)(Id,{className:"h-alert-icon",icon:"triangle-exclamation",...t});case"success":return(0,i.jsx)(Id,{className:"h-alert-icon",icon:"circle-check",...t});case"primary":case"gray":return(0,i.jsx)(Id,{className:"h-alert-icon",icon:"circle-info",...t});default:vd(e.iconStyle)}},Td=xa(rd,{borderRadius:"$1",alignItems:"flex-start",gap:"$2",padding:"$4","& i":{fontSize:"$textMd"},variants:{alertStyle:{error:{background:"$error50",border:"1px solid $error500",color:"$gray800","& i.h-alert-icon":{color:"$error500"}},warning:{background:"$warning50",border:"1px solid $warning500",color:"$gray800","& i.h-alert-icon":{color:"$warning500"}},success:{background:"$success50",border:"1px solid $success500",color:"$gray800","& i.h-alert-icon":{color:"$success500"}},primary:{background:"$primary50",border:"1px solid $primary500",color:"$gray800","& i.h-alert-icon":{color:"$primary500"}},gray:{background:"$gray50",border:"1px solid $gray500",color:"$gray800","& i.h-alert-icon":{color:"$gray500"}}}},defaultVariants:{alertStyle:"error"}}),Rd=xa("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:"$textMd",fontWeight:"$medium",lineHeight:"1.55556"},smallcapsheading:{color:"$gray500",fontSize:"10px",lineHeigh:"24px",textTransform:"uppercase"},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"}}),Od=V.forwardRef(({children:e,...t},n)=>(0,i.jsx)(Rd,{ref:n,...t,children:e}));Od.displayName="Text";const Dd=({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 V.useEffect(()=>l(`h${d(r.current?.parentElement,e)}`),[e,t]),(0,i.jsx)(Od,{ref:r,as:a,...s,textStyle:n,children:o})},zd=e=>{const{translate:t}=bd();return(0,i.jsxs)(Td,{alertStyle:e.alertStyle,"aria-live":e["aria-live"]??"polite",role:"alert",width:e.width,children:[(0,i.jsx)(rd,{align:"start",children:(0,i.jsx)(ka,{height:"20px",width:"20px",children:(0,i.jsx)(Ed,{iconStyle:e.alertStyle})})}),(0,i.jsx)(rd,{align:"start",css:{flex:"1",gap:"2px"},direction:"column",children:e.children}),e.onClose&&(0,i.jsx)(kd,{"aria-label":t("fermer_62479"),color:"invisible",css:{height:"20px",padding:0,width:"20px","& i":{color:"$gray500"}},textAlign:"center",onClick:e.onClose,children:(0,i.jsx)(Id,{icon:"xmark"})})]})},$d=({children:e})=>(0,i.jsx)(Dd,{css:{color:"$gray900",fontWeight:"$medium",fontSize:"$textSm",lineHeight:"1.42857"},children:e}),Pd=({children:e})=>(0,i.jsx)(i.Fragment,{children:e}),Md=e=>(0,i.jsxs)(zd,{alertStyle:"error","aria-live":"assertive",children:[(0,i.jsx)($d,{children:e.title}),(0,i.jsx)(Pd,{children:e.children})]});function Fd(e){return e?(0,bs.A)(Object.values(e).map(e=>"string"==typeof e?e:Array.isArray(e)?(0,hd.A)(e).map(e=>Fd(e)).flat():Fd(e)).flat()):[]}const Nd=e=>{const{translate:t}=bd(),{formRenderProps:{errors:n,submitErrors:o},showErrors:s}=(0,V.useContext)(ud),r=Fd((0,gd.A)({},n,o));return s&&Bs(r)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Md,{title:t("form_has_errors_14074"),children:(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:r.map((e,t)=>(0,i.jsx)("li",{children:e},t))})}),!0!==e.hideSpacer&&(0,i.jsx)(md,{height:"6"})]}):null};function Ld(e,t){Object.values(t.fields).forEach(e=>{e.data={...e.data,forceDisplayError:!0}})}const Bd=e=>{const t=V.useRef(null),{setShowErrors:n}=V.useContext(ud),o=()=>{const t=e.formRenderProps.handleSubmit();return t?.catch(e=>{console.debug("Form submission failed:",e)}),t},s=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?o():void 0):o());return(0,i.jsxs)(rd,{ref:t,as:"form",onSubmit:s,...od(e),children:[!e.hideDefaultErrors&&!e.customErrorRef&&(0,i.jsx)(Nd,{}),(0,i.jsx)("input",{style:{display:"none"},type:"submit",value:"Submit"}),e.render({...e.formRenderProps,handleSubmit:s})]})},Vd=e=>{const t=Ei(ld),[n,o]=V.useState(!1);return(0,i.jsx)(cd.lV,{initialValues:e.initialValues,initialValuesEqual:e.initialValuesEqual??La.A,mutators:{...e.mutators,...dd.A,forceErrors:Ld},render:t=>(0,i.jsx)(ud.Provider,{value:{formRenderProps:t,showErrors:n,setShowErrors:o},children:(0,i.jsx)(Bd,{...(0,Ta.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}})};var Ud=n(9008);function Wd(e){return e.data?.forceDisplayError&&e.invalid||e.touched&&!e.pristine&&e.invalid||!1}const Gd=(e,t=!0)=>{t&&e?.preventDefault(),e?.nativeEvent?.stopImmediatePropagation(),e?.stopPropagation()};var qd=n(5664);function Hd(){const[e]=(0,V.useState)(()=>(0,qd.A)("forminput-")),[t]=(0,V.useState)(()=>(0,qd.A)("forminputlabel-")),[n]=(0,V.useState)(()=>(0,qd.A)("forminputdesc-")),[i]=(0,V.useState)(()=>(0,qd.A)("forminputerror-"));return{inputId:e,labelId:t,descId:n,errorId:i}}const Kd=({children:e,id:t})=>e?(0,i.jsx)(ka,{color:"gray500",fontSize:"textXs",id:t,children:e}):null,Yd=e=>e.children?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"error"===e.state?"error500":"gray500",fontSize:"textXs",id:e.id,role:"error"===e.state?"alert":void 0,children:e.children})]}):null,Zd=({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)(ka,{color:"gray700",fontWeight:"medium",children:t})}):null,Xd=xa("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 $primaryCustom500"},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"}}),Jd=V.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)(Xd,{ref:m,className:"h-styled-input-container",css:n,cursor:t,height:e,state:r,onClick:e=>{a?.(e)},...u,children:[o&&(0,i.jsx)(rd,{css:{color:"$gray500"},role:"presentation",children:(0,i.jsx)(Id,{icon:o})}),s,"error"===r&&(0,i.jsx)(rd,{className:"styled-input-container-circle-exclamation",css:{color:"$error500"},children:(0,i.jsx)(Id,{icon:"circle-exclamation"})}),l&&(0,i.jsx)(rd,{css:{color:"$gray500",cursor:"function"==typeof c?"pointer":"inherit"},role:"presentation",onClick:e=>{c?.(e)},children:(0,i.jsx)(Id,{icon:l})}),g(d)&&(0,i.jsx)(ka,{css:{userSelect:"none"},font:"gray500 textSm regular",children:d})]}));Jd.displayName="StyledInputContainer";const Qd=V.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:h,icon:p,treatIntNaNAsNull:f,..._},x)=>{const I=V.useRef(),v=V.useRef(),b=x??v,{inputId:j,descId:C,errorId:y}=Hd();return(0,i.jsxs)(rd,{ref:I,css:o,direction:"column",width:1,children:[(0,i.jsx)(Zd,{htmlFor:j,children:s}),(0,i.jsx)(Kd,{id:C,children:r}),(s||r)&&(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(Jd,{cursor:"text",icon:p,rightIcon:m,rightText:h,state:d,onClick:()=>b.current?.focus(),onRightIconClick:e=>{Gd(e),l?.(e)},children:(0,i.jsx)(ka,{color:"inherit",css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%","&:disabled":{color:"$gray500"}},"& 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:b,"aria-describedby":r?C:void 0,"aria-errormessage":"error"===d?y:void 0,"aria-invalid":"error"===d,autoComplete:e??"off",disabled:"disabled"===d,id:j,type:c??(t?"email":n?"number":"text"),onChange:e=>{if(t&&g(e.target.value))u(e.target.value.toLowerCase());else if(!0===n){const t=parseInt(e.target.value,10);isNaN(t)?u(f?null:0):u(t)}else u(e.target.value)},..._})})}),(0,i.jsx)(Yd,{id:y,state:d,children:a})]})});Qd.displayName="TextInput";const ec=({autoComplete:e,hint:t,shouldParseAsInt:n,name:o,state:s,...r})=>{const a=(0,V.useCallback)(e=>{switch(e){case pt.City:return"address-level1";case pt.DateOfBirth:return"bday";case pt.FirstName:return"given-name";case pt.LastName:return"family-name";case pt.PostalCode:return"postal-code";case pt.Street:return"street-address";case pt.Country:case pt.Language:case pt.Nationality:case pt.Phone:case pt.Picture:case pt.Sex:default:return}},[]),l=(0,V.useMemo)(()=>o.startsWith("formRegister.userInfo.fields.")?a(o.split(".").pop())??e:e,[o,e,a]),d=(0,V.useCallback)(e=>{const o=Wd(e.meta);return(0,i.jsx)(Qd,{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)(cd.D0,{name:o,parse:Ud.A,render:d})},tc={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",ACCREDITATIONS_IMPORT_FORMATS:"heavent-accreditations-import-formats",ACCREDITATIONS_IMPORT_MAPPINGS:"heavent-accreditations-import-mappings",ACCREDITATIONS_IMPORT_MODE:"heavent-accreditations-import-mode",ACCREDITATIONS_IMPORT_PRESETS:e=>`heavent-accreditations-import-presets-${e}`,ACCREDITATIONS_PROFILES_IMPORT_FORMATS:"heavent-accreditations-profiles-import-formats",ACCREDITATIONS_PROFILES_IMPORT_MAPPINGS:"heavent-accreditations-profiles-import-mappings",ACCREDITATIONS_PROFILES_IMPORT_MODE:"heavent-accreditations-profiles-import-mode",ACCREDITATIONS_PROFILES_IMPORT_PRESETS:e=>`heavent-accreditations-profiles-import-presets-${e}`,EVENTS_IMPORT_FORMATS:"heavent-events-import-formats",EVENTS_IMPORT_MAPPINGS:"heavent-events-import-mappings",EVENTS_IMPORT_MODE:"heavent-events-import-mode",EVENTS_IMPORT_PRESETS:e=>`heavent-events-import-presets-${e}`,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 nc=class{translationService;constructor(e){this.translationService=e}t(e,...t){return this.translationService.translate(e,...t)}};nc=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],nc);let ic=class extends nc{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))))}};ic=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],ic);function oc(e){return"string"==typeof e&&e.length>=16}function sc(e){return"string"==typeof e&&null!==e.match(/\d/)}function rc(e){return"string"==typeof e&&null!==e.match(/[A-Z]/)&&null!==e.match(/[a-z]/)}function ac(e){return"string"==typeof e&&null!==e.match(/[^A-Za-z0-9]/)}let lc=class extends ic{constructor(e){super(e)}signInSchema(){return c.Ik().shape({email:this.email()})}signInPasswordSchema(){return c.Ik().shape({email:this.email(),password:this.password()})}codeSchema(){return c.Ik().shape({code:this.code()})}emailSchema(){return c.Ik().shape({email:this.email()})}emailConfirmSchema(){return c.Ik().shape({email:this.email(),emailConfirm:this.emailConfirm()})}emailCodeSchema(){return c.Ik().shape({email:this.email(),code:this.code()})}email(){return c.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856"))}emailConfirm(){return c.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 c.Yj().required(this.t("le_code_est_req_77618")).length(6,this.t("le_code_doit_co_37160"))}password(){return c.Yj().required(this.t("le_mot_de_passe_14773"))}passwordRules(){return c.Yj().required(this.t("le_mot_de_passe_24842")).test("valid-password",this.t("le_mot_de_passe_24842"),function(){return oc(this.parent.password)&&sc(this.parent.password)&&rc(this.parent.password)&&ac(this.parent.password)})}};lc=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],lc);let dc=class extends lc{constructor(e){super(e)}step1Schema(){return c.Ik().shape({email:this.email()})}step2Schema(){return c.Ik().shape({email:this.email(),code:this.code()})}};dc=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],dc);var cc,uc,mc,hc=n(2302);function gc(){return gc=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.jsxs)(rd,{align:"center",css:{background:"#232935",overflowX:"hidden",overflowY:"auto"},direction:"column",height:1,width:1,children:[(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(ka,{css:{marginBottom:"40px","@desktop":{marginBottom:"80px"},"& svg":{height:"100%"}},height:32,children:(0,i.jsx)(pc,{})}),(0,i.jsxs)(rd,{css:{width:"100%","@mobile":{px:"$4"},"@desktop":{width:"540px"}},direction:"column",children:[(0,i.jsx)(rd,{css:{background:"white",borderTopLeftRadius:"$2",borderTopRightRadius:"$2",padding:"$7"},width:1,children:e.children}),(0,i.jsx)(rd,{css:{background:"$gray100",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",padding:"$7"},direction:"column",gap:"2",width:1,children:e.link})]}),(0,i.jsx)(md,{height:"7"})]}),xc=e=>(0,i.jsx)(rd,{align:"center",direction:{"@initial":"column","@desktop":"row"},gap:"1",justify:"center",width:1,children:e.children}),Ic=e=>{const t=Ti(),n=$i(),o=Mi(),s=Ei(ld),r=Ei(dc),{mutate:a}=function(e={}){return Di("mutation LoginCodeEmailCreate($loginCodeEmail: LoginCodesEmailInput!) {\n loginCodeEmailCreate(loginCodeEmail: $loginCodeEmail) {\n insertedAt\n }\n}\n",e)}(),[l,d]=(0,V.useState)(null),[c,u]=(0,V.useState)(0),[m,h]=(0,V.useState)(0),[g,p]=(0,V.useState)(!1),[f,_]=(0,V.useState)(Date.now());return(0,i.jsx)(_c,{link:(0,i.jsxs)(xc,{children:[(0,i.jsx)(ka,{color:"gray500",children:t("vous_n_avez_pas_69078")}),(0,i.jsx)(ka,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{n.push(fs.AUTH_SIGN_IN_EMAIL)},children:t("r_essayer_21582")})]}),children:(0,i.jsx)(Vd,{direction:"column",initialValues:{email:o.getItem(tc.AUTH_EMAIL)||"",code:""},render:({handleSubmit:n,submitting:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:t("se_connecter_av_59438")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:t("saisissez_votre_01613")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(ec,{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)(md,{height:"4"}),(0,i.jsx)(ec,{autoComplete:"one-time-code",inputMode:"numeric",label:t("code_20843"),name:"code",pattern:"\\d*",placeholder:t("code_20843"),state:g?"disabled":void 0})]}),(0,i.jsx)(md,{height:"6"}),g?(0,i.jsx)(kd,{textAlign:"center",onClick:e.onFailure,children:t("recommencer_14712")}):(0,i.jsx)(kd,{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 h(m+1),{code:t("le_code_n_est_p_95065",3-(m+1))};{let i;return function(e,t,n){!async function(e){await fetch(`${F.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=As.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:$e.App}}),_(Date.now());const e=await async function(e,t,n){try{return await ee(e,t,n)}catch(i){if(i!==H)throw i;try{return await J(e,W().toString()),await ee(e,t,n)}catch{throw new Error("Auth failure")}}}(n.email,hc.A,hc.A);d(e),u(1)}}})})},vc=V.forwardRef(({css:e,hint:t,description:n,icon:o,state:s,onChange:r,label:a,onForgotPasswordClick:l,...d},c)=>{const u=Ti(),m=V.useRef(),[h,g]=V.useState("password"),{inputId:p,descId:f,errorId:_}=Hd();return(0,i.jsxs)(rd,{ref:m,css:e,direction:"column",width:1,onClick:e=>{e.preventDefault(),m.current?.querySelector("input")?.focus()},children:[(0,i.jsxs)(rd,{gap:"3",width:1,children:[(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(Zd,{htmlFor:p,children:a})}),"function"==typeof l&&(0,i.jsx)(ka,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{l?.()},children:u("mot_de_passe_ou_17690")})]}),(0,i.jsx)(Kd,{id:f,children:n}),(a||n)&&(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(Jd,{cursor:"text",icon:o,rightIcon:"password"===h?"eye":"eye-slash",state:s,onRightIconClick:e=>{Gd(e),g("password"===h?"text":"password")},children:(0,i.jsx)(ka,{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?_:void 0,"aria-invalid":"error"===s,disabled:"disabled"===s,id:p,type:h,onChange:e=>{r(e.target.value)},...d})})}),(0,i.jsx)(Yd,{id:_,state:s,children:t})]})});vc.displayName="PasswordInput";const bc=({name:e,autoComplete:t,hint:n,state:o,...s})=>(0,i.jsx)(cd.D0,{name:e,render:r=>{const a=Wd(r.meta);return(0,i.jsx)(vc,{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 jc=class extends lc{constructor(e){super(e)}step1Schema(){return c.Ik().shape({email:this.email()})}step2Schema(){return c.Ik().shape({email:this.email(),code:this.code(),password:this.passwordRules()})}};jc=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],jc);const Cc=xa("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"}}}}),yc=V.forwardRef((e,t)=>{const n={gridTemplate:e.gridtemplate,gridTemplateColumns:e.gridtemplatecolumns,gridTemplateRows:e.gridtemplaterows};return e.height&&(n.height=ga(e.height)),e.width&&(n.width=ga(e.width)),(0,i.jsx)(Cc,{role:"grid",...e,ref:t,css:{...n,...e.css}})});yc.displayName="Grid";const Ac=e=>(0,i.jsxs)(rd,{align:"center",gap:{"@initial":"2","@desktop":"1"},children:[(0,i.jsx)(rd,{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)(Id,{icon:"check"})}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:e.children})]}),Sc=e=>{const t=Ti();return(0,i.jsxs)(yc,{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)(Ac,{isValid:oc(e.password),children:t("16_caract_res_m_52434")}),(0,i.jsx)(Ac,{isValid:sc(e.password),children:t("au_moins_un_chi_73862")}),(0,i.jsx)(Ac,{isValid:rc(e.password),children:t("au_moins_une_ma_58302")}),(0,i.jsx)(Ac,{isValid:ac(e.password),children:t("au_moins_un_car_54396")})]})},kc=e=>{const t=Ti(),n=$i(),o=Mi(),s=Ei(ld),r=Ei(jc),[a,l]=(0,V.useState)(0);return(0,i.jsx)(_c,{link:(0,i.jsxs)(xc,{children:[(0,i.jsx)(ka,{color:"gray500",children:t("vous_n_avez_pas_69078")}),(0,i.jsx)(ka,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{n.push(fs.AUTH_SIGN_IN_EMAIL)},children:t("r_essayer_21582")})]}),children:(0,i.jsx)(Vd,{direction:"column",initialValues:{email:o.getItem(tc.AUTH_EMAIL)||"",code:"",password:""},render:({handleSubmit:e,submitting:n,values:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:t("mot_de_passe_ou_17690")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:t("saisissez_votre_47959")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(ec,{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)(md,{height:"4"}),(0,i.jsx)(ec,{autoComplete:"one-time-code",inputMode:"numeric",label:t("code_re_u_par_e_75150"),name:"code",pattern:"\\d*",placeholder:t("code_20843")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(bc,{autoComplete:"new-password",label:t("nouveau_mot_de_46347"),name:"password",placeholder:t("entrez_votre_mo_51874")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Sc,{password:o.password})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(kd,{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 ne(t.email),l(1)):e.onSuccess(await ie(t.email,t.code,t.password))}})})},wc={Aso:{Aso:n(8301),HomeBackground:n(8144),Logo:n(0)},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),NetflixWood:n(5095),UserProfile:n(8264),WeezConstruction:n(6400)},Ec={Alert:n(2630),Check:n(3780),DnsBlank:n(1037),DnsWrongDomain:n(8184),Done:n(8652),Done2:n(3574),FileBlank:n(7619),FileCSV:n(9625),FileJPG:n(6751),FilePDF:n(9848),FilePNG:n(6959),FileZIP:n(539),RecrewteerMarker:n(8798),Sad:n(5376),WeezeventBlankHandGlobe:n(2599),WeezeventBlankMessages:n(6687),WeezeventBlankPerson:n(7648),WeezeventBlankSwissArmyKnife:n(4362)};var Tc=n(7480);const Rc=[ae.De,ae.En,ae.Es,ae.Fr,ae.Nl];function Oc(e){return e===ae.En?"en-gb":e.toString().toLowerCase()}function Dc(e){if(g(e)){const t=(0,Tc.A)(e.trim().substring(0,2));return Rc.includes(t)?t:null}return null}function zc(e,t){return t.has("lang")?Dc(t.get("lang"))||ae.En:e||Dc(navigator.language)||ae.En}ae.En.toLowerCase(),ae.Fr.toLowerCase(),ae.De.toLowerCase(),ae.Es.toLowerCase(),ae.Nl.toLowerCase();const $c=F.EMAIL_FROM_NAME,Pc=(F.EMAIL_PICTURE_LINK,F.EMAIL_FROM);function Mc(e){return e===ae.Fr?`${F.HEAVENT_ASSETS_URL}/cgu/weezcrew-cgus-fr.pdf`:e===ae.Nl?`https://${F.WEEZEVENT_DOMAIN}/nl/gebruiksvoorwaarden-diensten`:e===ae.Es?`https://${F.WEEZEVENT_DOMAIN}/es/cgus`:`https://${F.WEEZEVENT_DOMAIN}/en-gb/terms-of-use`}const Fc=e=>{const{translate:t,history:n}=bd(),o=Ei(lc),s=Ei(ld),r=Mi(),a=Mc(zc(null,new URL(location.href).searchParams));return(0,i.jsx)(_c,{link:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(ka,{color:"gray500",children:t("pas_encore_sur_13386")}),(0,i.jsx)(ka,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{n.push(fs.AUTH_SIGN_UP_CREDENTIALS)},children:t("ouvrez_un_compt_91337")})]}),(0,i.jsx)(xc,{children:(0,i.jsx)(ka,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{window.open(a,"_blank")},children:t("conditions_g_n_34786")})})]}),children:(0,i.jsx)(Vd,{direction:"column",initialValues:{email:"",password:""},render:({handleSubmit:e,submitting:o,values:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:t("ravi_de_vous_re_24368")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:t("identifiez_vous_57743")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(ec,{autoComplete:"email",isEmail:!0,label:t("adresse_e_mail_60930"),name:"email",placeholder:t("entrez_votre_ad_42451")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(bc,{label:t("mot_de_passe_41738"),name:"password",placeholder:t("entrez_votre_mo_51874"),onForgotPasswordClick:()=>{r.setItem(tc.AUTH_EMAIL,s.email),n.push(fs.AUTH_FORGOT_PASSWORD)}}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(kd,{isLoading:o,textAlign:"center",onClick:e,children:t("se_connecter_63820")}),(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{align:"center",gap:"4",children:[(0,i.jsx)(ka,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}}),(0,i.jsx)(ka,{color:"gray500",fontSize:"textXs",children:t("ou_67404")}),(0,i.jsx)(ka,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{r.setItem(tc.AUTH_EMAIL,s.email),n.push(fs.AUTH_SIGN_IN_CODE)},children:[(0,i.jsx)(ka,{color:"gray500",fontSize:"textMd",children:(0,i.jsx)(Id,{icon:"envelope"})}),(0,i.jsx)(ka,{color:"gray700",children:t("se_connecter_av_59438")})]}),(0,i.jsx)(md,{height:"4"}),(0,i.jsxs)(rd,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{window.location.href=fc("Google")},children:[(0,i.jsx)(ka,{children:(0,i.jsx)("img",{alt:"Google logo",height:"24px",src:wc.Google})}),(0,i.jsx)(ka,{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 te(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 Nc=class extends lc{constructor(e){super(e)}step1Schema(){return c.Ik().shape({email:this.email(),password:this.passwordRules()})}step2Schema(){return c.Ik().shape({email:this.email(),code:this.code(),password:this.passwordRules()})}};Nc=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],Nc);const Lc=e=>{const{history:t,translate:n}=bd(),o=Ei(ld),s=Ei(Nc),[r,a]=(0,V.useState)(0),l=Mc(zc(null,new URL(location.href).searchParams));return(0,i.jsx)(_c,{link:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(ka,{color:"gray500",children:n("vous_avez_d_j_26391")}),(0,i.jsx)(ka,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{t.push(fs.AUTH_SIGN_IN_EMAIL)},children:n("connectez_vous_14760")})]}),(0,i.jsx)(xc,{children:(0,i.jsx)(ka,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{window.open(l,"_blank")},children:n("conditions_g_n_34786")})})]}),children:(0,i.jsx)(cd.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)(ka,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:n("cr_er_un_compte_71423")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:n("utilisez_recrew_64841")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(ec,{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)(md,{height:"4"}),(0,i.jsx)(bc,{label:n("nouveau_mot_de_46347"),name:"password",placeholder:n("entrez_votre_mo_51874"),state:r>0?"disabled":"active"}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Sc,{password:o.password}),r>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ec,{autoComplete:"one-time-code",inputMode:"numeric",label:n("code_re_u_par_e_75150"),name:"code",pattern:"\\d*",placeholder:n("code_20843")})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(kd,{isLoading:t,textAlign:"center",onClick:e,children:n(0===r?"recevoir_le_cod_04513":"cr_er_mon_compt_84515")}),(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{align:"center",gap:"4",children:[(0,i.jsx)(ka,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}}),(0,i.jsx)(ka,{color:"gray500",fontSize:"textXs",children:n("ou_67404")}),(0,i.jsx)(ka,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{window.location.href=fc("Google")},children:[(0,i.jsx)(ka,{children:(0,i.jsx)("img",{alt:"Google logo",height:"24px",src:wc.Google})}),(0,i.jsx)(ka,{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 ne(t.email),a(1)):e.onSuccess(await ie(t.email,t.code,t.password))}})})},Bc=async e=>{await Js(dr,{token:e}),window.location.href=fs.HOME},Vc=e=>{e&&Vi("Auth failure",e),window.location.href=fs.AUTH_SIGN_IN},Uc=()=>(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{exact:!0,path:fs.AUTH_FORGOT_PASSWORD,children:(0,i.jsx)(kc,{onSuccess:Bc})}),(0,i.jsx)(Ea.qh,{exact:!0,path:fs.AUTH_SIGN_IN_EMAIL,children:(0,i.jsx)(Fc,{onSuccess:Bc})}),(0,i.jsx)(Ea.qh,{exact:!0,path:fs.AUTH_SIGN_IN_CODE,children:(0,i.jsx)(Ic,{onFailure:Vc,onSuccess:Bc})}),(0,i.jsx)(Ea.qh,{exact:!0,path:fs.AUTH_SIGN_UP_CREDENTIALS,children:(0,i.jsx)(Lc,{onSuccess:Bc})}),(0,i.jsx)(Ea.qh,{exact:!0,path:fs.AUTH_SIGN_UP_CODE,children:(0,i.jsx)(Fi,{path:fs.AUTH_SIGN_IN_EMAIL})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:fs.AUTH_SIGN_IN_EMAIL})})]}),Wc=e=>(V.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",{})})),Gc=()=>{const[,e]=location.search.substr(1).split("="),{data:t,loader:n}=Oi("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)(Wc,{loader:n,onLoad:()=>{!function(e){const t=new U.p4({IdToken:new U.Yw({IdToken:e.idToken}),RefreshToken:new U.c9({RefreshToken:e.refreshToken}),AccessToken:new U.pD({AccessToken:e.accessToken})}),n=e.email.trim().toLowerCase();new U.TU({Username:n,Pool:Y()}).setSignInUserSession(t)}(t.userTokens),window.location.href=fs.HOME}})},qc="www.partagetapassion.com",Hc="registering.aso.fr",Kc="billets.onepiecemarket.fr",Yc=new Map([[1792,"evenements.handicap-international.fr"],[858,qc],[1773,"communaute.rncb.fr"],[3306,"mariage.ravey.fr"],[3136,Hc],[3469,Kc]]);function Zc(e){(0,V.useEffect)(()=>{const t=document.title;return document.title=(n=location.host,`${g(i=e)?`${i} | `:""}${function(e){return e===qc?"Partage Ta Passion":e===Kc?"One Piece":e===Hc?"A.S.O.":$c}(n)}`),()=>{document.title=t};var n,i},[e])}function Xc(e,t){const n=V.useCallback(e,t||[]);V.useEffect(()=>(document.addEventListener("click",n,!1),()=>{document.removeEventListener("click",n,!1)}),t||[])}function Jc(e){const t=(0,V.useCallback)(t=>{"Esc"!==t.key&&"Escape"!==t.key||e()},[]);(0,V.useEffect)(()=>(document.addEventListener("keydown",t,!1),()=>{document.removeEventListener("keydown",t,!1)}),[])}const Qc="h-dropdown-open";function eu(e,t){e.dispatchEvent(new CustomEvent(Qc,{bubbles:!0,detail:{uuid:t??""}}))}const tu=V.createContext({}),nu=e=>{const t=V.useRef(W()),[n,o]=V.useState(e.isOpen??!1),[s,r]=V.useState(null),[a,l]=V.useState(null),d=V.useCallback(n=>{e.disabled||(o(n),e.onStateChange&&e.onStateChange(n),!0===n&&s&&eu(s,t.current))},[e.disabled,s,o,e.onStateChange]),c=V.useCallback(n=>{n.detail.uuid!==t.current&&!0!==e.doNotCloseOnOtherOpen&&d(!1)},[d]);return V.useEffect(()=>{e.isOpen!==n&&o(e.isOpen??!1)},[e.isOpen]),V.useEffect(()=>(document.addEventListener(Qc,c),()=>{document.removeEventListener(Qc,c)}),[c]),Jc(()=>{d(!1)}),Xc(()=>{d(!1)}),(0,i.jsx)(tu.Provider,{value:{isOpen:n,referenceElement:s,popperElement:a,setIsOpen:d,setReferenceElement:r,setPopperElement:l},children:e.children})};function iu(){return V.useContext(tu)}const ou=xa("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:"$primary500"}},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"}}),su=({children:e,color:t,css:n,download:o,to:s,onClick:r,target:a,role:l})=>"disabled"!==t&&s?(0,i.jsx)(_d,{download:o,target:a,to:s,onClick:e=>r?.(e),children:(0,i.jsx)(ou,{color:t||"default",css:n,children:e})}):(0,i.jsx)(ou,{color:t||"default",css:n,role:l??"menuitem",tabIndex:s?void 0:"presentation"!==l?0:void 0,onClick:e=>r?.(e),children:e}),ru=({css:e,children:t,color:n,download:o,icon:s,isDisabled:r=!1,onClick:a,to:l,target:d})=>(0,i.jsx)(su,{color:n,css:{cursor:r?"not-allowed":"pointer",opacity:r?"0.6":"inherit",...e},download:o,target:d,to:l,onClick:e=>{r||(eu(e.target),a?.(e))},children:(0,i.jsxs)(rd,{align:"center",gap:"3",height:1,width:1,children:[(0,i.jsx)(rd,{align:"center",height:1,justify:"start",width:16,children:(0,i.jsx)(Id,{icon:s})}),(0,i.jsx)(ka,{css:{flex:"1",ellipsis:""},children:t})]})});var au=n(832);const lu=e=>{const{isOpen:t,referenceElement:n,popperElement:o,setPopperElement:s}=iu(),{styles:r,attributes:a,update:l}=(0,au.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";V.useEffect(()=>{l?.()},[l,t,n]),V.useEffect(()=>{if(n){const e=new ResizeObserver(()=>{l?.()});return e.observe(n),()=>{e.disconnect()}}return hc.A},[l,n]);const c=(0,i.jsx)(rd,{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=>Gd(e,!1),...a.popper,tabIndex:-1,children:e.children});return t?e.renderOnPortal?(0,pn.createPortal)(c,document.body):c:null},du=e=>{const{isOpen:t,setIsOpen:n,setReferenceElement:o}=iu(),s=e.children,r=e=>{Gd(e),n(!t),s.props.onClick?.(e)},a=V.cloneElement(V.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 cu=n(5315);function uu(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 mu(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 hu=[0,50,100,200,300,400,500,600,700,800,900,950,1e3],gu=Object.fromEntries(["gray","grayDark","primary","error","warning","success","blue","blueGray","blueLight","purple","purpleLight","purpleDark","pink","orange","redLight","redDark","green","greenDark","brown"].flatMap(e=>{const t={50:Ia.colors[`${e}50`].value,100:Ia.colors[`${e}100`].value,500:Ia.colors[`${e}500`].value,700:Ia.colors[`${e}700`].value};return[[e,t],[t[700],t]]}));function pu(e,t=700){const n=gu[e.toLowerCase()];if(n)return n;{const n=(0,cu.KI)(e),i=((e,t=700)=>hu.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()]))}}const fu={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function _u(e){return g(e)&&(function(e){return/^#(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/g.test(e)}(e)||function(e){return Object.keys(fu).includes(e)}(e))}function xu(e,{higherIsBetter:t}={higherIsBetter:!0}){return e<=.2?t?Ia.colors.error500.value:Ia.colors.success500.value:e<=.7?Ia.colors.warning500.value:e<=1?t?Ia.colors.success500.value:Ia.colors.error500.value:Ia.colors.blueGray500.value}const Iu=xa("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"}}),vu=V.forwardRef((e,t)=>{const n=V.useMemo(()=>{const t=e.color||"gray",n=pu(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"}}:"orange"===t?{background:"$orange50",color:"$orange700","& > .h-badge-left-icon":{color:"$orange500"}}:{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)(Iu,{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)(rd,{className:"h-badge-left-icon",css:{cursor:e.onLeftIconClick?"pointer":"inherit"},onClick:t=>{e.onLeftIconClick?.(t)},children:(0,i.jsx)(Id,{icon:e.leftIcon,iconStyle:e.leftIconStyle})}),e.children&&(0,i.jsx)(ka,{className:"h-badge-content",css:{flex:"1",overflow:"hidden"},title:e.title,onClick:t=>{e.onContentClick?.(t)},children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:"string"==typeof e.children?e.children:"",children:e.children})}),e.rightIcon&&(0,i.jsx)(rd,{css:{cursor:e.onRightIconClick?"pointer":"inherit"},onClick:t=>{e.onRightIconClick?.(t)},children:(0,i.jsx)(Id,{icon:e.rightIcon})}),("number"==typeof e.count||g(e.count))&&(0,i.jsx)(rd,{align:"center",className:"h-badge-count",children:e.count})]})});vu.displayName="Badge";const bu=Ca({"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}),ju=V.memo(function(e){const t="circular"===e.variant?e.size:e.height,n="circular"===e.variant?e.size:e.width;return(0,i.jsx)(ka,{css:{animation:`${bu} 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 Cu=n(7456),yu=n(4757);const Au=e=>(0,i.jsx)(rd,{css:{background:"$gray50",boxShadow:"0px -1px 3px rgba(16, 24, 40, 0.1), 0px -1px 2px rgba(16, 24, 40, 0.06)",color:"$primary500",cursor:"pointer",padding:"$3 $4",userSelect:"none"},width:1,onClick:e.onClick,children:e.children});function Su(e,t){"production"!==a.Production&&console.warn(`Component ${e} is deprecated, use ${t} instead.`)}const ku=xa("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 $primaryCustom600"}},checked:{background:"$primaryCustom600",border:"none",color:"white"},indeterminate:{background:"$primaryCustom600",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"}}),wu=({shouldPreventDefault:e=!0,...t})=>{Su("common-front/src/designSystem/components/checkbox.tsx","a new component following the pattern of common-front/src/designSystem/components/radioCard.tsx");const n=n=>{e&&Gd(n),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked",n):t.onClick("checked",n))};return(0,i.jsxs)(ku,{"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)},onMouseDown:e=>{e.shiftKey&&Gd(e)},children:["checked"===t.state&&(0,i.jsx)("i",{className:"far fa-check"}),"indeterminate"===t.state&&(0,i.jsx)("div",{})]})},Eu=({shouldPreventDefault:e=!0,...t})=>{Su("common-front/src/designSystem/components/checkbox.tsx","a new component following the pattern of common-front/src/designSystem/components/radioCard.tsx");const{descId:n,inputId:o,labelId:s}=Hd(),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)(rd,{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)(rd,{css:{alignItems:"center",height:"md"===t.size?"23px":"20px"},children:(0,i.jsx)(wu,{descId:n,disabled:t.disabled,inputId:o,labelId:s,shouldPreventDefault:!1,size:t.size,state:t.state,tabIndex:-1,onClick:hc.A})}),(0,i.jsx)(md,{width:"2"}),(0,i.jsxs)(rd,{css:{flexDirection:"column",fontSize:"md"===t.size?"$3":"$2"},children:[(0,i.jsx)(Zd,{htmlFor:o,id:s,children:(0,i.jsx)(ka,{css:{color:t.disabled&&!r?"$gray300":"$gray800"},fontWeight:"medium",children:t.children})}),r&&(0,i.jsx)(ka,{color:"gray500",id:n,children:t.subtext})]})]})},Tu=({children:e,index:t,state:n,onToggle:o,...s})=>(0,i.jsxs)(i.Fragment,{children:[0!==t&&(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{align:"center",css:o?{cursor:"pointer",userSelect:"none"}:void 0,gap:"2",width:1,onClick:o,children:[o&&(0,i.jsx)(wu,{shouldPreventDefault:!1,state:n??"unchecked",onClick:hc.A}),(0,i.jsx)(ka,{"aria-label":e?.toString(),css:{flex:"1"},font:"gray600 textXs semiBold",role:"group",...s,children:e})]}),(0,i.jsx)(md,{height:"2"})]});function Ru(e){return"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Ru).join(""):(0,V.isValidElement)(e)?Ru(e.props.children):""}const Ou=xa("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"}}),Du=({shouldPreventDefault:e=!0,...t})=>{Su("common-front/src/designSystem/components/radio.tsx","common-front/src/designSystem/components/radioCard.tsx for card-style radio buttons, or create a new component following that pattern for other styles of radio button");const n=n=>{e&&Gd(n),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked"):t.onClick("checked"))};return(0,i.jsx)(Ou,{"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",{})})},zu=({shouldPreventDefault:e=!0,...t})=>{Su("common-front/src/designSystem/components/radio.tsx","common-front/src/designSystem/components/radioCard.tsx for card-style radio buttons, or create a new component following that pattern for other styles of radio button");const{inputId:n,descId:o,labelId:s}=Hd(),r="string"==typeof t.subtext&&t.subtext.length>0,a=n=>{e&&Gd(n),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked"):t.onClick("checked"))};return(0,i.jsxs)(rd,{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)(rd,{css:{alignItems:"center",height:"md"===t.size?"23px":"20px"},children:(0,i.jsx)(Du,{descId:o,disabled:t.disabled,inputId:n,labelId:s,shouldPreventDefault:!1,size:t.size,state:t.state,tabIndex:-1,onClick:hc.A})}),(0,i.jsx)(md,{width:"2"}),(0,i.jsxs)(rd,{css:{flexDirection:"column",fontSize:"md"===t.size?"$3":"$2","& div":{cursor:"pointer !important"}},children:[(0,i.jsx)(Zd,{htmlFor:n,id:s,children:(0,i.jsx)(ka,{css:{color:t.disabled&&!r?"$gray300":"$gray800"},fontWeight:"medium",children:t.children})}),t.subtext&&(0,i.jsx)(ka,{color:"gray500",id:o,children:t.subtext})]})]})},$u=({badge:e,children:t,color:n,css:o,disabled:s,isCheckbox:r,isRadio:a,isSelected:l,onClick:d,subtext:c,value:u,...m})=>{const h=(0,V.useCallback)(()=>{s||d?.()},[s,d]),p=(0,V.useCallback)(e=>{"Enter"===e.key&&h?.()},[h]),f=(0,V.useMemo)(()=>Ru(t),[t]);return(0,i.jsxs)(rd,{align:"center","aria-checked":r?l:void 0,"aria-label":f,"aria-selected":l,css:{cursor:s?"default":"pointer",minHeight:"40px",padding:"$2 $3",userSelect:"none","&:hover":{background:"$gray100",borderRadius:"$1"},...o},gap:"3",role:"option",tabIndex:0,width:1,onClick:h,onKeyDown:p,...m,children:[r&&(0,i.jsx)(wu,{disabled:s,shouldPreventDefault:!1,state:l?"checked":"unchecked",onClick:hc.A}),a&&(0,i.jsx)(Du,{shouldPreventDefault:!1,state:l?"checked":"unchecked",onClick:hc.A}),(0,i.jsxs)(rd,{align:"center",css:{flex:"1",overflow:"hidden"},gap:"2",children:[_u(n)&&!e&&(0,i.jsx)(ka,{css:{background:n,borderRadius:"16px",overflow:"hidden"},height:16,width:16}),_u(n)&&e?(0,i.jsx)(rd,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(vu,{color:n,children:t})}):(0,i.jsxs)(rd,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{color:"gray800",css:{ellipsis:!0},title:f,width:1,children:t}),g(c)&&(0,i.jsx)(ka,{color:"gray500",css:{ellipsis:!0},title:c,width:1,children:c})]})]}),!r&&!a&&l&&(0,i.jsx)(ka,{color:"primary500",children:(0,i.jsx)(Id,{icon:"check"})})]})};var Pu=n(7231);function Mu(e,t){if(0===e.length)return"unchecked";{const n=(0,Pu.A)(e,t).length;return 0===n?"unchecked":n>=e.length?"checked":"indeterminate"}}function Fu(e,t,n){return"checked"===n?(0,yu.A)(e,t):(0,bs.A)(e.concat(t))}function Nu(e){return V.Children.toArray(e).map(t=>{if("optgroup"===t.type)return[{id:(0,qd.A)(),type:"group",text:t.props.label}].concat(Nu(t.props.children));if("option"===t.type)return{id:(0,qd.A)(),type:"option",text:t.props.children,value:t.props.value,badge:!0===t.props["data-badge"]||"true"===t.props["data-badge"],color:t.props["data-color"],disabled:t.props.disabled,radio:t.props["data-radio"],selected:t.props.selected,style:t.props.style,subtext:t.props["data-subtext"]};if(t.type===Symbol.for("react.fragment"))return Nu(t.props.children);throw Vi("Unexpected child type",t,e),new Error("Unexpected child type")}).flat()}function Lu(e){return Object.fromEntries(e.filter(e=>"option"===e.type).map(e=>[e.value,e.text]))}var Bu=n(9116),Vu=n(6618);const Uu=({children:e,createText:t,css:n,description:o,hint:s,icon:r,isCreateVisible:a,isSearchLoading:l,isSearchVisible:d,isSelectAllVisible:c,label:u,menuWidth:h,multiple:f,onChange:_,onClick:x,onCreateClick:I,placeholder:v,renderOnPortal:b,renderValue:j,searchElement:C,searchPlaceholder:y,state:A,triggerElem:S,values:k})=>{const{translate:w}=bd(),E=(0,V.useCallback)(e=>e?.focus({preventScroll:!0}),[]),[T,R]=(0,V.useState)(!1),[O,D]=(0,V.useState)(""),{inputId:z,descId:$}=Hd(),{displayedChildren:P,allValues:M,valuesByGroup:F,childrenByRadio:N,valueToName:L,valueToText:B}=function(e,t){const n=(0,V.useMemo)(()=>Nu(e),[e]),i=(0,V.useMemo)(()=>{const e=m(t||"");return n.filter(t=>""===e||"group"===t.type||m(Ru(t.text)).includes(e)).filter((e,t,n)=>{const i=n[t+1];return"option"===e.type||"option"===i?.type})},[n,t]),o=(0,V.useMemo)(()=>i.flatMap(e=>"option"===e.type?[e.value]:[]),[i]),s=(0,V.useMemo)(()=>{const e={};let t=null;for(const n of i)"group"===n.type?(t=n.id,e[t]=[]):t&&!n.disabled&&p(n.radio)&&e[t].push(n.value);return e},[i]),r=(0,V.useMemo)(()=>(0,Bu.A)((0,Vu.A)(i.filter(e=>"option"===e.type&&g(e.radio)),e=>e.radio),e=>e.map(e=>e.value)),[i]),a=(0,V.useMemo)(()=>Lu(n),[n]),l=(0,V.useMemo)(()=>(0,Bu.A)(a,Ru),[a]);return{displayedChildren:i,allValues:o,valuesByGroup:s,childrenByRadio:r,valueToName:a,valueToText:l}}(e,O),U=Mu(M,k),W=(0,V.useMemo)(()=>j?j(k[0],L[k[0]]):L[k[0]],[j,k,L]);return(0,V.useEffect)(()=>{T||D("")},[T]),(0,i.jsxs)(rd,{css:n,direction:"column",width:1,children:[u&&(0,i.jsx)(Zd,{htmlFor:z,children:u}),o&&(0,i.jsx)(Kd,{id:$,children:o}),(u||o)&&(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(nu,{disabled:"disabled"===A,isOpen:T,onStateChange:e=>R(e),children:[(0,i.jsx)(du,{children:S||(0,i.jsx)(Jd,{"aria-describedby":$,"aria-label":(u??v)+(B[k[0]]?` (currently: ${B[k[0]]})`:""),"aria-multiselectable":f,"aria-owns":P.map(e=>e.id).join(" "),"aria-placeholder":v,css:{maxHeight:"200px",overflowY:"auto",padding:"$2 $3",userSelect:"none",cursor:"disabled"===A?"not-allowed":void 0},cursor:"disabled"===A?"default":"pointer",height:"fluid",icon:r,id:z,rightIcon:T?"chevron-up":"chevron-down",role:"listbox",state:A,children:Bs(k)?f?(0,i.jsx)(rd,{css:{flex:"1",overflowY:"auto"},gap:"2",height:1,role:"presentation",wrap:"wrap",children:k.map((e,t)=>(0,i.jsx)(vu,{ellipsis:!0,rightIcon:"xmark",onRightIconClick:t=>{Gd(t),_((0,Cu.A)(k,e))},children:L[e]},t))}):(0,i.jsx)(ka,{color:"gray800",css:{flex:"1",overflow:"hidden"},role:"presentation",children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:B[k[0]],children:W})}):(0,i.jsx)(ka,{color:"gray500",css:{flex:"1"},role:"presentation",children:v})})}),(0,i.jsx)(lu,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:b,width:h??"match",children:(0,i.jsxs)(rd,{direction:"column",width:1,children:[(0,i.jsxs)(rd,{css:{padding:"$3"},direction:"column",width:1,children:[d&&(0,i.jsxs)(i.Fragment,{children:[C||(0,i.jsx)(Qd,{ref:E,icon:"magnifying-glass",placeholder:y||w("rechercher_50038"),state:"search",value:O,onChange:D}),(0,i.jsx)(md,{height:"3"})]}),(0,i.jsx)(ka,{css:{maxHeight:"250px",overflowY:"auto"},children:l?(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ju,{borderRadius:"$1",height:40}),(0,i.jsx)(ju,{borderRadius:"$1",height:40}),(0,i.jsx)(ju,{borderRadius:"$1",height:40})]}):P.map((e,t)=>{if("group"===e.type){const n=F[e.id]??[],o=!0===f&&Bs(n),s=Mu(n,k);return(0,i.jsx)(Tu,{id:e.id,index:t,state:o?s:void 0,onToggle:o?()=>{_(Fu(k,n,s))}:void 0,children:e.text},e.id)}{const n=e.value,o=e.selected??k.includes(n),s=e.radio,r=!0===f&&p(s),a=!0===f&&g(s);return(0,i.jsx)($u,{badge:e.badge,color:e.color,css:e.style,disabled:e.disabled,id:e.id,isCheckbox:r,isRadio:a,isSelected:o,subtext:e.subtext,value:e.value,onClick:()=>{if(x)x(n,o);else if(f&&r)_(o?(0,Cu.A)(k,n):k.concat(n));else if(f&&a){const e=(0,yu.A)(k,N[s]).concat(o?[]:[n]);_(e)}else _(o?[]:[n]),R(!1)},children:e.text},t)}})})]}),a&&(0,i.jsxs)(Au,{onClick:()=>{I?.(),R(!1)},children:["+ ",t||w("cr_er_82895")]}),c&&(0,i.jsx)(Au,{onClick:()=>{_(Fu(k,M,U))},children:w("checked"===U?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")})]})})]}),(0,i.jsx)(Yd,{state:A,children:s})]})},Wu=e=>(0,i.jsx)(rd,{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}),Gu=V.createContext({}),qu=e=>{const[t,n]=V.useState(null);return(0,i.jsx)(Gu.Provider,{value:{clickedRowIndex:t,setClickedRowIndex:n},children:e.children})},Hu=({children:e,css:t,hideBorder:n,...o})=>(0,i.jsx)(qu,{children:(0,i.jsx)(rd,{className:!0===n?"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"},...t},direction:"column",...o,children:e})}),Ku="old",Yu="new2025",Zu=(0,V.createContext)({});function Xu(){return(0,V.useContext)(Zu)}function Ju(e,t){return{flex:t?"1 1 0":e?"0 0 0":"1",minWidth:t?`${t}px`:e?`${e}px`:void 0}}const Qu=V.forwardRef((e,t)=>(0,i.jsx)(rd,{ref:t,align:"center",className:"table-cell",css:{...Ju(e.width,e.minWidth),color:"$gray800",overflow:"hidden",px:"$3",...e.css},height:1,role:"gridcell",onClick:t=>{e.onClick&&e.onClick(t)},...(0,Ta.A)(e,["direction","align","justify","wrap","gap"]),children:e.children}));Qu.displayName="Cell";const em=25,tm=[25,50,100];var nm=n(7773);function im(e){const t=window.matchMedia(e),[n,i]=(0,V.useState)(t.matches);return(0,V.useEffect)(()=>{const e=()=>i(t.matches);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},[n,e]),n}function om(){return im(fa.mobile)}const sm=e=>(0,i.jsx)(kd,{color:"white",css:{background:e.active?"$gray100":"white",border:0,borderInlineStart:"1px solid $gray300",color:e.disabled?"$gray400":"$gray700",cursor:e.disabled?"not-allowed":e.cursor,fontWeight:"$medium",inlineSize:"40px",blockSize:"32px",alignItems:"center",justifyContent:"center",borderRadius:"unset"},disabled:e.disabled,textAlign:"center",onClick:()=>{e.onClick()},children:e.children}),rm=e=>{const{translate:t}=bd(),n=om(),o=e.limit??em,s=Ri(),r=e.offset/o,a=(0,nm.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)(Qu,{css:{gap:"$6","@tablet":{justifyContent:"space-between"}},children:[(0,i.jsx)(ka,{css:{order:1,display:n?"none":void 0},width:150,children:!n&&e.showLimits&&(0,i.jsxs)(rd,{align:"center",css:{inlineSize:"fit-content",overflow:"hidden"},gap:"4",children:[(0,i.jsx)(rd,{css:{border:"1px solid $gray300",inlineSize:"fit-content",overflow:"hidden",borderRadius:"$1","& > button:first-child":{borderInlineStart:"none"}},children:tm.map((t,n)=>(0,i.jsx)(sm,{active:o===t,cursor:"pointer",disabled:!1,onClick:()=>{e.setLimit?.(t)},children:t},n))}),e.itemName&&(0,i.jsx)(Od,{css:{width:150},children:t("_1_per_page_06128",e.itemName)})]})}),!n&&(e.totalCount>o?(0,i.jsxs)(rd,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",order:3,"& > button:first-child":{borderInlineStart:"none"}},children:[(0,i.jsx)(sm,{active:!1,cursor:l?"default":"pointer",disabled:l,onClick:()=>e.setOffset(e.offset-o),children:(0,i.jsx)(Id,{icon:"arrow-left"})}),e.numberOfPages<=7?(0,nm.A)(0,e.numberOfPages).map(t=>(0,i.jsx)(sm,{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)(sm,{active:!1,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(0),children:"1"}),!a.includes(1)&&(0,i.jsx)(sm,{active:!1,cursor:"default",disabled:!1,onClick:hc.A,children:(0,i.jsx)(Id,{icon:"ellipsis"})}),a.map(t=>(0,i.jsx)(sm,{active:r===t,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(t*o),children:t+1},t)),!a.includes(e.numberOfPages-2)&&(0,i.jsx)(sm,{active:!1,cursor:"default",disabled:!1,onClick:hc.A,children:(0,i.jsx)(Id,{icon:"ellipsis"})}),!a.includes(e.numberOfPages-1)&&(0,i.jsx)(sm,{active:!1,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset((e.numberOfPages-1)*o),children:e.numberOfPages})]}),(0,i.jsx)(sm,{active:!1,cursor:d?"default":"pointer",disabled:d,onClick:()=>e.setOffset(e.offset+o),children:(0,i.jsx)(Id,{icon:"arrow-right"})})]}):(0,i.jsx)(ka,{css:{order:3}})),n&&(0,i.jsx)(rd,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",order:1,inlineSize:"fit-content","& > button:first-child":{borderInlineStart:"none"}},children:(0,i.jsx)(sm,{active:!1,cursor:l?"default":"pointer",disabled:l,onClick:()=>e.setOffset(e.offset-o),children:(0,i.jsx)(Id,{icon:"arrow-left"})})}),(0,i.jsx)(ka,{css:{order:2,flex:"1","@tablet":{order:3,flex:"unset"}},textAlign:n?"center":"end",width:150,children:n?[...s(t("page_1_of_2_92409"),(0,i.jsx)("b",{children:r+1}),(0,i.jsx)("b",{children:e.numberOfPages}))]:[...s(t(e.itemName?"_1_of_2_3_03566":"x_to_y_of_x","{1}",e.totalCount,e.itemName),(0,i.jsxs)("b",{children:[r*o+1,"–",c]}))]}),n&&(0,i.jsx)(rd,{css:{border:"1px solid $gray300",order:3,borderRadius:"$1",overflow:"hidden",inlineSize:"fit-content","& > button:first-child":{borderInlineStart:"none"}},children:(0,i.jsx)(sm,{active:!1,cursor:d?"default":"pointer",disabled:d,onClick:()=>e.setOffset(e.offset+o),children:(0,i.jsx)(Id,{icon:"arrow-right"})})})]})},am=e=>{const{setClickedRowIndex:t}=V.useContext(Gu);return(0,i.jsx)(rd,{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})},lm=e=>(0,i.jsx)(am,{css:{borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",height:"56px",...e.css},children:e.children}),dm=({css:e,filters:t,headerCells:n,limit:o,numberOfPages:s,offset:r,rows:a,setLimit:l,setOffset:d,showLimits:c=!1,showPagination:u=!0,title:m,totalCount:h})=>{const{designSystem:g}=Xu(),p=(c||u)&&"number"==typeof s&&"number"==typeof r&&"function"==typeof d&&(h??0)>0;return(0,i.jsxs)(ka,{css:{...e},children:[(0,i.jsxs)(rd,{align:"center",css:{background:"white",border:"1px solid $gray200",borderBottom:"none",borderTopLeftRadius:"$2",borderTopRightRadius:"$2",padding:"$3 $6"},gap:"3",children:[m&&(0,i.jsx)(ka,{color:"gray900",css:{flex:"1"},fontSize:g===Yu?"textMd":"textLg",fontWeight:"medium",children:m}),t]}),(0,i.jsxs)(Hu,{role:"grid",children:[(0,i.jsx)(Wu,{css:{borderRadius:"0 !important",borderTop:"1px solid $gray200"},children:n}),a,p&&(0,i.jsx)(lm,{children:(0,i.jsx)(rm,{limit:o,numberOfPages:s,offset:r,setLimit:l,setOffset:d,showLimits:c,totalCount:h??0})})]})]})};var cm=n(2499);function um(){const e=Ti();return t=>(0,cm.A)(t.map(t=>({value:t,translation:e(t)})),({translation:e})=>m(e)).map(({value:e,translation:t},n)=>(0,i.jsx)("option",{value:e,children:t},n))}var mm=n(4741);function hm(e,t=500){return(0,V.useCallback)((0,mm.A)(e,t),[])}function gm(e,t=500){const[n,i]=(0,V.useState)(e),[o,s]=(0,V.useState)(e),r=hm(e=>{s(e)},t);return[n,o,e=>{i(e),r(e)}]}const pm=e=>(0,i.jsx)(rd,{align:"center",className:"table-header-cell",css:{...Ju(e.width,e.minWidth),color:"$gray500",overflow:"hidden",px:"$3",...e.css},height:1,role:"columnheader",tabIndex:0,onClick:()=>{e.onClick?.()},...(0,Ta.A)(e,["aria-label","direction","align","justify","wrap","gap"]),children:e.children}),fm=e=>(0,i.jsx)(rd,{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)(ju,{borderRadius:"$1",height:1,width:1})}),_m=["weezevent.com","weeztix.com","kaboodle.com"];function xm(e){return _m.includes(e.split("@")[1])}function Im(e){return["benjamin.vuitton@weezevent.com","florent.odier@weezevent.com","matthieu.ravey@weezevent.com"].includes(e)}const vm=e=>(0,i.jsxs)(nu,{isOpen:e.isOpen,onStateChange:e.onStateChange,children:[(0,i.jsx)(du,{children:e.triggerElem||(0,i.jsx)(rd,{align:"center",css:{cursor:"pointer"},height:20,justify:"center",width:20,children:(0,i.jsx)(Id,{icon:"ellipsis-vertical"})})}),(0,i.jsx)(lu,{placement:"bottom-end",children:e.children})]}),bm=({css:e,children:t,hideIcon:n,to:o,...s})=>{const r=new URL(o.toString(),location.origin),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)(rd,{align:"center",as:"span",css:{cursor:"pointer",fontWeight:"$medium","&:hover":{textDecoration:"underline"},...e},gap:"2",children:(0,i.jsxs)(_d,{to:r,...s,children:[t,a&&(0,i.jsx)(ka,{as:"span",css:{marginInlineStart:"$1"},children:(0,i.jsx)(Id,{icon:a})})]})})};bm.displayName="LinkText";const jm=({children:e,css:t,gap:n,justify:o,width:s})=>(0,i.jsx)(Qu,{width:s??100,children:(0,i.jsx)(rd,{align:"center",className:"h-controls",css:{cursor:"pointer",display:"none",...t},gap:n??"6",height:1,justify:o,width:1,onClick:Gd,children:e})});let Cm=class{translationService;constructor(e){this.translationService=e}now(){return As.c9.utc()}invalid(){return As.c9.invalid("Invalid")}toLocaleString(e,t){return e.toLocaleString(t,{locale:Oc(this.translationService.language)})}};function ym(e){return e.infos?.billingAddress?.company||""}function Am(e){return e.infos?.vatExonerated?e.amountCents:1.2*e.amountCents}function Sm(e){switch(e){case Pe.Refunded:return{color:"warning",leftIcon:"rotate-left"};case Pe.Paid:return{color:"success",leftIcon:"check"};case Pe.Overdue:return{color:"error",leftIcon:"alarm-clock"};case Pe.Waiting:return{color:"error",leftIcon:"xmark"};case Pe.WrittenOff:return{color:"gray",leftIcon:"ban"};default:return vd()}}var km;Cm=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],Cm),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"}(km||(km={}));const wm=e=>{const t=Ti(),n=Ei(Cm),{user:o}=Li(),s=new Intl.NumberFormat(o?.language.toLowerCase()||"fr",{style:"currency",currency:e.invoice.currency}),r=(a=e.invoice).isWrittenOff?Pe.WrittenOff:a.isRefunded?Pe.Refunded:a.paidAt?Pe.Paid:a.insertedAte.markAsPaid?.(),children:t("marqu_e_comme_p_72620")}),!e.invoice.isRefunded&&(0,i.jsx)(ru,{icon:"rotate-left",onClick:()=>e.markAsRefunded?.(),children:t("marqu_e_comme_r_27551")}),!e.invoice.isWrittenOff&&(0,i.jsx)(ru,{icon:"ban",onClick:()=>e.markAsWrittenOff?.(),children:t("marqu_e_comme_i_89016")})]})})]})},Em=xa("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}}),Tm=xa("div",{display:"flex",flexDirection:"column",overflow:"auto",width:"100%",variants:{mobile:{true:{flex:"1",px:"$4"},false:{px:"$8"}}}}),Rm=xa("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"}}}}),Om=({buttons:e,children:t,onClose:n,role:o,size:s})=>{const r=om();return Jc(n),Su("../../../../../components/modals/__deprecated/modal/modal.tsx","../../../../../components/modals/base/modal.tsx"),(0,pn.createPortal)((0,i.jsx)(rd,{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)(Em,{mobile:r,open:!0,role:o,size:s,onClick:e=>Gd(e,!1),onMouseDown:e=>Gd(e,!1),children:[(0,i.jsx)(Tm,{mobile:r,children:t}),e&&(0,i.jsx)(Rm,{mobile:r,children:e})]})}),document.body)};var Dm=n(6666);const zm=e=>{const t=Ti(),{mutate:n,isLoading:o}=function(e={}){return Di("mutation BackofficeInvoiceMarkAsPaid($invoiceId: InvoiceId!, $transactionId: String!) {\n backofficeInvoiceMarkAsPaid(invoiceId: $invoiceId, transactionId: $transactionId)\n}\n",e)}(),{data:s}=Oi("query QontoTransactions {\n backoffice {\n qontoTransactions {\n id\n label\n amount\n }\n }\n}\n",{},[]),[r,a]=(0,V.useState)(null);return(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(ka,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(Id,{icon:"file-invoice"})}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",textAlign:"center",children:t("marqu_e_une_fac_47139")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("s_lectionner_un_46296"),values:r?[r]:[],onChange:e=>{a((0,Dm.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)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{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)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},$m=e=>{const{mutate:t}=function(e={}){return Di("mutation BackofficeInvoiceMarkAsRefunded($invoiceId: InvoiceId!) {\n backofficeInvoiceMarkAsRefunded(invoiceId: $invoiceId)\n}\n",e)}(),{mutate:n}=function(e={}){return Di("mutation BackofficeInvoiceMarkAsWrittenOff($invoiceId: InvoiceId!) {\n backofficeInvoiceMarkAsWrittenOff(invoiceId: $invoiceId)\n}\n",e)}(),[o,s]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wm,{invoice:e.invoice,isBackoffice:!0,markAsPaid:()=>s(!0),markAsRefunded:async()=>{await t({invoiceId:e.invoice.id}),e.reload()},markAsWrittenOff:async()=>{await n({invoiceId:e.invoice.id}),e.reload()},showColumn:e.showColumn}),o&&(0,i.jsx)(zm,{invoiceId:e.invoice.id,reload:e.reload,onClose:()=>s(!1)})]})},Pm=()=>{const{history:e,translate:t}=bd(),n=Mi(),o=um(),{user:s}=Li(),[r,a,l]=gm(""),[d,c]=(0,V.useState)([]),[u,m]=(0,V.useState)(em),[h,p]=(0,V.useState)(0),{data:f,isLoading:_,reload:x}=Oi("query BackofficeInvoices($name: String, $states: [InvoiceState!], $limit: Int, $offset: Int) {\n backoffice {\n invoices(name: $name, states: $states, limit: $limit, offset: $offset) {\n nodes {\n id\n invoiceNumber\n amountCents\n smsAmountCents\n currency\n paidAt\n url\n organizationsNames\n dealId\n isRefunded\n isWrittenOff\n insertedAt\n infos\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{name:g(a)?a:void 0,states:Bs(d)?d:void 0,limit:u,offset:h},[]);const[I,v]=(0,V.useState)(()=>{const e=n.getItem(tc.BACKOFFICE_INVOICES_COLUMNS);return e?JSON.parse(e):[]}),b=(0,V.useCallback)(e=>{v(e),n.setItem(tc.BACKOFFICE_INVOICES_COLUMNS,JSON.stringify(e))},[v]),j=(0,V.useCallback)(async e=>{try{const t=new URLSearchParams;e?t.set("date",e):Bs(d)&&t.set("states",d.join(","));const n=await fetch(`${F.HEAVENT_API_URL}/invoice/all?${t}`,{method:"post",headers:{[B]:await X()||""}}),{link:i}=await n.json();window.open(i,"_blank")}catch{window.alert(t("impossible_d_ex_55872"))}},[d]),C=e=>I.includes(e);return(0,i.jsx)(ka,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsxs)(rd,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(ka,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("factures_03552")}),(0,i.jsx)(ka,{children:(0,i.jsxs)(Uu,{isSelectAllVisible:!0,multiple:!0,placeholder:"Colonnes visibles",values:I,onChange:b,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("State")}),(0,i.jsx)("option",{value:"transactionId",children:t("id_de_la_transa_98869")})]})}),(0,i.jsx)(kd,{onClick:()=>{e.push(fs.HOME)},children:"Home"}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsx)(ru,{icon:"eye",onClick:()=>{e.push(fs.BACKOFFICE_ORGANIZATIONS)},children:t("voir_les_organi_78756")}),(0,i.jsx)(ru,{icon:"file-export",onClick:()=>j(null),children:"Exporter les factures sélectionnées"}),(0,i.jsx)(ru,{icon:"file-export",onClick:()=>j("this-month"),children:t("exporter_les_fa_11017")}),(0,i.jsx)(ru,{icon:"file-export",onClick:()=>j("last-month"),children:t("exporter_les_fa_01571")}),(0,i.jsx)(ru,{icon:"file-export",onClick:()=>j("all"),children:t("exporter_toutes_46318")})]})]})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(dm,{filters:(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("id_ou_nom_25064"),value:r,onChange:e=>{l(e),p(0)}})}),(0,i.jsx)(ka,{width:200,children:(0,i.jsx)(Uu,{isSearchVisible:!0,multiple:!0,values:d,onChange:c,children:o(Wn)})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:t("num_ro_de_factu_68150")}),C(km.Organization)&&(0,i.jsx)(pm,{children:t("organisation_71863")}),C(km.CustomerName)&&(0,i.jsx)(pm,{children:t("nom_du_client_28343")}),C(km.Date)&&(0,i.jsx)(pm,{children:t("Date")}),C(km.PaidAt)&&(0,i.jsx)(pm,{children:t("pay_e_le_92377")}),C(km.Amount)&&(0,i.jsx)(pm,{children:t("montant_55595")}),C(km.AmountTTC)&&(0,i.jsx)(pm,{children:t("montant_ttc_86677")}),C(km.State)&&(0,i.jsx)(pm,{children:t("State")}),C(km.TransactionId)&&(0,i.jsx)(pm,{children:t("id_de_la_transa_98869")}),Im(s?.email||"")&&(0,i.jsx)(pm,{width:100})]}),limit:u,numberOfPages:f.backoffice?.invoices.numberOfPages??0,offset:h,rows:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:f.backoffice.invoices.nodes.map(e=>(0,i.jsx)($m,{invoice:e,reload:x,showColumn:C},e.id))}),setLimit:m,setOffset:p,showLimits:!0,title:t("liste_des_factu_86735"),totalCount:f.backoffice?.invoices.totalCount??0})]})})};let Mm=class{countries;countriesCodes;phoneCodes;constructor(e){const t=e.translate.bind(e);this.countries=(0,cm.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_indian_08875"),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:"+383",code:"XK",name:t("kosovo_44440"),nationality:t("kosovare_35920"),emoji:"🇽🇰",smsPrice:.12},{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:"+596",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_virgin_42963"),emoji:"🇻🇬"},{phoneCode:"+1340",code:"VI",name:t("virgin_islands_12516"),nationality:t("american_virgi_98088"),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})=>m(e)),this.countriesCodes=this.countries.map(({code:e})=>e),this.phoneCodes=this.countries.flatMap(({phoneCode:e})=>Ls(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,cm.A)(this.countries.map(({code:e,name:t})=>({id:e,name:t})),({id:e,name:n})=>[e===t?1:2,m(n)])}getNationalitiesIdName(e){const t=this.getDefaultCountryValues(e).user.nationality;return(0,cm.A)(this.countries.map(({code:e,nationality:t})=>({id:e,name:t})),({id:e,name:n})=>[e===t?1:2,m(n)])}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=>Ls(e.language||[]).map(e=>e.toLowerCase()).includes(navigator.language.toLowerCase()))}catch{}t||(t=this.countries.find(({code:e})=>"FR"===e))}const n=Ls(t.language||[]);return{user:{language:n.some(e=>e.toLowerCase().startsWith("fr"))?ae.Fr:n.some(e=>e.toLowerCase().startsWith("es"))?ae.Es:n.some(e=>e.toLowerCase().startsWith("de"))?ae.De:n.some(e=>e.toLowerCase().startsWith("nl"))?ae.Nl:ae.En,country:t.code,nationality:t.code},phone:{country:t.code,code:Ls(t.phoneCode)[0]}}}getSmsPriceByPhone(e){return this.countries.find(t=>Ls(t.phoneCode).some(t=>e.startsWith(t)))?.smsPrice}};Mm=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],Mm);const Fm=[Oe.Date,Oe.Number,Oe.Text,Oe.Textarea],Nm=[Oe.Phone,Oe.Select,Oe.Text,Oe.Textarea];function Lm(e,t,n){const i=[],o=[];for(const s of t)if(!g(n)||m(s.name).includes(m(n))||g(s.label)&&m(s.label).includes(m(n))){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 Bm(e,t){return Bs(e.values)?e.values.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:t(n)},e)):Bs(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)):[]}function Vm(e,t){return m(e.name).includes(m(t))||(!("number"!=typeof(n=t)||!isFinite(n))||"string"==typeof n&&parseInt(n,10).toString(10)===n)&&e.id===parseInt(t,10);var n}let Um=class extends nc{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=As.c9.isDateTime(n.value)?n.value:As.c9.fromISO(n.value,{zone:"utc",setZone:!0}),o=!i.isValid||t.fieldType!==Zt.DateTimeRange&&t.fieldType!==Zt.Datetime?i.isValid&&t.fieldType===Zt.Date?this.dateTimeService.toLocaleString(i,zs.DateOnly.MonthLong):n.value:this.dateTimeService.toLocaleString(i,zs.DateTime),s=As.c9.isDateTime(n.value2)?n.value2:As.c9.fromISO(n.value2,{zone:"utc",setZone:!0}),r=!s.isValid||t.fieldType!==Zt.DateTimeRange&&t.fieldType!==Zt.Datetime?s.isValid&&t.fieldType===Zt.Date?this.dateTimeService.toLocaleString(s,zs.DateOnly.MonthLong):n.value2:this.dateTimeService.toLocaleString(s,zs.DateTime),a=n.value3;switch(n.operator){case we.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 we.NotContains:return this.t("_1_ne_contient_14612",t.name,o);case we.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,zs.DateOnly.MonthLong),r);if(t.fieldType===Zt.Date)return this.t("_1_est_gal_43375",t.name,this.valueDateToString(n.valueDate));if(t.fieldType===Zt.Datetime||t.fieldType===Zt.DateTimeRange){const e=i?.isValid?this.dateTimeService.toLocaleString(i,zs.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 we.IsNot:if("isLeader"===t.slug)return this.t("n_est_pas_respo_55625");if("isPositionLeader"===t.slug)return this.t("n_est_pas_respo_35508");if("isPositionCategoryLeader"===t.slug)return this.t("n_est_pas_respo_07811");if("isDelegationLeader"===t.slug)return this.t("n_est_pas_respo_91275");if("privacy"===t.slug)return this.t("visibilit_est_55411");if("condition"===t.slug)return this.t("champ_d_pendant_33676");if("numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug)return this.t("_1_pour_la_jou_61197",t.name,this.dateTimeService.toLocaleString(i,zs.DateOnly.MonthLong),r);if(t.fieldType===Zt.Date)return this.t("_1_n_est_pas_38478",t.name,this.valueDateToString(n.valueDate));if(t.fieldType===Zt.Datetime||t.fieldType===Zt.DateTimeRange){const e=i?.isValid?this.dateTimeService.toLocaleString(i,zs.DateOnly.MonthLong):n.value;return this.t("_1_n_est_pas_38478",t.name,e)}return this.t("_1_n_est_pas_38478",t.name,this.valueToString(t,o));case we.IsEmpty:return this.t("_1_est_vide_08225",t.name);case we.IsNotEmpty:return this.t("_1_n_est_pas_v_31530",t.name);case we.IsValid:return this.t("_1_est_valide_45209",t.name);case we.IsNotValid:return this.t("_1_n_est_pas_v_05077",t.name);case we.GreaterThan:return"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_91055",t.name,this.dateTimeService.toLocaleString(i,zs.DateOnly.MonthLong),r):this.t("_1_est_plus_gr_93527",t.name,n.value);case we.GreaterThanEqual:return"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_41388",t.name,this.dateTimeService.toLocaleString(i,zs.DateOnly.MonthLong),r):this.t("_1_est_gal_ou_95771",t.name,n.value);case we.LessThan:return"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_99548",t.name,this.dateTimeService.toLocaleString(i,zs.DateOnly.MonthLong),r):this.t("_1_est_plus_pe_18306",t.name,n.value);case we.LessThanEqual:return"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_37455",t.name,this.dateTimeService.toLocaleString(i,zs.DateOnly.MonthLong),r):this.t("_1_est_gal_ou_39305",t.name,n.value);case we.Overlaps:return this.t("_1_chevauche_45834",t.name,o,r);case we.NotOverlaps:return this.t("_1_ne_chevauch_01846",t.name,o,r);case we.Engulfs:return this.t("_1_engloutis_32228",t.name,o,r);case we.NotEngulfs:return this.t("_1_n_engloutis_52951",t.name,o,r);case we.EngulfedBy:return this.t("_1_est_englout_36064",t.name,o,r);case we.NotEngulfedBy:return this.t("_1_n_est_pas_e_89161",t.name,o,r);case we.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 we.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 we.Between:return"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_66546",t.name,this.dateTimeService.toLocaleString(i,zs.DateOnly.MonthLong),r,a):this.t("_1_est_entre_39871",t.name,o,r);case we.StartsWith:return this.t("_1_commence_pa_47720",t.name,o);case we.EndsWith:return this.t("_1_finit_par_65840",t.name,o);case we.ThisDayMonth:return this.t("_1_est_aujourd_09227",t.name);case we.Today:return this.t("_1_est_aujourd_42954",t.name);default:return vd(n.operator)}}}getValues(e){return e.fieldType===Oe.Sex?ai.map(e=>({id:e,name:this.t(e)})):e.fieldType===Oe.Language?e.fieldProperty===pt.Language?Rc.map(e=>({id:e,name:this.t(e)})):Gn.map(e=>({id:e,name:this.t(e)})):e.fieldType===Oe.Nationality?this.countriesService.getNationalitiesIdName():e.fieldType===Oe.Country?this.countriesService.getCountriesIdName():e.fieldType===Oe.Select&&Bs(e.values)?e.values.map(({id:e,value:t})=>({id:e,name:t})):[]}valueToString(e,t){const n=function(e){return Bs(e.values)?e.values:Bs(e.valuesGroups)?e.valuesGroups.flatMap(e=>e.values):[]}(e);return Bs(n)?Ls(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(As.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})=>[Zt.Address,Zt.Checkbox,Zt.Country,Zt.Date,Zt.Datetime,Zt.File,Zt.Language,Zt.Nationality,Zt.Number,Zt.Phone,Zt.Select,Zt.Sex,Zt.Text,Zt.Textarea,Zt.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:Nm.includes(e.fieldType),isSortable:!!Fm.includes(e.fieldType)||e.fieldType===Oe.Select&&e.isSelectV2&&!e.canSelectMultiple,sortAttribute:e.slug,width:e.fileType===gt.Picture?80:void 0,minWidth:e.fileType===gt.Picture?void 0:180}))}};Um=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mm,Cm,Si])],Um);var Wm=n(1932),Gm=n(3627),qm=n(4979);function Hm(e,t){const{attributes:n,isDragging:i,listeners:o,setActivatorNodeRef:s,setNodeRef:r,transform:a,transition:l}=(0,Gm.gl)({id:e,data:t});return{handleProps:{ref:s,...n,...o},isDragging:i,setNodeRef:r,style:{position:"relative",transform:qm.Ks.Translate.toString(a),transition:l,zIndex:i?1:void 0}}}const Km=xa("div",{alignItems:"center",borderRadius:"12px",cursor:"pointer",display:"flex",position:"relative",padding:"$1","&:hover":{background:"$gray300"},"& > div":{background:"white",boxShadow:"$sm",position:"absolute",transition:"left 200ms ease-in"},"& > i":{color:"white"},"&:focus":{outline:"none"},"&:focus-visible":{border:"1px solid $success500",boxShadow:"0 0 0 4px rgba(16, 167, 77, 0.16)"},variants:{disabled:{true:{cursor:"not-allowed",background:"$gray100","&:hover":{background:"$gray100"},"&:focus-visible":{border:"1px solid $gray300",boxShadow:"0 0 0 4px rgba(206, 206, 206, 0.4)"},"& > i":{color:"$gray400"}}},size:{sm:{blockSize:"16px",inlineSize:"30px","& > div":{borderRadius:"12px",blockSize:"12px",inlineSize:"12px"},"& > i":{fontSize:"8px"}},md:{blockSize:"24px",inlineSize:"44px","& > div":{borderRadius:"20px",blockSize:"20px",inlineSize:"20px"},"& > i":{fontSize:"12px",paddingInlineStart:"2px"}}},state:{unchecked:{background:"$gray200","& > div":{left:"2px"}},checked:{background:"$success500","&:hover":{background:"$success600"}}}},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","&:hover":{background:"$gray100"}}}],defaultVariants:{size:"sm"}}),Ym=e=>(0,i.jsxs)(Km,{"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)(Id,{height:"8",icon:"check",width:"8"}),(0,i.jsx)("div",{})]}),Zm=e=>{const{inputId:t,descId:n,labelId:o}=Hd(),s=g(e.subtext);return(0,i.jsxs)(rd,{align:"center","aria-keyshortcuts":e["aria-keyshortcuts"],css:{cursor:e.disabled?"auto":"pointer",userSelect:"none",...e.css},onClick:()=>{e.disabled||e.onChange(!e.value)},onKeyDown:t=>{e.disabled||"Space"!==t.code||(t.preventDefault(),e.onChange(!e.value))},children:[(0,i.jsx)(Ym,{descId:n,disabled:e.disabled,inputId:t,labelId:o,size:e.size,value:e.value,onChange:hc.A}),(0,i.jsx)(md,{width:"2"}),(0,i.jsxs)(rd,{css:{flex:"1",fontSize:"md"===e.size?"$3":"$2"},direction:"column",children:[(0,i.jsx)(Zd,{htmlFor:t,id:o,children:(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:e.children})}),s&&(0,i.jsx)(ka,{color:"gray500",id:n,children:e.subtext})]})]})},Xm=e=>{const{setNodeRef:t,style:n,handleProps:o}=Hm(e.column.slug);return(0,i.jsxs)(rd,{ref:t,css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",style:n,children:[(0,i.jsx)(ka,{color:"gray300",css:{cursor:"grab"},...o,children:(0,i.jsx)(Id,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsxs)(rd,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{color:"gray800",css:{ellipsis:!0},title:e.column.name,width:1,children:e.column.name}),g(e.column.label)&&(0,i.jsx)(ka,{color:"gray500",css:{ellipsis:!0},title:e.column.label,width:1,children:e.column.label})]}),(0,i.jsx)(Ym,{value:e.column.isSelected,onChange:e.onToggle})]})},Jm=({children:e,css:t,onClose:n,returnToFallback:o,size:s})=>{const r=$i(),a=()=>{n?n():r.goBack(o??fs.HOME)};return Jc(a),Su("common-front/src/designSystem/components/rightPanels/__deprecated/rightPanel.tsx","common-front/src/designSystem/components/rightPanels/base/rightPanel.tsx"),(0,pn.createPortal)((0,i.jsx)(rd,{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)(rd,{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=>Gd(e,!1),children:[(0,i.jsx)(ka,{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)},Qm=V.forwardRef((e,t)=>(0,i.jsx)(rd,{ref:t,css:{flex:"1",overflowY:"auto",px:"$6",...e.css},direction:"column",children:e.children}));Qm.displayName="RightPanelBody";const eh=e=>(0,i.jsx)(ka,{color:"gray800",css:{borderTop:"1px solid $gray200",px:"$6",py:"$4"},children:e.children});var th=n(3375),nh=n(8831);const ih=[nh.FN,nh.Mk],oh=e=>{const t=(0,th.FR)((0,th.MS)(th.AN,{activationConstraint:{distance:4}}),(0,th.MS)(th.uN,{coordinateGetter:Gm.JR})),n=(0,V.useCallback)(({active:t,over:n})=>{if(n&&t.id!==n.id){const i=e.ids.indexOf(t.id),o=e.ids.indexOf(n.id);-1!==i&&-1!==o&&e.onReorder(i,o)}},[e.ids,e.onReorder]);return(0,i.jsx)(th.Mp,{collisionDetection:th.fp,modifiers:ih,sensors:t,onDragEnd:n,children:(0,i.jsx)(Gm.gB,{items:e.ids,strategy:Gm._G,children:e.children})})},sh=e=>{const t=Ti(),[n,o]=(0,V.useState)(""),[s,r]=(0,V.useState)((0,cm.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])),a=e=>{if(g(n)){const t=m(n);return m(e.name).includes(t)||g(e.label)&&m(e.label).includes(t)}return!0},l=s.filter(a).map(e=>e.slug);return(0,i.jsxs)(Jm,{css:e.css,size:"sm",onClose:e.onClose,children:[(0,i.jsxs)(Qm,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textXl",children:e.title}),(0,i.jsx)(ka,{color:"gray500",children:e.subtitle}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:e.searchPlaceholder,value:n,onChange:o}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_champ_00325")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(oh,{ids:l,onReorder:(e,t)=>{const n=s.map(e=>e.slug);r(Gs(s,n.indexOf(l[e]),n.indexOf(l[t])))},children:(0,i.jsx)(rd,{direction:"column",gap:"2",children:s.map((e,t)=>a(e)?(0,i.jsx)(Xm,{column:e,onToggle:()=>{((e,t)=>{r((0,Wm.jM)(n=>{n[t].isSelected=!e.isSelected}))})(e,t)}},e.slug):null)})}),(0,i.jsx)(md,{height:"6"})]}),(0,i.jsx)(eh,{children:(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{onClick:()=>{e.onSave(s.filter(e=>e.isSelected).map(e=>e.slug)),e.onClose()},children:e.saveButtonText}),(0,i.jsx)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})})]})};function rh(e){const[t,n]=(0,V.useState)(e),[i,o]=(0,V.useState)(!1),s=(0,V.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,bs.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,V.useRef)(null),a=(0,V.useCallback)((e,t,i)=>{const s=r.current;n(n=>{const o=i&&s?function(e,t,n){const i=Object.keys(e),o=i.indexOf(t),s=i.indexOf(n);return-1===o||-1===s?[n]:i.slice(Math.min(o,s),Math.max(o,s)+1)}(n,s,e):[e];return{...n,...Object.fromEntries(o.filter(e=>!0!==n[e]?.disabled).map(e=>[e,{...n[e],state:t}]))}}),r.current=e,"unchecked"===t&&o(!1)},[n,o]),l=(0,V.useCallback)(e=>{r.current=null,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,V.useCallback)((e,t)=>i?{ids:null,predicates:e??null,scope:t??null}:{ids:s.selectedsIds,predicates:null,scope:null},[i,s]),isAllSelected:i,numberOfSelected:s.numberOfSelected,selectAllState:s.selectAllState,selecteds:s.selecteds,selectedsIds:s.selectedsIds,setIsAllSelected:o,setStates:n,states:t,toggleRow:a,toggleSelectAll:l}}function ah(e){return{numberOfPages:(0,V.useMemo)(()=>e?.numberOfPages??1,[e]),totalCount:(0,V.useMemo)(()=>e?.totalCount??0,[e])}}var lh=n(903);const dh=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.filterPredicate.predicate?.value??[]),[s,r]=(0,V.useState)(e.filterPredicate.predicate?.value2??[]),a=e.filterPredicate.filter.campaigns??[],l=(0,bs.A)(a.filter(({id:e})=>n.includes(e)).map(({campaignType:e})=>e)),d=(0,bs.A)(["NotSent",...l.includes(ue.Email)?Dn.filter(e=>e!==dt.Queued):[],...l.includes(ue.Sms)?ci:[]]),c=Bs(n)&&Bs(s);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uu,{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)(md,{height:"2"}),(0,i.jsx)(Uu,{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)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{disabled:!c,onClick:()=>{e.onAdd({operator:we.Is,value:n,value2:s,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},ch=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.filterPredicate.predicate?.value??[]),[s,r]=(0,V.useState)(e.filterPredicate.predicate?.operator??we.Contains),[a,l]=(0,V.useState)(e.filterPredicate.predicate?.value2??[]),d=e.filterPredicate.filter.campaigns??[],c=Bs(n)&&(s===we.Contains&&g(a)||s===we.IsEmpty||s===we.IsNotEmpty);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uu,{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)(md,{height:"3"}),(0,i.jsx)(zu,{state:"contains"===s?"checked":"unchecked",onClick:()=>r(we.Contains),children:t("contient_34012")}),"contains"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isEmpty"===s?"checked":"unchecked",onClick:()=>r(we.IsEmpty),children:t("est_vide_96759")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNotEmpty"===s?"checked":"unchecked",onClick:()=>r(we.IsNotEmpty),children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{disabled:!c,onClick:()=>{e.onAdd({operator:s,value:n,value2:a,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},uh=xa("select",{backgroundColor:"$white",height:"100%",left:0,opacity:0,position:"absolute",top:0,width:"100%"}),mh=xa("div",{ellipsis:""}),hh=({autoComplete:e,children:t,css:n,label:o,description:s,shouldParseAsInt:r,shouldParseAsBoolean:a,onChange:l,hint:d,icon:c,state:u,value:m="",...h})=>{const g=V.useMemo(()=>Lu(Nu(t)),[t]),{inputId:p,descId:f,errorId:_}=Hd();return(0,i.jsxs)(rd,{css:n,direction:"column",width:1,children:[(0,i.jsx)(Zd,{htmlFor:p,children:o}),(0,i.jsx)(Kd,{id:f,children:s}),(o||s)&&(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(Jd,{cursor:"default",icon:c,state:u,children:[(0,i.jsx)(rd,{align:"center",css:{flex:"1",overflow:"hidden"},height:1,width:1,children:(0,i.jsx)(mh,{children:g[m.toString()]})}),(0,i.jsx)(rd,{css:{color:"$gray500"},children:(0,i.jsx)(Id,{icon:"chevron-down"})}),(0,i.jsx)(uh,{"aria-describedby":s?f:void 0,"aria-errormessage":"error"===u?_:void 0,"aria-invalid":"error"===u,autoComplete:e??"off",css:{cursor:"disabled"===u?"not-allowed":"pointer"},disabled:"disabled"===u,id:p,value:m.toString(),onChange:e=>{l(r?parseInt(e.target.value,10):a?"true"===e.target.value:e.target.value)},...h,children:t})]}),(0,i.jsx)(Yd,{id:_,state:u,children:d})]})},gh=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.filterPredicate.predicate?.operator??we.Is),[s,r]=(0,V.useState)(e.filterPredicate.predicate?.value??!0);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{state:"is"===n?"checked":"unchecked",onClick:()=>o(we.Is),children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsxs)(hh,{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)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNot"===n?"checked":"unchecked",onClick:()=>o(we.IsNot),children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsxs)(hh,{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)(md,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>o(we.IsEmpty),children:t("est_vide_96759")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>o(we.IsNotEmpty),children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{onClick:()=>{e.onAdd({operator:n,value:s,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},ph=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.filterPredicate.predicate?.operator??we.Is),s=e.filterPredicate.filter.values??[],[r,a]=(0,V.useState)(Bs(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),l="is"===n||"isNot"===n||Bs(r);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{state:"is"===n?"checked":"unchecked",onClick:()=>o(we.Is),children:t("champ_dont_un_a_44854")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNot"===n?"checked":"unchecked",onClick:()=>o(we.IsNot),children:t("champ_d_pendant_33676")}),s.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"contains"===n?"checked":"unchecked",onClick:()=>o(we.Contains),children:t("d_pends_du_cham_39787")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Uu,{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)(md,{height:"1"})]})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{disabled:!l,onClick:()=>{e.onAdd({operator:n,value:r,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},fh=As.c9.fromObject({year:1920,month:1,day:1}),_h=As.c9.now();function xh(e){if(As.c9.isDateTime(e)&&e?.isValid)return e;if(g(e)){const t=As.c9.fromISO(e);return t.isValid?t:null}return null}const Ih=({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:h,...p})=>{const f=e?xh(e):null,_=f?.isValid?f.toFormat(Ss):"",{inputId:x,descId:I,errorId:v}=Hd();return(0,i.jsxs)(rd,{css:t,direction:"column",width:1,children:[(0,i.jsx)(Zd,{htmlFor:x,children:n}),(0,i.jsx)(Kd,{id:I,children:o}),(n||o)&&(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(Jd,{cursor:"default",icon:r,rightIcon:u,state:c,onRightIconClick:m,children:(0,i.jsx)(ka,{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:x,max:d?.toFormat(Ss),min:a?.toFormat(Ss),type:"date",value:_,onChange:e=>{g(e.target.value)?l(As.c9.fromFormat(e.target.value,Ss,{zone:h||"UTC"})):l(As.c9.invalid("Invalid"))},...p})})}),(0,i.jsx)(Yd,{id:v,state:c,children:s})]})};var vh=n(3551);const bh=e=>{const t=Ti(),n=Ei(Cm),o=(0,V.useMemo)(()=>As.c9.now().startOf("year"),[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsxs)(hh,{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,nm.A)(1,32).map(e=>(0,i.jsx)("option",{value:e,children:e},e))]})]}),(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsxs)(hh,{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,nm.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)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsxs)(hh,{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,vh.A)(1900,o.year+2).map(e=>(0,i.jsx)("option",{value:e,children:e},e))]})]}),(0,i.jsx)(md,{height:"1"})]})},jh=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.filterPredicate.predicate?.operator??we.Is),[s,r]=(0,V.useState)(xh(e.filterPredicate.predicate?.value)||""),[a,l]=(0,V.useState)(xh(e.filterPredicate.predicate?.value2)||""),[d,c]=(0,V.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)?As.c9.isDateTime(s)&&s.isValid:"between"!==n||As.c9.isDateTime(s)&&s.isValid&&As.c9.isDateTime(a)&&a.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{state:"is"===n?"checked":"unchecked",onClick:()=>o(we.Is),children:t("est_25967")}),"is"===n&&(0,i.jsx)(bh,{setValue:c,value:d}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNot"===n?"checked":"unchecked",onClick:()=>o(we.IsNot),children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsx)(bh,{setValue:c,value:d}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isBefore"===n?"checked":"unchecked",onClick:()=>o(we.IsBefore),children:t("est_avant_le_16689")}),"isBefore"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ih,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:s,onChange:r})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isAfter"===n?"checked":"unchecked",onClick:()=>o(we.IsAfter),children:t("est_apr_s_le_79703")}),"isAfter"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ih,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:s,onChange:r})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"between"===n?"checked":"unchecked",onClick:()=>o(we.Between),children:t("est_entre_born_59665")}),"between"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ih,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:s,onChange:r}),(0,i.jsx)(md,{width:"3"}),(0,i.jsx)(Ih,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"today"===n?"checked":"unchecked",onClick:()=>o(we.Today),children:t("est_aujourd_hui_82571")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"thisDayMonth"===n?"checked":"unchecked",onClick:()=>o(we.ThisDayMonth),children:t("est_aujourd_hui_70881")}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>o(we.IsEmpty),children:t("est_vide_96759")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>o(we.IsNotEmpty),children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{disabled:!u,onClick:()=>{e.onAdd({operator:n,value:s,value2:a,valueDate:d,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Ch=({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:h,...p})=>{const f=e?g(e)?As.c9.fromISO(e,{zone:"utc"}):e:null,_=f?.isValid?f.toFormat(ks):"",{inputId:x,descId:I,errorId:v}=Hd();return(0,i.jsxs)(rd,{css:t,direction:"column",width:1,children:[(0,i.jsx)(Zd,{htmlFor:x,children:n}),(0,i.jsx)(Kd,{id:I,children:o}),(n||o)&&(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(Jd,{cursor:"default",icon:r,rightIcon:c,state:m,onRightIconClick:u,children:(0,i.jsx)(ka,{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:x,max:d?.toFormat(ks),min:a?.toFormat(ks),type:"datetime-local",value:_,onChange:e=>{g(e.target.value)?l(As.c9.fromFormat(e.target.value,ks,{zone:h||"UTC"})):l(As.c9.invalid("Invalid"))},...p})})}),(0,i.jsx)(Yd,{id:v,state:m,children:s})]})},yh=e=>{const t=Ti(),n=(0,V.useMemo)(()=>e.filterPredicate.filter.useLocalZone?Ps():void 0,[e.filterPredicate]),[o,s]=(0,V.useState)(e.filterPredicate.predicate?.operator??we.Is),[r,a]=(0,V.useState)(xh(e.filterPredicate.predicate?.value)||""),[l,d]=(0,V.useState)(xh(e.filterPredicate.predicate?.value2)||""),c=["is","isNot","isBefore","isAfter"].includes(o)?As.c9.isDateTime(r)&&r.isValid:"between"!==o||As.c9.isDateTime(r)&&r.isValid&&As.c9.isDateTime(l)&&l.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{state:"is"===o?"checked":"unchecked",onClick:()=>s(we.Is),children:t("est_25967")}),"is"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ih,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:r,onChange:a})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNot"===o?"checked":"unchecked",onClick:()=>s(we.IsNot),children:t("n_est_pas_97826")}),"isNot"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ih,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:r,onChange:a})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isBefore"===o?"checked":"unchecked",onClick:()=>s(we.IsBefore),children:t("est_avant_le_16689")}),"isBefore"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{value:r,zone:n,onChange:a})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isAfter"===o?"checked":"unchecked",onClick:()=>s(we.IsAfter),children:t("est_apr_s_le_79703")}),"isAfter"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{value:r,zone:n,onChange:a})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"between"===o?"checked":"unchecked",onClick:()=>s(we.Between),children:t("est_entre_born_59665")}),"between"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{value:r,zone:n,onChange:a})]}),(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{value:l,zone:n,onChange:d})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"today"===o?"checked":"unchecked",onClick:()=>s(we.Today),children:t("est_aujourd_hui_82571")}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isEmpty"===o?"checked":"unchecked",onClick:()=>s(we.IsEmpty),children:t("est_vide_96759")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNotEmpty"===o?"checked":"unchecked",onClick:()=>s(we.IsNotEmpty),children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{disabled:!c,onClick:()=>{e.onAdd({operator:o,value:r,value2:l,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Ah=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.filterPredicate.predicate?.operator??we.Contains),[s,r]=(0,V.useState)(e.filterPredicate.predicate?.value??""),[a,l]=(0,V.useState)(e.filterPredicate.predicate?.value2??""),d=!!(As.c9.isDateTime(s)&&s.isValid&&["contains","notContains","is"].includes(n))||As.c9.isDateTime(a)&&a.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{state:"contains"===n?"checked":"unchecked",onClick:()=>o(we.Contains),children:t("contient_34012")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:s,onChange:r})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"is"===n?"checked":"unchecked",onClick:()=>o(we.Is),children:t("contient_date_89885")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ih,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:s,onChange:r})]})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"notContains"===n?"checked":"unchecked",onClick:()=>o(we.NotContains),children:t("ne_contient_pas_85399")}),"notContains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:s,onChange:r})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"overlaps"===n?"checked":"unchecked",onClick:()=>o(we.Overlaps),children:t("chevauche_49445")}),"overlaps"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:s,onChange:r})]}),(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"notOverlaps"===n?"checked":"unchecked",onClick:()=>o(we.NotOverlaps),children:t("ne_chevauche_pa_17307")}),"notOverlaps"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:s,onChange:r})]}),(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"engulfs"===n?"checked":"unchecked",onClick:()=>o(we.Engulfs),children:t("engloutis_42346")}),"engulfs"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:s,onChange:r})]}),(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"notEngulfs"===n?"checked":"unchecked",onClick:()=>o(we.NotEngulfs),children:t("n_engloutis_pas_42363")}),"notEngulfs"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:s,onChange:r})]}),(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"engulfedBy"===n?"checked":"unchecked",onClick:()=>o(we.EngulfedBy),children:t("est_englouti_pa_47852")}),"engulfedBy"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:s,onChange:r})]}),(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"notEngulfedBy"===n?"checked":"unchecked",onClick:()=>o(we.NotEngulfedBy),children:t("n_est_pas_englo_08733")}),"notEngulfedBy"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:s,onChange:r})]}),(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ch,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{disabled:!d,onClick:()=>{e.onAdd({operator:n,value:s,value2:a,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Sh=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.filterPredicate.predicate?.operator??we.IsEmpty);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>o(we.IsEmpty),children:t("est_vide_96759")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>o(we.IsNotEmpty),children:t("n_est_pas_vide_45804")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},kh=e=>{const t=Ti(),n=(0,V.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,V.useState)(e.filterPredicate.predicate?.operator??we.Is),[r,a]=(0,V.useState)(e.filterPredicate.predicate?.value??[]),[l,d]=(0,V.useState)(e.filterPredicate.predicate?.value2??""),[c,u]=(0,V.useState)(e.filterPredicate.predicate?.valueDate??{day:-1,month:-1,year:-1}),m=Bs(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)&&As.c9.isDateTime(l)&&l.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uu,{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)(md,{height:"3"}),(0,i.jsx)(zu,{state:"is"===o?"checked":"unchecked",onClick:()=>s(we.Is),children:t("est_25967")}),"is"===o&&(0,i.jsx)(bh,{setValue:u,value:c}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNot"===o?"checked":"unchecked",onClick:()=>s(we.IsNot),children:t("n_est_pas_97826")}),"isNot"===o&&(0,i.jsx)(bh,{setValue:u,value:c}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isBefore"===o?"checked":"unchecked",onClick:()=>s(we.IsBefore),children:t("est_avant_le_16689")}),"isBefore"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ih,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:l,onChange:d})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isAfter"===o?"checked":"unchecked",onClick:()=>s(we.IsAfter),children:t("est_apr_s_le_79703")}),"isAfter"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Ih,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:l,onChange:d})]}),(0,i.jsx)(md,{height:"1"})]})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{disabled:!m,onClick:()=>{e.onAdd({operator:o,value:r,value2:l,valueDate:c,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},wh=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.filterPredicate.predicate?.operator??we.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{state:"is"===n?"checked":"unchecked",onClick:()=>o(we.Is),children:t("est_administrat_15766")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNot"===n?"checked":"unchecked",onClick:()=>o(we.IsNot),children:t("n_est_pas_admin_58612")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Eh=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.filterPredicate.predicate?.operator??we.Is),s=(0,V.useMemo)(()=>Bm(e.filterPredicate.filter,t),[e.filterPredicate.filter]),[r,a]=(0,V.useState)(Bs(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),l="contains"!==n||Bs(r),d=(0,V.useMemo)(()=>Array.isArray(r)?r.length:0,[r]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{state:"is"===n?"checked":"unchecked",onClick:()=>o(we.Is),children:t("est_responsable_47377")}),(0,i.jsx)(md,{height:"3"}),"isDelegationLeader"===e.filterPredicate.filter.slug&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{state:"contains"===n?"checked":"unchecked",onClick:()=>o(we.Contains),children:t("est_responsable_00281")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(rd,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Uu,{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)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"})]}),(0,i.jsx)(zu,{state:"isNot"===n?"checked":"unchecked",onClick:()=>o(we.IsNot),children:t("n_est_pas_respo_55625")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{disabled:!l,onClick:()=>{e.onAdd({operator:n,value:r,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Th=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.filterPredicate.predicate?.operator??we.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{state:"is"===n?"checked":"unchecked",onClick:()=>o(we.Is),children:t("est_inscrit_en_86193")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNot"===n?"checked":"unchecked",onClick:()=>o(we.IsNot),children:t("n_est_pas_inscr_25311")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Rh=xa("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"}}),Oh=e=>(0,i.jsx)(Rh,{"aria-orientation":e.direction,color:e.color,css:e.css,direction:e.direction,role:"separator"}),Dh=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:e.height}),(0,i.jsx)(Rh,{color:e.color,direction:"horizontal",role:"separator"}),(0,i.jsx)(md,{height:e.height})]}),zh=e=>{const t=Ti(),n="numberOfAccreditations"===e.filterPredicate.filter.slug,o="numberOfAssignments"===e.filterPredicate.filter.slug,[s,r]=(0,V.useState)(e.filterPredicate.predicate?.operator??we.Is),[a,l]=(0,V.useState)(e.filterPredicate.predicate?.value??""),[d,c]=(0,V.useState)(e.filterPredicate.predicate?.value2??""),[u,m]=(0,V.useState)(xh(e.filterPredicate.predicate?.value3)||""),[h,g]=(0,V.useState)(xh(e.filterPredicate.predicate?.value4)||""),[p,f]=(0,V.useState)(As.c9.isDateTime(u)&&u.isValid&&As.c9.isDateTime(h)&&h.isValid?"checked":"unchecked"),[_,x]=(0,V.useState)(!n||Vs(e.filterPredicate.predicate?.value3)),[I,v]=(0,V.useState)(n&&Bs(e.filterPredicate.predicate?.value3)?e.filterPredicate.predicate?.value3:[]),[b,j]=(0,V.useState)(!o||Vs(e.filterPredicate.predicate?.value3)),[C,y]=(0,V.useState)(o&&Bs(e.filterPredicate.predicate?.value3)?e.filterPredicate.predicate?.value3:[]),A=("checked"!==p||As.c9.isDateTime(u)&&u.isValid&&As.c9.isDateTime(h)&&h.isValid)&&["is","isNot","greaterThan","greaterThanEqual","lessThan","lessThanEqual"].includes(s)?"number"==typeof a:"between"!==s||"number"==typeof a&&"number"==typeof d;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{state:"is"===s?"checked":"unchecked",onClick:()=>r(we.Is),children:t("est_25967")}),"is"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNot"===s?"checked":"unchecked",onClick:()=>r(we.IsNot),children:t("n_est_pas_97826")}),"isNot"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"greaterThan"===s?"checked":"unchecked",onClick:()=>r(we.GreaterThan),children:t("plus_grand_que_28412")}),"greaterThan"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"greaterThanEqual"===s?"checked":"unchecked",onClick:()=>r(we.GreaterThanEqual),children:t("_gal_ou_plus_gr_76897")}),"greaterThanEqual"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"lessThan"===s?"checked":"unchecked",onClick:()=>r(we.LessThan),children:t("plus_petit_que_35846")}),"lessThan"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"lessThanEqual"===s?"checked":"unchecked",onClick:()=>r(we.LessThanEqual),children:t("_gal_ou_plus_pe_38400")}),"lessThanEqual"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"between"===s?"checked":"unchecked",onClick:()=>r(we.Between),children:t("est_entre_born_59665")}),"between"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{shouldParseAsInt:!0,value:a,onChange:l}),(0,i.jsx)(md,{width:"3"}),(0,i.jsx)(Qd,{shouldParseAsInt:!0,value:d,onChange:c})]}),(0,i.jsx)(md,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isEmpty"===s?"checked":"unchecked",onClick:()=>r(we.IsEmpty),children:t("est_vide_96759")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNotEmpty"===s?"checked":"unchecked",onClick:()=>r(we.IsNotEmpty),children:t("n_est_pas_vide_45804")})]}),"numberOfAssignmentsDays"===e.filterPredicate.filter.slug&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Dh,{height:"3"}),(0,i.jsx)(Eu,{state:p,onClick:f,children:t("filtrer_sur_une_06420")}),"checked"===p&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsxs)(rd,{gap:"3",children:[(0,i.jsx)(Ih,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:u,onChange:m}),(0,i.jsx)(Ih,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:h,onChange:g})]})]})]}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{css:{border:"1px solid $gray200",borderRadius:"$2",background:"$gray50",padding:"$5 $6"},direction:"column",gap:"2",children:[(0,i.jsx)(ka,{font:"gray900 textSm medium",children:t("le_filtre_se_ba_92445")}),(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(zu,{state:_?"checked":"unchecked",onClick:()=>x(!0),children:t("sur_toutes_les_40684")}),(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(zu,{state:_?"unchecked":"checked",onClick:()=>x(!1),children:t("sur_certaines_a_13180")}),!_&&(0,i.jsx)(rd,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Uu,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,values:I,onChange:v,children:Bm(e.filterPredicate.filter,t)})})]})]})]})]}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{css:{border:"1px solid $gray200",borderRadius:"$2",background:"$gray50",padding:"$5 $6"},direction:"column",gap:"2",children:[(0,i.jsx)(ka,{font:"gray900 textSm medium",children:t("le_filtre_se_ba_92445")}),(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(zu,{state:b?"checked":"unchecked",onClick:()=>j(!0),children:t("sur_toutes_les_97037")}),(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(zu,{state:b?"unchecked":"checked",onClick:()=>j(!1),children:t("sur_certaines_m_74733")}),!b&&(0,i.jsx)(rd,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Uu,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,values:C,onChange:y,children:Bm(e.filterPredicate.filter,t)})})]})]})]})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{disabled:!A,onClick:()=>{e.onAdd({operator:s,value:a,value2:d,value3:n?I:o?C:u,value4:h,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},$h=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.filterPredicate.predicate?.operator??we.Is),[s,r]=(0,V.useState)(e.filterPredicate.predicate?.value??""),[a,l]=(0,V.useState)(e.filterPredicate.predicate?.value2??""),[d,c]=(0,V.useState)(e.filterPredicate.predicate?.value3??""),u=As.c9.isDateTime(s)&&s?.isValid&&(["is","isNot","greaterThan","greaterThanEqual","lessThan","lessThanEqual"].includes(n)?"number"==typeof a:"between"===n&&"number"==typeof a&&"number"==typeof d);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ih,{label:t("jour_d_affectat_27334"),max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:s,onChange:r}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Zd,{children:e.filterPredicate.filter.name}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(zu,{state:"is"===n?"checked":"unchecked",onClick:()=>o(we.Is),children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNot"===n?"checked":"unchecked",onClick:()=>o(we.IsNot),children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"greaterThan"===n?"checked":"unchecked",onClick:()=>o(we.GreaterThan),children:t("plus_grand_que_28412")}),"greaterThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"greaterThanEqual"===n?"checked":"unchecked",onClick:()=>o(we.GreaterThanEqual),children:t("_gal_ou_plus_gr_76897")}),"greaterThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"lessThan"===n?"checked":"unchecked",onClick:()=>o(we.LessThan),children:t("plus_petit_que_35846")}),"lessThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"lessThanEqual"===n?"checked":"unchecked",onClick:()=>o(we.LessThanEqual),children:t("_gal_ou_plus_pe_38400")}),"lessThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"between"===n?"checked":"unchecked",onClick:()=>o(we.Between),children:t("est_entre_born_59665")}),"between"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{shouldParseAsInt:!0,value:a,onChange:l}),(0,i.jsx)(md,{width:"3"}),(0,i.jsx)(Qd,{shouldParseAsInt:!0,value:d,onChange:c})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{disabled:!u,onClick:()=>{e.onAdd({operator:n,value:s,value2:a,value3:d,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Ph=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.filterPredicate.predicate?.operator??we.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{state:"is"===n?"checked":"unchecked",onClick:()=>o(we.Is),children:t("Public")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNot"===n?"checked":"unchecked",onClick:()=>o(we.IsNot),children:t("Private")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Mh=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.filterPredicate.predicate?.operator??we.Is),s=(0,V.useMemo)(()=>Bm(e.filterPredicate.filter,t),[e.filterPredicate.filter]),[r,a]=(0,V.useState)(Bs(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),l="is"!==n&&"isNot"!==n||Bs(r),d=(0,V.useMemo)(()=>Array.isArray(r)?r.length:0,[r]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{state:"is"===n?"checked":"unchecked",onClick:()=>o(we.Is),children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(rd,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Uu,{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)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNot"===n?"checked":"unchecked",onClick:()=>o(we.IsNot),children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(rd,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Uu,{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)(md,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>o(we.IsEmpty),children:t("est_vide_96759")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>o(we.IsNotEmpty),children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{disabled:!l,onClick:()=>{e.onAdd({operator:n,value:r,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Fh=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.filterPredicate.predicate?.operator??(e.filterPredicate.filter.isEncrypted?we.IsEmpty:we.Contains)),[s,r]=(0,V.useState)(e.filterPredicate.predicate?.value??""),a="contains"!==n&&"notContains"!==n||g(s);return(0,i.jsxs)(i.Fragment,{children:[!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsx)(zu,{state:"contains"===n?"checked":"unchecked",onClick:()=>o(we.Contains),children:t("contient_34012")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{value:s,onChange:r})]}),(0,i.jsx)(md,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"notContains"===n?"checked":"unchecked",onClick:()=>o(we.NotContains),children:t("ne_contient_pas_85399")})]}),"notContains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{value:s,onChange:r})]}),(0,i.jsx)(md,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"startsWith"===n?"checked":"unchecked",onClick:()=>o(we.StartsWith),children:t("commence_par_11056")})]}),"startsWith"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{value:s,onChange:r})]}),(0,i.jsx)(md,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"endsWith"===n?"checked":"unchecked",onClick:()=>o(we.EndsWith),children:t("finit_par_79657")})]}),"endsWith"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{value:s,onChange:r})]}),(0,i.jsx)(md,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>o(we.IsEmpty),children:t("est_vide_96759")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>o(we.IsNotEmpty),children:t("n_est_pas_vide_45804")})]}),e.showIsValid&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isValid"===n?"checked":"unchecked",onClick:()=>o(we.IsValid),children:t("est_valide_72630")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNotValid"===n?"checked":"unchecked",onClick:()=>o(we.IsNotValid),children:t("n_est_pas_valid_75405")})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{disabled:!a,onClick:()=>{e.onAdd({operator:n,value:s,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Nh=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.filterPredicate.predicate?.operator??we.Is),s=(0,V.useMemo)(()=>Bm(e.filterPredicate.filter,t),[e.filterPredicate.filter]),[r,a]=(0,V.useState)(Bs(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),[l,d]=(0,V.useState)(e.filterPredicate.predicate?.value2??1),c=Bs(r)||[we.IsEmpty,we.IsNotEmpty].includes(n);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{state:"is"===n?"checked":"unchecked",onClick:()=>o(we.Is),children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Uu,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:s})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNot"===n?"checked":"unchecked",onClick:()=>o(we.IsNot),children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Uu,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:s})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"contains"===n?"checked":"unchecked",onClick:()=>o(we.Contains),children:t("est_le_choix_07450")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Qd,{shouldParseAsInt:!0,value:l,onChange:d})]}),(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Uu,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:s})]}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>o(we.IsEmpty),children:t("est_vide_96759")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>o(we.IsNotEmpty),children:t("n_est_pas_vide_45804")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{disabled:!c,onClick:()=>{e.onAdd({operator:n,value:r,value2:l,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})};var Lh=n(8389),Bh=n(8047);const Vh=({children:e,dateTime:t,...n})=>{const o=g(t)?t:t.toISO();return(0,i.jsx)(Od,{as:"time",dateTime:o,textStyle:"inherit",...n,children:e})};function Uh(e,t){const n=t.formats?.localeFormat||zs.DateOnly.MonthLong,i=zs.TimeOnly,o=t.language?{locale:Oc(t.language)}:{};t.formats?.displayWeekday&&(n.weekday="long");const s=e.start,r=e.end;return{startDateString:g(t.formats?.dateFormat)?s.toFormat(t.formats.dateFormat):s.toLocaleString(n,o),startTimeString:g(t.formats?.timeFormat)?s.toFormat(t.formats.timeFormat):s.toLocaleString(i,o),endDateString:g(t.formats?.dateFormat)?r.toFormat(t.formats.dateFormat):r.toLocaleString(n,o),endTimeString:g(t.formats?.timeFormat)?r.toFormat(t.formats.timeFormat):r.toLocaleString(i,o)}}function Wh(e){return Math.ceil(e.end.endOf("day").diff(e.start.startOf("day"),"days").days)}function Gh(e){return e.flatMap(e=>{const t=e.range,n=Wh(t);return n>1?(0,nm.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:As.IX.fromDateTimes(o,s)}}):[e]})}function qh(e,t,n,i){const o=Math.ceil(n.endOf("day").diff(t.startOf("day"),"days").days),s=(0,nm.A)(0,o).map(e=>t.startOf("day").set({hour:i}).plus({day:e}));return e.flatMap(e=>{const{start:t,end:n}=e.range,i=s.filter(e=>e>t&&e({...e,range:t}))})}function Hh(e){const t=e.filter(e=>e.isValid);if(Bs(t)){const e=(0,cm.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,Lh.A)(n,e=>e.toMillis()).startOf("day"),c=(0,Bh.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 Yh=class{translationService;constructor(e){this.translationService=e}toDisplayString(e,t={}){return function(e,t={}){const{startDateString:n,startTimeString:i,endDateString:o,endTimeString:s}=Uh(e,t),r=t?.formats?.separator??"–";return e.start.year!==e.end.year||e.start.month!==e.end.month||e.start.day!==e.end.day?t.hideTime?`${n}${r}${o}`:t.hideDate?`${i}${r}${s}`:`${n} ${i}${r}${o} ${s}`:t.hideTime?`${n}`:t.hideDate?`${i}${r}${s}`:`${n} ${i}${r}${s}`}(e,{...t,language:this.translationService.language})}toComponents(e,t={}){return function(e,t={}){const{startDateString:n,startTimeString:o,endDateString:s,endTimeString:r}=Uh(e,t),a=t?.formats?.separator??"–";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)(Vh,{dateTime:e.start.toISODate(),children:n}),a,(0,i.jsx)(Vh,{dateTime:e.end.toISODate(),children:s})]}):t.hideDate?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vh,{dateTime:e.start.toISOTime(),children:o}),a,(0,i.jsx)(Vh,{dateTime:e.end.toISOTime(),children:o})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Vh,{dateTime:e.start,children:[n," ",o]}),a,(0,i.jsxs)(Vh,{dateTime:e.end,children:[s," ",r]})]}):t.hideTime?(0,i.jsx)(Vh,{dateTime:e.start.toISODate(),children:n}):t.hideDate?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vh,{dateTime:e.start.toISOTime(),children:o}),"–",(0,i.jsx)(Vh,{dateTime:e.end.toISOTime(),children:r})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Vh,{dateTime:e.start,children:[n," ",o]}),"–",(0,i.jsx)(Vh,{dateTime:e.end,children:r})]})}(e,{...t,language:this.translationService.language})}toLocaleString(e,t,n){return e.toLocaleString(n,t)}};Yh=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],Yh);var Zh=n(6452),Xh=n(5582);const Jh=/^\d{1,2}:\d{2}$/,Qh=/^\d{1,2}:\d{2}:\d{2}$/;function eg(e){return g(e)&&(null!==e.match(Jh)||null!==e.match(Qh))}function tg(e){if(eg(e)){const[t,n]=e.split(":");return[parseInt(t,10),parseInt(n,10)]}return null}function ng(e,t,n,i={}){const o=g(t.name)?t.name:"",s=e.toDisplayString(t.range,i.interval?.options),r=(0,hd.A)([i.position?.includeName?n:"",o,i.slot?.includeRange||p(o)?s:"",i.position?.includeNameAtEnd?n:""]).join(" - ");return g(r)?r:n}function ig(e,t){return t.some(({id:t,range:n})=>e.id!==t&&n.overlaps(e.range))}function og(e,t){const n=e.toISODate();return t.filter(e=>e.range.start.toISODate()===n)}function sg(e,t,n,i,o,s){const r=[],a=[],l=[],d=e=>lg(e.position,s),c=(e,t)=>t.some(t=>t.engulfs(e.range)),u=Bs(o),m=Bs(i)||Bs(n)||Bs(t),h=u&&m?"both":u?"ranges":m?"positions":"none";e.forEach(e=>{const s=i.includes(e.id)||n.includes(e.position.id)||t.includes(e.positionCategory.id);"both"===h&&c(e,o)&&d(e)&&s||"ranges"===h&&c(e,o)&&d(e)||"positions"===h&&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,cm.A)(r,g),possiblePositionsSlots:(0,cm.A)(a,g),otherPositionsSlots:(0,cm.A)(l,g)}}function rg(e){return`${e.name}${g(e.acronym)?` (${e.acronym})`:""}`}function ag(e,t){const n=t[e.customField.slug];return"boolean"==typeof n&&e.customField.fieldType===Oe.Checkbox?n===e.conditionValue:e.customField.fieldType===Oe.Select&&e.customField.canSelectMultiple&&Bs(n)?(0,Pu.A)(e.conditionValue,n??[]).length>0:e.customField.fieldType===Oe.Select&&"number"==typeof n&&e.conditionValue.includes(n)}function lg(e,t){if(!Bs(e?.conditionsCustomFields))return!0;switch(e.conditionsOperator){case Ie.Or:return e.conditionsCustomFields.some(e=>ag(e,t));case Ie.And:return e.conditionsCustomFields.every(e=>ag(e,t));default:return vd(e.conditionsOperator)}}function dg(e){return g(e.address)}function cg(e){return Ra(e.latitude)&&Ra(e.longitude)}function ug(e){return dg(e)||cg(e)}function mg(e){return(0,cm.A)(Object.values((0,Vu.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:g(n.acronym)?n.acronym:n.name,minDate:(0,Zh.A)(i),color:n.color,count:e.length,icon:n.icon}}),({category:e,text:t,minDate:n})=>[e.toLowerCase(),t.toLowerCase(),n])}function hg(e){return`${e.name}${g(e.acronym)?` (${e.acronym})`:""}`}function gg(e){return pg(e.map(({accreditationSlot:e})=>e))}function pg(e){return(0,cm.A)(Object.values((0,Vu.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:g(n.acronym)?n.acronym:n.name,minDate:(0,Zh.A)(i),color:n.color,count:e.length,icon:n.icon}}),({category:e,index:t,text:n,minDate:i})=>[m(e),fg(t),m(n),i])}function fg(e){return"number"!=typeof e||isNaN(e)?"9999":e.toString(10).padStart(4,"0")}function _g(e){return(0,cm.A)(e,e=>[m(e.accreditationCategoryName||""),fg(e.index),m(e.name)])}var xg,Ig,vg,bg,jg,Cg;function yg(e){switch(e){case vg.AccreditationsMatrix:case Cg.AccreditationsMatrix:return"table-cells";case jg.Calendar:case Cg.Calendar:return"chart-gantt";case bg.Card:return"rectangle-list";case Ig.List:case vg.List:case bg.List:case jg.List:case Cg.List:return"table";case jg.Map:case Cg.Map:return"map-location";case Ig.SlotsList:case jg.SlotsList:return"table";case Ig.Table:return"table-cells";case Ig.WeeklyCalendar:return"calendar";default:return vd()}}function Ag(e,t){switch(t){case vg.AccreditationsMatrix:case Cg.AccreditationsMatrix:return e("matrice_des_acc_84939");case jg.Calendar:case Cg.Calendar:return e("vue_planning_91663");case bg.Card:return e("vue_grille_37962");case Ig.List:case vg.List:case bg.List:case jg.List:case Cg.List:return e("vue_liste_56882");case jg.Map:case Cg.Map:return e("vue_carte_79064");case Ig.SlotsList:case jg.SlotsList:return e("vue_liste_cr_n_47406");case Ig.Table:return e("vue_tableau_18026");case Ig.WeeklyCalendar:return e("vue_calendrier_58086");default:return vd()}}!function(e){e.Category="Category",e.Date="Date"}(xg||(xg={})),function(e){e.List="List",e.SlotsList="SlotsList",e.Table="Table",e.WeeklyCalendar="WeeklyCalendar"}(Ig||(Ig={})),function(e){e.AccreditationsMatrix="AccreditationsMatrix",e.List="List"}(vg||(vg={})),function(e){e.Card="Card",e.List="List"}(bg||(bg={})),function(e){e.Calendar="Calendar",e.List="List",e.Map="Map",e.SlotsList="SlotsList"}(jg||(jg={})),function(e){e.AccreditationsMatrix="AccreditationsMatrix",e.Calendar="Calendar",e.List="List",e.Map="Map"}(Cg||(Cg={}));var Sg;function kg(e,t){return t===vg.AccreditationsMatrix?{includeAccreditations:!1,includeAccreditationsProfiles:!0,includeAccreditationsSlots:!0,includeCampaigns:!1,includeChildren:!1,includeCreatedBy:!1,includeDescription:!1,includeDocuments:!1,includeLayout:!1,includeLeaders:!1,includeResources:!1,includeParent:!1,includeTags:!1,includeUsedCustomFieldsFilled:!1}:{includeAccreditations:e.includes(Sg.Accreditations),includeAccreditationsProfiles:e.includes(Sg.AccreditationsProfiles),includeAccreditationsSlots:!1,includeCampaigns:e.includes(Sg.Campaigns),includeChildren:e.includes(Sg.Events),includeCreatedBy:e.includes(Sg.CreatedBy),includeDescription:e.includes(Sg.Description),includeDocuments:e.includes(Sg.Documents),includeLayout:e.includes(Sg.DelegationsSpaceLayout),includeLeaders:e.includes(Sg.Leaders)||e.includes(Sg.CategoryLeaders),includeResources:e.includes(Sg.FillingRate)||e.includes(Sg.AssignedResources),includeParent:e.includes(Sg.Parent),includeTags:e.includes(Sg.Tags),includeUsedCustomFieldsFilled:e.includes(Sg.UsedCustomFieldsFilled)}}!function(e){e.Accreditation="accreditation",e.AccreditationProfile="accreditation_profile",e.Accreditations="accreditations",e.AccreditationSlot="accreditationSlotId",e.AccreditationsProfiles="accreditationsProfiles",e.AssignedResources="resources",e.Campaigns="campaigns",e.CanLeadersAddMembers="canLeadersAddMembers",e.CanLeadersDeleteMembers="canLeadersDeleteMembers",e.CanLeadersDuplicateMembers="canLeadersDuplicateMembers",e.CanLeadersEditColumns="canLeadersEditColumns",e.CanLeadersEditCustomFields="canLeadersEditCustomFields",e.CanLeadersEditMembers="canLeadersEditMembers",e.CanLeadersImportMembers="canLeadersImportMembers",e.CanLeadersSeeHiddenAccreditationsSlots="canLeadersSeeHiddenAccreditationsSlots",e.CategoryLeaders="categoryLeaders",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.DeadlineDate="deadlineDate",e.DelegationCategory="delegationCategory",e.DelegationSpaceLink="delegationSpaceLink",e.DelegationsSpaceLayout="delegationsSpaceLayout",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.Parent="parent",e.PrivateNote="privateNote",e.ShowAllAccreditations="showAllAccreditations",e.ShowFormLinkInDelegationSpace="showFormLinkInDelegationSpace",e.ShowInDelegation="showInDelegation",e.State="delegationState",e.Tags="tags",e.UsedCustomFieldsFilled="usedCustomFieldsFilled"}(Sg||(Sg={}));let wg=class extends Um{constructor(e,t,n){super(e,t,n)}getDelegationsFilters(e,t,n,i){return(0,hd.A)([{slug:Sg.Name,name:this.t("nom_de_la_d_l_g_28087"),category:this.t("d_l_gations_78318"),fieldType:Zt.Text,hideEmpty:!0},{slug:Sg.Description,name:this.t("Description"),category:this.t("d_l_gations_78318"),fieldType:Zt.Text},{slug:Sg.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("d_l_gations_78318"),fieldType:Zt.Text},Bs(i)?{slug:Sg.DelegationCategory,name:this.t("cat_gorie_00291"),category:this.t("d_l_gations_78318"),fieldType:Zt.Select,values:(0,cm.A)(i,e=>m(e.name)),hideEmpty:!0}:null,{slug:"delegationState",name:this.t("State"),category:this.t("d_l_gations_78318"),fieldType:Zt.Select,values:Rn.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:Sg.CategoryLeaders,name:this.t("responsables_de_22220"),category:this.t("d_l_gations_78318"),fieldType:Zt.Select,needLoading:!0,organizationId:e,eventId:t},{slug:Sg.Leaders,name:this.t("responsables_de_03381"),category:this.t("d_l_gations_78318"),fieldType:Zt.Select,needLoading:!0,organizationId:e,eventId:t},{slug:"leadersEmailSend",name:this.t("les_responsable_08257"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:"form",name:this.t("Form"),category:this.t("d_l_gations_78318"),fieldType:Zt.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:Zt.Date},{slug:Sg.MaxResources,name:this.t("MaxResources"),category:this.t("d_l_gations_78318"),fieldType:Zt.Number},{slug:"tag",name:this.t("Tag"),category:this.t("d_l_gations_78318"),fieldType:Zt.Select,needLoading:!0,organizationId:e,eventId:t,tagContext:Fe.Delegations},{slug:"resources",name:this.t("nombre_de_membr_08851"),category:this.t("d_l_gations_78318"),fieldType:Zt.Number,hideEmpty:!0},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("d_l_gations_78318"),fieldType:Zt.Number,hideEmpty:!0},{slug:Sg.ShowInDelegation,name:this.t("ShowInDelegationSpace"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:Sg.CanLeadersAddMembers,name:this.t("CanLeadersAddMembers"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:Sg.CanLeadersDeleteMembers,name:this.t("CanLeadersDeleteMembers"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:Sg.CanLeadersDuplicateMembers,name:this.t("CanLeadersDuplicateMembers"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:Sg.CanLeadersEditMembers,name:this.t("CanLeadersEditMembers"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:Sg.CanLeadersEditColumns,name:this.t("CanLeadersEditColumns"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:Sg.CanLeadersEditCustomFields,name:this.t("CanLeadersEditCustomFields"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:Sg.CanLeadersImportMembers,name:this.t("CanLeadersImportMembers"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:Sg.CanLeadersSeeHiddenAccreditationsSlots,name:this.t("CanLeadersSeeHiddenAccreditationsSlots"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:Sg.ShowFormLinkInDelegationSpace,name:this.t("afficher_le_lie_05841"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:Sg.ShowAllAccreditations,name:this.t("ShowAllAccreditations"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox,hideEmpty:!0},t?{slug:Sg.DelegationsSpaceLayout,name:this.t("DelegationsSpaceLayout"),category:this.t("d_l_gations_78318"),fieldType:Zt.Select,needLoading:!0,eventId:t}:null,t?{slug:Sg.Accreditation,name:this.t("accr_ditations_39450"),category:this.t("d_l_gations_78318"),fieldType:Zt.Select,needLoading:!0,eventId:t}:null,t?{slug:Sg.AccreditationSlot,name:this.t("cr_neaux_accr_d_70934"),category:this.t("d_l_gations_78318"),fieldType:Zt.Select,needLoading:!0,eventId:t}:null,t?{slug:Sg.AccreditationProfile,name:this.t("profil_d_accr_d_02274"),category:this.t("d_l_gations_78318"),fieldType:Zt.Select,needLoading:!0,eventId:t}:null,{slug:Sg.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("d_l_gations_78318"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:Sg.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("d_l_gations_78318"),fieldType:Zt.Datetime,hideEmpty:!0},t?{slug:"parent",name:this.t("est_li_e_une_48471"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox,hideEmpty:!0}:{slug:"event",name:this.t("_v_nement_22345"),category:this.t("d_l_gations_78318"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:Sg.UsedCustomFieldsFilled,name:this.t("champs_personna_27238"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox,hideEmpty:!0},...this.customFieldsToFilters(n)])}getDelegationsPossibleColumns(e,t){return[{slug:Sg.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:Kt.Id,width:100},{slug:Sg.Name,name:this.t("nom_de_la_d_l_g_28087"),isSearchable:!0,isSortable:!0,sortAttribute:Kt.Name,minWidth:240},{slug:Sg.Description,name:this.t("Description"),minWidth:320},{slug:Sg.DelegationCategory,name:this.t("cat_gorie_00291"),isSearchable:!0,isSortable:!0,sortAttribute:Kt.Category,minWidth:240},{slug:Sg.State,name:this.t("State"),minWidth:180},{slug:Sg.CategoryLeaders,name:this.t("responsables_de_22220"),isSearchable:!0,minWidth:320},{slug:Sg.Leaders,name:this.t("responsables_de_03381"),isSearchable:!0,minWidth:320},{slug:Sg.Form,name:this.t("Form"),isSearchable:!0,minWidth:180},{slug:Sg.FormLink,name:this.t("FormLink"),minWidth:240},{slug:Sg.DelegationSpaceLink,name:this.t("DelegationSpaceLink"),minWidth:240},{slug:Sg.DelegationsSpaceLayout,name:this.t("DelegationsSpaceLayout"),minWidth:240},{slug:Sg.DeadlineDate,name:this.t("date_limite_d_i_79779"),minWidth:180},{slug:Sg.MaxResources,name:this.t("MaxResources"),minWidth:180,isSortable:!0,sortAttribute:Kt.MaxResources},{slug:Sg.AssignedResources,name:this.t("membres_11310"),minWidth:240},{slug:Sg.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:240},{slug:Sg.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:Sg.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:Sg.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:Kt.CreatedAt,minWidth:180},{slug:Sg.ShowInDelegation,name:this.t("ShowInDelegationSpace"),minWidth:180},{slug:Sg.CanLeadersAddMembers,name:this.t("CanLeadersAddMembers"),minWidth:180},{slug:Sg.CanLeadersEditMembers,name:this.t("CanLeadersEditMembers"),minWidth:180},{slug:Sg.CanLeadersDeleteMembers,name:this.t("CanLeadersDeleteMembers"),minWidth:180},{slug:Sg.CanLeadersDuplicateMembers,name:this.t("CanLeadersDuplicateMembers"),minWidth:180},{slug:Sg.CanLeadersEditColumns,name:this.t("CanLeadersEditColumns"),minWidth:180},{slug:Sg.CanLeadersEditCustomFields,name:this.t("CanLeadersEditCustomFields"),minWidth:180},{slug:Sg.CanLeadersImportMembers,name:this.t("CanLeadersImportMembers"),minWidth:180},{slug:Sg.CanLeadersSeeHiddenAccreditationsSlots,name:this.t("CanLeadersSeeHiddenAccreditationsSlots"),minWidth:180},{slug:Sg.ShowFormLinkInDelegationSpace,name:this.t("afficher_le_lie_05841"),minWidth:180},{slug:Sg.ShowAllAccreditations,name:this.t("ShowAllAccreditations"),minWidth:180},{slug:Sg.IsLocked,name:this.t("IsLocked"),minWidth:180},e?{slug:Sg.Parent,name:this.t("d_l_gation_de_l_86100"),minWidth:320}:{slug:Sg.Events,name:this.t("_v_nements_53672"),minWidth:320},...e?[{slug:Sg.Accreditations,name:this.t("accr_ditations_39450"),minWidth:320},{slug:Sg.AccreditationsProfiles,name:this.t("profils_d_accr_27825"),minWidth:320}]:[],{slug:Sg.Campaigns,name:this.t("campagnes_que_l_81468"),minWidth:320},{slug:Sg.Documents,name:this.t("documents_que_l_18755"),minWidth:320},{slug:Sg.UsedCustomFieldsFilled,name:this.t("champs_personna_27238"),minWidth:180},...this.customFieldsToPossibleColumns(t)]}};function Eg(e){return"production"===a.Development?1===e:3136===e}function Tg(){return"production"===a.Development?[14]:[66919,68131,68598,70260,74864,74866,74868]}wg=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mm,Cm,Si])],wg);const Rg="custom_document_";function Og(e){return`${Rg}${e}`}function Dg(e){return e.startsWith(Rg)}function zg(e,t){return 0===e.length||e.includes(t)}function $g(e){return"production"===a.Development?1===e:2676===e}var Pg;function Mg(e,t,n){return t===Cg.AccreditationsMatrix?{includeAccreditationProfile:!1,includeAccreditations:!1,includeAccreditationsMatrix:!0,includeAvailability:!1,includeComments:!1,includeCustomDocuments:!1,includeDelegation:!1,includeDuplicatedFrom:!1,includeEmails:!1,includeForms:!1,includeFormsUsersInfos:!1,includeNumberOfAccreditations:!1,includeNumberOfAssignments:!1,includeNumberOfAssignmentsDays:!1,includeNumberOfAvailableDays:!1,includePicture:!0,includePositions:!1,includePreassignedPositions:!1,includeRoles:!1,includeTags:!1,includeTeam:!1,includeTraces:!1,includeVolunteerMinutes:!1,includeWeezeventChecklists:!1,includeWeezeventUrls:!1,includeWishedPositions:!1}:t===Cg.Map?{includeAccreditationProfile:!1,includeAccreditations:!1,includeAccreditationsMatrix:!1,includeAvailability:!1,includeComments:!1,includeCustomDocuments:!1,includeDelegation:!1,includeDuplicatedFrom:!1,includeEmails:!1,includeForms:!1,includeFormsUsersInfos:!1,includeNumberOfAccreditations:!1,includeNumberOfAssignments:!1,includeNumberOfAssignmentsDays:!1,includeNumberOfAvailableDays:!1,includePicture:!1,includePositions:!1,includePreassignedPositions:!1,includeRoles:!1,includeTags:!1,includeTeam:!1,includeTraces:!0,includeVolunteerMinutes:!1,includeWeezeventChecklists:!1,includeWeezeventUrls:!1,includeWishedPositions:!1}:{includeAccreditationProfile:e.includes(Pg.AccreditationProfile)||e.includes(Pg.WishedAccreditationProfile),includeAccreditations:e.includes(Pg.Accreditations)||e.includes(Pg.AccreditationsCategories)||e.includes(Pg.AccreditationsSlots)||e.includes(Pg.WishedAccreditationSlots)||e.includes(Pg.ScannedAccreditations)||e.includes("bracelet_a_delivrer"),includeAccreditationsMatrix:!1,includeAvailability:e.includes(Pg.Availability),includeComments:e.includes(Pg.Comments),includeCustomDocuments:e.some(Dg),includeDelegation:e.includes(Pg.Delegations)||e.includes(Pg.DelegationCategory)||e.includes(Pg.DelegationBannerNumber),includeDuplicatedFrom:e.includes(Pg.DuplicatedFrom),includeEmails:e.includes(Pg.CampaignsStates),includeFormsUsersInfos:e.includes(Pg.CompletedForms)||e.includes(Pg.FormsInsertedAt)||e.some(e=>e.startsWith("form_inserted_at_"))||e.includes(Pg.Availability)||e.includes(Pg.TeamCode)||e.includes(Pg.TeamMembers)||e.includes(Pg.WishedAccreditationProfile),includeForms:e.includes(Pg.CompletedForms)||e.includes(Pg.FormsInsertedAt)||e.some(e=>e.startsWith("form_inserted_at_"))||e.includes(Pg.Availability),includeNumberOfAccreditations:e.includes(Pg.NumberOfAccreditations),includeNumberOfAssignments:e.includes(Pg.NumberOfAssignments),includeNumberOfAssignmentsDays:e.includes(Pg.NumberOfAssignmentsDays),includeNumberOfAvailableDays:e.includes(Pg.NumberOfAvailableDays),includePicture:e.includes(Pg.Name),includePositions:e.includes(Pg.Positions)||e.includes(Pg.PositionsCategories)||e.includes(Pg.WishedPositions)||e.includes(Pg.CheckedInPositions),includeRoles:e.includes(Pg.Roles),includeTags:e.includes(Pg.Tags),includeTeam:e.includes(Pg.TeamCode)||e.includes(Pg.TeamMembers),includeTraces:!1,includeVolunteerMinutes:e.includes(Pg.VolunteerMinutes),includeWishedPositions:e.includes(Pg.WishedPositions),includePreassignedPositions:e.includes(Pg.PreassignedPositionsCategories)||e.includes(Pg.PreassignedPositions),includeWeezeventChecklists:e.includes(Pg.WeezaccessChecklists),includeWeezeventUrls:!0===n?.includeWeezeventUrls&&(e.includes(Pg.WeezeventBarcodeId)||e.includes(Pg.WeezeventShortTag))}}!function(e){e.AccreditationProfile="accreditation_profile",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.DelegationBannerNumber="delegation_banner_number",e.DelegationCategory="delegation_category",e.Delegations="delegations",e.DuplicatedFrom="duplicatedFrom",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.WeezeventBarcodeVersion="weezevent_barcode_version",e.WeezeventPairedAt="weezevent_paired_at",e.WeezeventShortTag="weezevent_short_tag",e.WishedAccreditationProfile="wished_accreditation_profile",e.WishedAccreditationSlots="wished_accreditation_slots",e.WishedPositions="wished_positions"}(Pg||(Pg={}));let Fg=class extends Um{constructor(e,t,n){super(e,t,n)}getVolunteersFilters(e,t,n,i,o,{hasAccreditations:s,hasCampaigns:r,hasDelegations:a,hasForms:l,hasPositions:d,isWeezeventConnected:c}){return[...this.getBaseFilters(i),...this.getBarcodeFilters(),...this.getAvailabilitiesFilters(t,o),...d?this.getPositionsFilters(e,t,o):[],...s?this.getAccreditationsFilters(e,t,o):[],...a?this.getDelegationsFilters(e,t):[],...this.getSegmentsFilters(e,t,n,o),...l?this.getFormsFilters(t):[],...l?this.getTeamsFilters():[],...c?this.getWeezeventFilters(t):[],...this.getEmailsFilters(t,r),...this.getCommentsFilter(e,t),{slug:"tag",name:this.t("Tags"),category:this.t("autres_99130"),fieldType:Zt.Select,needLoading:!0,organizationId:e,eventId:t,tagContext:Fe.UsersInfos},{slug:"sameEmail",name:this.t("nombre_de_profi_42316"),category:this.t("autres_99130"),fieldType:Zt.Number,hideEmpty:!0},{slug:"possibleDuplicates",name:this.t("potentiel_doubl_87672"),category:this.t("autres_99130"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:"isLeader",name:this.t("est_responsable_19679"),category:this.t("autres_99130"),fieldType:Zt.Checkbox},{slug:"isPositionLeader",name:this.t("est_responsable_27270"),category:this.t("autres_99130"),fieldType:Zt.Checkbox},{slug:"isPositionCategoryLeader",name:this.t("est_responsable_91796"),category:this.t("autres_99130"),fieldType:Zt.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),...o.slotDisplay===Qe.Hide?[]:this.getAvailabilitiesFilters(t,i),...this.getAccreditationsFilters(e,t,i),...o.positionDisplay===tt.None?[]:this.getPositionMembersFilters(e,t,n,i),...s?this.getWeezeventFilters(t):[]]}getVolunteersPossibleColumns(e,t,n,i,{hasAccreditations:o,hasCampaigns:s,hasCustomDocuments:r,hasDelegations:a,hasForms:l,hasPositions:d,isWeezeventConnected:c}){return[...this.getBaseColumns(t,{forDelegationsSpace:!1}),...r?this.getCustomDocumentsColumns(i):[],...l?this.getFormsColumns(n):[],...d?this.getPositionsColumns():[],...c?this.getWeezeventColumns():[],...o?this.getAccreditationsColumns(e):[],...this.getAvailabilitiesColumns(),...a?this.getDelegationsColumns(e):[],...s?[{slug:Pg.CampaignsStates,name:this.t("statut_des_camp_25280"),minWidth:320}]:[],{slug:Pg.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:Pg.Comments,name:this.t("commentaires_96492"),isSearchable:!0,minWidth:320},{slug:Pg.Roles,name:this.t("r_les_61679"),minWidth:320}]}getPositionMembersPossibleColumns(e){return[...this.getBaseColumns(e,{forDelegationsSpace:!1}),...this.getPositionsColumns()]}getAccreditationMembersPossibleColumns(e,t){return[...this.getBaseColumns(t,{forDelegationsSpace:!1}),...this.getAccreditationsColumns(e),...this.getDelegationsColumns(e)]}getDelegationCategoryMembersPossibleColumns(e,t,n){return[...this.getBaseColumns(t,{forDelegationsSpace:!1}),...this.getAccreditationsColumns(e),...this.getDelegationsColumns(e),...n?this.getWeezeventColumns():[],{slug:Pg.CampaignsStates,name:this.t("statut_des_camp_25280")},{slug:Pg.Delegations,name:this.t("Delegation"),isSearchable:!0}]}getDelegationMembersPossibleColumns(e,t,{forDelegationsSpace:n,isWeezeventConnected:i,positionDisplay:o,slotDisplay:s}){return[...this.getBaseColumns(t,{forDelegationsSpace:n}),...this.getAccreditationsColumns(e),...o===tt.None?[]:this.getPositionsColumns(),...s===Qe.Hide?[]:this.getAvailabilitiesColumns(),...i?this.getWeezeventColumns():[],{slug:Pg.CampaignsStates,name:this.t("statut_des_camp_25280")}]}getBaseColumns(e,{forDelegationsSpace:t}){return(0,hd.A)([{slug:Pg.Email,name:this.t("e_mail_du_membr_69509"),isSearchable:!0,isSortable:!0,sortAttribute:rn.Email,minWidth:180},t?null:{slug:Pg.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:rn.Id,width:100},t?null:{slug:Pg.LocalId,name:this.t("id_sur_l_v_nem_01171"),isSearchable:!0,isSortable:!0,sortAttribute:rn.LocalId,width:100},t?null:{slug:Pg.WeezeventBarcodeId,name:this.t("TicketId"),isSearchable:!0,minWidth:240},t?null:{slug:Pg.WeezeventBarcodeVersion,name:this.t("version_du_code_15471"),minWidth:100},{slug:Pg.Name,name:this.t("full_name"),isSearchable:!0,isSortable:!0,sortAttribute:rn.Name,minWidth:240},{slug:Pg.InsertedAt,name:this.t("date_d_inscript_31369"),isSortable:!0,sortAttribute:rn.InsertedAt,width:240},t?null:{slug:Pg.DuplicatedFrom,name:this.t("dupliqu_de_28582"),minWidth:240},...this.customFieldsToPossibleColumns(e)])}getAvailabilitiesColumns(){return[{slug:Pg.Availability,name:this.t("disponibilit_s_49923"),minWidth:320}]}getCustomDocumentsColumns(e){return(0,cm.A)(e,e=>m(e.name)).map(e=>({slug:Og(e.id),name:this.t("imprimer_1_75795",e.name),customDocument:e,minWidth:240}))}getFormsColumns(e){return[{slug:Pg.CompletedForms,name:this.t("formulaires_rem_62495"),minWidth:320},{slug:Pg.FormsInsertedAt,name:this.t("dates_de_rempli_65075"),minWidth:320},...(0,cm.A)(e,e=>m(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:Pg.TeamCode,name:this.t("code_quipe_14296"),isSearchable:!0,isSortable:!0,sortAttribute:rn.TeamCode,minWidth:180},{slug:Pg.TeamMembers,name:this.t("membres_de_l_q_00891"),minWidth:240}]}getPositionsColumns(){return[{slug:Pg.NumberOfAssignments,name:this.t("nombre_d_affect_31455"),width:240},{slug:Pg.NumberOfAssignmentsDays,name:this.t("nombre_de_jours_86280"),width:240},{slug:Pg.NumberOfAvailableDays,name:this.t("nombre_de_jours_07962"),width:240},{slug:Pg.Positions,name:this.t("missions_affect_97811"),minWidth:320},{slug:Pg.PositionsCategories,name:this.t("cat_gories_de_m_93035"),minWidth:320},{slug:Pg.VolunteerMinutes,name:this.t("nombre_de_minut_50497"),width:240},{slug:Pg.VolunteerRegistrationState,name:this.t("status_d_affect_75769"),isSortable:!0,sortAttribute:rn.State,width:240},{slug:Pg.WishedPositions,name:this.t("missions_souhai_23225"),minWidth:320},{slug:Pg.PreassignedPositions,name:this.t("missions_pr_af_02950"),minWidth:320},{slug:Pg.PreassignedPositionsCategories,name:this.t("cat_gories_pr_83825"),minWidth:320},{slug:Pg.CheckedInPositions,name:this.t("missions_point_05292"),minWidth:320}]}getAccreditationsColumns(e){return(0,hd.A)([{slug:Pg.Accreditations,name:this.t("accr_ditations_33155"),minWidth:320},{slug:Pg.AccreditationsCategories,name:this.t("cat_gories_d_ac_37678"),minWidth:320},{slug:Pg.AccreditationState,name:this.t("statut_d_accr_d_75527"),isSortable:!0,sortAttribute:rn.AccreditationState,width:240},{slug:Pg.NumberOfAccreditations,name:this.t("nombre_d_accr_d_02452"),width:240},{slug:Pg.WishedAccreditationSlots,name:this.t("accr_ditations_74375"),minWidth:320},{slug:Pg.ScannedAccreditations,name:this.t("accr_ditations_52153"),minWidth:320},{slug:Pg.AccreditationProfile,name:this.t("profil_d_accr_d_02274"),minWidth:240},{slug:Pg.WishedAccreditationProfile,name:this.t("profil_d_accr_d_63000"),minWidth:240},$g(e)?{slug:"bracelet_a_delivrer",name:this.t("bracelet_d_li_50372")}:null])}getWeezeventColumns(){return[{slug:Pg.WeezeventShortTag,name:this.t("puce_50504"),isSearchable:!0,minWidth:180},{slug:Pg.WeezeventPairedAt,name:this.t("appair_le_70213"),isSortable:!0,sortAttribute:rn.PairedAt,minWidth:180},{slug:Pg.WeezaccessChecklists,name:this.t("listes_de_contr_55120"),minWidth:320}]}getDelegationsColumns(e){return(0,hd.A)([{slug:Pg.Delegations,name:this.t("Delegation"),isSearchable:!0,isSortable:!0,sortAttribute:rn.Delegation,minWidth:240},{slug:Pg.DelegationCategory,name:this.t("cat_gorie_de_d_18027"),minWidth:240},Eg(e)?{slug:Pg.DelegationBannerNumber,name:this.t("num_ro_de_bande_16203"),isSearchable:!0,width:100}:null])}getBaseFilters(e){return[{slug:"email",name:this.t("Email"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Text,hideEmpty:!0},{slug:"insertedAt",name:this.t("date_d_inscript_31369"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Date,hideEmpty:!0},{slug:Pg.LocalId,name:this.t("id_sur_l_v_nem_01171"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Number,hideEmpty:!0},{slug:Pg.DuplicatedFrom,name:this.t("est_dupliqu_62764"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Checkbox,hideEmpty:!0},...this.customFieldsToFilters(e)]}getBarcodeFilters(){return[{slug:Pg.WeezeventBarcodeId,name:this.t("TicketId"),category:"Weezevent",fieldType:Zt.Text,hideEmpty:!0},{slug:Pg.WeezeventBarcodeVersion,name:this.t("version_du_code_15471"),category:"Weezevent",fieldType:Zt.Number,hideEmpty:!0}]}getAvailabilitiesFilters(e,t){return[{slug:"numberOfAvailableDays",name:this.t("nombre_de_jours_07962"),category:this.t("disponibilit_s_49923"),fieldType:Zt.Number,hideEmpty:!0},{slug:"wishedSlots",name:this.t("disponibilit_s_49923"),category:this.t("disponibilit_s_49923"),fieldType:Zt.DateTimeRange,startAt:t.startAt,endAt:t.endAt},{slug:"wishedSlotsCustom",name:this.t("disponibilit_s_26280"),category:this.t("disponibilit_s_49923"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:e},{slug:"numberOfWishedSlots",name:this.t("nombre_de_dispo_26405"),category:this.t("disponibilit_s_49923"),fieldType:Zt.Number,hideEmpty:!0}]}getPositionsFilters(e,t,n){return[{slug:"volunteerRegistrationState",name:this.t("statut_d_affect_57444"),category:this.t("missions_63972"),fieldType:Zt.Select,values:hi.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"position",name:this.t("missions_affect_97811"),category:this.t("missions_63972"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"hasOtherEventPosition",name:this.t("has_shift_on_ot_92375"),category:this.t("missions_63972"),fieldType:Zt.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:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"positionSlot",name:this.t("date_d_affectat_98566"),category:this.t("missions_63972"),fieldType:Zt.DateTimeRange,startAt:n.startAt,endAt:n.endAt},{slug:"positionCategory",name:this.t("cat_gories_de_m_93035"),category:this.t("missions_63972"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"numberOfAssignments",name:this.t("nombre_d_affect_31455"),category:this.t("missions_63972"),fieldType:Zt.Number,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"numberOfAssignmentsPerDay",name:this.t("nombre_d_affect_22087"),category:this.t("missions_63972"),fieldType:Zt.Number,hideEmpty:!0,startAt:n.startAt,endAt:n.endAt},{slug:"numberOfAssignmentsDays",name:this.t("nombre_de_jours_86280"),category:this.t("missions_63972"),fieldType:Zt.Number,hideEmpty:!0,startAt:n.startAt,endAt:n.endAt},{slug:"preassignedPosition",name:this.t("missions_pr_af_02950"),category:this.t("missions_63972"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"preassignedPositionCategory",name:this.t("cat_gories_pr_83825"),category:this.t("missions_63972"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"wishedPositionsCategories",name:this.t("cat_gories_souh_80851"),category:this.t("missions_63972"),fieldType:Zt.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedPositionsCategories",name:this.t("nombre_de_cat_g_05961"),category:this.t("missions_63972"),fieldType:Zt.Number,hideEmpty:!0},{slug:"wishedPositions",name:this.t("missions_souhai_23225"),category:this.t("missions_63972"),fieldType:Zt.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedPositions",name:this.t("nombre_de_missi_52579"),category:this.t("missions_63972"),fieldType:Zt.Number,hideEmpty:!0},{slug:"wishedPositionsSlots",name:this.t("cr_neaux_souhai_90108"),category:this.t("missions_63972"),fieldType:Zt.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedPositionsSlots",name:this.t("nombre_de_cr_ne_28370"),category:this.t("missions_63972"),fieldType:Zt.Number,hideEmpty:!0},{slug:"volunteersMinutes",name:this.t("nombre_de_minut_50497"),category:this.t("missions_63972"),fieldType:Zt.Number,hideEmpty:!0},{slug:"volunteersMinutesDays",name:this.t("nombre_de_minut_89574"),category:this.t("missions_63972"),fieldType:Zt.Number,hideEmpty:!0,startAt:n.startAt,endAt:n.endAt},{slug:"checkInAt",name:this.t("point_le_93167"),category:this.t("missions_63972"),fieldType:Zt.Datetime,useLocalZone:!0},{slug:"checkOutAt",name:this.t("d_point_le_29289"),category:this.t("missions_63972"),fieldType:Zt.Datetime,useLocalZone:!0},{slug:"checkInState",name:this.t("statut_de_point_44328"),category:this.t("missions_63972"),fieldType:Zt.Select,values:Sn.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:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"checkOutAtPositionSlot",name:this.t("cr_neaux_d_poin_45477"),category:this.t("missions_63972"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"overlappingAssignments",name:this.t("affectations_se_49339"),category:this.t("missions_63972"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:"differentPositions",name:this.t("les_missions_af_61709"),category:this.t("missions_63972"),fieldType:Zt.Checkbox,hideEmpty:!0}]}getAccreditationsFilters(e,t,n){return(0,hd.A)([{slug:"accreditationState",name:this.t("statut_d_accr_d_75527"),category:this.t("accr_ditations_39450"),fieldType:Zt.Select,values:vn.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:Zt.Number,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"accreditation",name:this.t("accr_ditations_33155"),category:this.t("accr_ditations_39450"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"hasOtherEventAccreditation",name:this.t("has_accreditati_31831"),category:this.t("accr_ditations_39450"),fieldType:Zt.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:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"wishedAccreditationsSlots",name:this.t("accr_ditations_74375"),category:this.t("accr_ditations_39450"),fieldType:Zt.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedAccreditationsSlots",name:this.t("nombre_d_accr_d_92021"),category:this.t("accr_ditations_39450"),fieldType:Zt.Number,hideEmpty:!0},{slug:"accreditationSlotId",name:this.t("cr_neaux_accr_d_70934"),category:this.t("accr_ditations_39450"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"accreditationSlot",name:this.t("date_d_accr_dit_26214"),category:this.t("accr_ditations_39450"),fieldType:Zt.Date,startAt:n.startAt,endAt:n.endAt},{slug:"scannedAccreditationsSlots",name:this.t("accr_ditations_52153"),category:this.t("accr_ditations_39450"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"differentAccreditations",name:this.t("les_accr_ditati_88638"),category:this.t("accr_ditations_39450"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:Pg.AccreditationProfile,name:this.t("profil_d_accr_d_02274"),category:this.t("accr_ditations_39450"),fieldType:Zt.Select,needLoading:!0,eventId:t},{slug:Pg.WishedAccreditationProfile,name:this.t("profil_d_accr_d_63000"),category:this.t("accr_ditations_39450"),fieldType:Zt.Select,needLoading:!0,eventId:t}])}getDelegationsFilters(e,t){return(0,hd.A)([{slug:"delegation",name:this.t("inscrit_via_la_86398"),category:this.t("d_l_gations_78318"),fieldType:Zt.Select,needLoading:!0,eventId:t},{slug:"delegationCategory",name:this.t("inscrit_via_la_12241"),category:this.t("d_l_gations_78318"),fieldType:Zt.Select,needLoading:!0,organizationId:e,eventId:t},{slug:"isDelegationCategoryLeader",name:this.t("est_responsable_36610"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox},{slug:"isDelegationLeader",name:this.t("est_responsable_87662"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox,needLoading:!0,eventId:t},Eg(e)?{slug:Pg.DelegationBannerNumber,name:this.t("num_ro_de_bande_16203"),category:this.t("d_l_gations_78318"),fieldType:Zt.Number}:null,{slug:"hasBeenInvitedToDelegation",name:this.t("a_re_u_le_lien_34327"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox,hideEmpty:!0}])}getSegmentsFilters(e,t,n,i){return[{slug:"segments",name:this.t("fait_partie_de_44650"),category:this.t("vues_personnali_80652"),fieldType:Zt.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:Zt.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"positionsSegments",name:this.t("affecter_une_10657"),category:this.t("vues_personnali_80652"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"accreditationsSegments",name:this.t("affecter_une_91431"),category:this.t("vues_personnali_80652"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"delegationsSegments",name:this.t("affecter_une_45240"),category:this.t("vues_personnali_80652"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:t}]}getFormsFilters(e){return[{slug:"forms",name:this.t("formulaires_rem_62495"),category:this.t("Form_plural"),fieldType:Zt.Select,needLoading:!0,eventId:e},{slug:"formsInsertedAt",name:this.t("dates_de_rempli_65075"),category:this.t("Form_plural"),fieldType:Zt.Date,hideEmpty:!0,needLoading:!0,eventId:e}]}getTeamsFilters(){return[{slug:"isTeam",name:this.t("est_inscrit_en_86193"),category:this.t("_quipes_18817"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:"teamCode",name:this.t("code_quipe_14296"),category:this.t("_quipes_18817"),fieldType:Zt.Text},{slug:"numberOfTeamMembers",name:this.t("nombre_de_membr_82302"),category:this.t("_quipes_18817"),fieldType:Zt.Number,hideEmpty:!0},{slug:"isTeamLeader",name:this.t("est_chef_d_qui_73792"),category:this.t("_quipes_18817"),fieldType:Zt.Checkbox,hideEmpty:!0}]}getWeezeventFilters(e){return[{slug:Pg.WeezeventShortTag,name:this.t("puce_50504"),category:"Weezevent",fieldType:Zt.Text},{slug:Pg.WeezeventPairedAt,name:this.t("appair_le_70213"),category:"Weezevent",fieldType:Zt.Datetime,useLocalZone:!0},{slug:Pg.WeezaccessChecklists,name:this.t("listes_de_contr_55120"),category:"Weezevent",fieldType:Zt.Select,needLoading:!0,eventId:e}]}getEmailsFilters(e,t){return(0,hd.A)([t?{slug:"campaign",name:this.t("campagne_97871"),category:this.t("e_mails_09850"),fieldType:Zt.Campaign,needLoading:!0,eventId:e}:null,{slug:"assignmentEmailSentAt",name:this.t("date_d_envoi_de_01614"),category:this.t("e_mails_09850"),fieldType:Zt.Date},{slug:"assignmentEmailState",name:this.t("statut_de_de_l_36346"),category:this.t("e_mails_09850"),fieldType:Zt.Select,values:Dn.filter(e=>e!==dt.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:Zt.Select,values:Dn.filter(e=>e!==dt.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:Zt.Checkbox,hideEmpty:!0},t?{slug:"campaignReply",name:this.t("r_ponse_une_c_32448"),category:this.t("e_mails_09850"),fieldType:Zt.Text,needLoading:!0,eventId:e}:null])}getCommentsFilter(e,t){return[{slug:"comments",name:this.t("commentaires_96492"),category:this.t("commentaires_96492"),fieldType:Zt.Text},{slug:"lastCommentAt",name:this.t("date_du_dernier_73554"),category:this.t("commentaires_96492"),fieldType:Zt.Date,hideEmpty:!0},{slug:"commentWrittenBy",name:this.t("commentaire_cr_96610"),category:this.t("commentaires_96492"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t}]}};var Ng;Fg=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mm,Cm,Si])],Fg),function(e){e.AccreditationSlot="accreditationSlotId",e.Accreditations="accreditations",e.Action="Action",e.Campaign="campaign",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.CustomField="customField",e.ExecutedAt="executedAt",e.Frequency="frequency",e.Id="id",e.Name="name",e.State="state",e.Trigger="trigger",e.VolunteersSegment="volunteersSegment"}(Ng||(Ng={}));class Lg extends Um{constructor(e,t,n){super(e,t,n)}getWorkflowsFilters(e,t){return[{slug:Ng.State,name:this.t("State"),category:this.t("automatisations_60045"),fieldType:Zt.Select,hideEmpty:!0,values:vi.map(e=>({id:e,name:this.t(e)}))},{slug:Ng.Trigger,name:this.t("d_clencheur_73493"),category:this.t("automatisations_60045"),fieldType:Zt.Select,hideEmpty:!0,values:bi.map(e=>({id:e,name:this.t(e)}))},{slug:Ng.Action,name:this.t("action_44224"),category:this.t("automatisations_60045"),fieldType:Zt.Select,hideEmpty:!0,values:pi.map(e=>({id:e,name:this.t(e)}))},{slug:Ng.Frequency,name:this.t("Frequency"),category:this.t("automatisations_60045"),fieldType:Zt.Select,hideEmpty:!0,values:fi.map(e=>({id:e,name:this.t(e)}))},{slug:Ng.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("automatisations_60045"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:Ng.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("automatisations_60045"),fieldType:Zt.Datetime,hideEmpty:!0},...t?[{slug:Ng.AccreditationSlot,name:this.t("cr_neaux_accr_d_70934"),category:this.t("automatisations_60045"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t}]:[],{slug:Ng.Campaign,name:this.t("campagne_97871"),category:this.t("automatisations_60045"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:Ng.CustomField,name:this.t("CustomField"),category:this.t("automatisations_60045"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:Ng.VolunteersSegment,name:this.t("vue_s_lectionn_21556"),category:this.t("automatisations_60045"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t}]}getWorkflowsPossibleColumns(){return[{slug:Ng.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,width:100,sortAttribute:ln.Id},{slug:Ng.Name,name:this.t("nom_de_l_automa_04883"),isSearchable:!0,isSortable:!0,sortAttribute:ln.Name,minWidth:240},{slug:Ng.State,name:this.t("State"),minWidth:180},{slug:Ng.Trigger,name:this.t("d_clencheur_73493"),minWidth:180},{slug:Ng.Action,name:this.t("action_44224"),minWidth:180},{slug:Ng.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:Ng.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:ln.CreatedAt,minWidth:180},{slug:Ng.VolunteersSegment,name:this.t("vue_s_lectionn_21556"),isSortable:!0,sortAttribute:ln.VolunteersSegment,minWidth:320},{slug:Ng.ExecutedAt,name:this.t("ex_cut_e_le_99019"),isSortable:!0,sortAttribute:ln.ExecutedAt,minWidth:180},{slug:Ng.Accreditations,name:this.t("accr_ditations_39450"),minWidth:320},{slug:Ng.Campaign,name:this.t("campagne_97871"),minWidth:240},{slug:Ng.CustomField,name:this.t("CustomField"),minWidth:240},{slug:Ng.Frequency,name:this.t("Frequency"),minWidth:180}]}}var Bg=n(9669);function Vg(e,t,n,i,o){const s=t.diff(e,"days").days;return(0,Bg.A)((0,nm.A)(0,s+1).map(t=>e.plus({days:t}).set({hour:o})),e=>i===et.AllDays||n.some(t=>t.contains(e)||t.start.startOf("day").equals(e.startOf("day"))||t.end.startOf("day").equals(e.startOf("day"))))}function Ug(e,t,n,i,o){const s=t.diff(e,"days").days;return(0,nm.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===et.AllDays||i.some(t=>t.overlaps(e.interval)))}function Wg(e,t){return g(e)?`${e} (${t.toFormat("HH:mm")})`:t.toFormat("HH:mm")}function Gg(e,t,n){const i=e.filter(e=>!t.equals(Ts(e)));return i.length===e.length&&n?[...e,Os(t)]:i.length===e.length||n?e:i}function qg(e,t,n,i={}){const o=g(t.name)?t.name:"",s=t.date?g(i?.date?.format)?t.date.toFormat(i?.date?.format??""):e.toLocaleString(t.date,i?.date?.localeFormat||zs.DateOnly.Numeric):"",r=(0,hd.A)([i?.accreditation?.includeName?n:"",o,s,i?.accreditation?.includeNameAtEnd?n:""]).join(" - ");return g(r)?r:g(i?.defaultName)?i?.defaultName:n}function Hg(e){return(0,cm.A)(e,e=>[e.date?.toMillis()??1,e.name.toLowerCase()])}function Kg(e,t,n={}){return(0,cm.A)(t,e=>m(e.name)).flatMap(t=>_g(t.accreditations).map(o=>{const s=n.useAccreditationDisplay&&o.accreditationDisplay===xe.Radio?o.name:void 0,r=Hg(o.slots);return(0,i.jsx)("optgroup",{label:`${t.name} - ${hg(o)}`,children:r.map(t=>{const r=qg(e,t,hg(o),{accreditation:{includeNameAtEnd:!0}});return(0,i.jsx)("option",{"data-radio":s,disabled:!(!n.useIsBlocked||!t.isBlocked),value:t.id,children:r},t.id)})},o.id)}))}function Yg(e,t){return(0,cm.A)(t,e=>m(e.name)).flatMap(t=>(0,cm.A)(t.positions,e=>m(e.name)).map(n=>(0,i.jsx)("optgroup",{label:`${t.name} - ${rg(n)}`,children:(0,cm.A)(n.slots,e=>[e.range.start.toMillis(),e.name]).map(t=>{const o=ng(e,t,rg(n),{position:{includeNameAtEnd:!0}});return(0,i.jsx)("option",{value:t.id,children:o},t.id)})},n.id)))}const Zg=async(e,t,n,i)=>{const o=await X();if("createdBy"===i.slug&&i.organizationId){const{organization:e}=await function(e,t){return Js("query Admins($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n usersInfos(isResourceCreator: true) {\n nodes {\n userId\n email\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:i.organizationId},o);i.values=e.usersInfos.nodes.map(({userId:e,email:t,name:n})=>({id:e,name:`${g(n)?n:"-"} - ${t}`})),i.needLoading=!1}else if("categoryLeaders"===i.slug&&i.organizationId){const{organization:e}=await function(e,t){return Js('query DelegationsSegmentsCategoryLeaders($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n usersInfos(\n eventId: $eventId\n isDelegationCategoryLeader: 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:i.organizationId,eventId:i.eventId},o);i.values=e.usersInfos.nodes,i.needLoading=!1}else if("leaders"===i.slug&&i.organizationId){const{organization:e}=await function(e,t){return Js('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:i.organizationId,eventId:i.eventId},o);i.values=e.usersInfos.nodes,i.needLoading=!1}else if("delegationCategory"===i.slug&&i.organizationId){const{organization:e}=await function(e,t){return Js("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:i.organizationId,level:i.eventId?ke.Event:ke.Organization,eventId:i.eventId},o);i.values=(0,cm.A)(e.delegationsCategories.nodes,e=>m(e.name)),i.needLoading=!1}else if("roles"===i.slug&&i.organizationId){const{organization:e}=await function(e,t){return Js("query UsersSegmentsRoles($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n roles {\n id\n name\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:i.organizationId},o);i.values=(0,cm.A)(e.roles,e=>m(e.name)),i.needLoading=!1}else if("tag"===i.slug&&i.organizationId){const{organization:e}=await Pr({organizationId:i.organizationId,eventId:i.eventId,context:i.tagContext},o);i.values=(0,cm.A)(e.tags.nodes,e=>m(e.name)),i.needLoading=!1}else if(i.slug===Ng.CustomField&&i.organizationId){const{organization:e}=await $r({organizationId:i.organizationId,eventId:i.eventId},o);i.values=(0,cm.A)(e.customFields.nodes,e=>m(e.name)),i.needLoading=!1}else if(i.slug===Ng.VolunteersSegment&&i.organizationId){const{organization:e}=await function(e,t){return Js("query WorkflowsSegmentsSegments(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n) {\n organization(id: $organizationId) {\n volunteersSegmentsFolders: segmentsFolders(\n level: $level\n eventId: $eventId\n segmentType: Volunteers\n ) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n\n delegationsSegmentsFolders: segmentsFolders(\n level: $level\n eventId: $eventId\n segmentType: Delegations\n ) {\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:i.organizationId,level:i.eventId?ke.Event:ke.Organization,eventId:i.eventId},o),t=(e,t)=>(0,cm.A)(t,e=>e.index).map(t=>({name:`${e} - ${t.name}`,values:(0,cm.A)(t.segments,e=>e.index)}));i.valuesGroups=t(n.translate("membres_11310"),e.volunteersSegmentsFolders).concat(t(n.translate("d_l_gations_78318"),e.delegationsSegmentsFolders)),i.needLoading=!1}else if(i.eventId){if(["preassignedPosition","position","wishedPositions"].includes(i.slug)){const{event:e}=await function(e,t){return Js("query VolunteersSegmentsPositions($eventId: EventId!) {\n event(id: $eventId) {\n positions {\n nodes {\n id\n name\n acronym\n positionCategoryName\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:i.eventId},o);i.valuesGroups=(0,cm.A)(Object.entries((0,Vu.A)(e.positions.nodes,e=>e.positionCategoryName)).map(([e,t])=>({name:t[0].positionCategoryName,values:(0,cm.A)(t.map(e=>({id:e.id,name:`${rg(e)} - ${e.positionCategoryName}`})),e=>m(e.name))})),({name:e})=>m(e)),i.needLoading=!1}else if("hasOtherEventPosition"===i.slug&&i.organizationId){const{organization:{positions:e}}=await function(e,t){return Js("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:i.organizationId,eventId:i.eventId},o);i.valuesGroups=(0,cm.A)(Object.entries((0,Vu.A)(e.nodes,e=>[e.event.id,e.positionCategoryName])).map(([e,t])=>({name:`${t[0].event.name}: ${t[0].positionCategoryName}`,values:(0,cm.A)(t,e=>m(e.name))})),({name:e})=>m(e)),i.needLoading=!1}else if(["numberOfAssignments","positionSlotId","wishedPositionsSlots","checkInAtPositionSlot","checkOutAtPositionSlot"].includes(i.slug)){const{event:e}=await Hr({eventId:i.eventId},o);i.valuesGroups=function(e,t){return(0,cm.A)(t,e=>m(e.name)).flatMap(t=>(0,cm.A)(t.positions,e=>m(e.name)).map(n=>({id:n.id,name:`${t.name} - ${rg(n)}`,values:(0,cm.A)(n.slots,e=>[e.range.start.toMillis(),e.name]).map(t=>{const i=ng(e,t,rg(n),{position:{includeNameAtEnd:!0}});return{id:t.id,name:i}})})))}(t,e.positionsCategories),i.needLoading=!1}else if(["positionCategory","preassignedPositionCategory","wishedPositionsCategories"].includes(i.slug)){const{event:e}=await function(e,t){return Js("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:i.eventId},o);i.values=(0,cm.A)(e.positionsCategories,e=>m(e.name)),i.needLoading=!1}else if("wishedSlotsCustom"===i.slug){const{event:t}=await function(e,t){return Js("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:i.eventId},o);i.valuesGroups=((e,t)=>{const n=t.customSlotsPeriods.flatMap(e=>Ug(e.startDate??t.startAt,e.endDate??t.endAt,e.customSlots,t.ranges,et.AllDays));return(0,cm.A)(Object.values((0,Vu.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"),zs.DateOnly.WeekdayLongMonthLong),values:t.map(({name:e,interval:t})=>({id:t.toISO(),name:Wg(e,t)}))}})})(e,t),i.needLoading=!1}else if(i.slug==Pg.AccreditationProfile||i.slug===Pg.WishedAccreditationProfile){const{event:e}=await function(e,t){return Js("query VolunteersSegmentsAccreditationsProfiles($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfilesCategories {\n id\n name\n\n accreditationsProfiles {\n id\n name\n acronym\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:i.eventId},o);i.valuesGroups=(0,cm.A)(e.accreditationsProfilesCategories,e=>m(e.name)).map(e=>({name:e.name,values:(0,cm.A)(e.accreditationsProfiles,e=>m(e.name)).map(t=>({id:t.id,name:`${hg(t)} - ${e.name}`}))})),i.needLoading=!1}else if("accreditation"===i.slug){const{event:e}=await function(e,t){return Js("query VolunteersSegmentsAccreditations($eventId: EventId!) {\n event(id: $eventId) {\n accreditations {\n nodes {\n id\n name\n acronym\n accreditationCategoryName\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:i.eventId},o);i.valuesGroups=(0,cm.A)(Object.entries((0,Vu.A)(e.accreditations.nodes,e=>e.accreditationCategoryName)).map(([e,t])=>({name:t[0].accreditationCategoryName,values:(0,cm.A)(t.map(e=>({id:e.id,name:`${hg(e)} - ${e.accreditationCategoryName}`})),e=>m(e.name))})),({name:e})=>m(e)),i.needLoading=!1}else if("hasOtherEventAccreditation"===i.slug&&i.organizationId){const{organization:{accreditations:e}}=await function(e,t){return Js("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:i.organizationId,eventId:i.eventId},o);i.valuesGroups=(0,cm.A)(Object.entries((0,Vu.A)(e.nodes,e=>e.accreditationCategoryName)).map(([e,t])=>({name:`${t[0].event.name}: ${t[0].accreditationCategoryName}`,values:(0,cm.A)(t,e=>m(e.name))})),({name:e})=>m(e)),i.needLoading=!1}else if("accreditationCategory"===i.slug){const{event:e}=await function(e,t){return Js("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:i.eventId},o);i.values=(0,cm.A)(e.accreditationsCategories,e=>m(e.name)),i.needLoading=!1}else if("positionsSegments"===i.slug){const{event:e}=await function(e,t){return Js("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:i.eventId},o);i.valuesGroups=(0,cm.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,cm.A)(e.segments,e=>e.index)})),i.needLoading=!1}else if("accreditationsSegments"===i.slug){const{event:e}=await function(e,t){return Js("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:i.eventId},o);i.valuesGroups=(0,cm.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,cm.A)(e.segments,e=>e.index)})),i.needLoading=!1}else if("delegationsSegments"===i.slug||"isDelegationLeader"===i.slug){const{event:e}=await function(e,t){return Js("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:i.eventId},o);i.valuesGroups=(0,cm.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,cm.A)(e.segments,e=>e.index)})),i.needLoading=!1}else if("forms"===i.slug||"form"===i.slug||"formsInsertedAt"===i.slug){const{event:e}=await function(e,t){return Js("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:[js.SegmentFormFragment]})}({eventId:i.eventId},o);i.values=(0,cm.A)(e.forms.nodes,e=>m(e.name)),i.needLoading=!1}else if("campaign"===i.slug||"campaignReply"===i.slug){const{event:e}=await function(e,t){return Js("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:[js.SegmentCampaignFragment]})}({eventId:i.eventId},o);i.campaigns=(0,cm.A)(e.campaigns.nodes,e=>m(e.name)),i.values=i.campaigns,i.needLoading=!1}else if("delegation"===i.slug){const{event:e}=await function(e,t){return Js("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:i.eventId},o);i.values=(0,cm.A)(e.delegations.nodes,e=>m(e.name)),i.needLoading=!1}else if(["numberOfAccreditations","accreditationSlotId","scannedAccreditationsSlots","wishedAccreditationsSlots"].includes(i.slug)){const{event:t}=await qr({eventId:i.eventId,loadIsBlocked:!1},o);i.valuesGroups=function(e,t){return(0,cm.A)(t,e=>m(e.name)).flatMap(t=>_g(t.accreditations).map(n=>{const i=Hg(n.slots);return{id:n.id,name:`${t.name} - ${hg(n)}`,values:i.map(t=>{const i=qg(e,t,hg(n),{accreditation:{includeNameAtEnd:!0}});return{id:t.id,name:i}})}}))}(e,t.accreditationsCategories),i.needLoading=!1}else if(i.slug===Pg.WeezaccessChecklists){const{event:e}=await function(e,t){return Js("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:i.eventId},o);i.values=(0,cm.A)(e.weezaccessChecklists,e=>m(e.name)),i.needLoading=!1}else if("commentWrittenBy"===i.slug){const{organization:e}=await function(e,t){return Js("query VolunteersSegmentsLeaders($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n admins: usersInfos(isResourceCreator: true) {\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:i.organizationId,eventId:i.eventId},o);i.values=(0,cm.A)((0,Xh.A)(e.admins.nodes.concat(e.usersInfos.nodes),e=>e.id),e=>m(e.nameOrEmail)).map(({id:e,nameOrEmail:t})=>({id:e,name:t})),i.needLoading=!1}else if(i.slug===Sg.DelegationsSpaceLayout){const{event:e}=await function(e,t){return Js("query DelegationsSegmentsLayouts($eventId: EventId!) {\n event(id: $eventId) {\n delegationsSpaceLayouts {\n id\n name\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:i.eventId},o);i.values=(0,cm.A)(e.delegationsSpaceLayouts,e=>m(e.name)),i.needLoading=!1}}else if(i.organizationId)if("event"===i.slug){const{organization:e}=await function(e,t){return Js("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:[js.SegmentEventFragment]})}({organizationId:i.organizationId},o);i.values=(0,cm.A)(e.events.nodes,e=>m(e.name)),i.needLoading=!1}else if("forms"===i.slug||"formsInsertedAt"===i.slug){const{organization:e}=await function(e,t){return Js("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:[js.SegmentFormFragment]})}({organizationId:i.organizationId},o);i.values=(0,cm.A)(e.forms.nodes,e=>m(e.name)),i.needLoading=!1}else if("campaign"===i.slug){const{organization:e}=await function(e,t){return Js("query UsersSegmentsCampaigns($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n campaigns(level: Organization, states: [Done, Scheduled, Template]) {\n nodes {\n ...SegmentCampaign\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[js.SegmentCampaignFragment]})}({organizationId:i.organizationId},o);i.campaigns=(0,cm.A)(e.campaigns.nodes,e=>m(e.name)),i.values=i.campaigns,i.needLoading=!1}else if("positionCustomField"===i.slug||"accreditationCustomField"===i.slug){const{organization:e}=await $r({organizationId:i.organizationId,eventId:i.eventId,fieldTypes:[Oe.Checkbox,Oe.Select]},o);i.values=(0,cm.A)(e.customFields.nodes,e=>m(e.name)),i.needLoading=!1}else if("delegation"===i.slug){const{organization:e}=await function(e,t){return Js("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:i.organizationId},o);i.valuesGroups=(0,cm.A)(Object.entries((0,Vu.A)(e.delegations.nodes,e=>e.event?.id||-1)).map(([t,n])=>({name:n[0].event?.name??e.name,values:(0,cm.A)(n,e=>m(e.name))})),({name:e})=>m(e)),i.needLoading=!1}else if("usersSegments"===i.slug){const{organization:e}=await function(e,t){return Js("query VolunteersSegmentsUsersSegments(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n) {\n organization(id: $organizationId) {\n segmentsFolders(level: $level, eventId: $eventId, 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:i.organizationId,level:ke.Organization},o);i.valuesGroups=(0,cm.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,cm.A)(e.segments,e=>e.index)})),i.needLoading=!1}};function Xg(e){const t=Ei(Cm),n=Ei(Yh),i=Ei(Si),[o,s]=(0,V.useState)(!1);return(0,V.useEffect)(()=>{const o=e.filter(({filter:e})=>e.needLoading);Bs(o)&&(s(!0),Promise.all(o.map(({filter:e})=>Zg(t,n,i,e))).then(()=>{s(!1)}))},[e]),o}const Jg=e=>{const t=Ti(),n=e.filterPredicate.filter.slug,o=e.filterPredicate.filter.fieldType,s=function(e){const t=Ei(Cm),n=Ei(Yh),i=Ei(Si),[o,s]=(0,V.useState)(!1);return(0,V.useEffect)(()=>{e.needLoading&&(s(!0),Zg(t,n,i,e).then(()=>{s(!1)}))},[e.needLoading]),o}(e.filterPredicate.filter);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{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)(md,{height:"4"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:e.filterPredicate.filter.name}),(0,i.jsx)(md,{height:"3"}),s?(0,i.jsx)(Cd,{}):"condition"===n?(0,i.jsx)(ph,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"isLeader"===n||"isPositionLeader"===n||"isPositionCategoryLeader"===n||"isDelegationLeader"===n?(0,i.jsx)(Eh,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"isAdmin"===n?(0,i.jsx)(wh,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"privacy"===n?(0,i.jsx)(Ph,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"isTeam"===n?(0,i.jsx)(Th,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"wishedPositions"===n||"wishedPositionsCategories"===n?(0,i.jsx)(Nh,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"formsInsertedAt"===n?(0,i.jsx)(kh,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"numberOfAssignmentsPerDay"===n||"volunteersMinutesDays"===n?(0,i.jsx)($h,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"campaignReply"===n?(0,i.jsx)(ch,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):[Zt.Address,Zt.Text,Zt.Textarea].includes(o)?(0,i.jsx)(Fh,{filterPredicate:e.filterPredicate,showIsValid:!1,onAdd:e.onAdd}):[Zt.Country,Zt.Language,Zt.Nationality,Zt.Select,Zt.Sex].includes(o)?(0,i.jsx)(Mh,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):[Zt.Checkbox,Zt.Validation].includes(o)?(0,i.jsx)(gh,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):o===Zt.Phone?(0,i.jsx)(Fh,{filterPredicate:e.filterPredicate,showIsValid:!0,onAdd:e.onAdd}):o===Zt.Number?(0,i.jsx)(zh,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):o===Zt.DateTimeRange?(0,i.jsx)(Ah,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):o===Zt.Date?(0,i.jsx)(jh,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):o===Zt.Datetime?(0,i.jsx)(yh,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):o===Zt.File?(0,i.jsx)(Sh,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):o===Zt.Campaign?(0,i.jsx)(dh,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):(0,i.jsx)("div",{children:"TODO"})]})};function Qg(e){switch(e){case Zt.Address:return"map-location";case Zt.Text:case Zt.Textarea:return"text";case Zt.Checkbox:return"square-check";case Zt.Validation:return"check";case Zt.Select:return"list-ul";case Zt.Date:return"calendar";case Zt.Datetime:return"calendar-day";case Zt.Time:return"clock";case Zt.File:return"file";case Zt.Phone:return"phone";case Zt.Language:return"language";case Zt.Number:return"00";case Zt.Sex:return"venus-mars";case Zt.Nationality:case Zt.Country:return"flag";case Zt.DateTimeRange:return"calendar-range";case Zt.Campaign:return"paper-plane";default:return vd()}}const ep=e=>{const t=(0,V.useMemo)(()=>(0,bs.A)(e.filtersPredicates.map(({filter:e})=>e.category)),[e.filtersPredicates]),n=(0,V.useMemo)(()=>(0,Vu.A)(e.filtersPredicates,({filter:e})=>e.category),[e.filtersPredicates]);return(0,i.jsx)(rd,{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)(V.Fragment,{children:[!e.isEdit&&(0,i.jsxs)(i.Fragment,{children:[0!==o&&(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(ka,{css:{paddingBottom:"$2",paddingTop:"$3"},font:"gray500 textXs semiBold",children:t})]}),s.map(t=>{const{filter:n}=t;return(0,i.jsxs)(rd,{align:"center",css:{py:"$2"},gap:"3",children:[(0,i.jsx)(rd,{align:"center",css:{borderRadius:"$1",height:"32px",width:"32px"},justify:"center",children:(0,i.jsx)(Id,{icon:Qg(n.fieldType)})}),(0,i.jsxs)(rd,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{color:"gray900",css:{ellipsis:!0},fontWeight:"medium",title:n.name,width:1,children:n.name}),g(n.label)&&(0,i.jsx)(ka,{color:"gray500",css:{ellipsis:!0},title:n.label,width:1,children:n.label})]}),e.isEdit?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kd,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>e.onEdit(t)}),(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>e.onDelete(n.slug)})]}):(0,i.jsx)(kd,{color:"white",leftIcon:"plus",size:"sm",onClick:()=>e.onAdd(t)})]},n.slug)})]},o)})})},tp=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.selectedFilterPredicate),[s,r]=(0,V.useState)((0,lh.A)(e.predicates)),a=(0,V.useCallback)(e=>{r((0,Wm.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,V.useCallback)(e=>{r((0,Wm.jM)(t=>{const n=t.findIndex(t=>t.slug===e);t.splice(n,1)}))},[r]),[d,c]=(0,V.useState)(""),[u,m]=Lm(s,e.possibleFilters,d);return(0,i.jsxs)(Jm,{size:"sm",onClose:e.onClose,children:[(0,i.jsxs)(Qm,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textXl",children:t("filtres_64574")}),g(e.subtitle)&&(0,i.jsx)(ka,{color:"gray500",children:e.subtitle}),(0,i.jsx)(md,{height:"6"}),n?(0,i.jsx)(Jg,{filterPredicate:n,onAdd:a,onBack:()=>{o(null)}}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_un_f_22061"),value:d,onChange:c}),(0,i.jsx)(md,{height:"6"}),s.length>0&&u.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_filtr_29511")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ep,{filtersPredicates:u,isEdit:!0,onDelete:l,onEdit:e=>o(e)}),(0,i.jsx)(md,{height:"8"})]}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_filtr_37728")}),m.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ep,{filtersPredicates:m,isEdit:!1,onAdd:e=>{o(e)}})]})]}),(0,i.jsx)(md,{height:"6"})]}),null===n&&(0,i.jsx)(eh,{children:(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{onClick:()=>{e.onFilter(s),e.onClose()},children:e.buttonText||t("filtrer_78031")}),(0,i.jsx)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})})]})},np=V.createContext({});function ip(){return V.useContext(np)}const op=()=>{const e=Ti(),t=Ei(Um),{filtersPredicates:n,clearNameCursors:o,setPredicates:s,setIsFilterOpen:r,setSelectedFilterPredicate:a,showFilters:l,predicates:d}=ip(),c=(0,V.useCallback)(()=>{o(),s([])},[o,s]),u=(0,V.useCallback)(e=>{a(e),r(!0)},[r,a]),m=(0,V.useCallback)(e=>{o(),s((0,Cu.A)(d,e.predicate))},[d,o,s]);return Xg(n),Bs(n)?(0,i.jsxs)(rd,{align:"center",gap:"3",width:1,wrap:"wrap",children:[n.map((e,n)=>e.filter.needLoading?(0,i.jsx)(vu,{leftIcon:"loader"},n):l?(0,i.jsx)(vu,{cursor:"pointer",ellipsis:!0,rightIcon:"xmark",onContentClick:()=>u(e),onRightIconClick:()=>m(e),children:t.filterPredicateToText(e)},n):(0,i.jsx)(vu,{cursor:"default",ellipsis:!0,children:t.filterPredicateToText(e)},n)),(0,i.jsx)(ka,{color:"gray700",css:{cursor:"pointer"},fontWeight:"medium",onClick:c,children:e("r_initialiser_l_66835")})]}):null};function sp(){return(0,V.useMemo)(()=>navigator.platform.toLowerCase().startsWith("mac"),[])}function rp(e,t){const n=sp(),i=(0,V.useCallback)(i=>{i.key===e&&(n&&i.metaKey||!n&&i.ctrlKey)&&t(i)},[e,t]);(0,V.useEffect)(()=>(document.addEventListener("keydown",i,!1),()=>{document.removeEventListener("keydown",i,!1)}),[e,t,i])}const ap=e=>{const{translate:t}=bd(),{columnsSearch:n,setColumnsSearch:o}=ip(),[s,r]=(0,V.useState)(""),a=(0,V.useMemo)(()=>g(s)?e.searchableColumns.filter(e=>m(e.name).includes(m(s))):e.searchableColumns,[e.searchableColumns,s]);return(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",css:{borderLeft:"none",borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"bars-filter"})}),(0,i.jsx)(lu,{css:{padding:"0"},maxHeight:350,placement:"bottom-end",width:320,children:(0,i.jsxs)(rd,{css:{padding:"$4 $6"},direction:"column",gap:"3",children:[(0,i.jsx)(ka,{font:"gray800 textMd medium",children:t("rechercher_sur_85243")}),(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("filtrer_78031"),state:"search",value:s,onChange:r}),(0,i.jsx)(rd,{direction:"column",gap:"3",children:a.map(({slug:e,name:t})=>(0,i.jsx)(Eu,{state:n.includes(e)?"checked":"unchecked",onClick:t=>{o(Us(n,e,"checked"===t))},children:t},e))})]})})]})},lp=()=>{const e=Ti(),{isEditMode:t,massActions:n,name:o,possibleColumns:s,possibleRenderings:r,reload:a,renderActions:l,renderControls:d,rendering:c,setAreColumnsOpen:u,setIsEditMode:m,setIsFilterOpen:h,setName:g,setNameDebounced:p,setRendering:f,showEditColumns:_,showEditMode:x,showFilters:I,showMassActions:v,showSearchColumns:b,totalCount:j}=ip(),C=sp(),y=v&&n.numberOfSelected>0,A=(0,V.useMemo)(()=>(0,cm.A)(s.filter(e=>e.isSearchable),e=>e.name),[s]),S=(0,V.useMemo)(()=>b?{"& .h-styled-input-container":{borderBottomRightRadius:"0",borderTopRightRadius:"0"}}:{},[b]);return rp("e",(0,V.useCallback)(()=>{x&&m(!t)},[t,x,m])),(0,i.jsxs)(rd,{align:"center",gap:"4",children:[(0,i.jsxs)(rd,{width:320,children:[(0,i.jsx)(Qd,{css:S,icon:"magnifying-glass",placeholder:e("rechercher_50038"),value:o,onChange:e=>{g(e),p(e)}}),b&&(0,i.jsx)(ap,{searchableColumns:A})]}),y?(0,i.jsx)(rd,{css:{flex:"1",justifyContent:"right"},gap:"4",children:"function"==typeof l?l(n,j,a):null}):(0,i.jsxs)(rd,{css:{flex:"1"},gap:"4",children:[I&&(0,i.jsx)(kd,{color:"gray",leftIcon:"bars-filter",onClick:()=>h(!0),children:e("filtres_64574")}),(0,i.jsx)(ka,{css:{flex:"1"}}),"function"==typeof d?d():null,Bs(r)&&(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:yg(c),children:Ag(e,c)})}),(0,i.jsx)(lu,{placement:"bottom-end",children:r.map(t=>(0,i.jsx)(ru,{icon:yg(t),onClick:()=>f(t),children:Ag(e,t)},t))})]}),_&&(0,i.jsx)(kd,{color:"white",leftIcon:"gear",onClick:()=>{u(!0)},children:e("_diter_les_colo_39630")}),x&&(0,i.jsx)(Zm,{"aria-keyshortcuts":(C?"Meta":"Control")+"+E",value:t,onChange:m,children:e("mode_dition_93778")})]})]})},dp=()=>{const e=Ti(),{limit:t,massActions:n,renderAllSelectedText:o,renderPageSelectedText:s,renderSelectAllText:r,totalCount:a}=ip(),l=(0,V.useCallback)(()=>{n.toggleSelectAll("unchecked"),n.setIsAllSelected(!1)},[n]),d=(0,V.useCallback)(()=>{n.setIsAllSelected(!0)},[n]);return(0,i.jsxs)(rd,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$3 $4"},gap:"3",children:[(0,i.jsx)(ka,{fontSize:"textMd",fontWeight:"medium",children:(0,i.jsx)(Id,{icon:"circle-exclamation"})}),(0,i.jsx)(ka,{color:"gray700",css:{flex:"1"},fontWeight:"medium",children:n.isAllSelected?o?.(a):s?.(t)}),n.isAllSelected?(0,i.jsx)(ka,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",onClick:l,children:e("effacer_la_s_le_85095")}):(0,i.jsx)(ka,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",onClick:d,children:r?.(a)})]})},cp=()=>{const{limit:e,massActions:t,showMassActions:n,showPredicatesBadges:o,showSelectAll:s,totalCount:r}=ip(),a=n&&s&&t.numberOfSelected===e&&r>e;return(0,i.jsxs)(rd,{css:{border:"1px solid $gray200",borderBottom:"none",borderTopLeftRadius:"$1",borderTopRightRadius:"$1",padding:"$3 $4"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(lp,{}),o&&(0,i.jsx)(op,{}),a&&(0,i.jsx)(dp,{})]})},up=e=>{const{translate:t}=bd(),[n,o]=V.useState(e.predicates),[s,r]=V.useState(e.columns),[a,l]=V.useState(e.columnsSearch),[d,c]=V.useState(e.rendering),[u,m]=V.useState(e.name||""),[h,p]=V.useState(e.name||""),[f,_]=V.useState(e.limit),[x,I]=V.useState(e.sort),[v,b]=V.useState(0),j=hm(e=>{p(e),C()}),C=V.useCallback(()=>{b(0)},[b]),y=V.useCallback(t=>{e.setName?.(t),m(t)},[e.setName,m]),A=V.useCallback(()=>{y(""),p(""),C()},[y,p,C]),S=V.useCallback(t=>{e.setPredicates?.(t),o(t)},[e.setPredicates,o]),k=V.useCallback(t=>{e.setColumns?.(t),r(t)},[e.setColumns,r]),w=V.useCallback(t=>{e.setColumnsSearch?.(t),l(t)},[e.setColumnsSearch,l]),E=V.useCallback(t=>{e.setRendering?.(t),c(t)},[e.setRendering,c]),T=V.useCallback(t=>{e.setLimit?.(t),_(t)},[e.setLimit,_]),R=V.useCallback(t=>{e.setSort?.(t),I(t),b(0)},[e.setSort,I,b]),O=V.useMemo(()=>JSON.stringify(e.predicates),[e.predicates]),D=V.useMemo(()=>JSON.stringify(e.columns),[e.columns]),z=V.useMemo(()=>JSON.stringify(e.columnsSearch),[e.columnsSearch]),$=V.useMemo(()=>JSON.stringify(e.rendering),[e.rendering]),P=V.useMemo(()=>JSON.stringify(e.sort),[e.sort]),M=V.useMemo(()=>JSON.stringify(n)!==O||JSON.stringify(s)!==D||JSON.stringify(a)!==z||JSON.stringify(d)!==$||JSON.stringify(x)!==P,[O,n,D,s,z,a,$,d,P,x]),F=V.useMemo(()=>e.columnsToIncludes?.(s,d)??{},[s,d,e.columnsToIncludes]),[N,L]=V.useState(null),[B,U]=V.useState(!1),W=V.useCallback(async()=>{U(!0);const t=await e.loadDataList({...F,...e.loadDataListParams||{},organizationId:e.organizationId||void 0,eventId:e.eventId||void 0,name:g(h)?h:null,columnsSearch:Bs(a)?a:null,predicates:n,limit:f,offset:v,sort:x},await X());L(t.data),U(!1)},[a,F,f,h,v,n,U,L,x,e.organizationId,e.eventId,e.loadDataList,e.loadDataListParams]),[G,q]=V.useState([]),{numberOfPages:H,totalCount:K}=ah(N?.rows),[Y,Z]=V.useState({}),J=V.useCallback(async t=>{Z(e=>({...e,[t]:!0}));const n=(await e.loadRow({...F,...e.loadRowParams||{},organizationId:e.organizationId||void 0,eventId:e.eventId||void 0,id:t},await X())).data.row;q(e=>e.map(e=>e.id===t?n:e)),Z(e=>({...e,[t]:!1}))},[F,Z,e.organizationId,e.eventId,e.loadRow,e.loadRowParams]),Q=V.useCallback(t=>e.getMassActionId?.(t)??t.id,[e.getMassActionId]),ee=rh({}),[te]=V.useMemo(()=>Lm(n,e.filters),[n,e.filters]),[ne,ie]=V.useState(!1),[oe,se]=V.useState(!1),[re,ae]=V.useState(!1),[le,de]=V.useState(null);return V.useEffect(()=>{W()},[a,F,f,h,v,n,x,e.organizationId,e.eventId,e.loadDataList]),V.useEffect(()=>{q(N?.rows?.nodes??[])},[N]),V.useEffect(()=>{ee.setStates(Object.fromEntries(G.map(e=>[`r${Q(e)}`,{id:Q(e),state:"unchecked"}]))),ee.setIsAllSelected(!1)},[G,ee.setStates,ee.setIsAllSelected]),(0,i.jsxs)(np.Provider,{value:{areColumnsOpen:re,clearNameCursors:A,columns:s,columnsSearch:a,data:G,filtersPredicates:te,getMassActionId:Q,idToLoading:Y,isEditMode:ne,isFilterOpen:oe,isLoading:B,isSaveVisible:M,limit:f,loadDataResult:N,massActions:ee,name:u,nameDebounced:h,numberOfPages:H,offset:v,possibleColumns:e.possibleColumns,possibleRenderings:e.possibleRenderings,predicates:n,reload:W,reloadRow:J,renderActions:e.renderActions,renderAllSelectedText:e.renderAllSelectedText,renderControls:e.renderControls,renderPageSelectedText:e.renderPageSelectedText,renderSelectAllText:e.renderSelectAllText,rendering:d,selectedFilterPredicate:le,setAreColumnsOpen:ae,setColumns:k,setColumnsSearch:w,setIsEditMode:ie,setIsFilterOpen:se,setLimit:T,setName:y,setNameDebounced:j,setOffset:b,setPredicates:S,setRendering:E,setSelectedFilterPredicate:de,setSort:R,showEditColumns:e.showEditColumns,showEditMode:e.showEditMode,showFilters:e.showFilters,showMassActions:e.showMassActions,showPredicatesBadges:e.showPredicatesBadges,showRowDropdown:e.showRowDropdown,showRowEdit:e.showRowEdit,showSearchColumns:e.showSearchColumns,showSelectAll:e.showSelectAll??!1,sort:x,totalCount:K},children:[(0,i.jsxs)(rd,{css:{background:"white"},direction:"column",height:1,width:1,children:[(0,i.jsx)(cp,{}),e.children]}),oe&&(0,i.jsx)(tp,{possibleFilters:e.filters,predicates:n,selectedFilterPredicate:le,onClose:()=>{se(!1)},onFilter:e=>{A(),S(e)}}),re&&(0,i.jsx)(sh,{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:k})]})},mp={deserialize(e){const t=parseInt(e||"",10);return isNaN(t)?null:t},serialize:e=>e.toString(10)},hp={deserialize(e){try{return JSON.parse(e||"")}catch{return null}},serialize:e=>JSON.stringify(e)},gp={deserialize:e=>g(e)&&As.c9.fromISO(e)?.isValid?As.c9.fromISO(e):null,serialize:e=>e.toISO()};function pp(e,t,n={}){const i=Mi(),[o,s]=V.useState("function"==typeof n.deserialize?n.deserialize(i.getItem(e))||t:i.getItem(e)??t);return[o,V.useCallback(t=>{s(t),i.setItem(e,"function"==typeof n.serialize?n.serialize(t):t)},[e,s,i])]}const fp=e=>{return(0,i.jsxs)(pm,{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:re.Asc}:t.direction===re.Asc?{attribute:n,direction:re.Desc}:null))},children:[e.children,(0,i.jsx)(md,{width:"2"}),(0,i.jsx)(Id,{icon:(t=e.sort,n=e.attribute,null===t||t.attribute!==n?"arrow-down-arrow-up":t.direction===re.Asc?"arrow-up":"arrow-down")})]});var t,n},_p=e=>{const t=!!e.paginationRow;return(0,i.jsx)(qu,{children:(0,i.jsxs)(rd,{direction:"column",width:1,children:[(0,i.jsxs)(yc,{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)(ka,{css:{overflow:"auto"},children:e.children})]}),e.paginationRow]})})},xp=V.createContext({}),Ip=e=>{const[t,n]=V.useState(!1),[o,s]=V.useState(null),[r,a]=V.useState(null),l=(0,qd.A)("tooltip-");return(0,i.jsx)(xp.Provider,{value:{isVisible:t,referenceElement:o,popperElement:r,tooltipId:l,setIsVisible:n,setReferenceElement:s,setPopperElement:a},children:e.children})};function vp(){return V.useContext(xp)}const bp=e=>{const{isVisible:t,popperElement:n,referenceElement:o,setPopperElement:s,tooltipId:r}=vp(),{styles:a,attributes:l,update:d}=(0,au.E)(o,n,{placement:e.placement,modifiers:[{name:"offset",options:{offset:[0,4]}}]});V.useEffect(()=>{d?.()},[t,o]);const c=(0,i.jsx)(rd,{ref:s,align:"center",css:{background:"$grayCustom900",borderRadius:"$1",color:location.origin===F.HEAVENT_PUBLIC_URL.origin?"contrast-color(var(--colors-grayCustom900))":"white",display:t?"flex":"none",px:"$3",py:"6px",zIndex:1e3,...a.popper},id:r,justify:"center",role:"tooltip",...l.popper,children:e.children});return e.renderOnPortal?(0,pn.createPortal)(c,document.body):c},jp=e=>{const{setIsVisible:t,setReferenceElement:n,tooltipId:o}=vp(),s=V.cloneElement(V.Children.only(e.children),{ref(e){n(e)},"aria-labelledby":o,"aria-describedby":o,onMouseEnter(){t(!0)},onMouseLeave(){t(!1)},onFocus(){t(!0)},onBlur(){t(!1)}});return(0,i.jsx)(ka,{css:e.css,children:s})},Cp=e=>{const{translate:t}=bd(),{showRowEdit:n,getMassActionId:o,massActions:s,reload:r,reloadRow:a,showMassActions:l,showRowDropdown:d}=ip(),c=s.states[`r${o(e.row)}`]?.state??"unchecked",u=V.useCallback(()=>{a(e.row.id)},[e.row.id,a]),m=d||n;return(0,i.jsxs)(am,{css:{background:"checked"===c?"$primary100":"white","&:hover":{background:"checked"===c?"$primary100":"$gray100"}},onMouseLeave:e=>{eu(e.target)},children:[l&&(0,i.jsx)(Qu,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:c,onClick:(t,n)=>{s.toggleRow(`r${o(e.row)}`,t,n.shiftKey)}})}),e.selectedColumns.map(t=>(0,i.jsx)(V.Fragment,{children:e.renderCell(t,e.row,u)},t.slug)),m&&(0,i.jsxs)(jm,{justify:"center",children:[n&&e.getEditPath&&(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"pen",to:e.getEditPath(e.row)})})}),(0,i.jsx)(bp,{placement:"top",children:t("_diter_62574")})]}),d&&e.renderRowDropdown?.(e.row,r)]}),e.renderRowPanels?.(e.row,u)]})},yp=e=>{const{columns:t,data:n,idToLoading:o,isLoading:s,limit:r,massActions:a,numberOfPages:l,offset:d,possibleColumns:c,setLimit:u,setOffset:m,setSort:h,showMassActions:g,showRowDropdown:p,showRowEdit:f,sort:_,totalCount:x}=ip(),I=V.useMemo(()=>t.flatMap(e=>(0,hd.A)([c.find(t=>t.slug===e)])),[t,c]);return(0,i.jsx)(rd,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(_p,{"aria-busy":s,headerRow:(0,i.jsxs)(Wu,{children:[g&&(0,i.jsx)(pm,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:a.selectAllState,onClick:a.toggleSelectAll})}),I.map(e=>e.isSortable?(0,i.jsx)(fp,{attribute:e.sortAttribute,minWidth:e.minWidth,setSort:h,sort:_,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(pm,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),(p||f)&&(0,i.jsx)(pm,{width:100})]}),paginationRow:(0,i.jsx)(lm,{children:(0,i.jsx)(rm,{limit:r,numberOfPages:l,offset:d,setLimit:u,setOffset:m,showLimits:!0,totalCount:x})}),children:s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):n.map(t=>o[t.id]?(0,i.jsx)(fm,{},t.id):(0,i.jsx)(Cp,{getEditPath:e.getEditPath,renderCell:e.renderCell,renderRowDropdown:e.renderRowDropdown,renderRowPanels:e.renderRowPanels,row:t,selectedColumns:I},t.id))})})};var Ap;!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",e.WeezeventOrganizationId="weezeventOrganizationId"}(Ap||(Ap={}));let Sp=class extends Um{constructor(e,t,n){super(e,t,n)}getFilters(){return[{slug:"features",name:this.t("fonctionnalit_s_47714"),category:this.t("organisation_71863"),fieldType:Zt.Select,values:Pn.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"isAdmin",name:this.t("est_admin_98471"),category:this.t("organisation_71863"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:"isActive",name:this.t("est_active_05309"),category:this.t("organisation_71863"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:"useOldBilling",name:this.t("utilise_l_ancie_27299"),category:this.t("organisation_71863"),fieldType:Zt.Checkbox},{slug:"isOverLimit",name:this.t("d_passe_la_limi_27046"),category:this.t("organisation_71863"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:Ap.MembersLimit,name:this.t("nombre_de_membr_16400"),category:this.t("organisation_71863"),fieldType:Zt.Number},{slug:Ap.PricePerMember,name:this.t("prix_par_membre_20633"),category:this.t("organisation_71863"),fieldType:Zt.Number}]}getPossibleColumns(){return[{slug:Ap.Id,name:this.t("id_51738"),isSortable:!0,sortAttribute:vt.Id,width:100},{slug:Ap.Name,name:this.t("nom_de_l_organi_49583"),minWidth:240},{slug:Ap.InsertedAt,name:this.t("date_de_cr_atio_00749"),isSortable:!0,sortAttribute:vt.InsertedAt,width:200},{slug:Ap.PeriodEndAt,name:this.t("date_de_fin_de_17750"),isSortable:!0,sortAttribute:vt.PeriodEndAt,width:200},{slug:Ap.Features,name:this.t("fonctionnalit_s_47714"),minWidth:320},{slug:Ap.NumberOfEvents,name:this.t("nombre_d_v_nem_14214"),minWidth:180},{slug:Ap.NumberOfMembers,name:this.t("nombre_de_membr_49522"),minWidth:180},{slug:Ap.MembersLimit,name:this.t("nombre_de_membr_16400"),minWidth:180},{slug:Ap.PricePerMember,name:this.t("prix_par_membre_20633"),minWidth:180},{slug:Ap.WeezeventOrganizationId,name:this.t("id_de_l_organis_67465"),isSortable:!0,sortAttribute:vt.WeezeventOrganizationId,width:100}]}};function kp(e){switch(e){case Ae.Accreditation:return"badge-check";case Ae.Api:return"code-branch";case Ae.Beta:return"flask";case Ae.Community:return"people-group";case Ae.Criblage:return"filter";case Ae.CustomDocument:return"file";case Ae.Delegation:return"users";case Ae.Documents:return"file";case Ae.Eid:return"id-card";case Ae.KmlImport:return"cloud-arrow-up";case Ae.Languages:return"language";case Ae.Multiform:return"file-lines";case Ae.Skidata:return"person-skiing";case Ae.Sms:return"message";case Ae.Weezevent:return"ticket";case Ae.Zapier:return"bolt";default:return vd()}}Sp=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mm,Cm,Si])],Sp);const wp=e=>{const t=Ei(Cm);return e.column.slug===Ap.Id?(0,i.jsx)(Qu,{width:e.column.width,children:e.row.id}):e.column.slug===Ap.WeezeventOrganizationId?(0,i.jsx)(Qu,{width:e.column.width,children:e.row.weezeventOrganizationId?(0,i.jsxs)(bm,{to:`/ticket/O${e.row.weezeventOrganizationId}`,children:["O",e.row.weezeventOrganizationId]}):""}):e.column.slug===Ap.Name?(0,i.jsx)(Qu,{css:{"& a":{color:"$primary500 !important"}},children:(0,i.jsx)(_d,{to:io.ORGANIZATION({organizationId:e.row.id}),children:e.row.name})}):e.column.slug===Ap.InsertedAt?(0,i.jsx)(Qu,{width:e.column.width,children:t.toLocaleString(e.row.insertedAt,zs.DateOnly.MonthLong)}):e.column.slug===Ap.PeriodEndAt?(0,i.jsx)(Qu,{width:e.column.width,children:t.toLocaleString(e.row.periodEndAt,zs.DateOnly.MonthLong)}):e.column.slug===Ap.Features?(0,i.jsx)(Qu,{children:(0,i.jsx)(rd,{align:"center",css:{overflow:"auto",py:"$2"},gap:"2",height:1,width:1,wrap:"wrap",children:e.row.features.map(e=>(0,i.jsx)(vu,{leftIcon:kp(e),children:e},e))})}):e.column.slug===Ap.NumberOfEvents?(0,i.jsx)(Qu,{children:e.row.numberOfEvents}):e.column.slug===Ap.NumberOfMembers?(0,i.jsx)(Qu,{children:e.row.membersStats.numberOfMembers}):e.column.slug===Ap.MembersLimit?(0,i.jsx)(Qu,{children:e.row.membersLimit}):e.column.slug===Ap.PricePerMember?(0,i.jsx)(Qu,{children:e.row.pricePerMember}):(0,i.jsx)(Qu,{})},Ep=e=>{const t=Ti(),{user:n}=Li(),{mutate:o,isLoading:s}=function(e={}){return Di("mutation BackofficeOrganizationUserAdd($organizationId: OrganizationId!) {\n backofficeOrganizationUserAdd(organizationId: $organizationId)\n}\n",e)}(),{mutate:r,isLoading:a}=function(e={}){return Di("mutation BackofficeOrganizationUserRemove($organizationId: OrganizationId!) {\n backofficeOrganizationUserRemove(organizationId: $organizationId)\n}\n",e)}(),l=e.organization.users.map(({id:e})=>e);return(0,i.jsxs)(vm,{children:[l.includes(n.id)?(0,i.jsx)(ru,{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)(ru,{color:s?"disabled":"default",icon:"plus",onClick:async()=>{await o({organizationId:e.organization.id}),window.open(`${F.HEAVENT_APP_URL}${io.ORGANIZATION({organizationId:e.organization.id})}`,"_blank"),e.reload()},children:t("s_ajouter_comme_70404")}),(0,i.jsx)(ru,{icon:"pen",to:fs.EDIT_BACKOFFICE_ORGANIZATION(e.organization.id),children:t("_diter_62574")})]})},Tp=()=>{const{history:e,translate:t}=bd(),n=Ei(Sp),[o,s]=pp(tc.BACKOFFICE_SEARCH,"",{deserialize(e){const t=new URL(location.href).searchParams.get("q");return g(t)?t:e}}),[r,a]=pp(tc.BACKOFFICE_COLUMNS,[Ap.Id,Ap.Name,Ap.InsertedAt,Ap.PeriodEndAt],hp),[l,d]=pp(tc.BACKOFFICE_LIMIT,em,mp),[c,u]=pp(tc.BACKOFFICE_PREDICATES,[],hp),[m,h]=pp(tc.BACKOFFICE_SORT,null,hp);return(0,i.jsx)(ka,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsxs)(rd,{css:{padding:"$7"},direction:"column",gap:"7",width:1,children:[(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(ka,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("organisations_26509")}),(0,i.jsx)(kd,{color:"white",leftIcon:"plus",to:Yi(io.ORGANIZATIONS),children:t("cr_er_une_organ_06669")}),(0,i.jsx)(kd,{leftIcon:"house",onClick:()=>{e.push(fs.HOME)},children:"WeezCrew"}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(lu,{placement:"bottom-end",children:(0,i.jsx)(ru,{icon:"eye",onClick:()=>{e.push(fs.BACKOFFICE_INVOICES)},children:t("voir_les_factur_82290")})})]})]}),(0,i.jsx)(up,{columns:r,columnsSearch:[],eventId:null,filters:n.getFilters(),limit:l,loadDataList:il,loadRow:nl,name:o,organizationId:null,possibleColumns:n.getPossibleColumns(),predicates:c,rendering:Cg.List,setColumns:a,setLimit:d,setName:s,setPredicates:u,setSort:h,showEditColumns:!0,showEditMode:!1,showFilters:!0,showMassActions:!1,showPredicatesBadges:!0,showRowDropdown:!0,showRowEdit:!0,showSearchColumns:!1,sort:m,children:(0,i.jsx)(yp,{getEditPath:e=>fs.EDIT_BACKOFFICE_ORGANIZATION(e.id),renderCell:(e,t)=>(0,i.jsx)(wp,{column:e,row:t}),renderRowDropdown:(e,t)=>(0,i.jsx)(Ep,{organization:e,reload:t})})})]})})},Rp=xa("div",{margin:"auto",width:"$containerTablet","@desktop":{width:"$container"}}),Op=V.forwardRef((e,t)=>(0,i.jsx)(ka,{ref:t,css:{background:"$gray50",overflowX:"hidden",overflowY:"auto",py:"$10",...e.css},height:1,width:1,children:(0,i.jsx)(Rp,{children:e.children})}));Op.displayName="CenteredContainer";const Dp=xa("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"}}),zp=e=>{const t=$i();return(0,i.jsxs)(Dp,{color:e.color,children:[(0,i.jsxs)(rd,{align:"center",className:"fsp-header",gap:"4",height:65,width:1,children:[(0,i.jsx)(ka,{css:{flexShrink:3},width:300}),(0,i.jsxs)(rd,{align:"center",css:{flex:"1"},direction:"column",children:[e.category&&(0,i.jsx)(ka,{className:"fsp-category",children:e.category}),(0,i.jsx)(ka,{className:"fsp-title",css:{maxWidth:"100%"},ellipsis:!0,children:e.heading})]}),(0,i.jsxs)(rd,{gap:"4",justify:"end",width:300,children:[e.button,(0,i.jsx)(kd,{color:"dark"===e.color?"gray":"white",css:{flexShrink:0},leftIcon:"xmark",onClick:()=>{"function"==typeof e.onClose?e.onClose():t.goBack(e.fallbackClosePath||fs.HOME)}})]})]}),(0,i.jsx)(ka,{css:{height:"calc(100% - 65px)"},width:1,children:e.children})]})},$p=({acceptCustomColours:e,css:t,footer:n,header:o,heading:s,subtitle:r,children:a,...l})=>(0,i.jsxs)(rd,{as:id.Section,className:"card",css:{padding:"unset !important",bd:!0,inlineSize:"100%",backgroundColor:"$white","& .card":{backgroundColor:"$gray50","& .card__body":{padding:"$4 $5"}},...t},direction:"column",...l,children:[o||(s||r)&&(0,i.jsx)(rd,{align:"center",as:id.Header,css:{borderBlockEnd:"1px solid $gray200",padding:"$6 $7 $5 $7"},gap:"3",children:(0,i.jsxs)(ka,{css:{flex:"1"},children:[s&&(0,i.jsx)(Dd,{css:e?{color:"$grayCustom900"}:void 0,children:s}),r&&(0,i.jsx)(Od,{css:e?{color:"$grayCustom500"}:void 0,textStyle:"subtitle",children:r})]})}),(0,i.jsx)(rd,{className:"card__body",css:{gap:"$6",padding:"$6 $7","&:empty":{display:"none"}},direction:"column",children:a}),n&&(0,i.jsx)(rd,{as:id.Footer,css:{borderBlockStart:"1px solid $gray200",padding:"$6","&:empty":{display:"none"}},gap:"3",children:n})]}),Pp=(0,V.createContext)({});function Mp(){return(0,V.useContext)(Pp)}const Fp=({name:e,children:t,...n})=>{const{isDisabled:o}=Mp();return(0,i.jsx)(cd.D0,{name:e,render:e=>{const s=!0===e.input.checked?"checked":"unchecked";return(0,i.jsx)(Eu,{...n,disabled:o??n.disabled,state:s,onClick:()=>{e.input.onChange(!e.input.checked)},children:t})},type:"checkbox"})},Np=(0,V.memo)(function({name:e,hint:t,state:n,...o}){return(0,i.jsx)(cd.D0,{name:e,render:({input:s,meta:r})=>{const a=r.data?.forceDisplayError&&r.invalid||r.touched&&r.invalid;return(0,i.jsx)(Ih,{hint:a?r.error:t,name:e,state:a?"error":n,value:s.value,onBlur:s.onBlur,onChange:s.onChange,onFocus:s.onFocus,...o})}})}),Lp=({value:e,onChange:t,...n})=>{const[o,s]=(0,V.useState)(e?.toString()??""),[r,a]=(0,V.useState)(e);return r!==e&&(s(e?.toString()??""),a(e)),(0,i.jsx)(Qd,{value:o,onChange:e=>{const n=parseFloat(e);s(e),a(isNaN(n)?null:n),t(isNaN(n)?null:n)},...n})},Bp=({name:e,hint:t,state:n,...o})=>(0,i.jsx)(cd.D0,{name:e,render:s=>{const r=Wd(s.meta);return(0,i.jsx)(Lp,{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})}}),Vp=e=>(0,i.jsx)(rd,{as:"legend",css:{position:"absolute",overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",width:"1px",height:"1px",whiteSpace:"nowrap"},direction:"column",children:e.heading});var Up;!function(e){e.Dark="dark",e.Normal="normal"}(Up||(Up={}));const Wp=({canSelect:e,centerHeader:t,children:n,disabled:o,footerActions:s,heading:r,header:a,headerStyle:l=Up.Normal,headerActions:d,hideHeader:c,initialIsOpen:u,isCompleted:m,isOpen:h,isToggleable:g,onSelect:p,onToggle:f,stepNumber:_,subtitle:x,...I})=>{const v=Ti(),{descId:b}=Hd(),[j,C]=V.useState(u??!0),y=g?j:h,A=l===Up.Dark;return(0,i.jsx)(Pp.Provider,{value:{isDisabled:o},children:(0,i.jsx)($p,{"aria-describedby":b,as:"fieldset",css:{borderRadius:A?"$1":void 0,overflow:"hidden","&:disabled :is(input, select, textarea, datalist, button)":{cursor:"not-allowed !important"},...I.css},direction:"column",disabled:o,footer:!1!==y&&s,header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vp,{heading:r}),!c&&(0,i.jsxs)(rd,{align:"center",as:"header",css:A?{background:y?"$gray900":"white",blockSize:"64px",cursor:e&&!y?"pointer":"default",padding:"$6 $6 $5 $6"}:t?{padding:"$7 $7 0 $7",textAlign:"center"}:!1!==y?{borderBlockEnd:"1px solid $gray200",padding:"$6 $7 $5 $7"}:{padding:"$6 $7"},gap:"3",onClick:p,children:[A&&(0,i.jsx)(rd,{align:"center",css:{background:m?"$success200":"white",border:m?"none":"1px solid $gray200",borderRadius:"32px",color:m?"$success700":"$gray800",fontWeight:"$medium"},height:32,justify:"center",width:32,children:m?(0,i.jsx)(Id,{icon:"check"}):_}),(0,i.jsxs)(ka,{css:{flex:"1"},children:[r&&(0,i.jsx)(Dd,{"aria-hidden":"true",css:A?y?{color:"white"}:void 0:{fontWeight:"$semiBold"},children:r}),x&&(0,i.jsx)(Od,{color:A?y?"white":"gray800":void 0,id:b,textStyle:"subtitle",children:x})]}),d&&(0,i.jsx)(rd,{gap:"4",justify:"end",children:d}),g&&(0,i.jsx)(Ym,{label:v("toggle_section_92160"),size:"md",value:j,onChange:e=>{C(e),f?.(e)}})]})]}),...I,children:!1!==y&&(0,i.jsx)(rd,{css:{"&:has(> fieldset.fieldset--column)":{gap:"$9"}},direction:"column",children:n})})})},Gp=({name:e,hint:t,state:n,multiple:o,...s})=>{const{isDisabled:r}=Mp();return(0,i.jsx)(cd.D0,{name:e,render:a=>{const l=Wd(a.meta);return(0,i.jsx)(Uu,{hint:l?a.meta.error:t,multiple:o,name:e,state:l?"error":r?"disabled":n,values:o?Array.isArray(a.input.value)?a.input.value:[]:"number"==typeof a.input.value||g(a.input.value)?[a.input.value]:[],onChange:e=>{o?a.input.onChange(e):Bs(e)?a.input.onChange(e[0]):a.input.onChange(null)},...s})}})},qp=({css:e,label:t,description:n,state:o,icon:s,hint:r,rightIcon:a,rightText:l,onChange:d,value:c,...u})=>{const{inputId:m,descId:h,errorId:g}=Hd();return(0,i.jsxs)(rd,{css:e,direction:"column",width:1,children:[(0,i.jsx)(Zd,{htmlFor:m,children:t}),(0,i.jsx)(Kd,{id:h,children:n}),(t||n)&&(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(Jd,{cursor:"text",height:"fluid",icon:s,rightIcon:a,rightText:l,state:o,children:(0,i.jsxs)(yc,{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?h:void 0,"aria-errormessage":"error"===o?g:void 0,"aria-invalid":"error"===o,disabled:"disabled"===o,id:m,value:c,onChange:e=>{d(e.target.value)},...u}),(0,i.jsxs)(ka,{className:"replicated-text",children:[c," "]})]})}),(0,i.jsx)(Yd,{id:g,state:o,children:r})]})},Hp=({name:e,hint:t,state:n,...o})=>(0,i.jsx)(cd.D0,{name:e,render:s=>{const r=Wd(s.meta);return(0,i.jsx)(qp,{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})}}),Kp=e=>(0,i.jsx)(cd.D0,{name:e.name,render:t=>(0,i.jsx)(Zm,{disabled:e.disabled,size:e.size,subtext:e.subtext,value:t.input.value,onChange:t.input.onChange,children:e.children})}),Yp=c.gl(e=>e&&As.c9.fromISO(e).isValid);let Zp=class extends ic{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 c.Ik().shape({name:c.Yj().required(this.t("le_nom_de_l_org_60618")),periodEndAt:Yp.required(this.t("la_date_de_fin_04076")).typeError(this.t("la_date_de_fin_04076")).test("min-period-end-at",this.t("la_date_de_fin_63806"),function(){return As.c9.isDateTime(this.parent.periodEndAt)&&this.parent.periodEndAt.isValid&&this.parent.periodEndAt>As.c9.fromObject({year:2016})}),features:c.YO().of(c.Yj().oneOf(Pn,this.t("les_fonctionnal_36778"))),usersIds:c.YO().of(c.ai()),isBlocked:c.zM().required()})}updateOrganizationSchema(){return c.Ik().shape({organization:this.organizationInputSchema()})}};Zp=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],Zp);const Xp=xa("span",{variants:{color:{inherit:{color:"inherit"},cyan:{color:"$cyan"},gray25:{color:"$gray25"},gray50:{color:"$gray50"},grayCustom50:{color:"$grayCustom50"},gray100:{color:"$gray100"},gray200:{color:"$gray200"},gray300:{color:"$gray300"},gray400:{color:"$gray400"},gray500:{color:"$gray500"},grayCustom500:{color:"$grayCustom500"},gray600:{color:"$gray600"},gray700:{color:"$gray700"},grayCustom700:{color:"$grayCustom700"},gray800:{color:"$gray800"},grayCustom800:{color:"$grayCustom800"},gray900:{color:"$gray900"},grayCustom900:{color:"$grayCustom900"},grayDark50:{color:"$grayDark50"},grayDark100:{color:"$grayDark100"},grayDark500:{color:"$grayDark500"},grayDark700:{color:"$grayDark700"},primary25:{color:"$primary25"},primary50:{color:"$primary50"},primary100:{color:"$primary100"},primary200:{color:"$primary200"},primary300:{color:"$primary300"},primary400:{color:"$primary400"},primary500:{color:"$primary500"},primaryCustom500:{color:"$primaryCustom500"},primary600:{color:"$primary600"},primaryCustom600:{color:"$primaryCustom600"},primary700:{color:"$primary700"},primary800:{color:"$primary800"},primary900:{color:"$primary900"},primary950:{color:"$primary950"},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"},blueLight50:{color:"$blueLight50"},blueLight100:{color:"$blueLight100"},blueLight400:{color:"$blueLight400"},blueLight500:{color:"$blueLight500"},blueLight600:{color:"$blueLight600"},blueLight700:{color:"$blueLight700"},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"},purpleLight50:{color:"$purpleLight50"},purpleLight100:{color:"$purpleLight100"},purpleLight500:{color:"$purpleLight500"},purpleLight700:{color:"$purpleLight700"},purpleDark50:{color:"$purpleDark50"},purpleDark100:{color:"$purpleDark100"},purpleDark500:{color:"$purpleDark500"},purpleDark700:{color:"$purpleDark700"},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"},orange50:{color:"$orange50"},orange100:{color:"$orange100"},orange400:{color:"$orange400"},orange500:{color:"$orange500"},orange600:{color:"$orange600"},orange700:{color:"$orange700"},redLight50:{color:"$redLight50"},redLight100:{color:"$redLight100"},redLight500:{color:"$redLight500"},redLight700:{color:"$redLight700"},redDark50:{color:"$redDark50"},redDark100:{color:"$redDark100"},redDark500:{color:"$redDark500"},redDark700:{color:"$redDark700"},green50:{color:"$green50"},green100:{color:"$green100"},green500:{color:"$green500"},green700:{color:"$green700"},greenDark50:{color:"$greenDark50"},greenDark100:{color:"$greenDark100"},greenDark500:{color:"$greenDark500"},greenDark700:{color:"$greenDark700"},brown50:{color:"$brown50"},brown100:{color:"$brown100"},brown500:{color:"$brown500"},brown700:{color:"$brown700"},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"}}),Jp=V.forwardRef((e,t)=>(0,i.jsx)(Xp,{...(0,ma.A)(e,"font"),...ha(e.font),ref:t,css:e.css}));Jp.displayName="Span";const Qp=1587,ef=1123,tf=1122,nf=793,of=559,sf=396,rf=323,af=204,lf={A4:{height:"297mm",width:"210mm"},A5:{height:"210mm",width:"148mm"},A6:{height:"148mm",width:"105mm"},CB:{height:"53.98mm",width:"85.6mm"}},df=(e,t)=>{t?.startsWith("/")||(console.warn(`Path '${t}' missing leading slash`),t="/"+t);const n=new b(F.HEAVENT_PUBLIC_URL);return Yc.has(e)&&(n.host=Yc.get(e)),n.pathname+=t,n.href},cf=({organizationId:e,eventId:t,delegationId:n,formId:i,teamCode:o,query:s})=>{const r=new b(F.HEAVENT_PUBLIC_URL);return Yc.has(e)&&(r.host=Yc.get(e)),r.pathname+=`${(()=>{if(n)return"number"==typeof t?qo.DELEGATION_FORM({organizationId:e,delegationId:n,eventId:t,formId:i}):qo.DELEGATION_FORM({organizationId:e,delegationId:n,formId:i});{const n="number"==typeof t?So.EVENT_FORM({organizationId:e,eventId:t,formId:i}):io.ORGANIZATION_FORM({organizationId:e,formId:i});return g(o)?`${n}/team/${o}`:n}})()}`,g(s?.email)&&r.searchParams.set("email",s.email),s?.preview&&r.searchParams.set("preview",s?.preview?.toString()),s?.previewState&&r.searchParams.set("state",s?.previewState?.toString()),r.href};var uf;!function(e){e.QR="qr",e.Code39="code39"}(uf||(uf={}));const mf=(e,t)=>{const n=new b(F.HEAVENT_API_URL);return n.pathname+=`/barcode/${t?.barcodeType??uf.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},hf=({organizationId:e,eventId:t,lang:n,pathComponent:i,key:o,searchParams:s})=>{const r=new b(F.HEAVENT_API_URL);return r.pathname+=t?`/export/organization/${e}/event/${t}/${i}`:`/export/organization/${e}/${i}`,g(o)&&r.searchParams.set("key",o),g(n)&&r.searchParams.set("lang",n),Object.entries(s??{}).forEach(([e,t])=>{r.searchParams.set(e,t)}),r.href};function gf(e,t,n={}){const i=new b(F.HEAVENT_API_URL);i.pathname+=`/documents/${e}.${t}`;const o=new URLSearchParams(Object.entries(n).filter(([e,t])=>g(t)));for(const[e,t]of o)i.searchParams.set(e,t);return i.href}function pf(e,t){return new b(`https://${F.HEAVENT_APP_URL.subdomain}.${F.WEEZEVENT_DOMAIN}`,void 0,void 0,`access/O${e}/checkpoints/edit/${t}`).href}const ff=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=(0,cm.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{css:{background:`url(${F.HEAVENT_ASSETS_URL}/badges/animaje/convention-2026-2-page1.jpg) no-repeat`,backgroundSize:"cover",color:"#040f29",fontFamily:"$neufileGrotesk",pageBreakBefore:"always",position:"relative"},height:tf,width:nf,children:[(0,i.jsxs)(ka,{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)(ka,{css:{fontSize:"14px",fontWeight:"500",left:"72px",position:"absolute",textTransform:"uppercase",top:"364px"},children:n.fields?.phone?.internationalFormat||""}),(0,i.jsx)(ka,{css:{left:"650px",position:"absolute",top:"322px"},height:72,width:72,children:(0,i.jsx)("img",{height:"100%",src:mf(t.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsx)(rd,{css:{left:"72px",position:"absolute",top:"558px"},direction:"column",gap:"1",children:o.map((e,t)=>(0,i.jsxs)(ka,{css:{fontSize:"12px",fontWeight:"500"},children:[(0,i.jsxs)(Jp,{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)(rd,{css:{background:`url(${F.HEAVENT_ASSETS_URL}/badges/animaje/convention-2026-3-page2.jpg) no-repeat`,backgroundSize:"cover",color:"#040f29",fontFamily:"$neufileGrotesk",pageBreakBefore:"always",position:"relative"},height:tf,width:nf,children:[(0,i.jsxs)(ka,{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)(ka,{css:{fontSize:"14px",fontWeight:"500",left:"72px",position:"absolute",textTransform:"uppercase",top:"252px"},children:n.fields?.phone?.internationalFormat||""}),(0,i.jsx)(ka,{css:{left:"650px",position:"absolute",top:"210px"},height:72,width:72,children:(0,i.jsx)("img",{height:"100%",src:mf(t.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsxs)(ka,{css:{fontSize:"12px",fontWeight:"700",left:"178px",position:"absolute",top:"455px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]}),(0,i.jsxs)(ka,{css:{fontSize:"12px",fontWeight:"700",left:"72px",position:"absolute",top:"537px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]}),(0,i.jsxs)(ka,{css:{fontSize:"12px",fontWeight:"700",left:"72px",position:"absolute",top:"617px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]})]})]})};var _f=n(5526),xf=n(7431);function If(e,t,n){return e.filter(e=>{if(t?.isValid&&n?.isValid){const i=As.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 vf(e,t,n=" "){const i=Object.fromEntries(Object.values((0,Vu.A)(t,e=>e.positionSlot.range.start.startOf("day").toMillis())).map(e=>[`positions.${e[0].positionSlot.range.start.toFormat("yyyyMMdd")}`,(0,cm.A)((0,bs.A)(e.map(e=>e.position.name))).join(n)]));return{assignmentsDays:(0,Xh.A)(t.map(({positionSlot:e})=>e.range.start),e=>e.startOf("day").toMillis()).map(t=>e.toLocaleString(t,zs.DateOnly.WeekdayLongMonthLong)).join(", "),positionsCategories:(0,cm.A)((0,bs.A)(t.map(e=>e.position.category.name))).join(", "),positions:(0,cm.A)((0,bs.A)(t.map(e=>e.position.name))).join(", "),volunteerMinutes:(0,_f.A)(t,e=>e.positionSlot.timeDifferenceMinutes),volunteerHours:(0,xf.A)((0,_f.A)(t,e=>e.positionSlot.timeDifferenceMinutes)/60,1),...i}}function bf(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:"$primary500"},[`${e} blockquote`]:{borderLeft:"3px solid $gray200",fontStyle:"italic",marginLeft:0,marginRight:0,px:"$4","& p":{margin:0,paddingBottom:"$2",paddingTop:"$2"}}}}const jf=e=>(0,i.jsx)(ka,{className:"h-rich-text",css:{...bf("&"),"& > 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 Cf(e,t){return`https://www.google.com/maps/place/${e},${t}`}const yf=4427,Af=4848,Sf=e=>e===yf?{color:"#ff5501"}:e===Af?{color:"#005a41"}:-1===e?{color:"#1e4850"}:{},kf=e=>e===yf?{color:"white"}:e===Af?{color:"#005a41"}:-1===e?{color:"#1e4850"}:{},wf=e=>{const t=e.psuis[0].position,n=(0,cm.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),o=t.leaders[0];return(0,i.jsxs)(rd,{css:{background:`url(${s=e.eventId,s===yf?`${F.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/semi.jpg`:s===Af?`${F.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/marathon.jpg`:-1===s?`${F.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/10k.jpg`:""}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:tf,width:nf,children:[(0,i.jsx)(ka,{css:{fontSize:"24px",left:"298px",position:"absolute",top:"101px",...kf(e.eventId)},textAlign:"center",width:409,children:e.userInfo.name}),(0,i.jsx)(ka,{css:{fontSize:"12px",left:"46px",position:"absolute",top:"374px"},children:g(e.options.habits)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(ka,{css:{...kf(e.eventId),"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(jf,{text:e.options.habits})})})}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{css:{color:"#005a41",left:"46px",position:"absolute",top:"581px",...kf(e.eventId)},textAlign:"center",width:150,children:o.userInfo.name}),(0,i.jsx)(ka,{css:{left:"46px",position:"absolute",top:"602px",...kf(e.eventId)},textAlign:"center",width:150,children:o.userInfo.phone?.internationalFormat})]}),(0,i.jsxs)(rd,{css:{left:"228px",position:"absolute",padding:"32px",top:"167px"},direction:"column",width:550,children:[(0,i.jsx)(ka,{css:{fontSize:"28px",fontWeight:"700",...Sf(e.eventId)},textAlign:"center",children:t.name}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(ka,{css:{fontWeight:"700",textTransform:"uppercase",...Sf(e.eventId)},children:"Date et heure de la mission"}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(rd,{css:{fontSize:"12px"},direction:"column",gap:"1",children:n.map((e,t)=>{const n=e.range.start;return(0,i.jsxs)(ka,{children:[n.toFormat("cccc dd MMMM yyyy",{locale:"fr"})," à"," ",n.toFormat("H'h'mm",{locale:"fr"})]},t)})}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{css:{fontWeight:"700",textTransform:"uppercase",...Sf(e.eventId)},children:"Détail de la mission"}),(0,i.jsx)(md,{height:"1"}),g(t.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(ka,{css:{color:"black",fontSize:"12px","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(jf,{text:t.description})})}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{css:{fontWeight:"700",textTransform:"uppercase",...Sf(e.eventId)},children:"Lieu de rendez-vous"}),(0,i.jsx)(md,{height:"1"}),dg(t)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{css:{fontSize:"12px"},children:t.address}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsxs)(rd,{gap:"3",width:1,children:[(0,i.jsx)(ka,{height:180,width:1,children:(0,i.jsx)("a",{href:Cf(t.latitude,t.longitude),style:{background:`url(${F.HEAVENT_API_URL}/image/event/${e.eventId}/position/${t.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),g(t.fields?.cf45815?.url)&&(0,i.jsx)(ka,{css:{background:`url(${t.fields.cf45815.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204})]}),g(t.fields.cf44423)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{css:{fontWeight:"700",textTransform:"uppercase",...Sf(e.eventId)},children:"Ton kit bénévole"}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{css:{fontSize:"12px"},dangerouslySetInnerHTML:{__html:t.fields.cf44423.replace(/\n/g," ")}})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{css:{fontWeight:"700",textTransform:"uppercase",...Sf(e.eventId)},children:"Un imprévu ?"}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{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},Ef=[120785,134101],Tf=e=>{const t=If(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,null).filter(({position:e})=>!Ef.includes(e.id)),n=(0,cm.A)(Object.entries((0,Vu.A)(t,({position:e})=>e.id)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:n.map(([t,n],o)=>(0,i.jsx)(wf,{eventId:e.event.id,options:e.options,psuis:n,userInfo:e.event.volunteerRegistration.userInfo},o))})},Rf=["TERRAIN","VESTIAIRES","ESPACE PRESSE","SALON NEODIF","SALON GEOFIT","SALON PRESTIGE"],Of={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"},Df=({css:e,name:t})=>(0,i.jsx)(ka,{css:{background:`url(https://assets.recrewteer.com/badges/hbc/lnh/${Of[t]}) no-repeat`,backgroundSize:"cover",height:"30px",position:"absolute",width:"30px",...e}}),zf=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,o=n.fields?.cf38222?.value,s=t.accreditationsUsersInfos.reduce((e,t)=>Rf.includes(t.accreditation.name)?{...e,[t.accreditation.name]:!0}:e,{});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{css:{background:"url(https://assets.recrewteer.com/badges/hbc/ldc/2026/bg_badge_recto.jpg) no-repeat",backgroundSize:"cover",color:"#FFF",fontFamily:"$formulaCondensedBold",position:"relative"},height:476,width:363,children:[(0,i.jsx)(ka,{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)(ka,{css:{fontSize:"13px",fontWeight:"700",left:"34px",lineHeight:"normal",position:"absolute",textAlign:"center",top:"172px"},children:n.fields.cf38077?.value}),(0,i.jsx)(ka,{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)(Df,{css:{left:"251px",top:"314px"},name:"TERRAIN"}),s.VESTIAIRES&&(0,i.jsx)(Df,{css:{left:"299px",top:"314px"},name:"VESTIAIRES"}),s["ESPACE PRESSE"]&&(0,i.jsx)(Df,{css:{left:"251px",top:"363px"},name:"ESPACE PRESSE"}),s["SALON NEODIF"]&&(0,i.jsx)(Df,{css:{left:"299px",top:"363px"},name:"SALON NEODIF"}),s["SALON GEOFIT"]&&(0,i.jsx)(Df,{css:{left:"251px",top:"412px"},name:"SALON GEOFIT"}),s["SALON PRESTIGE"]&&(0,i.jsx)(Df,{css:{left:"299px",top:"412px"},name:"SALON PRESTIGE"})]}),(0,i.jsx)(rd,{css:{background:"url(https://assets.recrewteer.com/badges/hbc/ldc/2026/bg_badge_verso.jpg) no-repeat",backgroundSize:"cover",position:"relative"},height:476,width:363})]})},$f=["TERRAIN","VESTIAIRES","ESPACE PRESSE","SALON NEODIF","SALON GEOFIT","SALON PRESTIGE"],Pf={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"},Mf=({css:e,name:t})=>(0,i.jsx)(ka,{css:{background:`url(${F.HEAVENT_ASSETS_URL}/badges/hbc/lnh/${Pf[t]}) no-repeat`,backgroundSize:"cover",height:"47px",position:"absolute",top:"463px",width:"47px",...e}}),Ff=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,o=n.fields?.cf38222?.value,s=t.accreditationsUsersInfos.reduce((e,t)=>$f.includes((t.accreditation?.name||"").toUpperCase())?{...e,[t.accreditation.name]:!0}:e,{});return(0,i.jsxs)(rd,{css:{fontFamily:"$zuumeMedium",position:"relative"},height:of,width:sf,children:[(0,i.jsx)(ka,{css:{left:"52px",position:"absolute",top:"205px"},height:111,width:111,children:g(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(ka,{css:{left:"69px",position:"absolute",top:"317px"},textAlign:"center",width:77,children:n.id}),(0,i.jsx)(ka,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"205px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(ka,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"229px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(ka,{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)(ka,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",textDecoration:"uppercase",top:"298px"},children:o}),s.TERRAIN&&(0,i.jsx)(Mf,{css:{left:"45px"},name:"TERRAIN"}),s.VESTIAIRES&&(0,i.jsx)(Mf,{css:{left:"96px"},name:"VESTIAIRES"}),s["ESPACE PRESSE"]&&(0,i.jsx)(Mf,{css:{left:"149px"},name:"ESPACE PRESSE"}),s["SALON NEODIF"]&&(0,i.jsx)(Mf,{css:{left:"201px"},name:"SALON NEODIF"}),s["SALON GEOFIT"]&&(0,i.jsx)(Mf,{css:{left:"253px"},name:"SALON GEOFIT"}),s["SALON PRESTIGE"]&&(0,i.jsx)(Mf,{css:{left:"306px"},name:"SALON PRESTIGE"})]})};function Nf(e={}){const t=I(e.firstName||"").trim();return`${I(e.lastName||"").trim().toUpperCase()} ${t}`.trim()}const Lf=(e,t)=>e.split(t).map(e=>e.trim().length>0?e.trim()[0]:"").join("").substring(0,3);function Bf(e,t){if(g(e))return Lf(e," ");if(g(t)){const[e]=t.split("@");return Lf(e,".")}return""}const Vf=[Ia.colors.success600.value,Ia.colors.blueGray600.value,Ia.colors.blueLight600.value,Ia.colors.purple600.value,Ia.colors.pink600.value,Ia.colors.warning600.value];function Uf(e){const t=e.charCodeAt(0);return Vf[t%Vf.length]}const Wf=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}},Gf=e=>{const[t,n]=(0,V.useState)(g(e.image)?e.image:void 0);if((0,V.useEffect)(()=>{g(e.image)&&n(e.image)},[e.image]),g(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=Bf(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:Uf(t),color:"white",display:"flex",fontSize:`${Wf(e.size)}px`,height:"100%",justifyContent:"center",textTransform:"uppercase",width:"100%"},children:t})})}},qf=e=>{const t=e.event.volunteerRegistration.userInfo,n=t.fields.phone?.internationalFormat||"";return(0,i.jsxs)(rd,{css:{background:`url(${F.HEAVENT_ASSETS_URL}/badges/p2n/planning_masque.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"Plus Jakarta Sans",fontSize:"$textXs",fontWeight:"$regular",pageBreakBefore:"always",position:"relative"},direction:"column",height:tf,width:nf,children:[(0,i.jsx)(ka,{css:{left:"48px",position:"absolute",top:"47px"},children:(0,i.jsx)(Gf,{email:t.email,image:t.fields?.picture?.url,name:t.name,size:40})}),(0,i.jsxs)(rd,{css:{left:"104px",position:"absolute",top:"45px"},direction:"column",children:[(0,i.jsx)(ka,{css:{color:"$gray800",fontWeight:"600"},children:t.name}),(0,i.jsx)(ka,{color:"gray800",children:n})]}),(0,i.jsx)(ka,{css:{color:"black",fontSize:"24px",fontWeight:"700",position:"absolute",top:"112px"},textAlign:"center",width:1,children:e.title}),(0,i.jsx)(rd,{css:{gap:"28px",flex:"1",left:"48px",position:"absolute",top:"172px",width:"calc(100% - 96px)"},direction:"column",children:e.children})]})},Hf=As.IX.fromDateTimes(As.c9.fromObject({year:2026,month:5,day:22}).startOf("day"),As.c9.fromObject({year:2026,month:5,day:24}).endOf("day"));var Kf;function Yf(){return Yf=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=Ei(Cm),n=e.psui.position,o=n.category,s=e.psui.positionSlot,r=(0,cm.A)((0,Xh.A)(n.leaders.concat(o.leaders),e=>e.userInfo.id),e=>e.userInfo.name).map(e=>e.userInfo.name).join(", ");return(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{css:{color:"black",fontWeight:"700",textTransform:"uppercase"},children:t.toLocaleString(s.range.start,zs.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(md,{height:"2"}),(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(rd,{align:"center",css:{"& svg":{fill:"black",height:"100%",width:"100%"}},height:16,justify:"center",width:16,children:(0,i.jsx)(Zf,{})}),(0,i.jsxs)(ka,{color:"gray800",children:[(0,i.jsx)(Jp,{css:{fontWeight:"600"},children:n.name})," | De"," ",s.range.start.toFormat("H:mm")," à ",s.range.end.toFormat("H:mm")]})]}),(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{gap:"2",children:[(0,i.jsx)(rd,{align:"center",css:{"& svg":{fill:"black",height:"100%",width:"100%"}},height:16,justify:"center",width:16,children:(0,i.jsx)(Qf,{})}),(0,i.jsxs)(ka,{color:"gray800",children:[(0,i.jsx)(Jp,{css:{fontWeight:"600"},children:"Responsable : "}),r]})]}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ka,{css:{color:"black"},children:(0,i.jsx)(jf,{css:{"& > p:first-child":{marginTop:0},"& > p:last-child":{marginBottom:0}},text:n.description})})]})},t_=e=>{const t=e.event.volunteerRegistration,[n,o]=(0,Bg.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.overlaps(Hf));return(0,i.jsx)(i.Fragment,{children:Bs(n)&&(0,i.jsx)(qf,{event:e.event,title:"Planning P2N 2026",children:(0,cm.A)(n,({positionSlot:e})=>e.range.start.toMillis()).map(e=>(0,i.jsx)(e_,{psui:e},e.id))})})},n_=e=>{const t=Ei(Cm);return(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(ka,{css:{color:"black",fontWeight:"700",textTransform:"uppercase"},children:e.psuis[0].position.name}),(0,cm.A)(e.psuis,e=>e.positionSlot.range.start.toMillis()).map(e=>{const n=e.positionSlot;return(0,i.jsxs)(ka,{color:"gray800",children:[(0,i.jsx)(Jp,{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)})]})},i_=e=>{const t=e.event.volunteerRegistration,[n,o]=(0,Bg.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.overlaps(Hf)),s=(0,cm.A)(Object.entries((0,Vu.A)(o,e=>e.position.name)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:Bs(o)&&(0,i.jsx)(qf,{event:e.event,title:"Planning Montage/Démontage P2N 2026",children:s.map(([e,t],n)=>(0,i.jsx)(n_,{psuis:t},n))})})},o_=e=>e.includes("BLEU_CLAIR")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/bleu_clair_verso.jpg`:e.includes("BLEU_FONCE")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/bleu_fonce_verso.jpg`:e.includes("JAUNE")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/jaune_verso.jpg`:e.includes("ORANGE")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/orange_verso.jpg`:e.includes("VERT")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/vert_verso.jpg`:e.includes("VIOLET")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/violet_verso.jpg`:"",s_=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)(rd,{css:{background:`url(${o_(o)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:476,width:368,children:(0,i.jsx)(rd,{align:"center",css:{color:"black",fontSize:"16px",fontWeight:"700",height:"39px",left:"29px",position:"absolute",top:"31px",width:"40px"},justify:"center",children:s})})},r_=e=>e.includes("BLEU_CLAIR")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/bleu_clair/bleu_clair_recto.jpg`:e.includes("BLEU_FONCE")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/bleu_fonce/bleu_fonce_recto.jpg`:e.includes("JAUNE")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/jaune/jaune_recto.jpg`:e.includes("ORANGE")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/orange/orange_recto.jpg`:e.includes("VERT")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/vert/vert_recto.jpg`:e.includes("VIOLET")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/violet/violet_recto.jpg`:"",a_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,o=t.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym),s=(0,bs.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)(rd,{css:{background:`url(${r_(o)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:476,width:368,children:[(0,i.jsx)(ka,{css:{position:"absolute",right:"40px",top:"43px"},height:65,width:65,children:(0,i.jsx)("img",{height:"100%",src:mf(t.ticketId,{height:65,width:65}),width:"100%"})}),(0,i.jsx)(ka,{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)(ka,{css:{color:r,fontSize:"18px",fontWeight:"700",position:"absolute",textAlign:"center",top:"242px",width:"100%"},children:n.name}),(0,i.jsx)(rd,{css:{color:r,fontSize:"12px",gap:"2px",position:"absolute",top:"271px",width:"100%"},direction:"column",children:t.state===ve.NotApplicable||"Intervenant"===a?(0,i.jsx)(ka,{textAlign:"center",width:1,children:l}):"Direction"===a?Bs(d)?d.map((e,t)=>(0,i.jsx)(ka,{textAlign:"center",width:1,children:e},t)):null:s.map((e,t)=>(0,i.jsx)(ka,{textAlign:"center",width:1,children:e},t))}),(0,i.jsx)(ka,{css:{color:r,fontSize:"32px",fontWeight:"700",position:"absolute",textAlign:"center",textTransform:"uppercase",top:"364px",width:"100%"},children:a})]})},l_=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a_,{event:e.event}),(0,i.jsx)(s_,{event:e.event})]}),d_=e=>{const t=e.psuis[0].position,n=(0,cm.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)(rd,{css:{background:`url(${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/assignment_v2.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$avenir",fontWeight:"500",pageBreakBefore:"always",position:"relative"},height:tf,width:nf,children:[(0,i.jsx)(ka,{css:{borderRadius:"5px",left:"67px",overflow:"hidden",position:"absolute",top:"212px"},height:74,width:74,children:g(o.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:o.fields.picture.url,width:"100%"})}),(0,i.jsx)(ka,{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)(rd,{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)(ka,{children:s.userInfo.firstName}),(0,i.jsx)(ka,{children:s.userInfo.lastName}),(0,i.jsx)(ka,{children:s.userInfo.phone?.internationalFormat})]}),r&&(0,i.jsxs)(rd,{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)(ka,{children:r.userInfo.firstName}),(0,i.jsx)(ka,{children:r.userInfo.lastName}),(0,i.jsx)(ka,{children:r.userInfo.phone?.internationalFormat})]}),(0,i.jsxs)(rd,{css:{left:"210px",padding:"24px 40px 0 40px",position:"absolute",top:"170px"},direction:"column",width:584,children:[(0,i.jsx)(rd,{align:"center",css:{color:"#d7531e",fontSize:"18px",fontWeight:"900",textTransform:"uppercase"},height:38,justify:"center",width:1,children:t.name}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(ka,{css:{fontSize:"16px",fontWeight:"900"},children:"Date de ta mission :"}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(rd,{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)(ka,{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)(md,{height:"6"}),(0,i.jsx)(ka,{css:{fontSize:"16px",fontWeight:"900"},children:"Détails de ta mission :"}),(0,i.jsx)(md,{height:"2"}),g(t.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(ka,{css:{color:"black","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(jf,{text:t.description})})}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{css:{fontSize:"16px",fontWeight:"900"},children:"Lieu de rendez-vous :"}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ka,{children:t.address}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ka,{height:180,width:1,children:(0,i.jsx)("a",{href:Cf(t.latitude,t.longitude),style:{background:`url(${F.HEAVENT_API_URL}/image/event/${e.eventId}/position/${t.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),g(t.fields.cf38416)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(ka,{children:t.fields.cf38416})]})]})]})},c_=e=>{const t=If(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,null).filter(({position:e})=>e.tags.some(e=>"Fiche personnalisée"===e.name)),n=(0,cm.A)(Object.entries((0,Vu.A)(t,({position:e})=>e.id)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:n.map(([t,n],o)=>(0,i.jsx)(d_,{eventId:e.event.id,psuis:n,userInfo:e.event.volunteerRegistration.userInfo},o))})},u_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo;return(0,i.jsxs)(rd,{css:{background:`url(${o=e.event.id,4183===o?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/accreditation_vip.jpg`:3694===o?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/intervenant.jpg`:""}) no-repeat`,backgroundSize:"cover",fontFamily:"$avenir",position:"relative"},height:tf,width:nf,children:[(0,i.jsxs)(rd,{css:{fontSize:"24px",fontWeight:"900",left:"80px",lineHeight:"28px",position:"absolute",top:"261px"},direction:"column",children:[(0,i.jsx)(ka,{children:n.fields?.firstName?.value||""}),(0,i.jsx)(ka,{children:n.fields?.lastName?.value||""})]}),(0,i.jsxs)(ka,{css:{color:"#d8541d",fontSize:"20px",fontWeight:"800",left:"80px",position:"absolute",top:"325px"},children:[(0,i.jsxs)(Jp,{css:{color:"black",fontWeight:"400"},children:[4183===e.event.id?"VIP":"Intervenant"," |"]})," ",n.fields.cf21104?.value]}),(0,i.jsx)(ka,{css:{position:"absolute",right:"80px",top:"261px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:mf(t.ticketId,{height:90,width:90}),width:"100%"})})]});var o},m_=e=>3376===e?`${F.HEAVENT_ASSETS_URL}/badges/playground/fiche_reims_v2.jpg`:3827===e?`${F.HEAVENT_ASSETS_URL}/badges/playground/fiche_corrida.jpg`:3823===e?`${F.HEAVENT_ASSETS_URL}/badges/playground/fiche_semi_boulogne.jpg`:3808===e?`${F.HEAVENT_ASSETS_URL}/badges/playground/fiche_toulouse.jpg`:5233===e?`${F.HEAVENT_ASSETS_URL}/badges/playground/fiche_unicef.jpg`:5158===e?`${F.HEAVENT_ASSETS_URL}/badges/playground/fiche_marseille.jpg`:5644===e||5341===e?`${F.HEAVENT_ASSETS_URL}/badges/playground/fiche_montpellier.jpg`:`${F.HEAVENT_ASSETS_URL}/badges/playground/fiche_gcsd_v3.jpg`,h_=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"},g_=e=>3827===e||5233===e?{top:"859px"}:5158===e?{top:"746px"}:5644===e||5341===e?{top:"744px"}:{top:"915px"},p_=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)(rd,{css:{background:`url(${m_(e.eventId)}) no-repeat`,backgroundSize:"cover",color:"#333333",position:"relative"},direction:"column",height:tf,width:nf,children:[(0,i.jsx)(ka,{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)(rd,{css:{left:"210px",padding:"$7 $8 0 $8",position:"absolute",top:"170px"},direction:"column",width:584,children:[(0,i.jsx)(ka,{css:h_(e.eventId),textAlign:"center",width:1,children:n.name}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(ka,{css:a,children:"Détails de la mission :"}),(0,i.jsx)(md,{height:"2"}),g(n.description)&&(0,i.jsx)(ka,{css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(jf,{text:n.description})}),ug(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{css:a,children:"Lieu de mission :"}),dg(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ka,{children:n.address})]}),cg(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ka,{height:180,width:1,children:(0,i.jsx)("a",{href:Cf(n.latitude,n.longitude),style:{background:`url(${F.HEAVENT_API_URL}/image/event/${e.eventId}/position/${n.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})})]})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{css:a,children:"À cette heure ci :"}),(0,i.jsx)(md,{height:"2"}),(0,i.jsxs)(rd,{css:{gap:"22px"},width:1,children:[(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{css:{fontWeight:"700"},children:o.range.start.toFormat("dd MMMM yyyy",{locale:"fr"})}),(0,i.jsxs)(ka,{children:["De ",o.range.start.toFormat("H'h'mm")," à"," ",o.range.end.toFormat("H'h'mm")]})]}),s&&(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{css:{fontWeight:"700"},children:"Mon contact d'urgence"}),(0,i.jsxs)(ka,{children:[s.userInfo.firstName," :"," ",s.userInfo.phone?.internationalFormat]}),r&&(0,i.jsxs)(ka,{children:[r.userInfo.firstName," :"," ",r.userInfo.phone?.internationalFormat]})]})]}),(0,i.jsx)(md,{height:"6"}),g(n.fields.cf38780)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{css:a,children:"Transports"}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ka,{dangerouslySetInnerHTML:{__html:n.fields.cf38780.split("\n").join(" ")}})]})]}),(0,i.jsx)(ka,{css:{left:"53px",position:"absolute",...g_(e.eventId)},height:104,width:104,children:(0,i.jsx)("img",{height:"100%",src:mf(e.vr.ticketId,{height:104,width:104}),width:"100%"})})]})},f_=e=>{const t=(0,V.useMemo)(()=>(0,cm.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)(p_,{eventId:e.event.id,positionSlotUserInfo:t,vr:e.event.volunteerRegistration},t.positionSlot.id))})},__="#e30613",x_="#26306b",I_={cf25078:"Parcours",cf25079:"Plan village",cf25080:"Poste vélo",cf25511:"Poste course à pied",cf25512:"Plan d'accès"},v_=Object.keys(I_),b_=e=>{const t=Ei(Cm),n=e.positionSlotUserInfo.position,o=n.category,s=e.positionSlotUserInfo.positionSlot,r=o.leaders[0],a=v_.some(e=>g(n.fields[e]?.url)),l=a||"Restauration athlètes"===o.name||"Ravitaillement"===o.name||"Retrait des dossards"===o.name;return(0,i.jsxs)(rd,{css:{background:"white",fontFamily:"$roboto"},direction:"column",height:tf,width:nf,children:[(0,i.jsxs)(rd,{height:185,width:1,children:[(0,i.jsx)(rd,{height:1,width:185,children:g(e.options.logo?.content)&&(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"100%"})}),(0,i.jsx)(rd,{css:{padding:"$4 $7"},width:609,children:(0,i.jsxs)(rd,{direction:"column",justify:"between",width:1,children:[(0,i.jsxs)(rd,{justify:"between",width:1,children:[(0,i.jsxs)(rd,{direction:"column",width:1,children:[(0,i.jsx)(ka,{css:{color:__,fontSize:"34px",fontWeight:"700",lineHeight:"40px"},children:g(n.acronym)?n.acronym:n.name}),(0,i.jsxs)(ka,{css:{color:__,ellipsis:!0,fontSize:"18px",fontWeight:"700"},children:["POSTE / ",o.name]})]}),l&&(0,i.jsxs)(rd,{direction:"column",width:1,children:[(0,i.jsx)(ka,{css:{color:__,fontSize:"18px",fontWeight:"700",textAlign:"right"},children:"Adresse"}),(0,i.jsx)(ka,{css:{color:x_,fontSize:"16px",fontWeight:"500",textAlign:"right"},children:n.address})]})]}),l&&(0,i.jsxs)(rd,{justify:"between",width:1,children:[(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{css:{color:x_,fontSize:"18px",fontWeight:"700"},children:"Point GPS"}),(0,i.jsxs)(ka,{css:{color:__,fontSize:"16px",fontWeight:"500"},children:[n.latitude,", ",n.longitude]})]}),(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{css:{color:x_,fontSize:"18px",fontWeight:"700",textAlign:"right"},children:"Horaires de mission"}),(0,i.jsxs)(ka,{css:{color:__,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)(rd,{width:1,children:(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{css:{color:__,fontSize:"18px",fontWeight:"700"},children:"Adresse"}),(0,i.jsx)(ka,{css:{color:x_,fontSize:"16px",fontWeight:"500"},children:n.address})]})})]})})]}),(0,i.jsx)(ka,{css:{background:__},height:10,width:1}),(0,i.jsxs)(rd,{css:{flex:"1",padding:"$6 $7"},direction:"column",gap:"1",width:1,children:[(0,i.jsx)(ka,{css:{color:__,fontSize:"20px",fontWeight:"700"},children:"VOTRE MISSION"}),(0,i.jsx)(ka,{css:{color:x_,fontSize:"16px",fontWeight:"500","& .h-rich-text > p":{margin:0}},children:(0,i.jsx)(jf,{text:n.description})})]}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{css:{background:__},height:10,width:1}),(0,i.jsx)(rd,{css:{padding:"$5 $7"},gap:"5",height:335,width:1,children:v_.map(e=>{if(g(n.fields[e]?.url)){const t=I_[e];return(0,i.jsxs)(rd,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(ka,{css:{color:__,fontSize:"20px",fontWeight:"700"},children:t}),(0,i.jsx)(ka,{height:255,width:1,children:(0,i.jsx)("img",{height:"100%",src:n.fields[e].url,width:"100%"})})]},e)}return null})})]}),(0,i.jsx)(rd,{align:"center",css:{background:__,color:"white",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},height:40,justify:"center",width:1,children:"Vous rencontrez un problème ?"}),(0,i.jsxs)(rd,{css:{padding:"$4"},direction:"column",height:88,width:1,children:[(0,i.jsx)(ka,{css:{color:x_,fontSize:"20px",fontWeight:"500",textAlign:"center"},width:1,children:"Contactez votre responsable de secteur"}),r&&(0,i.jsxs)(ka,{css:{color:x_,fontSize:"20px",fontWeight:"700",textAlign:"center"},width:1,children:[r.userInfo.name," : ",r.userInfo.phone?.internationalFormat]})]}),(0,i.jsx)(rd,{align:"center",css:{background:x_,color:"white",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},height:40,justify:"center",width:1,children:"Merci"})]})},j_=e=>(0,i.jsx)(i.Fragment,{children:e.event.volunteerRegistration.positionsSlotsUsersInfos.map((t,n)=>(0,i.jsx)(b_,{options:e.options,positionSlotUserInfo:t,userInfo:e.event.volunteerRegistration.userInfo},n))});function C_(e,t,n,o){switch(e){case Se.Animajeconvention:return(0,i.jsx)(ff,{event:t});case Se.Asoassignment:return(0,i.jsx)(Tf,{date:o,event:t,options:n});case Se.Hbcldc:return(0,i.jsx)(zf,{event:t});case Se.Hbclnh:return(0,i.jsx)(Ff,{event:t});case Se.P2nassignment:return(0,i.jsx)(t_,{event:t});case Se.P2nassignmentmontagedemontage:return(0,i.jsx)(i_,{event:t});case Se.Paris20km:return(0,i.jsx)(l_,{event:t});case Se.Paris20kmassignment:return(0,i.jsx)(c_,{date:o,event:t});case Se.Paris20kmcontremarque:return(0,i.jsx)(u_,{event:t});case Se.Playground:return(0,i.jsx)(f_,{event:t});case Se.T24assignment:return(0,i.jsx)(j_,{event:t,options:n});default:return vd()}}function y_(e){switch(e){case Se.Animajeconvention:return"Animaje Convention";case Se.Asoassignment:return"Fiche d'affectation ASO";case Se.Hbcldc:return"Badge HBC Ligue des Champions";case Se.Hbclnh:return"Badge HBC LNH";case Se.P2nassignment:return"Fiche d'affectation P2N (Exploit)";case Se.P2nassignmentmontagedemontage:return"Fiche d'affectation P2N (Montage/Démontage)";case Se.Paris20km:return"Badge 20km de Paris";case Se.Paris20kmassignment:return"Fiche d'affectation 20km de Paris";case Se.Paris20kmcontremarque:return"Contremarque 20km de Paris";case Se.Playground:return"Fiche d'affectation Playground";case Se.T24assignment:return"Fiche d'affectation T24";default:return vd()}}function A_(e){return"number"==typeof e?.latitude&&"number"==typeof e?.longitude?{lat:e.latitude,lng:e.longitude}:void 0}function S_(e,t,n){const i=zs.DateOnly.MonthLong;return t.equals(n)?e.toLocaleString(t,i):[e.toLocaleString(t,zs.DateOnly.MonthShort),e.toLocaleString(n,zs.DateOnly.MonthShort)].join(" - ")}function k_(e){switch(e){case oe.Archived:case oe.Done:return"error";case oe.Ongoing:return"success";case oe.Upcoming:return"purple";default:return vd()}}function w_(e,t){const n=As.c9.now().setZone("utc",{keepLocalTime:!0}).startOf("day");return As.IX.fromDateTimes(e.startOf("day"),t.endOf("day")).contains(n)?n:e}const E_=e=>{const{translate:t}=bd(),{mutate:n}=function(e={}){return Di("mutation BackofficeEventUnarchive($eventId: EventId!) {\n backofficeEventUnarchive(eventId: $eventId)\n}\n",e)}();return(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{width:100,children:e.event.id}),(0,i.jsx)(Qu,{children:(0,i.jsx)(bm,{to:So.EVENT({organizationId:e.organizationId,eventId:e.event.id}),children:e.event.name})}),(0,i.jsx)(Qu,{children:(0,i.jsx)(vu,{color:k_(e.event.state),children:t(e.event.state)})}),(0,i.jsx)(Qu,{children:e.event.state===oe.Archived&&(0,i.jsx)(kd,{color:"invisible",onClick:async()=>{await n({eventId:e.event.id}),e.reload()},children:t("d_sarchiver_76082")})})]})},T_=As.c9.fromObject({year:2016}),R_=e=>{const{history:t,translate:n}=bd(),o=um(),s=Ei(Zp),r=Ei(ld),{mutate:a}=function(e={}){return Di("mutation BackofficeOrganizationUpdate(\n $id: OrganizationId!\n $organization: BackofficeOrganizationInput!\n) {\n backofficeOrganizationUpdate(id: $id, organization: $organization) {\n id\n }\n}\n",e)}(),[l,d,c]=gm(""),[u,m]=(0,V.useState)([]),[h,p]=(0,V.useState)({direction:re.Asc,attribute:se.Name}),[f,_]=(0,V.useState)(0),{data:x,isLoading:I,reload:v}=Oi("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:g(d)?d:void 0,states:Bs(u)?u:void 0,sort:h,offset:f},[]);const{numberOfPages:b,totalCount:j}=ah(x.backoffice?.events),C=(0,V.useMemo)(()=>(0,Xh.A)(F.ADMINS.concat(e.organization.users).map(e=>({id:e.id,name:e.email})),({id:e})=>e),[e.organization]),y=(0,V.useMemo)(()=>(0,cm.A)(kn.map(e=>({value:e,name:y_(e)})),({name:e})=>e),[]),A=e=>{p(e),_(0)};return(0,i.jsx)(Vd,{height:1,hideDefaultErrors:!0,initialValues:{organization:s.organizationInputDefault(e.organization)},render:({form:t,handleSubmit:s,submitting:r})=>(0,i.jsx)(zp,{button:(0,i.jsx)(kd,{isLoading:r,textAlign:"center",onClick:s,children:n("mettre_jour_l_12499")}),category:"Backoffice",fallbackClosePath:fs.BACKOFFICE_ORGANIZATIONS,heading:n("mise_jour_de_17055",e.organization.name),children:(0,i.jsxs)(Op,{children:[(0,i.jsx)(Nd,{}),(0,i.jsx)($p,{children:(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ec,{label:n("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(Np,{label:n("date_de_fin_de_17750"),min:T_,name:"organization.periodEndAt"}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("fonctionnalit_s_47714"),multiple:!0,name:"organization.features",children:Pn.map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(Gp,{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)(md,{height:"4"}),(0,i.jsx)(Gp,{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)(md,{height:"4"}),(0,i.jsx)(ec,{label:n("id_de_l_organis_67465"),name:"organization.weezeventOrganizationId",rightIcon:"xmark",shouldParseAsInt:!0,onRightIconClick:()=>{t.change("organization.weezeventOrganizationId",null)}}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(Fp,{name:"organization.isBlocked",children:n("bloquer_l_organ_81103")})]})}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Wp,{heading:n("facturation_53594"),children:(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(Kp,{name:"organization.useOldBilling",children:n("utilise_l_ancie_40491")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(ec,{label:n("nombre_de_membr_16400"),name:"organization.membersLimit",shouldParseAsInt:!0}),(0,i.jsx)(Bp,{label:n("prix_par_membre_20633"),name:"organization.pricePerMember"})]}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{children:n("nombre_de_membr_20439",e.organization.membersStats.numberOfMembers)}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ka,{children:n("nombre_de_membr_54470",e.organization.membersStats2024.numberOfMembers)}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(Hp,{label:n("commentaire_sur_40207"),name:"organization.billingComment"})]})}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Wp,{heading:n("Event"),children:(0,i.jsx)(dm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{width:200,children:(0,i.jsx)(Uu,{isSelectAllVisible:!0,multiple:!0,placeholder:n("State"),values:u,onChange:e=>{m(e),_(0)},children:o($n)})}),(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:n("rechercher_un_40024"),value:l,onChange:e=>{c(e),_(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{width:100,children:"ID"}),(0,i.jsx)(fp,{attribute:se.Name,setSort:A,sort:h,children:n("nom_de_l_v_nem_08711")}),(0,i.jsx)(pm,{children:n("State")}),(0,i.jsx)(pm,{})]}),numberOfPages:b,offset:f,rows:I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):x.backoffice.events.nodes.map(t=>(0,i.jsx)(E_,{event:t,organizationId:e.organization.id,reload:v},t.id)),setOffset:_,title:n("liste_des_v_ne_29929"),totalCount:j})}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)($p,{children:(0,i.jsx)(kd,{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(fs.BACKOFFICE)}})},O_=()=>{const{organizationId:e}=zi(),{data:t,loader:n}=Oi(Ga,{organizationId:e},[js.OrganizationBackofficeFragment]);return n||(0,i.jsx)(R_,{organization:t.data.row})},D_=()=>(Zc(Ti()("back_office_83072")),(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{exact:!0,path:fs.BACKOFFICE_ORGANIZATIONS,children:(0,i.jsx)(Tp,{})}),(0,i.jsx)(Ea.qh,{exact:!0,path:fs.EDIT_BACKOFFICE_ORGANIZATION(":organizationId"),children:(0,i.jsx)(O_,{})}),(0,i.jsx)(Ea.qh,{exact:!0,path:fs.BACKOFFICE_INVOICES,children:(0,i.jsx)(Pm,{})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:fs.BACKOFFICE_ORGANIZATIONS,replace:!0})})]})),z_=xa(rd,{backgroundColor:"$blueGray900",".amicale-theme &, .volunteers-theme &":{backgroundColor:"white"},".mso-theme &":{backgroundColor:"$cyan"}}),$_=()=>(0,i.jsx)(pc,{}),P_=V.forwardRef((e,t)=>(0,i.jsxs)(z_,{ref:t,align:"stretch",css:{overflow:"auto",padding:"$6"},justify:"between",width:1,children:[(0,i.jsx)(ka,{width:100}),(0,i.jsxs)(rd,{align:"stretch",css:{height:"fit-content",py:"$2",width:"920px"},direction:"column",gap:"6",children:[(0,i.jsx)(rd,{css:{marginBottom:"$7","& svg":{height:"100%"}},height:32,justify:"center",children:(0,i.jsx)($_,{})}),e.children]}),(0,i.jsx)(rd,{justify:"end",width:100,children:(0,i.jsx)(kd,{color:"gray",leftIcon:"xmark",onClick:e.onClose})})]}));P_.displayName="OnboardingView";const M_=["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 F_(e){return"string"!=typeof e||""===e.trim()||u(e.toLowerCase())===e}const N_=["country","code","number"];let L_=class extends ic{countriesService;constructor(e,t){super(e),this.countriesService=t}basePhoneInputDefault(){return{country:"",code:"",number:""}}phoneInputDefault(e){return{...this.basePhoneInputDefault(),...e.phone}}phoneInputSchema(){return c.Ik().shape({country:c.Yj().required(this.t("le_num_ro_de_t_76885")).oneOf(this.countriesService.countriesCodes,this.t("le_num_ro_de_t_76885")),code:c.Yj().required(this.t("le_num_ro_de_t_76885")).oneOf(this.countriesService.phoneCodes,this.t("le_num_ro_de_t_76885")),number:c.Yj().required(this.t("le_num_ro_de_t_76885"))})}phoneInputSchemaNotRequired(){return c.Ik().nullable().shape({country:c.Yj(),code:c.Yj(),number:c.Yj()})}};L_=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si,Mm])],L_);let B_=class extends ic{countriesService;phoneInputService;constructor(e,t,n){super(n),this.countriesService=e,this.phoneInputService=t}organizationInputDefault(e){const t=this.countriesService.getDefaultCountryValues();return{name:"",adminFirstName:"",adminLastName:"",adminPhone:this.phoneInputService.phoneInputDefault(t),weezeventOrganizationId:e}}organizationInputSchema(e){let t=c.Ik().shape({name:c.Yj().required(this.t("le_nom_de_l_org_60618")),adminFirstName:c.Yj().required(this.t("le_pr_nom_est_r_10935")),adminLastName:c.Yj().required(this.t("le_nom_est_requ_61536")),adminPhone:this.phoneInputService.phoneInputSchema()});return e||(t=t.shape({termsAccepted:c.zM().oneOf([!0],this.t("il_est_n_cessai_83896")).required(this.t("il_est_n_cessai_83896"))})),t}createOrganizationSchema(e){return c.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??As.c9.local().zoneName,emailSenderId:e.emailSenderId,dateFormat:e.dateFormat,datetimeFormat:e.datetimeFormat,timeFormat:e.timeFormat}}organizationInfosInputSchema(){return c.Ik().shape({name:c.Yj().required(this.t("le_nom_de_l_org_60618")),adminName:c.Yj().required(this.t("le_nom_du_respo_43823")),adminEmail:c.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 F_(this.parent.adminEmail)}),street:c.Yj().required(this.t("l_adresse_est_r_40489")),postalCode:c.Yj().required(this.t("le_code_postal_43189")),city:c.Yj().required(this.t("la_ville_est_re_35239")),country:c.Yj().oneOf(this.countriesService.countriesCodes).required(this.t("le_pays_est_req_33749")),emailSenderId:c.ai().nullable(),dateFormat:c.Yj().required(this.t("le_format_est_r_17097")),datetimeFormat:c.Yj().required(this.t("le_format_est_r_17097")),timeFormat:c.Yj().required(this.t("le_format_est_r_17097"))})}updateOrganizationGeneralSchema(){return c.Ik().shape({organization:this.organizationInfosInputSchema()})}};B_=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mm,L_,Si])],B_);let V_=class extends nc{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??As.c9.invalid("Invalid"),endAt:e?.endAt??As.c9.invalid("Invalid"),languages:e?.languages??[t.user.language],timeZone:e?.timeZone??As.c9.local().zoneName??"utc",country:e?.country??t.user.country,layer:e?.layer??de.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,useAccreditations:e?.useAccreditations??!0,useCampaigns:e?.useCampaigns??!0,useDelegations:e?.useDelegations??!0,useDocuments:e?.useDocuments??!0,useForms:e?.useForms??!0,usePositions:e?.usePositions??!0,useWorkflows:e?.useWorkflows??!0,delegationsSpaceLayoutId:e?.delegationsSpaceLayoutId??null,groupsAccesses:(e?.groupsAccesses??[]).map(({groupId:e,roleId:t})=>({groupId:e,roleId:t}))}}eventGroupAccessDefault(){return{groupId:null,roleId:null}}eventInputSchema(){return c.Ik().shape({name:c.Yj().required(this.t("nom_de_l_v_nem_58512")),description:c.Yj(),startAt:Yp.required(this.t("la_date_d_but_d_30022")).typeError(this.t("la_date_d_but_d_30022")),endAt:Yp.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 As.c9.isDateTime(this.parent.startAt)&&this.parent.startAt.isValid&&As.c9.isDateTime(this.parent.endAt)&&this.parent.endAt.isValid&&this.parent.endAt>=this.parent.startAt}),languages:c.YO().of(c.Yj().oneOf(Rc,this.t("les_langues_doi_27712"))).required(this.t("les_langues_son_53717")).min(1,this.t("vous_devez_s_le_16610")),timeZone:c.Yj().required(this.t("le_fuseau_horai_37109")).oneOf(M_,this.t("le_fuseau_horai_37109")),latitude:c.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:c.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:c.ai().nullable(),dayStartTime:c.Yj().required(this.t("l_heure_laque_87748")),isWeezeventSynchronized:c.zM().required(),usePositions:c.zM().required(),useAccreditations:c.zM().required(),useDelegations:c.zM().required(),useForms:c.zM().required(),useDocuments:c.zM().required(),useWorkflows:c.zM().required(),groupsAccesses:c.YO().of(c.Ik().shape({groupId:c.ai().nullable().required(this.t("vous_devez_s_le_78671")),roleId:c.ai().nullable().required(this.t("vous_devez_s_le_18837"))}))})}eventOrganizationInputSchema(e){return c.Ik().shape({event:this.eventInputSchema(),organization:this.organizationInputService.organizationInputSchema(e)})}createUpdateEventSchema(e){const t=this.eventInputSchema();return c.Ik().shape({event:e?t.shape({fields:e}):t})}};V_=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mm,B_,Si])],V_);const U_=e=>{if(0===e.names.length)return e.render(e.fields);{const[t,...n]=e.names;return(0,i.jsx)(cd.D0,{name:t,render:o=>(0,i.jsx)(U_,{fields:{...e.fields||{},[t]:o},names:n,render:e.render,subscription:e.subscription}),subscription:e.subscription})}},W_=({value:e,onChange:t,css:n,label:o,state:s,description:r,hint:a,...l})=>{const d=Ti(),c=(0,V.useCallback)(e=>{e&&p(e.getBoundingClientRect().width)},[]),m=(0,V.useCallback)(e=>e?.focus({preventScroll:!0}),[]),[h,p]=(0,V.useState)(200),[f,_]=(0,V.useState)(!1),[x,I]=(0,V.useState)(""),v=Ei(Mm),b=(0,V.useMemo)(()=>(0,cm.A)(v.countries.flatMap(e=>Ls(e.phoneCode).map(t=>({...e,phoneCode:t}))),({name:e})=>u(e)),[]),j=(0,V.useMemo)(()=>b.find(({code:t,phoneCode:n})=>t===e.country&&n===e.code),[e.country,e.code]),C=(0,V.useMemo)(()=>b.filter(e=>!g(x)||e.name.toLowerCase().includes(x.trim().toLowerCase())||e.phoneCode.includes(x.trim())),[b,x]),y=(0,V.useMemo)(()=>C.map((n,o)=>(0,i.jsx)(su,{onClick:()=>{t({...e,country:n.code,code:n.phoneCode}),I(""),_(!1)},children:(0,i.jsxs)(rd,{gap:"2",width:1,children:[(0,i.jsx)(ka,{children:n.emoji}),(0,i.jsx)(ka,{css:{ellipsis:!0},children:n.name}),(0,i.jsx)(ka,{color:"gray500",children:n.phoneCode})]})},o)),[C,e,t]),{inputId:A,descId:S,errorId:k}=Hd();return(0,i.jsxs)(rd,{ref:c,css:n,direction:"column",width:1,children:[(0,i.jsx)(Zd,{htmlFor:A,children:o}),(0,i.jsx)(Kd,{id:S,children:r}),(o||r)&&(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{children:[(0,i.jsxs)(nu,{disabled:"disabled"===s,isOpen:f,onStateChange:e=>_(e),children:[(0,i.jsx)(du,{children:(0,i.jsx)(Jd,{css:{borderRight:"none",borderBottomRightRadius:"0",borderTopRightRadius:"0",userSelect:"none",width:"100px","& .styled-input-container-circle-exclamation":{display:"none"},cursor:"disabled"===s?"not-allowed !important":void 0},cursor:"pointer",rightIcon:f?"chevron-up":"chevron-down",state:s,children:j&&(0,i.jsxs)(ka,{width:1,children:[j.emoji," ",j.phoneCode]})})}),(0,i.jsx)(lu,{placement:"bottom-start",renderOnPortal:!0,width:h,children:(0,i.jsxs)(rd,{direction:"column",height:Math.min(201,40*C.length+41),width:1,children:[(0,i.jsx)(ka,{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":d("indicatif_t_l_p_02025"),placeholder:d("rechercher_un_p_04678"),type:"text",value:x,onChange:e=>{I(e.target.value)}})}),(0,i.jsx)(Oh,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(rd,{css:{height:"calc(100% - 41px)",overflowY:"auto"},direction:"column",children:y})]})})]}),(0,i.jsx)(Jd,{css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0",flex:"1"},cursor:"text",state:s,children:(0,i.jsx)(ka,{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?S:void 0,"aria-errormessage":"error"===s?k:void 0,"aria-invalid":"error"===s,autoComplete:"tel-national",disabled:"disabled"===s,id:A,type:"tel",value:e.number,onChange:n=>{t({...e,number:n.target.value})},...l})})})]}),(0,i.jsx)(Yd,{id:k,state:s,children:a})]})},G_=(0,V.memo)(function({prefix:e,hint:t,state:n,...o}){const{isDisabled:s}=Mp(),r=`${e}country`,a=`${e}code`,l=`${e}number`;return(0,i.jsx)(U_,{names:[r,a,l],render:e=>{const d=Wd(e[a].meta)||Wd(e[l].meta);return(0,i.jsx)(W_,{hint:d?e[a].meta.error||e[l].meta.error:t,state:d?"error":s?"disabled":n,value:{country:e[r].input.value,code:e[a].input.value,number:e[l].input.value},onChange:t=>{e[r].input.onChange(t.country),e[a].input.onChange(t.code),e[l].input.onChange(t.number)},...o})}})}),q_=(0,V.memo)(function(){const e=Ti();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ec,{label:e("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(md,{height:"4"}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(ec,{label:e("pr_nom_66988"),name:"organization.adminFirstName"}),(0,i.jsx)(ec,{label:e("last_name"),name:"organization.adminLastName"})]}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(G_,{label:e("Phone"),prefix:"organization.adminPhone."})]})}),H_=()=>{const e=Ti(),{user:t}=Li();return(0,i.jsx)(Fp,{name:"organization.termsAccepted",children:(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e("en_cr_ant_votre_88363",Mc(zc(t?.language,new URL(location.href).searchParams)),$c)}})})},K_=e=>{const t=Ti(),n=As.c9.utc(),{event:o}=e.values;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba.Yr,{name:"event.startAt",children:t=>{t.isValid&&!1===e.form.getFieldState("event.endAt").touched&&e.form.change("event.endAt",t)}}),(0,i.jsx)(ec,{label:t("nom_de_l_v_nem_08711"),name:"event.name"}),(0,i.jsx)(md,{height:"4"}),(0,i.jsxs)(rd,{gap:"6",children:[(0,i.jsx)(Np,{label:t("date_de_d_but_43380"),min:n,name:"event.startAt"}),(0,i.jsx)(Np,{label:t("date_de_fin_86920"),min:o.startAt&&o.startAt.isValid?o.startAt:n,name:"event.endAt"})]})]})},Y_=()=>{const{translate:e,params:{weezeventOrganizationId:t}}=bd(),n=Ei(V_),o=Ei(B_),s=Ei(ld),{mutate:r}=function(e={}){return Di("mutation EventOrganizationCreate($eventOrganization: EventOrganizationInput!) {\n eventOrganizationCreate(eventOrganization: $eventOrganization) {\n id\n organizationId\n }\n}\n",e)}({redirectOnSuccess:!0}),a=$i(),l=(0,V.useRef)(null),d=!!Li().user?.termsAcceptedAt;return(0,i.jsx)(Vd,{customErrorRef:l,height:1,initialValues:{event:n.eventInputDefault(),organization:o.organizationInputDefault(t)},render:({form:t,values:n,handleSubmit:o})=>(0,i.jsxs)(P_,{ref:l,onClose:Q,children:[(0,i.jsx)(Nd,{}),(0,i.jsx)(Wp,{centerHeader:!0,heading:e("dites_en_nous_u_13238"),subtitle:e("param_trer_votr_94121"),children:(0,i.jsx)(K_,{form:t,values:n})}),(0,i.jsx)(Wp,{heading:e("_propos_de_vot_88855"),subtitle:e("ajouter_le_nom_69919"),children:(0,i.jsx)(q_,{})}),(0,i.jsx)($p,{children:(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[!d&&(0,i.jsx)(H_,{}),(0,i.jsx)(kd,{textAlign:"center",onClick:o,children:e("cr_er_l_v_neme_16731")})]})})]}),validate:s.validateForForm(n.eventOrganizationInputSchema(d)),width:1,onSubmit:async e=>{const{eventOrganizationCreate:{id:t,organizationId:n}}=await r({eventOrganization:e});a.push(So.EVENT({organizationId:n,eventId:t}))}})},Z_=()=>{const{data:e,loader:t}=Oi("query HomeOrganizations {\n user {\n roles {\n organizationId\n }\n }\n}\n",{},[]),n=$i();return(0,i.jsx)(Wc,{loader:t,onLoad:()=>{const t=e.user?.roles?.[0]?.organizationId;t?n.replace(So.EVENTS({organizationId:t})):n.replace(fs.CREATE_EVENT_WITH_ORGANIZATION())}})},X_=()=>{const{translate:e,history:t}=bd(),n=Ei(B_),o=Ei(ld),{mutate:s}=function(e={}){return Di("mutation OrganizationCreate($organization: OrganizationInput!) {\n organizationCreate(organization: $organization) {\n id\n }\n}\n",e)}({redirectOnSuccess:!0}),r=(0,V.useRef)(null),{user:a}=Li(),l=!!a?.termsAcceptedAt;return(0,i.jsx)(Vd,{customErrorRef:r,height:1,hideDefaultErrors:!0,initialValues:{organization:n.organizationInputDefault()},render:({handleSubmit:n})=>(0,i.jsxs)(P_,{ref:r,onClose:()=>t.goBack(fs.BACKOFFICE),children:[(0,i.jsx)(Nd,{}),(0,i.jsx)(Wp,{centerHeader:!0,heading:e("_propos_de_vot_88855"),subtitle:e("ajouter_le_nom_69919"),children:(0,i.jsx)(q_,{})}),(0,i.jsx)($p,{children:(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[!l&&(0,i.jsx)(H_,{}),(0,i.jsx)(kd,{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(io.ORGANIZATION({organizationId:n}))}})},J_={PLURAL:"custom-fields",SINGLE:"custom-field"},Q_="usage",ex=e=>Ui([J_.SINGLE,e]),tx={CUSTOM_FIELDS:({eventId:e,...t})=>Ui([e?So.EVENT({...t,eventId:e}):io.ORGANIZATION(t),J_.PLURAL]),CUSTOM_FIELDS_SEGMENT:({segmentId:e,...t})=>Ui([tx.CUSTOM_FIELDS(t),e]),CUSTOM_FIELD:({customFieldId:e,eventId:t,...n})=>Ui([t?So.EVENT({...n,eventId:t}):io.ORGANIZATION(n),ex(e)]),CUSTOM_FIELD_USAGE:({customFieldId:e,...t})=>Ui([tx.CUSTOM_FIELDS_SEGMENT(t),Q_,e]),CREATE:e=>Yi(tx.CUSTOM_FIELDS(e)),UPDATE:e=>Zi(tx.CUSTOM_FIELD(e))},nx={PLURAL:"members",SINGLE:"member"},ix={PLURAL:"profiles",SINGLE:"profile"},ox="accreditations",sx="actions",rx="availabilities",ax="campaigns",lx="comments",dx="documents",cx="events",ux="form",mx="forms",hx="history",gx="informations",px="messages",fx="positions",_x="scans",xx="segments",Ix=e=>Ui([nx.SINGLE,e]),vx=e=>Ui([ix.SINGLE,e]),bx={USER_PROFILE:({userInfoId:e,...t})=>Ui([io.ORGANIZATION(t),vx(e)]),USER_PROFILES:e=>Ui([io.ORGANIZATION(e),ix.PLURAL]),ORGANIZATION_MEMBERS:e=>Ui([io.ORGANIZATION(e),nx.PLURAL]),MEMBERS:e=>Ui(["delegationId"in e?qo.DELEGATION(e):"eventId"in e&&e.eventId?So.EVENT(e):ro.COMMUNITY(e),nx.PLURAL]),MEMBER:({userInfoId:e,...t})=>Ui(["eventId"in t&&t.eventId?So.EVENT(t):ro.COMMUNITY(t),Ix(e)]),MEMBER_INFORMATION:e=>Ui([bx.MEMBER(e),gx]),MEMBER_ACTIONS:e=>Ui([bx.MEMBER(e),sx]),MEMBER_AVAILABILITIES:e=>Ui([bx.MEMBER(e),rx]),MEMBER_COMMENTS:e=>Ui([bx.MEMBER(e),lx]),MEMBER_HISTORY:e=>Ui([bx.MEMBER(e),hx]),MEMBER_HISTORY_CAMPAIGNS:e=>Ui([bx.MEMBER(e),hx,ax]),MEMBER_HISTORY_EVENTS:e=>Ui([bx.MEMBER(e),hx,cx]),MEMBER_HISTORY_FORMS:e=>Ui([bx.MEMBER(e),hx,mx]),MEMBER_HISTORY_SCANS:e=>Ui([bx.MEMBER(e),hx,_x]),MEMBER_HISTORY_SEGMENTS:e=>Ui([bx.MEMBER(e),hx,xx]),MEMBER_POSITIONS:e=>Ui([bx.MEMBER(e),fx]),MEMBER_ACCREDITATIONS:e=>Ui([bx.MEMBER(e),ox]),MEMBER_FORMS:e=>Ui([bx.MEMBER(e),mx]),MEMBER_FORM:e=>Ui([bx.MEMBER(e),ux,e.formId]),MEMBER_FORM_EDIT:e=>Zi(bx.MEMBER_FORM(e)),MEMBER_MESSAGES:e=>Ui([bx.MEMBER(e),px]),MEMBER_DOCUMENTS:e=>Ui([bx.MEMBER(e),dx]),CREATE:e=>Yi(bx.MEMBERS(e))};var jx,Cx;function yx(){return yx=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=Ti();return(0,i.jsxs)(rd,{align:"center",direction:"column",children:[(0,i.jsx)(rd,{align:"center",css:{background:"$primary500",borderRadius:"48px",fontSize:"$textXl",color:"white",height:"48px",width:"48px"},justify:"center",children:(0,i.jsx)(Id,{icon:e.icon})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textMd",children:e.title||t("la_fonctionnali_59786")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:e.subtitle||t("si_vous_voulez_24448")}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(kd,{to:`mailto:${F.EMAIL_FROM}`,children:t("contacter_l_qu_16617")})]})},wx={PLURAL:"campaigns",SINGLE:"campaign"},Ex={CAMPAIGNS:wx.PLURAL,CAMPAIGN:e=>Ui([wx.SINGLE,e])},Tx={CAMPAIGNS:({organizationId:e,eventId:t})=>Ui([t?So.EVENT({organizationId:e,eventId:t}):ro.COMMUNITY({organizationId:e}),Ex.CAMPAIGNS]),CAMPAIGNS_SEGMENT:({organizationId:e,segmentId:t})=>Ui([Tx.CAMPAIGNS({organizationId:e}),t]),CAMPAIGN:({organizationId:e,eventId:t,campaignId:n})=>Ui([t?So.EVENT({organizationId:e,eventId:t}):ro.COMMUNITY({organizationId:e}),Ex.CAMPAIGN(n)]),CAMPAIGN_DASHBOARD:e=>Ui([Tx.CAMPAIGN(e),Hi.DASHBOARD]),CAMPAIGN_PREVIEW:({userInfoId:e,...t})=>Ui([Tx.CAMPAIGN(t),Hi.PREVIEW,e]),CREATE(e){const t=Yi(Tx.CAMPAIGNS(e));return e.options?`${t}/${e.options}`:t},CREATE_TEMPLATE:e=>Ui([Yi(Tx.CAMPAIGNS(e)),"template"]),UPDATE:e=>Zi(Tx.CAMPAIGN(e))},Rx={PLURAL:"workflows",SINGLE:"workflow"},Ox=e=>Ui([Rx.SINGLE,e]),Dx={WORKFLOWS:({eventId:e,...t})=>Ui([e?So.EVENT({...t,eventId:e}):ro.COMMUNITY(t),Rx.PLURAL]),WORKFLOWS_SEGMENT:({segmentId:e,...t})=>Ui([Dx.WORKFLOWS(t),e]),WORKFLOW:({workflowId:e,eventId:t,...n})=>Ui([t?So.EVENT({...n,eventId:t}):ro.COMMUNITY(n),Ox(e)]),CREATE:e=>Yi(Dx.WORKFLOWS(e)),UPDATE:e=>Zi(Dx.WORKFLOW(e))},zx=e=>{const t=(0,V.useRef)(null);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("details",{ref:t,open:e.showSection,onToggle:t=>e.setShowSection(t.currentTarget.open),children:[(0,i.jsx)("summary",{style:{cursor:"pointer"},children:(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(Ym,{tabIndex:-1,value:e.showSection,onChange:hc.A}),(0,i.jsx)(Od,{css:{fontWeight:"$medium"},children:e.toggle})]})}),(0,i.jsx)(rd,{css:{marginBlockStart:"$5",borderBlockStart:"1px solid $gray200",paddingBlockStart:"$6","&:has(> .card)":{borderBlockStart:"unset",marginBlockStart:"$4",paddingBlockStart:"unset"}},direction:"column",gap:"3",children:e.children})]})})},$x=({css:e,disabled:t,hideHeading:n,isOpen:o,isOpenToggleLabel:s,...r})=>{const{descId:l}=Hd(),[d,c]=V.useState(o??!1);return"production"!==a.Production&&V.Children.toArray(r.children).filter(e=>["RadioText","Radio"].includes(e.type.name)).length>=2&&"radiogroup"!==r.role&&console.warn('This `` element contains multiple ` ` components, but does not have `role="radiogroup"` set; this may result in incorrect styling (i.e., too much vertical spacing).'),(0,i.jsx)(Pp.Provider,{value:{isDisabled:t},children:(0,i.jsxs)(rd,{"aria-describedby":l,as:"fieldset",className:"fieldset--column",css:{border:"unset",padding:"unset",margin:"unset",'&[role="radiogroup"]':{gap:"$2","& header":{borderBlockEnd:"unset",paddingBlockEnd:"unset","& > h2":{fontSize:"$textSm",color:"$gray700"},"& + div":{gap:"$3"}}},"&:disabled :is(input, select, textarea, datalist, button)":{cursor:"not-allowed !important"},...e},direction:"column",disabled:s?!d:void 0,gap:s?"5":"6",...r,children:[(0,i.jsx)(Vp,{heading:r.heading}),!n&&(0,i.jsxs)(rd,{as:id.Header,css:{paddingBlockEnd:s?void 0:"$5",borderBlockEnd:s?void 0:"1px solid $gray200"},direction:"column",gap:"1",children:[(0,i.jsxs)(rd,{gap:"1",children:[(0,i.jsx)(Dd,{"aria-hidden":"true",color:"gray800",textStyle:"heading",children:r.heading}),r.tooltip]}),r.subtitle&&(0,i.jsx)(Od,{id:l,textStyle:"subtitle",children:r.subtitle})]}),s?(0,i.jsx)(zx,{setShowSection:c,showSection:d,toggle:s,children:r.children}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(rd,{css:{gap:"$6",'&:not(role="radiogroup"):has(> fieldset.fieldset--column + fieldset.fieldset--column)':{gap:"$9"},"&:has(> fieldset.fieldset--row)":{gap:"unset"}},direction:"column",children:r.children})})]})})};var Px;!function(e){e.Assignments="Assignments",e.Badge="Badge",e.Certificate="Certificate",e.UserHours="UserHours",e.UserPlanning="UserPlanning",e.UserPlanningDays="UserPlanningDays",e.UserPlanningList="UserPlanningList"}(Px||(Px={}));const Mx=[Px.Assignments,Px.Badge,Px.Certificate,Px.UserHours,Px.UserPlanning,Px.UserPlanningDays,Px.UserPlanningList],Fx=5e9,Nx=2e7;function Lx(e){let t=e;try{t=new URL(e).pathname}catch{}if(g(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 Bx=["jpg","png","jpeg","gif"];var Vx,Ux;function Wx(e){return Ls(e).flatMap(e=>{switch(e){case Vx.Archives:return["zip"];case Vx.Csv:return["csv"];case Vx.Gpx:return["gpx"];case Vx.Images:return["jpg","png","jpeg","gif"];case Vx.Kml:return["kml"];case Vx.Pdf:return["pdf"];case Vx.SmallImages:return["jpg","png","jpeg"];case Vx.Videos:return["mp4","mov","webm","mkv"];default:return vd()}})}function Gx(e){return Math.min(...Ls(e).flatMap(e=>{switch(e){case Vx.Archives:return Fx;case Vx.Csv:return Nx;case Vx.Images:case Vx.Pdf:return 2e7;case Vx.Kml:case Vx.Gpx:return 1/0;case Vx.SmallImages:return 2e6;case Vx.Videos:return 5e7;default:return vd()}}))}function qx(e){return Ls(e).flatMap(e=>e===Vx.Images?"image/*":Wx(e).map(e=>`.${e}`)).join(",")}!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",e[e.SmallImages=6]="SmallImages",e[e.Videos=7]="Videos"}(Vx||(Vx={})),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"}(Ux||(Ux={}));const Hx=e=>{switch(e.toLowerCase()){case"csv":return Ux.Csv;case"xls":case"xlsx":return Ux.Excel;case"gif":return Ux.Gif;case"jpg":case"jpeg":return Ux.Jpeg;case"pdf":return Ux.Pdf;case"png":return Ux.Png;case"zip":return Ux.Zip;default:return Ux.Default}};async function Kx(e,t,n,i){const o=await X(),{awsS3PostCredentials:{endpointUrl:s,policy:r,amzCredential:a,amzSignature:l,amzDate:d}}=await function(e,t){return Js("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:u}=Lx(t.name),m=`organization/${e}/${W()}/${h(c)}.${u}`,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",Hx(u)),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?(Vi("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)})}const Yx=e=>{switch(e.split(".").at(-1)){case"csv":return Ec.FileCSV;case"jpeg":case"jpg":return Ec.FileJPG;case"pdf":return Ec.FilePDF;case"png":return Ec.FilePNG;case"zip":return Ec.FileZIP;default:return Ec.FileBlank}};function Zx(e,t){return`https://${t}.s3-eu-west-1.amazonaws.com/${e.key}`}function Xx(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 Jx(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 Qx=xa("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"}}}}),eI=xa("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 tI;!function(e){e[e.EmptyFile=0]="EmptyFile",e[e.Pdf=1]="Pdf",e[e.Image=2]="Image"}(tI||(tI={}));class nI extends V.Component{contentRef;renderPagesDebounced;constructor(e){super(e);let t=tI.Image;"string"!=typeof this.props.fileUrl||0===this.props.fileUrl.trim().length?t=tI.EmptyFile:"pdf"===Lx(this.props.fileUrl).extension&&(t=tI.Pdf),this.state={image:null,isLoading:!0,fileType:t,pdf:null,rotate:0,zoomLevel:100},this.renderPagesDebounced=(0,mm.A)(()=>{this.renderPdfPages()},200),this.contentRef=V.createRef()}componentDidMount(){var e;this.state.fileType===tI.Pdf?(e=this.props.fileUrl,(void 0===window.pdfjsLib?Xx("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===tI.Image&&this.loaderImage()}renderPdfPages(){this.state.fileType===tI.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=Jx(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===tI.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:tI.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)(wi,{children:({container:e})=>{const t=e.get(Si);return(0,i.jsxs)(rd,{css:{position:"relative"},direction:"column",height:1,width:1,children:[(0,i.jsx)(ka,{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===tI.Image&&!1===this.state.isLoading&&(0,i.jsx)(ka,{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`,...Jx(this.state.rotate,this.imageHeight(),this.imageWidth())}})}),!0===this.state.isLoading&&(0,i.jsx)(ka,{css:{background:"white",height:"calc(100% - 50px)",left:"0",position:"absolute",top:"0",width:"100%",zIndex:"10"},children:(0,i.jsx)(Cd,{})}),this.state.fileType===tI.EmptyFile&&(0,i.jsx)(rd,{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)(rd,{align:"center",css:{height:"50px",width:"100%"},justify:"center",children:[(0,i.jsxs)(Qx,{controls:!0,children:[(0,i.jsx)("i",{className:"fas fa-minus",onClick:this.zoomMinus.bind(this)}),(0,i.jsx)(eI,{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)(Qx,{rotate:!0,onClick:this.rotate.bind(this),children:(0,i.jsx)("i",{className:"far fa-undo"})})]})]})}})}}const iI=({acl:e,document:t,onDelete:n,...o})=>{const{translate:s}=bd(),[r,a]=(0,V.useState)(!1),l=om(),d="public-read"===e||g(t.url),c=g(t.url)?t.url:Zx(t,F.HEAVENT_AWS_UPLOADS_BUCKET),{designSystem:u}=Xu();return(0,i.jsxs)(rd,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",fontSize:"$textSm",overflow:"hidden",minHeight:"72px","@tablet":{border:"1px solid $gray300",borderRadius:"$2",fontSize:"$textMd"},...(()=>{switch(u){case Ku:return{padding:"$3","@tablet":{padding:"$3"}};case Yu:return{padding:"$4 $6"};default:vd()}})()},justify:"between",width:1,...l&&{onClick:()=>{!function(e,t){const n=document.createElement("a");n.href=e,n.target="_blank",n.download=t,n.click()}(c,t.name)}},...o,children:[(0,i.jsxs)(rd,{align:"center",css:{maxInlineSize:"80%"},gap:"4",children:[(0,i.jsx)("img",{src:Yx(t.name),style:{color:"black"}}),(0,i.jsx)(Od,{css:{ellipsis:!0,wordBreak:"break-all",...(()=>{if(u===Yu)return{fontWeight:"$medium"}})()},children:t.name})]}),(0,i.jsx)(ka,{css:{flex:"1"}}),(0,i.jsxs)(rd,{gap:"2",children:[d&&(0,i.jsxs)(i.Fragment,{children:[!1===l&&(0,i.jsx)(kd,{"aria-label":s("view_48132"),color:"white",leftIcon:"eye",onClick:()=>{a(!0)}}),(0,i.jsx)(kd,{"aria-label":s("download_47607"),color:"white",download:t.name,leftIcon:"download",target:"_blank",to:c})]}),n&&(0,i.jsx)(kd,{"aria-label":s("delete_file_40417"),color:"white",leftIcon:"trash-can",onClick:n})]}),r&&(0,pn.createPortal)((0,i.jsx)(rd,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"250"},height:1,width:1,children:(0,i.jsx)(zp,{heading:t.name,onClose:()=>a(!1),children:(0,i.jsx)(nI,{fileUrl:c})})}),document.body)]})},oI=xa("progress",{}),sI=e=>(0,i.jsx)(oI,{...e,children:e.children}),rI=({name:e,progress:t,...n})=>{const o=Math.min(100,Math.max(0,t)),{inputId:s}=Hd();return(0,i.jsxs)(rd,{css:{border:"1px solid $gray300",borderRadius:"$2",padding:"$4"},direction:"column",width:1,gap:"2",...n,children:[(0,i.jsx)(Zd,{htmlFor:s,children:e}),(0,i.jsxs)(sI,{id:s,max:"100",value:o,children:[o,"%"]})]})};var aI=n(3112);let lI=class{translationService;constructor(e){this.translationService=e}getFormatter(e={}){return Intl.NumberFormat(Oc(this.translationService.language),{notation:e.notation||"compact",style:e.style||"unit",unit:e.unit||"byte",unitDisplay:e.unitDisplay||"narrow"})}toNumberOrEmpty(e,{prefix:t}={}){return"number"==typeof e?`${t??""}${e.toLocaleString()}`:""}toNumberOrInfinity(e,{prefix:t}={}){return`${t??""}${"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`}};lI=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],lI),n(8181);var dI=n(9618);const cI=({allowCrop:e,onChange:t,hint:n,label:o,...s})=>{const r=Ti(),{isDisabled:a}=Mp(),l=(0,V.useRef)(null),[d,c]=(0,V.useState)(!1),[u,m]=(0,V.useState)(null),[h,g]=(0,V.useState)(!1),p=Wx(Vx.Images),f=e=>{if(e&&e[0]){const t=URL.createObjectURL(e[0]),n=e[0].type,i=new FileReader;i.onload=i=>{m({src:t,type:(0,aI.h)(i.target?.result,n),name:e[0].name})},i.readAsArrayBuffer(e[0])}g(!0)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{gap:"4",width:1,children:[(0,i.jsx)(rd,{align:"center",css:{background:d?"$primary50":"$gray50",border:d?"1px solid $primary300":"1px solid $gray200",borderRadius:"$1",cursor:a?"not-allowed":"pointer"},disabled:a,height:126,justify:"center",width:126,onClick:()=>{l.current?.click()},onDragEnter:e=>{Gd(e),c(!0)},onDragLeave:e=>{Gd(e),c(!1)},onDragOver:e=>{Gd(e),d||c(!0)},onDrop:n=>{Gd(n),c(!1);const i=n.dataTransfer.files.item(0);i&&p.includes(Lx(i.name).extension)&&(e?f(n.dataTransfer.files):t(i))},children:(0,i.jsx)(rd,{align:"center",css:{background:d?"$primary100":"$gray100",borderRadius:"36px",color:d?"$primary600":"$gray600"},height:d?48:32,justify:"center",width:d?48:32,children:(0,i.jsx)(Id,{icon:"plus"})})}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(ka,{color:"gray700",fontWeight:"medium",children:o}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray400",children:n})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{onClick:()=>{l.current?.click()},children:r("s_lectionner_un_50712")})})]}),(0,i.jsx)(ka,{css:{display:"none"},children:(0,i.jsx)("input",{ref:l,accept:qx(Vx.Images),type:"file",onChange:n=>{n.target.files?.[0]&&(e?f(n.target.files):t(n.target.files[0]))},...s})})]}),e&&h&&u&&(0,i.jsx)(uI,{image:u,onChange:t,onClose:()=>g(!1)})]})},uI=({image:e,onChange:t,onClose:n})=>{const o=Ti(),s=(0,V.useRef)(null);return(0,V.useEffect)(()=>()=>{e&&e.src&&URL.revokeObjectURL(e.src)},[e]),(0,i.jsx)(Om,{size:"md",onClose:n,children:(0,i.jsxs)(rd,{css:{overflow:"auto"},direction:"column",gap:"3",children:[(0,i.jsx)(dI.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)(kd,{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")})]})})},mI="dragover",hI=({accept:e,allowCrop:t,"aria-describedby":n,capture:o,onChange:s,...r})=>{const{translate:a}=bd(),l=Ri(),{isDisabled:d}=Mp(),c=(0,qd.A)(),u=(0,V.useRef)(null),[m,h]=(0,V.useState)(void 0),[g,p]=(0,V.useState)(null),[f,_]=(0,V.useState)(!1),x=Wx(e||[]),I=Gx(e||[]),v=e=>{if(e&&e[0]){const t=URL.createObjectURL(e[0]),n=e[0].type,i=new FileReader;i.onload=i=>{p({src:t,type:(0,aI.h)(i.target?.result,n),name:e[0].name})},i.readAsArrayBuffer(e[0])}_(!0)},{designSystem:b}=(0,V.useContext)(Zu);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("input",{ref:u,accept:e?qx(e):void 0,"aria-describedby":[n,c].join(" "),capture:o,style:{display:"none"},type:"file",onChange:n=>{if(n.target.files?.[0])if(t){if(e!==Vx.Images)throw new Error("Crop enabled on non-image file uploader");v(n.target.files)}else s(n.target.files[0])},...r}),(0,i.jsxs)(rd,{align:"center",className:m,css:{background:"$gray50",borderWidth:"1px",borderColor:"$gray200",borderRadius:"$2",cursor:d?"not-allowed":"pointer",padding:"$4",[`&.${mI}`]:{background:"$primary50",borderColor:"$gray200"},...(()=>{switch(b){case Ku:return{borderStyle:"solid"};case Yu:return{borderStyle:"dashed",[`&:hover, &:has( input:focus), &.${mI}`]:{borderStyle:"solid",borderColor:"$primary500"}};default:vd()}})()},direction:"column",disabled:d,gap:"2",width:1,onClick:()=>u.current?.click(),onDragLeave:()=>{h(void 0)},onDragOver:e=>{Gd(e),h(mI)},onDrop:n=>{Gd(n),h(void 0);const i=n.dataTransfer.files.item(0);if(i&&(0===x.length||x.includes(Lx(i.name).extension)))if(t){if(e!==Vx.Images&&e!=Vx.SmallImages)throw new Error("Crop enabled on non-image file uploader");v(n.dataTransfer.files)}else s(i)},children:[(0,i.jsx)(rd,{align:"center","aria-hidden":!0,css:{color:"$gray600",...(()=>{switch(b){case Ku:return{background:"$gray100",borderRadius:"36px"};case Yu:return;default:vd()}})()},height:32,justify:"center",width:32,children:(0,i.jsx)(Id,{icon:"cloud-arrow-down"})}),(0,i.jsxs)(rd,{css:{textAlign:"center"},direction:"column",justify:"center",wrap:"wrap",children:[(0,i.jsx)(Od,{textStyle:"subtitle",children:[...l(a("_1_ou_glisser_61813","{1}"),(0,i.jsx)(kd,{color:"invisible",css:{height:"auto",padding:0},id:"clickHereLink",type:"button",children:a("cliquez_ici_98447")}))]}),(0,i.jsx)(Od,{id:c,textStyle:"subtitle",children:[...l(a("_1_accept_2_30390","{1}","{2}"),Bs(x)?x.map((e,t,{length:n})=>(0,i.jsxs)(V.Fragment,{children:[t>0?n-1!==t?", ":" & ":"",(0,i.jsxs)("code",{children:[".",e]})]},e)):a("all_file_format_50211"),I!==1/0?lI.bytesToMegabytes(I):a("no_55268"))]})]})]}),t&&f&&g&&(0,i.jsx)(uI,{image:g,onChange:s,onClose:()=>_(!1)})]})};var gI;!function(e){e[e.File=0]="File",e[e.Uploader=1]="Uploader",e[e.Uploading=2]="Uploading"}(gI||(gI={}));const pI=({acl:e,css:t,descId:n,description:o,errorId:s,inputId:r,label:a,labelId:l,hint:d,onChange:c,organizationId:u,state:m,value:h,...g})=>{const{translate:p}=bd(),[f,_]=(0,V.useState)(h?gI.File:gI.Uploader),[x,I]=(0,V.useState)(""),[v,b]=(0,V.useState)(0);return(0,i.jsxs)(rd,{"aria-live":"polite",css:t,direction:"column",gap:"1",width:1,children:[(a||o)&&(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(Zd,{htmlFor:r,id:l,children:a}),(0,i.jsx)(Kd,{id:n,children:o})]}),f===gI.File&&h?(0,i.jsx)(iI,{acl:e,"aria-label":p("delete_uploaded_14711"),document:h,id:r,role:"button",onDelete:()=>{c(null),_(gI.Uploader)}}):f===gI.Uploading?(0,i.jsx)(rI,{"aria-busy":!0,"aria-describedby":n,"aria-label":p("uploading_file_46483"),id:r,name:x,progress:v}):(0,i.jsx)(hI,{"aria-describedby":n,"aria-errormessage":s,"aria-invalid":"error"===m,"aria-label":p("upload_file_97740"),id:r,onChange:async t=>{_(gI.Uploading),I(t.name),b(0);try{if(t.size>Gx(g.accept||[]))throw I(""),alert(p("file_is_too_lar_57859")),new Error;const n=await Kx(u,t,e,b);c({...n,file:t}),_(gI.File)}catch{_(gI.Uploader)}},...g}),(0,i.jsx)(Yd,{state:m,children:d})]})},fI=e=>{const t=Ti();return(0,i.jsxs)(rd,{align:"center",gap:"1",children:[e.children,(0,i.jsxs)(ka,{color:"gray500",fontSize:"textXs",fontWeight:"regular",children:["(",t("facultatif_76747"),")"]})]})},_I=(0,V.createContext)({}),xI=xa("div",{background:"$gray50",border:"1px solid $gray100",borderRadius:"$2",display:"flex",gap:"$2",height:"44px",minHeight:"44px",padding:"$1",position:"relative",width:"100%"}),II=xa("div",{alignItems:"center",color:"$gray500",cursor:"pointer",display:"flex",fontWeight:"$medium",height:"100%",justifyContent:"center",userSelect:"none",width:"100%",variants:{color:{white:{},primary:{}},selected:{true:{borderRadius:"6px",boxShadow:"$sm"}}},compoundVariants:[{color:"white",selected:!0,css:{background:"white",color:"$gray700"}},{color:"primary",selected:!0,css:{background:"$primaryCustom500",color:"white"}}]}),vI=e=>(0,i.jsx)(_I.Provider,{value:{color:e.color??"white",selectedItem:e.selectedItem,onChange:e.onChange},children:(0,i.jsx)(xI,{css:e.css,children:e.children})}),bI=e=>{const{color:t,selectedItem:n,onChange:o}=(0,V.useContext)(_I);return(0,i.jsx)(II,{color:t,selected:n===e.item,onClick:()=>{o(e.item)},children:e.children})};var jI=n(3333),CI=n(5488),yI=n.n(CI);n(4385),n(5833),n(9844),n(6871),n(2830);const AI=({css:e,label:t,description:n,state:o,initialValue:s,onChange:r,onBlur:a,onFocus:l,hint:d,placeholder:c,value:u,...m})=>{const{translate:h,params:{organizationId:g}}=bd(),{language:p}=Ei(Si),f=(0,V.useMemo)(()=>[{color:"white",label:h("blanc_36425")},{color:Ia.colors.gray800.value,label:h("gris_fonc_51159")},{color:Ia.colors.gray400.value,label:h("gris_clair_52465")},{color:Ia.colors.primary900.value,label:h("bleu_fonc_40491")},{color:Ia.colors.primary500.value,label:h("bleu_41949")},{color:Ia.colors.error700.value,label:h("rouge_fonc_45023")},{color:Ia.colors.error500.value,label:h("rouge_75079")},{color:Ia.colors.warning300.value,label:h("jaune_53503")},{color:Ia.colors.warning600.value,label:h("orange_64132")},{color:Ia.colors.success700.value,label:h("vert_fonc_37265")},{color:Ia.colors.success500,label:h("vert_27018")},{color:Ia.colors.purple700.value,label:h("violet_fonc_77270")},{color:Ia.colors.purple500.value,label:h("violet_54005")},{color:Ia.colors.pink700.value,label:h("rose_fonc_98996")},{color:Ia.colors.pink500.value,label:h("rose_49360")}],[]);return(0,i.jsxs)(rd,{css:e,direction:"column",width:1,children:[(0,i.jsx)(Zd,{children:t}),(0,i.jsx)(Kd,{children:n}),(t||n)&&(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{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:"$primary100",color:"$primary500"}}},"& .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"},...bf("& .ck.ck-content")},width:1,children:(0,i.jsx)(jI.CKEditor,{config:{placeholder:c,fontColor:{colors:f},fontBackgroundColor:{colors:f},language:p.toString().toLowerCase(),simpleUpload:{uploadUrl:`${F.HEAVENT_API_URL}/image/upload?organizationId=${g}`},heading:{options:[{model:"paragraphSmall",view:{name:"p",classes:"h-small"},title:h("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"}]},toolbar:{shouldNotGroupWhenFull:!0}},data:s,editor:yI(),onBlur:()=>{a?.()},onChange:(e,t)=>{r(t.getData())},onFocus:()=>{l?.()},...m})}),(0,i.jsx)(Yd,{state:o,children:d})]})},SI=({name:e,hint:t,state:n,...o})=>(0,i.jsx)(cd.D0,{name:e,parse:Ud.A,render:s=>{const r=Wd(s.meta);return(0,i.jsx)(AI,{hint:r?s.meta.error:t,initialValue:s.input.value,name:e,state:r?"error":n,onChange:e=>{s.input.onChange(e)},...o})}}),kI=({value:e,css:t,label:n,description:o,hint:s,icon:r,onChange:a,state:l,...d})=>{const c=g(e)&&e.length>5?e.substring(0,5):e,{inputId:u,descId:m,errorId:h}=Hd();return(0,i.jsxs)(rd,{css:t,direction:"column",width:1,children:[(0,i.jsx)(Zd,{htmlFor:u,children:n}),(0,i.jsx)(Kd,{id:m,children:o}),(n||o)&&(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(Jd,{cursor:"default",icon:r,state:l,children:(0,i.jsx)(ka,{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?h: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)(Yd,{id:h,state:l,children:s})]})},wI=({name:e,hint:t,state:n,...o})=>(0,i.jsx)(cd.D0,{name:e,render:s=>{const r=Wd(s.meta);return(0,i.jsx)(kI,{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})}}),EI=e=>{const{translate:t}=bd();return(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(Fp,{name:`${e.prefix}hasCalendarInvite`,children:(0,i.jsxs)(rd,{align:"center",gap:"2",children:[t("ajouter_une_inv_92123"),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{css:{cursor:"help"},children:(0,i.jsx)(ka,{color:"gray500",children:(0,i.jsx)(Id,{icon:"circle-exclamation"})})}),(0,i.jsx)(bp,{placement:"top",children:t("un_fichier_ics_01663")})]})]})}),e.hasCalendarInvite&&(0,i.jsx)(rd,{css:{paddingLeft:"$6"},width:1,children:(0,i.jsxs)(rd,{css:{background:"$gray50",bd:!0,padding:"$4 $6"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(ec,{label:t("nom_de_l_v_nem_08711"),name:`${e.prefix}calendarInviteName`}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Np,{label:t("date_de_d_but_43380"),name:`${e.prefix}calendarInviteStartDate`}),(0,i.jsx)(wI,{label:t("heure_de_d_but_27566"),name:`${e.prefix}calendarInviteStartTime`})]}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Np,{label:t("date_de_fin_86920"),name:`${e.prefix}calendarInviteEndDate`}),(0,i.jsx)(wI,{label:t("heure_de_fin_95071"),name:`${e.prefix}calendarInviteEndTime`})]})]})})]})};function TI(e){navigator.clipboard.writeText(e)}function RI(){const[e,t]=(0,V.useState)(!1);return{isLoading:e,copy:(0,V.useCallback)(e=>{t(!0),TI(e),setTimeout(()=>t(!1),500)},[])}}const OI=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)(null),[s,r]=(0,V.useState)(null),a=(0,V.useMemo)(()=>e.customFields.find(e=>e.slug===n),[e.customFields,n]),l=(0,V.useMemo)(()=>a&&s?`{user.fieldUpdate.${a.slug}.${s}}`:"",[e.customFields,a,s]),{isLoading:d,copy:c}=RI();return(0,i.jsx)(Wp,{as:"div",heading:t("s_lectionner_un_93801"),hideHeader:!0,children:(0,i.jsxs)(rd,{direction:"column",gap:"5",children:[(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(Od,{children:t("s_lectionner_un_93801")}),(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsxs)(hh,{value:n??"-1",onChange:e=>{o(e)},children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:"-1",children:t("s_lectionner_un_01451")}),e.customFields.map(e=>(0,i.jsxs)("option",{value:e.slug,children:[e.name,g(e.label)&&` (${e.label})`]},e.slug))]}),(0,i.jsx)(Id,{icon:"arrow-right"}),a?.fieldType===Oe.Select?(0,i.jsxs)(hh,{state:n?"active":"disabled",value:s??"-1",onChange:e=>{r(e)},children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:"-1",children:t("select_value_61735")}),a.values.map(({id:e,value:t},n)=>(0,i.jsx)("option",{value:e,children:t},n))]}):(0,i.jsxs)(hh,{state:n?"active":"disabled",value:s??"-1",onChange:e=>{r(e)},children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:"-1",children:t("select_value_61735")}),(0,i.jsx)("option",{value:"true",children:t("true_65165")}),(0,i.jsx)("option",{value:"false",children:t("false_74637")})]})]})]}),s&&(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(Od,{children:t("variable_ins_49519")}),(0,i.jsxs)(rd,{gap:"2",children:[(0,i.jsx)(ka,{css:{flex:"1",bd:!0,borderRadius:"$1",padding:"$2 $3",background:"$white"},children:(0,i.jsx)(Od,{css:{cursor:d?"progress":"copy"},onClick:()=>c(l),children:l})}),(0,i.jsx)(kd,{isLoading:d,onClick:()=>c(l),children:t("copier_75889")})]})]})]})})},DI=e=>{const{history:t,params:{organizationId:n},translate:o}=bd(),[s,r]=(0,V.useState)(e.values.campaign.documents);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ec,{label:o("sujet_36033"),name:"campaign.subject"}),(0,i.jsxs)(rd,{direction:"column",gap:"8",children:[(0,i.jsxs)($x,{heading:o("contenu_29668"),hideHeading:!0,children:[(0,i.jsxs)(vI,{selectedItem:e.values.textOrHtml,onChange:t=>{e.form.change("textOrHtml",t)},children:[(0,i.jsx)(bI,{item:"text",children:o("contenu_en_vers_04808")}),(0,i.jsx)(bI,{item:"html",children:o("contenu_parti_04631")})]}),"text"===e.values.textOrHtml&&(0,i.jsx)(SI,{hint:(0,i.jsx)(ka,{css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:o("vous_pouvez_ajo_23408")}}),label:o("contenu_29668"),name:"campaign.text"}),"html"===e.values.textOrHtml&&(0,i.jsx)(Hp,{hint:(0,i.jsx)(ka,{css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:o("vous_pouvez_ajo_23408")}}),label:o("code_html_60711"),name:"campaign.html"})]}),Bs(e.customFields)&&(0,i.jsx)($x,{heading:o("attribution_d_u_18785"),isOpen:!1,isOpenToggleLabel:o("je_souhaite_cr_46006"),subtitle:o("cr_ez_une_varia_07170"),children:(0,i.jsx)(OI,{customFields:e.customFields})}),(0,i.jsxs)($x,{heading:o("_metteur_de_l_e_26879"),subtitle:o("personnaliser_v_65980"),children:[(0,i.jsx)(Gp,{isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(fI,{children:o("_metteur_de_l_e_51616")}),name:"campaign.emailSenderId",onCreateClick:()=>{t.push(fs.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n))},children:e.emailsSenders.map(t=>(0,i.jsx)("option",{value:t.id,children:`${t.name} ${t.id===e.emailSenderId?o("_metteur_par_d_03442"):t.isValidToSendEmail?"":o("_e_mail_non_con_07618")}`},t.id))}),(0,i.jsx)(ec,{isEmail:!0,label:(0,i.jsx)(fI,{children:o("adresse_de_r_po_86181")}),name:"campaign.replyTo"})]}),(0,i.jsxs)($x,{heading:o("pi_ce_s_jointe_82370"),subtitle:o("int_grer_dans_v_73429"),tooltip:(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{css:{cursor:"help"},children:(0,i.jsx)(ka,{color:"gray500",children:(0,i.jsx)(Id,{icon:"circle-exclamation"})})}),(0,i.jsx)(bp,{placement:"bottom",children:o("si_vos_pi_ces_j_95233")})]}),children:[e.canCustomDocuments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Gp,{isSearchVisible:!0,label:o("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)),Mx.map(e=>(0,i.jsx)("option",{value:e,children:o(e)},e))]}),e.hasDuplicatedMembers&&(0,i.jsx)(Fp,{name:"campaign.includeDuplicateMembersAttachments",children:o("inclure_les_doc_76200")})]}),s.map(t=>(0,i.jsx)(pI,{acl:"public-read",organizationId:n,value:t,onChange:()=>{const n=(0,Cu.A)(s,t);r(n),e.form.change("campaign.documents",n)}},t.key)),(0,i.jsx)(pI,{acl:"public-read",label:o("fichier_personn_20046"),organizationId:n,value:null,onChange:t=>{const n=[...s,(0,ma.A)(t,"file")];r(n),e.form.change("campaign.documents",n)}})]})]}),(0,i.jsx)(EI,{hasCalendarInvite:e.values.campaign.hasCalendarInvite,prefix:"campaign."})]})},zI=[" ","@","£","$","¥","è","é","ù","ì","ò","Ç","Ø","ø","Å","å","Æ","æ","ß","É","!",'"',"#","¤","%","&","'","(",")","*","+",",","-",".","/","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","ä","ö","ñ","ü","à"],$I=["^","{","}","\\","|","[","]","~","€","\n"],PI=zI.concat($I);function MI(e,t){const n=t?145:160,i=Array.from(e??"").reduce((e,t)=>zI.includes(t)?e+1:$I.includes(t)?e+2:e,0);return i<=n?{numberOfCharacters:i,numberOfSms:1}:{numberOfCharacters:i,numberOfSms:Math.ceil(i/153)}}const FI=e=>(0,i.jsx)(cd.D0,{name:e.name,render:t=>{const n=t.input.checked?"checked":"unchecked";return(0,i.jsx)(zu,{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}),NI=e=>{const t=Ti(),n=e.formRenderProps.values,{numberOfCharacters:o,numberOfSms:s}=MI(n.campaign.text,n.customSender);return(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsxs)($x,{heading:t("voulez_vous_per_07528"),name:"customSender",role:"radiogroup",children:[(0,i.jsx)(FI,{name:"customSender",value:!1,children:t("non_je_souhait_47056")}),(0,i.jsxs)($x,{css:{"& > div":{gap:"$2"}},heading:t("custom_sender_90460"),hideHeading:!0,children:[(0,i.jsx)(FI,{name:"customSender",value:!0,children:t("oui_je_souhait_40974")}),e.formRenderProps.values.customSender&&(0,i.jsx)(ka,{css:{paddingLeft:"$6"},children:(0,i.jsx)(ec,{hint:t("doit_commencer_93759"),name:"campaign.sender",placeholder:t("_metteur_du_mes_17005")})})]})]}),(0,i.jsx)(Hp,{hint:(0,i.jsx)(ka,{css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:t("vous_pouvez_ajo_23408")}}),label:(0,i.jsxs)(rd,{justify:"between",children:[(0,i.jsx)(ka,{children:t("contenu_29668")}),(0,i.jsx)(ka,{color:"gray500",children:t("_1_caract_re_04414",o,s)})]}),name:"campaign.text"})]})},LI=e=>{const t=Ti();return(0,i.jsx)($x,{css:{"& header":{borderBlockEnd:"unset",paddingBlockEnd:"unset"}},heading:t("contenu_29668"),hideHeading:!0,children:e.formRenderProps.values.campaign.campaignType===ue.Email?(0,i.jsx)(DI,{canCustomDocuments:e.canCustomDocuments,customDocuments:e.customDocuments,customFields:e.customFields,emailSenderId:e.emailSenderId,emailsSenders:e.emailsSenders,form:e.formRenderProps.form,hasDuplicatedMembers:e.hasDuplicatedMembers,values:e.formRenderProps.values}):(0,i.jsx)(NI,{formRenderProps:e.formRenderProps})})},BI=e=>(0,i.jsx)(Bd,{direction:"column",formRenderProps:e.formRenderProps,render:e.render}),VI=e=>{const{translate:t}=bd(),[n,o]=V.useState(!1),[s,r]=V.useState(0),a=Ei(ld),l=V.Children.toArray(e.children),[d,c]=V.useState(!1);return d?(0,i.jsx)(Wp,{heading:t("r_capitulaif_76565"),children:e.summaryStep}):(0,i.jsx)(cd.lV,{initialValues:e.initialValues,initialValuesEqual:La.A,mutators:{...dd.A,forceErrors:Ld},render:t=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cd.Pc,{subscription:{dirtyFields:!0},children:({dirtyFields:e})=>Object.keys(e).map((e,t)=>(0,i.jsx)(cd.D0,{name:e,render:()=>null,subscription:{}},t))}),l.map((a,l)=>{const d=s>=l||e.isEdit&&t.valid;if("string"==typeof a||"number"==typeof a||"boolean"==typeof a||!("props"in a))throw new Error("Invalid step passed to wizard");return(0,i.jsxs)(ud.Provider,{value:{formRenderProps:t,showErrors:n,setShowErrors:o},children:[(0,i.jsx)(Wp,{canSelect:d,footerActions:a.props.actions?.(t),headerStyle:Up.Dark,heading:a.props.heading,isCompleted:s>l,isOpen:s===l,stepNumber:l+1,onSelect:()=>{d&&(o(!1),r(l))},children:V.cloneElement(a,{formRenderProps:t})}),(0,i.jsx)(md,{height:"6"})]},l)})]}),validate:e=>a.validateForForm(l[s].props.schema)(e),onSubmit:async(t,n)=>{if(s===l.length-1){const i=await e.onSubmit(t,n);return i?(o(!0),e.containerRef&&e.containerRef.current&&(e.containerRef.current.scrollIntoView(),e.containerRef.current.scrollTop=0),i):void c(!0)}return o(!1),void r(s+1)}})},UI=e=>{const t=(0,V.useRef)(null),n=(0,V.useCallback)(e=>{e&&(t.current=e,setTimeout(()=>{e.style.right=Ia.space[6].value},100))},[]),o=(0,V.useCallback)(()=>{t.current.style.right="-400px",e.onClose()},[e.onClose]);return(0,pn.createPortal)((0,i.jsxs)(rd,{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)(rd,{align:"center",css:{color:"white"},justify:"center",children:(0,i.jsx)(Id,{icon:"black"===e.color?"circle-exclamation":"error"===e.color?"circle-xmark":"circle-check",iconStyle:"solid"})}),(0,i.jsx)(ka,{color:"white",css:{flex:"1","& a":{color:"white",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:e.text},fontWeight:"medium"}),(0,i.jsx)(rd,{align:"center",css:{color:"white",cursor:"pointer",fontSize:"$textMd"},height:32,justify:"center",width:32,onClick:o,children:(0,i.jsx)(Id,{icon:"xmark"})})]}),document.body)},WI=2e3,GI=(0,V.createContext)({}),qI=e=>{const t=Ti(),[n,o]=(0,V.useState)(!1),[s,r]=(0,V.useState)({color:"success",text:""}),a=(0,V.useCallback)(()=>{setTimeout(()=>{o(!1)},1200)},[o]),l=(0,V.useCallback)(e=>{o(!0),r("string"==typeof e?{text:e}:e),setTimeout(a,As.dw.fromObject({seconds:5}).toMillis())},[o,r,a]),{mutate:d}=function(e={}){return Di("mutation AccreditationsImportResult(\n $jobId: JobId!\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n accreditationsImportResult(organizationId: $organizationId, eventId: $eventId, jobId: $jobId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),c=(0,V.useRef)(null),u=(0,V.useCallback)((e,n,i)=>{c.current=window.setInterval(async()=>{const{accreditationsImportResult:{state:o}}=await d({jobId:e,organizationId:n,eventId:i});o===Ct.Done&&(clearInterval(c.current),l({color:"success",text:t("votre_import_es_60265")}))},WI)},[]),{mutate:m}=function(e={}){return Di("mutation AccreditationsProfilesImportResult(\n $jobId: JobId!\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n accreditationsProfilesImportResult(\n organizationId: $organizationId\n eventId: $eventId\n jobId: $jobId\n ) {\n state\n event {\n name\n }\n }\n}\n",e)}(),h=(0,V.useRef)(null),g=(0,V.useCallback)((e,n,i)=>{h.current=window.setInterval(async()=>{const{accreditationsProfilesImportResult:{state:o}}=await m({jobId:e,organizationId:n,eventId:i});o===Ct.Done&&(clearInterval(h.current),l({color:"success",text:t("votre_import_es_60265")}))},WI)},[]),{mutate:p}=function(e={}){return Di("mutation DelegationsImportResult(\n $jobId: JobId!\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n delegationsImportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),f=(0,V.useRef)(null),_=(0,V.useCallback)((e,n,i)=>{f.current=window.setInterval(async()=>{const{delegationsImportResult:{state:o,event:s}}=await p({jobId:e,organizationId:n,eventId:i});o===kt.Done&&(clearInterval(f.current),l({color:"success",text:t("votre_import_es_98992",s.name)}))},WI)},[]),{mutate:x}=function(e={}){return Di("mutation EventDocumentsExportResult(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId\n $jobId: JobId!\n) {\n eventDocumentsExportResult(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n jobId: $jobId\n ) {\n state\n url\n }\n}\n",e)}(),I=(0,V.useRef)(null),v=(0,V.useCallback)((e,n,i)=>{I.current=window.setInterval(async()=>{const{eventDocumentsExportResult:o}=await x({jobId:e,organizationId:n,eventId:i});o.state===Rt.Done&&(clearInterval(I.current),l({color:"success",text:t("l_export_de_vos_38257",o.url)}))},WI)},[]),{mutate:b}=function(e={}){return Di("mutation EventsImportResult($jobId: JobId!, $organizationId: OrganizationId!) {\n eventsImportResult(jobId: $jobId, organizationId: $organizationId) {\n state\n }\n}\n",e)}(),j=(0,V.useRef)(null),C=(0,V.useCallback)((e,n)=>{j.current=window.setInterval(async()=>{const{eventsImportResult:{state:i}}=await b({jobId:e,organizationId:n});i===St.Done&&(clearInterval(j.current),l({color:"success",text:t("votre_import_es_60265")}))},WI)},[]),{mutate:y}=function(e={}){return Di("mutation ExportResult($jobId: JobId!, $organizationId: OrganizationId!, $eventId: EventId) {\n exportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n url\n }\n}\n",e)}(),A=(0,V.useRef)(null),S=(0,V.useCallback)((e,n,i)=>{A.current=window.setInterval(async()=>{const{exportResult:o}=await y({jobId:e,organizationId:n,eventId:i});o.state===Rt.Done&&(clearInterval(A.current),l({color:"success",text:t("votre_export_es_96069",o.url)}))},WI)},[]),{mutate:k}=function(e={}){return Di("mutation FilesImportResult($jobId: JobId!, $organizationId: OrganizationId!, $eventId: EventId) {\n filesImportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),w=(0,V.useRef)(null),E=(0,V.useCallback)((e,n,i)=>{w.current=window.setInterval(async()=>{const{filesImportResult:{state:o,event:s}}=await k({jobId:e,organizationId:n,eventId:i});o===Ot.Done&&(clearInterval(w.current),l({color:"success",text:s?t("votre_import_es_11791",s.name):t("votre_import_es_10672")}))},WI)},[]),{mutate:T}=function(e={}){return Di("mutation PositionsImportResult(\n $jobId: JobId!\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n positionsImportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),R=(0,V.useRef)(null),O=(0,V.useCallback)((e,n,i)=>{R.current=window.setInterval(async()=>{const{positionsImportResult:{state:o,event:s}}=await T({jobId:e,organizationId:n,eventId:i});o===zt.Done&&(clearInterval(R.current),l({color:"success",text:t("votre_import_es_11848",s.name)}))},WI)},[]),{mutate:D}=function(e={}){return Di("mutation VolunteersImportResult(\n $jobId: JobId!\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n) {\n volunteersImportResult(\n jobId: $jobId\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n ) {\n state\n event {\n name\n }\n }\n}\n",e)}(),z=(0,V.useRef)(null),$=(0,V.useCallback)((e,n,i,o)=>{z.current=window.setInterval(async()=>{const{volunteersImportResult:{state:s,event:r}}=await D({jobId:e,organizationId:n,eventId:i,delegationId:o});s===Nt.Done&&(clearInterval(z.current),l({color:"success",text:r?t("votre_import_es_37822",r.name):t("votre_import_es_14145")}))},WI)},[]);return(0,i.jsx)(GI.Provider,{value:{checkAccreditationsImport:u,checkAccreditationsProfilesImport:g,checkDelegationsImport:_,checkDocumentsExport:v,checkEventsImport:C,checkExport:S,checkFilesImport:E,checkPositionsImport:O,checkVolunteersImport:$,showNotification:l},children:(0,i.jsxs)(i.Fragment,{children:[n&&(0,i.jsx)(UI,{color:s.color??"success",text:s.text,onClose:a}),e.children]})})};function HI(){return(0,V.useContext)(GI)}const KI=/^[a-z][a-z0-9]{2,10}$/i;var YI;!function(e){e.Accreditations="accreditations",e.Everyone="everyone",e.Positions="positions",e.Segments="segments",e.States="states",e.Users="users"}(YI||(YI={}));let ZI=class extends ic{constructor(e){super(e)}createUpdateCampaignValuesDefault(e,t,n,i){const o=this.campaignInputDefault(e,t,n,i);return{campaign:o,recipients:o.sendToEveryone?YI.Everyone:Bs(o.states)?YI.States:Bs(o.segmentsIds)?YI.Segments:Bs(o.accreditationsCategoriesIds)||Bs(o.accreditationsIds)||Bs(o.accreditationsSlotsIds)?YI.Accreditations:Bs(o.positionsCategoriesIds)||Bs(o.positionsIds)||Bs(o.positionsSlotsIds)?YI.Positions:YI.Users,customSender:g(n?.sender),textOrHtml:g(n?.html)?"html":"text"}}campaignStep1Fields(){return{name:c.Yj().required(this.t("le_nom_de_la_ca_63405")),campaignType:c.Yj().required(this.t("le_type_de_camp_96559")).oneOf(An,this.t("le_type_de_camp_56467"))}}campaignStep1Schema(){return c.Ik().shape({campaign:c.Ik().shape({...this.campaignStep1Fields()})})}campaignStep2Fields(){const e=this;return{sender:c.Yj().test("is-valid",this.t("l_metteur_ne_r_16421"),function(){return!g(this.parent.sender)||KI.test(this.parent.sender)}),text:c.Yj().test("non-empty-text",this.t("le_contenu_est_45048"),function(){return g(this.parent.text)||g(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=>!PI.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:c.Yj().when("campaignType",{is:ue.Email,then:e=>e.required(this.t("le_sujet_est_re_18923"))}),html:c.Yj().test("non-empty-text",this.t(this.t("le_code_html_es_52280")),function(){return g(this.parent.text)||g(this.parent.html)}),replyTo:c.Yj().email(this.t("l_adresse_de_r_53879")).test("clean-reply-to",this.t("l_adresse_de_r_53879"),function(){return F_(this.parent.replyTo)}),documents:c.YO().test("max-size",this.t("l_ensemble_des_32797"),function(){return this.parent.campaignType!==ue.Email||!Bs(this.parent.documents)||(0,_f.A)(this.parent.documents,e=>e.size)<2e7}),emailSenderId:c.ai().nullable(),attachments:c.YO().of(c.Yj()),includeDuplicateMembersAttachments:c.zM().required(),hasCalendarInvite:c.zM().required(),calendarInviteName:c.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("nom_de_l_v_nem_58512")),otherwise:e=>e.nullable()}),calendarInviteStartDate:Yp.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:c.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("heure_de_d_but_90785")),otherwise:e=>e.nullable()}),calendarInviteEndDate:Yp.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:c.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("l_heure_de_fin_78626")),otherwise:e=>e.nullable()})}}campaignStep2Schema(){return c.Ik().shape({campaign:c.Ik().shape({...this.campaignStep2Fields()})})}campaignStep3Fields(){const e=this,t=function(){return this.parent.state!==me.Draft&&this.parent.state!==me.Scheduled||!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:c.zM().required(this.t("requis_75853")),states:c.YO().of(c.Yj()).test("non-empty","",t),positionsCategoriesIds:c.YO().of(c.ai()).test("non-empty","",t),positionsIds:c.YO().of(c.ai()).test("non-empty","",t),positionsSlotsIds:c.YO().of(c.ai()).test("non-empty","",t),tagsIds:c.YO().of(c.ai()).test("non-empty","",t),accreditationsCategoriesIds:c.YO().of(c.ai()).test("non-empty","",t),accreditationsIds:c.YO().of(c.ai()).test("non-empty","",t),accreditationsSlotsIds:c.YO().of(c.ai()).test("non-empty","",t),usersInfosIds:c.YO().of(c.ai()).test("non-empty","",t),segmentsIds:c.YO().of(c.ai()).test("non-empty","",t)}}campaignStep3Schema(){return c.Ik().shape({campaign:c.Ik().shape({...this.campaignStep3Fields()})})}campaignStep4Fields(){return{scheduledAtDate:Yp.when("scheduleType",{is:pe.Datetime,then:e=>e.required(this.t("la_date_d_envoi_17792")).typeError(this.t("la_date_d_envoi_17792"))}),scheduledAtTime:c.Yj().when("scheduleType",{is:pe.Datetime,then:e=>e.required(this.t("l_heure_d_envoi_53643")).matches(/\d{2}:\d{2}/,this.t("l_heure_d_envoi_53643"))}),scheduleAnchor:c.Yj().when("scheduleType",{is:pe.Anchor,then:e=>e.required(this.t("d_but_fin_est_r_67120")).oneOf(jn,this.t("d_but_fin_est_r_67120"))}),scheduleOffsetDays:c.ai().when("scheduleType",{is:pe.Anchor,then:e=>e.required(this.t("le_nombre_de_jo_27562")).min(0,this.t("le_nombre_de_jo_62798"))}),scheduleBeforeAfter:c.Yj().when("scheduleType",{is:pe.Anchor,then:e=>e.required(this.t("avant_apr_s_est_31173")).oneOf(Cn,this.t("avant_apr_s_est_31173"))}),scheduleSendTime:c.Yj().when("scheduleType",{is:pe.Anchor,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 c.Ik().shape({campaign:c.Ik().shape({...this.campaignStep4Fields()})})}campaignInputSchema(){return c.Ik().shape({...this.campaignStep1Fields(),...this.campaignStep2Fields(),...this.campaignStep3Fields(),...this.campaignStep4Fields()})}createUpdateCampaignSchema(){return c.Ik().shape({campaign:this.campaignInputSchema()})}campaignInputDefault(e,t,n,i){let o=n?.segmentsIds??[],s=n?.usersInfosIds??[];if(g(i))try{const e=JSON.parse(r(i));e.segmentId&&(o=[e.segmentId]),Bs(e.usersInfosIds)&&(s=e.usersInfosIds)}catch{}const a=!Bs(o)&&!Bs(s)&&(n?.sendToEveryone??!1);return{name:n?.name??"",state:n?n.scheduleType!==pe.NoSchedule&&n.state===me.Draft?me.Scheduled:n.state:e?me.Template:me.Draft,campaignType:n?.campaignType??ue.Email,sender:n?.sender??"",text:n?.text??"",subject:n?.subject??"",html:n?.html??"",replyTo:n?.replyTo??"",sendToEveryone:a,states:n?.states??[],positionsCategoriesIds:n?.positionsCategoriesIds??[],positionsIds:n?.positionsIds??[],positionsSlotsIds:n?.positionsSlotsIds??[],tagsIds:n?.tagsIds??[],accreditationsCategoriesIds:n?.accreditationsCategoriesIds??[],accreditationsIds:n?.accreditationsIds??[],accreditationsSlotsIds:n?.accreditationsSlotsIds??[],usersInfosIds:s,segmentsIds:o,scheduledAtDate:n?.scheduledAt??void 0,scheduledAtTime:n?.scheduledAt?.toFormat("HH:mm")??void 0,documents:n?.documents??[],emailSenderId:n?.emailSenderId??t,attachments:n?.attachments??[],includeDuplicateMembersAttachments:n?.includeDuplicateMembersAttachments??!1,hasCalendarInvite:n?.hasCalendarInvite??!1,calendarInviteName:n?.calendarInviteName??null,calendarInviteStartDate:n?.calendarInviteStartDate??null,calendarInviteStartTime:n?.calendarInviteStartTime??null,calendarInviteEndDate:n?.calendarInviteEndDate??null,calendarInviteEndTime:n?.calendarInviteEndTime??null,scheduleType:n?.scheduleType??pe.NoSchedule,scheduleAnchor:n?.scheduleAnchor??fe.EventStart,scheduleOffsetDays:n?.scheduleOffsetDays??0,scheduleBeforeAfter:n?.scheduleBeforeAfter??_e.Before,scheduleSendTime:n?.scheduleSendTime??"00:00"}}};function XI(e,t,n){if("positionCategoryId"in n){const i=e.usersPositionsCategories.some(e=>"ANY"===n.positionCategoryId?t===e.roleId:t===e.roleId&&e.positionCategoryId===n.positionCategoryId);if("positionId"in n){const o=e.usersPositions.some(e=>t===e.roleId&&e.positionId===n.positionId);return i||o}return i}return"delegationCategoryId"in n?e.usersDelegationsCategories.some(e=>"ANY"===n.delegationCategoryId?t===e.roleId:t===e.roleId&&e.delegationCategoryId===n.delegationCategoryId):"eventId"in n&&e.usersEvents.some(e=>"ANY"===n.eventId?t===e.roleId:t===e.roleId&&e.eventId===n.eventId)}function JI(e,t,n){const i=n?e.roles.filter(t=>"positionCategoryId"in n||"positionId"in n?t.accessLevel===je.Position?XI(e,t.id,n):t.accessLevel===je.Organization||t.accessLevel===je.Event:"delegationCategoryId"in n?t.accessLevel===je.DelegationCategory?XI(e,t.id,n):t.accessLevel===je.Organization||t.accessLevel===je.Event:"eventId"in n&&(t.accessLevel===je.Event?XI(e,t.id,n):t.accessLevel===je.Organization)):e.roles;return t.map(e=>i.some(t=>"1"===t.permissions[e]))}function QI(e,t){return e.roles.filter(e=>e.accessLevel===je.Organization).some(e=>"1"===e.permissions[t])}ZI=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],ZI);const ev=V.createContext({}),tv=e=>{const{params:{eventId:t}}=bd(),n=V.useMemo(()=>e.userPermissions.roles.some(e=>e.accessLevel===je.Organization||e.accessLevel===je.Event),[e.userPermissions]);return t?(0,i.jsx)(ev.Provider,{value:{hasEventRole:n,userPermissions:e.userPermissions,hasPermission:(t,n)=>function(e,t,n){return JI(e,[t],n)[0]}(e.userPermissions,t,n),hasPermissions:(t,n)=>JI(e.userPermissions,t,n)},children:e.children}):(0,i.jsx)(i.Fragment,{children:e.children})};function nv(){return V.useContext(ev)}var iv=n(5830);class ov extends iv.Ay{events;forms;organizations;segmentsFolders;constructor(){super("recrewteer"),this.version(6).stores({events:"id",forms:"id",organizations:"id",segmentsFolders:"id"})}}const sv=new ov;var rv=n(8923);const av=V.createContext({}),lv=e=>{const[t,n]=V.useState(e.numberOfWaitingAccreditations),[o,s]=V.useState(e.numberOfWaitingAssigments),[r,a]=V.useState(null),l=V.useCallback(async t=>{const n=(0,rv.A)(r,{id:e.event.id},t);await sv.events.put(n),a(n)},[e.event.id,r,a]),{hasEventRole:d,userPermissions:c,hasPermission:u,hasPermissions:m}=nv();return V.useEffect(()=>{(async()=>{let t=await sv.events.get(e.event.id);t||(t={id:e.event.id},await sv.events.put(t)),a(t)})()},[e.event]),(0,i.jsx)(av.Provider,{value:{hasEventRole:d,event:e.event,localEvent:r,numberOfWaitingAccreditations:t,numberOfWaitingAssigments:o,userPermissions:c,hasPermission:u,hasPermissions:m,setNumberOfWaitingAccreditations:n,setNumberOfWaitingAssigments:s,updateLocalEvent:l},children:e.children})};function dv(){return V.useContext(av)}function cv(e){return 1752===e}function uv(e){return 4060===e}const mv=(0,V.createContext)({});function hv(){return(0,V.useContext)(mv)}const gv=({children:e,termsAccepted:t})=>{const{organizationId:n}=zi(),o=$i();return t||window.location.pathname.includes(fs.ACCEPT_TERMS_AND_CONDITIONS(n))?(0,i.jsx)(i.Fragment,{children:e}):(0,i.jsx)(Fi,{path:fs.ACCEPT_TERMS_AND_CONDITIONS(n),state:o.location})},pv=(0,V.createContext)({}),fv=e=>{const{history:t,params:{organizationId:n},translate:o}=bd(),{data:s,loader:r,reload:a}=Oi('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(whereUserIsLeader: true, sort: { attribute: StartAt, direction: Desc }) {\n nodes {\n id\n name\n state\n fields\n weezeventEventId\n }\n }\n\n roles {\n id\n accessLevel\n name\n type\n }\n }\n\n user {\n email\n language\n termsAcceptedAt\n\n roles(organizationId: $organizationId) {\n id\n accessLevel\n type\n permissions\n }\n\n userInfo(organizationId: $organizationId) {\n name\n firstName: fieldValue(slug: "firstName")\n intercomToken\n\n picture {\n url\n }\n }\n }\n}\n',{organizationId:n},[]),{update:l}=hv(),[d,c]=(0,V.useState)(),[u,h]=(0,V.useState)(null),g=(0,V.useCallback)(async e=>{const t=(0,gd.A)(u,{id:n},e);await sv.organizations.put(t),h(t)},[n,u,h]),p=(0,V.useMemo)(()=>Bs(s.user?.roles??[]),[s.user]),f=(0,V.useMemo)(()=>(s.user?.roles??[]).some(e=>e.accessLevel===je.Organization),[s.user]),_=(0,V.useMemo)(()=>s.organization?{organizationRoles:(0,cm.A)(s.organization.roles.filter(e=>e.accessLevel===je.Organization),e=>m(e.name)),eventRoles:(0,cm.A)(s.organization.roles.filter(e=>e.accessLevel===je.Event),e=>m(e.name)),delegationCategoryRoles:(0,cm.A)(s.organization.roles.filter(e=>e.accessLevel===je.DelegationCategory),e=>m(e.name)),positionRoles:(0,cm.A)(s.organization.roles.filter(e=>e.accessLevel===je.Position),e=>m(e.name))}:{organizationRoles:[],eventRoles:[],delegationCategoryRoles:[],positionRoles:[]},[s.organization]),x=(0,V.useCallback)(e=>!!s.organization&&function(e,t){return e.features.includes(t)}(s.organization,e),[s.organization]);return(0,V.useEffect)(()=>{s.organization&&(async()=>{let e=await sv.organizations.get(n);e||(e={id:n},await sv.organizations.put(e)),h(e)})()},[n,s.organization]),(0,V.useEffect)(()=>{l(s.user?.userInfo.intercomToken)},[s.user,l]),r||(r||s.organization?p?(0,i.jsx)(pv.Provider,{value:{hasOrganizationRole:f,localOrganization:u,organization:s.organization,roles:_,selectedEventId:d,user:s.user,hasPermission:e=>QI(s.user,e),hasPermissions:e=>function(e,t){return t.map(t=>QI(e,t))}(s.user,e),hasFeature:x,reload:a,setSelectedEventId:c,updateLocalOrganization:g},children:(0,i.jsx)(gv,{termsAccepted:null!==s.user.termsAcceptedAt,children:e.children})}):(0,i.jsx)(Om,{size:"sm",onClose:hc.A,children:(0,i.jsxs)(rd,{align:"center",direction:"column",gap:"3",children:[(0,i.jsx)(ka,{children:o("vous_n_avez_pas_23261")}),(0,i.jsx)(kd,{color:"invisible",onClick:Q,children:o("se_d_connecter_74151")})]})}):(setTimeout(()=>{t.replace(fs.HOME)},100),null))};function _v(){return(0,V.useContext)(pv)}const xv=V.createContext({});function Iv(){return V.useContext(xv)}const vv=xa("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}}),bv=e=>{const t=Ti(),{onClose:n}=Iv();return(0,i.jsxs)(rd,{css:{borderTop:e.hideBorder?void 0:"1px solid $gray200",padding:"$6 $7"},gap:"3",justify:"end",children:[!e.hideCancelButton&&(0,i.jsx)(kd,{color:"white",onClick:n,children:t("annuler_48254")}),"function"==typeof e.children?e.children(n):e.children]})},jv=e=>(0,i.jsx)(rd,{direction:"column",...od(e),css:{borderTop:e.hideBorder?void 0:"1px solid $gray200",padding:"$5 $7 $7 $7",...e.css},children:e.children}),Cv=({icon:e,iconColor:t,children:n,subtitle:o,onClose:s})=>(0,i.jsxs)(rd,{children:[(0,i.jsxs)(rd,{align:"center",css:{flexGrow:"1",padding:"$6 $7 $5 $7"},gap:"4",children:[(0,i.jsx)(rd,{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)(Id,{className:"fa-xl",icon:e})}),(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{font:"gray900 textLg medium",children:n}),g(o)&&(0,i.jsx)(ka,{color:"gray500",children:o})]})]}),s&&(0,i.jsx)(rd,{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)(Id,{className:"fa-xl",icon:"xmark"})})]}),yv=({children:e})=>{const{isOpen:t,onClose:n}=Iv();return Jc(n),Su("common-front/src/designSystem/components/modals/__deprecated/modal/modal.tsx","common-front/src/designSystem/components/modals/base/modal.tsx"),t?(0,pn.createPortal)((0,i.jsx)(rd,{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)(vv,{onClick:e=>Gd(e,!1),children:e})}),document.body):null},Av=e=>{const[t,n]=V.useState(e.isOpen??!1),o=V.useCallback(()=>{n(!1),e.onClose?.()},[n,e.onClose]);return V.useEffect(()=>{"boolean"==typeof e.isOpen&&n(e.isOpen)},[e.isOpen]),(0,i.jsx)(xv.Provider,{value:{isOpen:t,onClose:o,setIsOpen:n},children:e.children})},Sv=e=>{const{setIsOpen:t}=Iv(),n=e.children,o=V.useCallback(e=>{Gd(e),t(!0),n.props.onClick?.(e)},[t,n]),s=V.useMemo(()=>V.cloneElement(V.Children.only(n),{onClick:o,onKeyPress:o,tabIndex:0}),[n,o]);return(0,i.jsx)(i.Fragment,{children:s})},kv=()=>{const{translate:e}=bd(),t=Ei(Mm),[n,o]=(0,V.useState)(""),s=(0,V.useMemo)(()=>t.countries.filter(e=>"number"==typeof e.smsPrice),[t]),r=(0,V.useMemo)(()=>{if(g(n)){const e=m(n);return s.filter(t=>m(t.name).includes(e)||Ls(t.phoneCode).some(e=>e.includes(n)))}return s},[s,n]);return(0,i.jsxs)(Av,{children:[(0,i.jsx)(Sv,{children:(0,i.jsx)(ka,{color:"primary500",children:e("voir_la_liste_d_69122")})}),(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"message",children:e("liste_des_prix_58579")}),(0,i.jsxs)(jv,{css:{overflow:"auto"},direction:"column",gap:"3",height:300,children:[(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:"Rechercher un pays",state:"search",value:n,onChange:o}),(0,i.jsxs)(Hu,{children:[(0,i.jsxs)(Wu,{children:[(0,i.jsx)(pm,{children:e("Country")}),(0,i.jsx)(pm,{children:e("indicatif_40634")}),(0,i.jsx)(pm,{children:e("prix_ht_10965")})]}),r.map(e=>{return(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:e.name}),(0,i.jsx)(Qu,{children:e.phoneCode}),(0,i.jsx)(Qu,{children:(0,xf.A)((t=e.smsPrice,t*(14/9)),3)})]},e.code);var t})]})]}),(0,i.jsx)(bv,{})]})]})},wv=e=>{const t=Ti(),{hasFeature:n}=_v(),o=n(Ae.Sms);return(0,i.jsxs)($x,{heading:e.isTemplate?t("initialisation_84842"):t("initialisation_48904"),hideHeading:!0,children:[(0,i.jsx)(Ba.Yr,{name:"campaign.campaignType",children:t=>{t===ue.Sms?o?(e.formRenderProps.form.change("campaign.text",""),e.formRenderProps.form.change("campaign.html","")):e.formRenderProps.form.change("campaign.campaignType",ue.Email):(e.formRenderProps.form.change("campaign.text",""),e.formRenderProps.form.change("campaign.html",""))}}),(0,i.jsx)(ec,{label:e.isTemplate?t("nom_de_votre_mo_02364"):t("nom_de_votre_ca_08001"),name:"campaign.name"}),!e.isSent&&(0,i.jsxs)($x,{heading:e.isTemplate?t("quel_type_de_mo_32965"):t("quel_type_de_ca_11960"),name:"input.mode",role:"radiogroup",children:[(0,i.jsx)(FI,{name:"campaign.campaignType",value:ue.Email,children:t("e_mail_13869")}),(0,i.jsx)(FI,{disabled:!o,name:"campaign.campaignType",value:ue.Sms,children:(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{children:"SMS"}),(0,i.jsx)(kv,{}),!o&&(0,i.jsx)(ka,{color:"gray500",css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:t("contactez_nous_22980",F.EMAIL_FROM,F.EMAIL_FROM)},fontSize:"textXs"})]})})]})]})},Ev=({name:e,hint:t,state:n,...o})=>(0,i.jsx)(cd.D0,{name:e,render:s=>{const r=Wd(s.meta);return(0,i.jsx)(hh,{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})}}),Tv=e=>{const{translate:t}=bd(),{form:n,handleSubmit:o,values:s}=e.formRenderProps;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba.Yr,{name:"campaign.scheduleType",children:e=>{n.change("campaign.state",e===pe.NoSchedule?me.Draft:me.Scheduled)}}),(0,i.jsx)(ka,{color:"gray800",children:t("quand_voulez_vo_96615")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(FI,{name:"campaign.scheduleType",value:pe.NoSchedule,children:t("je_souahite_l_e_46027")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(FI,{name:"campaign.scheduleType",value:pe.Datetime,children:t("je_souhaite_pro_98854")}),s.campaign.scheduleType===pe.Datetime&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Np,{min:As.c9.local(),name:"campaign.scheduledAtDate",placeholder:t("choisissez_la_d_30578")}),(0,i.jsx)(wI,{hint:t("le_fuseau_horai_57116",e.timeZone),name:"campaign.scheduledAtTime",placeholder:t("choisissez_l_he_55311")})]})]}),"event"===e.campaignType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(FI,{name:"campaign.scheduleType",value:pe.Anchor,children:t("je_souhaite_pro_99169")})]}),s.campaign.scheduleType===pe.Anchor&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{width:80,children:(0,i.jsx)(ec,{min:0,name:"campaign.scheduleOffsetDays",shouldParseAsInt:!0})}),(0,i.jsx)(ka,{children:t("jour_s_06841")}),(0,i.jsx)(ka,{children:(0,i.jsxs)(Ev,{name:"campaign.scheduleBeforeAfter",children:[(0,i.jsx)("option",{value:_e.Before,children:t("avant_91154")}),(0,i.jsx)("option",{value:_e.After,children:t("apr_s_53238")})]})}),(0,i.jsx)(ka,{children:t("le_95402")}),(0,i.jsx)(ka,{children:(0,i.jsxs)(Ev,{name:"campaign.scheduleAnchor",children:[(0,i.jsx)("option",{value:fe.EventStart,children:t("d_but_63192")}),(0,i.jsx)("option",{value:fe.EventEnd,children:t("fin_33487")})]})}),(0,i.jsx)(ka,{children:t("de_l_v_nement_01521")}),(0,i.jsx)(ka,{children:(0,i.jsx)(wI,{name:"campaign.scheduleSendTime"})})]})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{onClick:o,children:t("suivant_r_cap_22677")})})]})},Rv=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),[s,r]=(0,V.useState)(null),{mutate:a}=function(e={}){return Di("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.formRenderProps,m=(0,V.useMemo)(()=>{if(e.formRenderProps.values.campaign.campaignType===ue.Email){const t=e.emailsSenders.find(t=>t.id===e.formRenderProps.values.campaign.emailSenderId);return t&&!t.isValidToSendEmail}return!1},[e.emailsSenders,e.formRenderProps.values.campaign.emailSenderId]);return(0,V.useEffect)(()=>{a({organizationId:n,eventId:o,campaign:e.formRenderProps.values.campaign}).then(e=>{r(e.campaignEstimate)})},[]),s?(0,i.jsxs)(i.Fragment,{children:[m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zd,{alertStyle:"error",children:(0,i.jsx)(Pd,{children:t("vous_ne_pouvez_33410")})}),(0,i.jsx)(md,{height:"4"})]}),(0,i.jsxs)(rd,{gap:"1",children:[(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:t("nombre_de_desti_22505")}),(0,i.jsx)(ka,{color:"gray800",children:t("_1_membre_49737",s.numberOfRecipients)})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsxs)(rd,{gap:"1",children:[(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:t("prix_total_03054")}),(0,i.jsx)(ka,{color:"gray800",children:0===s.price?t("gratuit_13712"):`${s.price}€`})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(kd,{disabled:m,isLoading:c,onClick:()=>{u.campaign.state!==me.Scheduled&&l.change("campaign.state",me.InProgress),d()},children:u.campaign.state===me.Scheduled?t("programmer_la_c_01938"):e.isEdit?t("mettre_jour_l_63945"):t("cr_er_et_envoye_81501")}),(0,i.jsx)(kd,{color:"white",isLoading:c,onClick:()=>{l.change("campaign.state",me.Draft),d()},children:t("enregistrer_en_81222")})]})]}):(0,i.jsx)(Cd,{})};var Ov;function Dv(){const{hasFeature:e,hasPermission:t}=_v(),{event:n,hasPermission:i}=dv();return(0,V.useMemo)(()=>{const o=e=>t(e)||(i?.(e)??!1),s=e(Ae.Accreditation)&&(n?.useAccreditations??!1),r=n?.useCampaigns??!0,a=e(Ae.Delegation)&&(n?.useDelegations??!0),l=(e(Ae.Documents)||e(Ae.CustomDocument))&&(n?.useDocuments??!1),d=n?.useForms??!0,c=n?.usePositions??!1,u=e(Ae.Weezevent)&&(n?.isWeezeventSynchronized??!1),m=n?.useWorkflows??!0;return{canAccreditationEdit:s&&o(Ov.ACCREDITATION_EDIT),canAccreditationRead:s&&o(Ov.ACCREDITATION_READ),canCampaignRead:r&&o(Ov.CAMPAIGN_READ),canCampaignSend:r&&o(Ov.CAMPAIGN_SEND),canCommentAdd:o(Ov.COMMENT_ADD),canCommentRead:o(Ov.COMMENT_READ),canCustomFieldEdit:o(Ov.CUSTOM_FIELD_EDIT),canCustomFieldRead:o(Ov.CUSTOM_FIELD_READ),canCustomFieldDecrypt:o(Ov.CUSTOM_FIELD_DECRYPT),canDelegationEdit:a&&o(Ov.DELEGATION_EDIT),canDelegationRead:a&&o(Ov.DELEGATION_READ),canDelegationsSpaceParamRead:a&&o(Ov.DELEGATIONS_SPACE_PARAM_READ),canDelegationsSpaceParamEdit:a&&o(Ov.DELEGATIONS_SPACE_PARAM_EDIT),canDocumentEdit:l&&o(Ov.DOCUMENT_EDIT),canDocumentRead:l&&o(Ov.DOCUMENT_READ),canEmailEdit:o(Ov.EMAIL_EDIT),canEventEdit:o(Ov.EVENT_EDIT),canFormEdit:d&&o(Ov.FORM_EDIT),canFormRead:d&&o(Ov.FORM_READ),canMemberAccredit:s&&o(Ov.MEMBER_ACCREDIT),canMemberAssign:c&&o(Ov.MEMBER_ASSIGN),canMemberAssignmentStateEdit:c&&o(Ov.MEMBER_ASSIGNMENT_STATE_EDIT),canMemberAvailabilitiesEdit:o(Ov.MEMBER_AVAILABILITIES_EDIT),canMemberCreate:o(Ov.MEMBER_CREATE),canMemberDelete:o(Ov.MEMBER_DELETE),canMemberEdit:o(Ov.MEMBER_EDIT),canOrganizationParamEdit:o(Ov.ORGANIZATION_PARAM_EDIT),canOrganizationParamRead:o(Ov.ORGANIZATION_PARAM_READ),canOrganizationUserEdit:o(Ov.ORGANIZATION_USER_EDIT),canOrganizationUserRead:o(Ov.ORGANIZATION_USER_READ),canPositionEdit:c&&o(Ov.POSITION_EDIT),canPositionRead:c&&o(Ov.POSITION_READ),canPrint:o(Ov.PRINT),canSegmentEdit:o(Ov.SEGMENT_EDIT),canTicketIdRegenerate:o(Ov.TICKET_ID_REGENERATE),canWeezeventEdit:u&&o(Ov.WEEZEVENT_EDIT),canWeezeventRead:u&&o(Ov.WEEZEVENT_READ),canWorkflowEdit:m&&o(Ov.WORKFLOW_EDIT),canWorkflowRead:m&&o(Ov.WORKFLOW_READ)}},[e,n,t,i])}function zv(){const{hasFeature:e,hasPermission:t}=_v();return(0,V.useMemo)(()=>{const n=e(Ae.Accreditation),i=e(Ae.Delegation),o=e(Ae.CustomDocument),s=e(Ae.Weezevent);return{canAccreditationEdit:n&&t(Ov.ACCREDITATION_EDIT),canAccreditationRead:n&&t(Ov.ACCREDITATION_READ),canCampaignRead:t(Ov.CAMPAIGN_READ),canCampaignSend:t(Ov.CAMPAIGN_SEND),canCommentAdd:t(Ov.COMMENT_ADD),canCommentRead:t(Ov.COMMENT_READ),canCustomFieldEdit:t(Ov.CUSTOM_FIELD_EDIT),canCustomFieldRead:t(Ov.CUSTOM_FIELD_READ),canCustomFieldDecrypt:t(Ov.CUSTOM_FIELD_DECRYPT),canDelegationEdit:i&&t(Ov.DELEGATION_EDIT),canDelegationRead:i&&t(Ov.DELEGATION_READ),canDelegationsSpaceParamRead:i&&t(Ov.DELEGATIONS_SPACE_PARAM_READ),canDelegationsSpaceParamEdit:i&&t(Ov.DELEGATIONS_SPACE_PARAM_EDIT),canDocumentEdit:o&&t(Ov.DOCUMENT_EDIT),canDocumentRead:o&&t(Ov.DOCUMENT_READ),canEmailEdit:t(Ov.EMAIL_EDIT),canEventEdit:t(Ov.EVENT_EDIT),canFormEdit:t(Ov.FORM_EDIT),canFormRead:t(Ov.FORM_READ),canMemberAccredit:t(Ov.MEMBER_ACCREDIT),canMemberAssign:t(Ov.MEMBER_ASSIGN),canMemberAssignmentStateEdit:t(Ov.MEMBER_ASSIGNMENT_STATE_EDIT),canMemberAvailabilitiesEdit:t(Ov.MEMBER_AVAILABILITIES_EDIT),canMemberCreate:t(Ov.MEMBER_CREATE),canMemberDelete:t(Ov.MEMBER_DELETE),canMemberEdit:t(Ov.MEMBER_EDIT),canOrganizationParamEdit:t(Ov.ORGANIZATION_PARAM_EDIT),canOrganizationParamRead:t(Ov.ORGANIZATION_PARAM_READ),canOrganizationUserEdit:t(Ov.ORGANIZATION_USER_EDIT),canOrganizationUserRead:t(Ov.ORGANIZATION_USER_READ),canPositionEdit:t(Ov.POSITION_EDIT),canPositionRead:t(Ov.POSITION_READ),canPrint:t(Ov.PRINT),canSegmentEdit:t(Ov.SEGMENT_EDIT),canTicketIdRegenerate:t(Ov.TICKET_ID_REGENERATE),canWeezeventEdit:s&&t(Ov.WEEZEVENT_EDIT),canWeezeventRead:s&&t(Ov.WEEZEVENT_READ),canWorkflowEdit:t(Ov.WORKFLOW_EDIT),canWorkflowRead:t(Ov.WORKFLOW_READ)}},[e,t])}function $v(){const{eventId:e}=zi(),{canCustomFieldEdit:t}=zv(),{canCustomFieldEdit:n}=Dv();return(0,V.useCallback)(i=>t||!!i.eventId&&i.eventId===e&&n,[t,n,e])}!function(e){e[e.POSITION_READ=0]="POSITION_READ",e[e.POSITION_EDIT=1]="POSITION_EDIT",e[e.MEMBER_EDIT=2]="MEMBER_EDIT",e[e.MEMBER_ASSIGNMENT_STATE_EDIT=3]="MEMBER_ASSIGNMENT_STATE_EDIT",e[e.COMMENT_READ=4]="COMMENT_READ",e[e.COMMENT_ADD=5]="COMMENT_ADD",e[e.MEMBER_AVAILABILITIES_EDIT=6]="MEMBER_AVAILABILITIES_EDIT",e[e.MEMBER_ASSIGN=7]="MEMBER_ASSIGN",e[e.CAMPAIGN_SEND=8]="CAMPAIGN_SEND",e[e.ACCREDITATION_READ=9]="ACCREDITATION_READ",e[e.ACCREDITATION_EDIT=10]="ACCREDITATION_EDIT",e[e.MEMBER_ACCREDIT=11]="MEMBER_ACCREDIT",e[e.DELEGATION_READ=12]="DELEGATION_READ",e[e.DELEGATION_EDIT=13]="DELEGATION_EDIT",e[e.FORM_READ=14]="FORM_READ",e[e.FORM_EDIT=15]="FORM_EDIT",e[e.EMAIL_EDIT=16]="EMAIL_EDIT",e[e.CAMPAIGN_READ=17]="CAMPAIGN_READ",e[e.DOCUMENT_READ=18]="DOCUMENT_READ",e[e.DOCUMENT_EDIT=19]="DOCUMENT_EDIT",e[e.WORKFLOW_READ=20]="WORKFLOW_READ",e[e.WORKFLOW_EDIT=21]="WORKFLOW_EDIT",e[e.CUSTOM_FIELD_READ=22]="CUSTOM_FIELD_READ",e[e.CUSTOM_FIELD_EDIT=23]="CUSTOM_FIELD_EDIT",e[e.SEGMENT_EDIT=24]="SEGMENT_EDIT",e[e.MEMBER_CREATE=25]="MEMBER_CREATE",e[e.MEMBER_DELETE=26]="MEMBER_DELETE",e[e.EVENT_EDIT=27]="EVENT_EDIT",e[e.ORGANIZATION_PARAM_READ=28]="ORGANIZATION_PARAM_READ",e[e.ORGANIZATION_PARAM_EDIT=29]="ORGANIZATION_PARAM_EDIT",e[e.ORGANIZATION_USER_READ=30]="ORGANIZATION_USER_READ",e[e.ORGANIZATION_USER_EDIT=31]="ORGANIZATION_USER_EDIT",e[e.CUSTOM_FIELD_DECRYPT=32]="CUSTOM_FIELD_DECRYPT",e[e.WEEZEVENT_READ=33]="WEEZEVENT_READ",e[e.WEEZEVENT_EDIT=34]="WEEZEVENT_EDIT",e[e.DELEGATIONS_SPACE_PARAM_READ=35]="DELEGATIONS_SPACE_PARAM_READ",e[e.DELEGATIONS_SPACE_PARAM_EDIT=36]="DELEGATIONS_SPACE_PARAM_EDIT",e[e.PRINT_CONFIG_READ=37]="PRINT_CONFIG_READ",e[e.PRINT_CONFIG_EDIT=38]="PRINT_CONFIG_EDIT",e[e.PRINT=39]="PRINT",e[e.TICKET_ID_REGENERATE=40]="TICKET_ID_REGENERATE"}(Ov||(Ov={}));const Pv=e=>{const{translate:t,params:{eventId:n}}=bd(),o=Ei(Cm),[s,r]=(0,V.useState)(!0),[a,l]=(0,V.useState)(!0),[d,c]=(0,V.useState)([]),[u,m]=(0,V.useState)([]),[h,g]=(0,V.useState)(!1),[p,f]=(0,V.useState)([]);return(0,V.useEffect)(()=>{(async()=>{if("accreditations"===e.recipients&&s){const e=await(t={eventId:n},i=await X(),Js("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,cm.A)(e.event.accreditationsCategories,e=>e.name)),m(Object.entries((0,Vu.A)(e.event.accreditations.nodes,e=>e.accreditationCategoryName))),g(Bs(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,zs.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===YI.Accreditations?(0,i.jsx)(rd,{css:{marginLeft:"$2"},direction:"column",gap:"2",children:a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ju,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(ju,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(ju,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gp,{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)(Gp,{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))}),h&&(0,i.jsx)(Gp,{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},Mv=e=>{const t=_v(),n=dv(),o=V.useMemo(()=>(t?.user?.roles.map(e=>e.type)||[]).concat(n?.userPermissions?.roles.map(e=>e.type)||[]),[t,n]);return V.useMemo(()=>"function"==typeof n?.hasPermissions&&Bs(Ls(e.permissions))?n.hasPermissions(Ls(e.permissions),e.scope).some(e=>e):!!Bs(Ls(e.permissions))&&t.hasPermissions(Ls(e.permissions)).some(e=>e),[e.permissions,e.scope,o,n])?(0,i.jsx)(i.Fragment,{children:e.children}):null},Fv=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),s=Ei(Yh),{hasEventRole:r}=dv(),[a,l]=(0,V.useState)(!0),[d,c]=(0,V.useState)(!0),[u,m]=(0,V.useState)([]),[h,p]=(0,V.useState)([]),[f,_]=(0,V.useState)([]),[x,I]=(0,V.useState)([]);return(0,V.useEffect)(()=>{(async()=>{if("positions"===e.recipients&&a){const e=await(t={organizationId:n,eventId:o},i=await X(),Js("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,cm.A)(e.event.positionsCategories,e=>e.name)),p(Object.entries((0,Vu.A)(e.event.positions.nodes,e=>e.positionCategoryName))),_(e.event.positions.nodes.map(e=>{const t=e.slots.map(t=>{const n=g(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===YI.Positions?(0,i.jsx)(rd,{css:{marginLeft:"$6"},direction:"column",gap:"2",children:d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ju,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(ju,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(ju,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(ju,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mv,{permissions:Ov.CAMPAIGN_SEND,scope:{positionCategoryId:"ANY"},children:(0,i.jsx)(Gp,{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)(Gp,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsIds",placeholder:t("ajouter_des_mis_44522"),children:h.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)(Gp,{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.jsx)(Gp,{isSearchVisible:!0,multiple:!0,name:"campaign.tagsIds",placeholder:t("ajouter_des_tag_57392"),children:x.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))})]})}):null},Nv=e=>{const{translate:t,params:{eventId:n}}=bd(),[o,s]=(0,V.useState)(!0),[r,a]=(0,V.useState)(!0),[l,d]=(0,V.useState)([]);return(0,V.useEffect)(()=>{(async()=>{if("segments"===e.recipients&&o){const e=await(t={eventId:n},i=await X(),Js("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.jsx)(ka,{css:{marginLeft:"$6"},children:r?(0,i.jsx)(ju,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(Gp,{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 Lv({eventId:e,hasSelected:t,includePhone:n,nameDebounced:o,organizationId:s,populationsIds:r,reloadKey:a,userInfoIds:l}){const[d,c]=V.useState(!1),[u,h]=V.useState(null),p=V.useMemo(()=>(0,cm.A)((0,Xh.A)((u?.usersInfos.nodes??[]).concat(u?.selectedUsersInfos?.nodes??[]),e=>e.id),e=>m(e.name)),[u]),f=V.useMemo(()=>p.map(e=>(0,i.jsxs)("option",{value:e.id,children:[g(e.name)?e.name:"-"," (",n?e.phone?.internationalFormat||"-":e.email,")"]},e.id)),[p]);return V.useEffect(()=>{(async()=>{c(!0);const{organization:i}=await(a={organizationId:s,eventId:e,hasSelected:t,includePhone:n||!1,userInfoIds:l,name:g(o)?o:void 0,populationsIds:r},d=await X(),Js('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;h(i),c(!1)})()},[s,e,n,o,r,a]),{usersInfos:p,usersInfosOptions:f,isLoading:d}}const Bv=e=>{const{params:{organizationId:t,eventId:n},translate:o}=bd(),[s,r,a]=gm(""),{usersInfosOptions:l,isLoading:d}=Lv({organizationId:t,eventId:n,includePhone:e.campaignType===ue.Sms,hasSelected:Bs(e.usersInfosIds),nameDebounced:r,userInfoIds:e.usersInfosIds});return"users"===e.recipients?(0,i.jsx)(ka,{css:{marginLeft:"$6"},children:(0,i.jsx)(Gp,{isSearchLoading:d,isSearchVisible:!0,multiple:!0,name:"campaign.usersInfosIds",placeholder:o("ajouter_des_mem_58427"),searchElement:(0,i.jsx)(Qd,{icon:"magnifying-glass",name:s,placeholder:o("rechercher_un_m_05904"),state:"search",onChange:a}),children:l})}):null},Vv=e=>{const{translate:t}=bd(),{event:n,hasEventRole:o,hasPermission:s}=dv(),{canAccreditationRead:r}=Dv(),{form:a,values:l}=e.formRenderProps,d=n.usePositions,c=r;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba.Yr,{name:"recipients",children:e=>{if("everyone"===e)a.change("campaign.sendToEveryone",!0),a.change("campaign.states",[]),a.change("campaign.positionsCategoriesIds",[]),a.change("campaign.positionsIds",[]),a.change("campaign.positionsSlotsIds",[]),a.change("campaign.accreditationsCategoriesIds",[]),a.change("campaign.accreditationsIds",[]),a.change("campaign.accreditationsSlotsIds",[]),a.change("campaign.tagsIds",[]),a.change("campaign.usersInfosIds",[]),a.change("campaign.segmentsIds",[]);else if("states"===e)a.change("campaign.sendToEveryone",!1),a.change("campaign.positionsCategoriesIds",[]),a.change("campaign.positionsIds",[]),a.change("campaign.positionsSlotsIds",[]),a.change("campaign.accreditationsCategoriesIds",[]),a.change("campaign.accreditationsIds",[]),a.change("campaign.accreditationsSlotsIds",[]),a.change("campaign.tagsIds",[]),a.change("campaign.usersInfosIds",[]),a.change("campaign.segmentsIds",[]);else if("positions"===e)a.change("campaign.sendToEveryone",!1),a.change("campaign.states",[]),a.change("campaign.accreditationsCategoriesIds",[]),a.change("campaign.accreditationsIds",[]),a.change("campaign.accreditationsSlotsIds",[]),a.change("campaign.usersInfosIds",[]),a.change("campaign.segmentsIds",[]);else if("accreditations"===e)a.change("campaign.sendToEveryone",!1),a.change("campaign.states",[]),a.change("campaign.positionsCategoriesIds",[]),a.change("campaign.positionsIds",[]),a.change("campaign.positionsSlotsIds",[]),a.change("campaign.usersInfosIds",[]),a.change("campaign.segmentsIds",[]);else if("users"===e)a.change("campaign.sendToEveryone",!1),a.change("campaign.states",[]),a.change("campaign.positionsCategoriesIds",[]),a.change("campaign.positionsIds",[]),a.change("campaign.positionsSlotsIds",[]),a.change("campaign.accreditationsCategoriesIds",[]),a.change("campaign.accreditationsIds",[]),a.change("campaign.accreditationsSlotsIds",[]),a.change("campaign.tagsIds",[]),a.change("campaign.segmentsIds",[]);else{if("segments"!==e)throw new Error(`Recipients ${e} is not possible`);a.change("campaign.sendToEveryone",!1),a.change("campaign.states",[]),a.change("campaign.positionsCategoriesIds",[]),a.change("campaign.positionsIds",[]),a.change("campaign.positionsSlotsIds",[]),a.change("campaign.accreditationsCategoriesIds",[]),a.change("campaign.accreditationsIds",[]),a.change("campaign.accreditationsSlotsIds",[]),a.change("campaign.tagsIds",[]),a.change("campaign.usersInfosIds",[])}}}),(0,i.jsx)(Ba.Yr,{name:"campaign.sendToEveryone",children:e=>{e&&(a.change("campaign.states",[]),a.change("campaign.positionsCategoriesIds",[]),a.change("campaign.positionsIds",[]),a.change("campaign.positionsSlotsIds",[]),a.change("campaign.tagsIds",[]),a.change("campaign.accreditationsCategoriesIds",[]),a.change("campaign.accreditationsIds",[]),a.change("campaign.accreditationsSlotsIds",[]),a.change("campaign.usersInfosIds",[]))}}),(0,i.jsx)(Ba.Yr,{name:"campaign.positionsCategoriesIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.positionsCategoriesIds.length>0&&a.change("campaign.positionsCategoriesIds",[])}}),(0,i.jsx)(Ba.Yr,{name:"campaign.positionsIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.positionsIds.length>0&&a.change("campaign.positionsIds",[])}}),(0,i.jsx)(Ba.Yr,{name:"campaign.positionsSlotsIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.positionsSlotsIds.length>0&&a.change("campaign.positionsSlotsIds",[])}}),(0,i.jsx)(Ba.Yr,{name:"campaign.tagsIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.tagsIds.length>0&&a.change("campaign.tagsIds",[])}}),(0,i.jsx)(Ba.Yr,{name:"campaign.usersInfosIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.usersInfosIds.length>0&&a.change("campaign.usersInfosIds",[])}}),(0,i.jsx)(Ba.Yr,{name:"campaign.segmentsIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.segmentsIds.length>0&&a.change("campaign.segmentsIds",[])}}),(0,i.jsxs)($x,{heading:t("_qui_voulez_vo_96064"),name:"recipients",role:"radiogroup",children:[s(Ov.CAMPAIGN_SEND,{eventId:n.id})&&d&&(0,i.jsx)(FI,{name:"recipients",value:"everyone",children:t("_tous_vos_memb_31761")}),s(Ov.CAMPAIGN_SEND,{eventId:n.id})&&d&&(0,i.jsxs)($x,{css:{"& > div":{gap:"$2"}},heading:t("specify_which_m_11119"),hideHeading:!0,children:[(0,i.jsx)(FI,{name:"recipients",value:"states",children:t("_certains_memb_35722")}),"states"===l.recipients&&(0,i.jsx)(ka,{css:{marginLeft:"$6"},children:(0,i.jsx)(Gp,{isSearchVisible:!0,multiple:!0,name:"campaign.states",placeholder:t("ajouter_des_sta_70922"),children:hi.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))})})]}),d&&(0,i.jsxs)($x,{css:{"& > div":{gap:"$2"}},heading:t("specify_which_c_37426"),hideHeading:!0,children:[(0,i.jsx)(FI,{name:"recipients",value:"positions",children:o?t("_certaines_cat_59188"):s(Ov.CAMPAIGN_SEND,{positionCategoryId:"ANY"})?t("_certaines_cat_22161"):t("_certaines_mis_80674")}),(0,i.jsx)(Fv,{recipients:l.recipients})]}),c&&(0,i.jsxs)($x,{css:{"& > div":{gap:"$2"}},heading:t("specify_which_c_03754"),hideHeading:!0,children:[(0,i.jsx)(FI,{name:"recipients",value:"accreditations",children:t("_certaines_cat_14293")}),(0,i.jsx)(Pv,{recipients:l.recipients})]}),(0,i.jsxs)($x,{css:{"& > div":{gap:"$2"}},heading:t("specify_which_m_11119"),hideHeading:!0,children:[(0,i.jsx)(FI,{name:"recipients",value:"users",children:t("_certains_memb_91094")}),(0,i.jsx)(Bv,{campaignType:e.formRenderProps.values.campaign.campaignType,recipients:l.recipients,usersInfosIds:e.formRenderProps.values.campaign.usersInfosIds})]}),(0,i.jsxs)($x,{css:{"& > div":{gap:"$2"}},heading:t("specify_which_v_99730"),hideHeading:!0,children:[(0,i.jsx)(FI,{name:"recipients",value:"segments",children:t("_certaines_vue_55512")}),(0,i.jsx)(Nv,{recipients:l.recipients})]})]})]})},Uv=e=>{const{translate:t,params:{organizationId:n}}=bd(),[o,s]=(0,V.useState)(!0),[r,a]=(0,V.useState)(!0),[l,d]=(0,V.useState)([]);return(0,V.useEffect)(()=>{(async()=>{if("segments"===e.recipients&&o){const e=await(t={organizationId:n},i=await X(),Js("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.jsx)(ka,{css:{marginLeft:"$6"},children:r?(0,i.jsx)(ju,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(Gp,{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},Wv=e=>{const t=Ti(),{form:n,values:o}=e.formRenderProps;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba.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)(Ba.Yr,{name:"campaign.sendToEveryone",children:e=>{e&&(n.change("campaign.segmentsIds",[]),n.change("campaign.usersInfosIds",[]))}}),(0,i.jsx)(Ba.Yr,{name:"campaign.usersInfosIds",children:()=>{o.campaign.sendToEveryone&&o.campaign.usersInfosIds.length>0&&n.change("campaign.usersInfosIds",[])}}),(0,i.jsx)(Ba.Yr,{name:"campaign.segmentsIds",children:()=>{o.campaign.sendToEveryone&&o.campaign.segmentsIds.length>0&&n.change("campaign.segmentsIds",[])}}),(0,i.jsxs)($x,{heading:t("_qui_voulez_vo_96064"),name:"recipients",role:"radiogroup",children:[(0,i.jsx)(FI,{name:"recipients",value:"everyone",children:t("_tous_vos_memb_83616")}),(0,i.jsxs)($x,{css:{"& > div":{gap:"$2"}},heading:"",hideHeading:!0,children:[(0,i.jsx)(FI,{name:"recipients",value:"users",children:t("_certains_memb_91094")}),(0,i.jsx)(Bv,{campaignType:e.formRenderProps.values.campaign.campaignType,recipients:o.recipients,usersInfosIds:e.formRenderProps.values.campaign.usersInfosIds})]}),(0,i.jsxs)($x,{css:{"& > div":{gap:"$2"}},heading:"",hideHeading:!0,children:[(0,i.jsx)(FI,{name:"recipients",value:"segments",children:t("_certaines_vue_55512")}),(0,i.jsx)(Uv,{recipients:o.recipients})]})]})]})},Gv=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=bd(),{showNotification:r}=HI(),a=Ei(ZI),l=e.initialValues.campaign.state===me.Template,d=(0,V.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,l]);Zc(d);const c=[me.Done,me.InProgress].includes(e.initialValues.campaign.state),u=Tx.CAMPAIGNS({organizationId:n,eventId:o}),m=(0,V.useRef)(null);return(0,i.jsx)(Zu.Provider,{value:{designSystem:Yu},children:(0,i.jsx)(zp,{category:d,fallbackClosePath:u,heading:e.isEdit?e.initialValues.campaign.name:s(l?"nouveau_mod_le_74336":"nouvelle_campag_28814"),children:(0,i.jsx)(Op,{ref:m,children:(0,i.jsxs)(VI,{containerRef:m,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)(BI,{heading:s(l?"initialisation_84842":"initialisation_48904"),render:e=>(0,i.jsxs)(rd,{direction:"column",gap:"7",children:[(0,i.jsx)(wv,{formRenderProps:e,isSent:c,isTemplate:l}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{onClick:e.handleSubmit,children:s(l?"suivant_conte_33443":"suivant_conte_90603")})})]}),schema:a.campaignStep1Schema()}),(0,i.jsx)(BI,{heading:s("contenu_29668"),render:t=>(0,i.jsxs)(rd,{direction:"column",gap:"7",children:[(0,i.jsx)(LI,{canCustomDocuments:e.canCustomDocuments,customDocuments:e.customDocuments,customFields:e.customFields,emailSenderId:e.emailSenderId,emailsSenders:e.emailsSenders,formRenderProps:t,hasDuplicatedMembers:e.hasDuplicatedMembers,isSent:c,isTemplate:l}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{isLoading:t.submitting,onClick:t.handleSubmit,children:l?e.isEdit?s("mettre_jour_l_13576"):s("cr_er_le_mod_le_06346"):s(c?"mettre_jour_l_32694":"suivant_desti_10756")})})]}),schema:a.campaignStep2Schema()}),!l&&!c&&(0,i.jsx)(BI,{heading:s("destinataires_19592"),render:t=>(0,i.jsxs)(rd,{direction:"column",gap:"7",children:["event"===e.campaignType?(0,i.jsx)(Vv,{formRenderProps:t}):(0,i.jsx)(Wv,{formRenderProps:t}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{onClick:t.handleSubmit,children:s("suivant_livra_97068")})})]}),schema:a.campaignStep3Schema()}),!l&&!c&&(0,i.jsx)(BI,{heading:s("livraison_86944"),render:t=>(0,i.jsx)(Tv,{campaignType:e.campaignType,formRenderProps:t,timeZone:e.timeZone}),schema:a.campaignStep4Schema()}),!l&&!c&&(0,i.jsx)(BI,{heading:s("r_capitulatif_a_79107"),render:t=>(0,i.jsx)(Rv,{emailsSenders:e.emailsSenders,formRenderProps:t,isEdit:e.isEdit}),schema:a.createUpdateCampaignSchema()})]})})})})},qv=e=>{const{organizationId:t,eventId:n,options:o}=zi(),s=Ei(ZI),{data:r,loader:a}=fr({organizationId:t,eventId:n}),{mutate:l}=gr(),{event:d}=dv();return a||(0,i.jsx)(Gv,{campaignType:n?"event":"organization",canCustomDocuments:d?.useDocuments??!1,customDocuments:r.organization?.event?.customDocuments??[],customFields:r.organization.customFields.nodes,emailSenderId:r.organization?.event?.emailSender?.id??r.organization.emailSenderId,emailsSenders:r.organization.emailsSenders,hasDuplicatedMembers:r.organization?.event?.hasDuplicatedMembers??!1,initialValues:s.createUpdateCampaignValuesDefault(e.isTemplate,r.organization.emailSenderId,null,o),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})},Hv=()=>{const{organizationId:e,eventId:t,campaignId:n}=zi(),{data:o,loader:s}=Oi("query CampaignEventToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $campaignId: CampaignId!\n) {\n organization(id: $organizationId) {\n customFields(\n eventId: $eventId\n variety: UserInfo\n fieldTypes: [Checkbox, Select, Validation]\n onlyUpdatableByUrl: true\n ) {\n nodes {\n ...CustomField\n }\n }\n\n emailsSenders(isValidToSendEmail: true) {\n ...CreateCampaignEmailSender\n }\n }\n\n event(id: $eventId) {\n hasDuplicatedMembers\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},[js.CustomFieldFragment,js.CreateCampaignEmailSenderFragment,js.CampaignEditFragment]),r=Ei(ZI),{mutate:a}=pr(),{event:l}=dv();return s||(0,i.jsx)(Gv,{campaignType:"event",canCustomDocuments:l.useDocuments,customDocuments:o.event.customDocuments,customFields:o.organization.customFields.nodes,emailSenderId:o.event.emailSender?.id,emailsSenders:o.organization.emailsSenders,hasDuplicatedMembers:o.event.hasDuplicatedMembers,initialValues:r.createUpdateCampaignValuesDefault(!1,o.event.emailSender?.id,o.event.campaign,null),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})},Kv=()=>{const{organizationId:e,campaignId:t}=zi(),{data:n,loader:o}=Oi("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 customFields(\n variety: UserInfo\n fieldTypes: [Checkbox, Select, Validation]\n onlyUpdatableByUrl: true\n ) {\n nodes {\n ...CustomField\n }\n }\n\n emailsSenders(isValidToSendEmail: true) {\n ...CreateCampaignEmailSender\n }\n }\n}\n",{organizationId:e,campaignId:t},[js.CampaignEditFragment,js.CustomFieldFragment,js.CreateCampaignEmailSenderFragment]),s=Ei(ZI),{mutate:r}=pr();return o||(0,i.jsx)(Gv,{campaignType:"organization",canCustomDocuments:!1,customDocuments:[],customFields:n.organization.customFields.nodes,emailSenderId:n.organization.emailSenderId,emailsSenders:n.organization.emailsSenders,hasDuplicatedMembers:!1,initialValues:s.createUpdateCampaignValuesDefault(!1,n.organization.emailSenderId,n.organization.campaign,null),isEdit:!0,mutate:async n=>{const{campaignUpdate:{id:i}}=await r({organizationId:e,campaignId:t,campaign:n});return i},timeZone:n.organization.timeZone})},Yv=({children:e,...t})=>(0,i.jsx)(Od,{as:"abbr",textStyle:"abbreviation",...t,children:e}),Zv=xa(rd,{borderRadius:"$2",fontSize:"$textSm",height:"32px",width:"32px",variants:{size:{sm:{},md:{borderRadius:"$3",fontSize:"$textMd",height:"40px",width:"40px"},responsive:{"@tablet":{borderRadius:"$3",fontSize:"$textMd",height:"40px",width:"40px"}}}},defaultVariants:{size:"responsive"}}),Xv=e=>{const t=(0,V.useMemo)(()=>pu(e.color??""),[e.color]),n=(0,V.useMemo)(()=>Vn.includes(e.icon)?xd(e.icon):e.icon,[e.icon]);return(0,i.jsx)(Zv,{align:"center",css:{background:t[100],color:t[700],...e.css},justify:"center",role:"presentation",size:e.size,children:(0,i.jsx)(Id,{icon:n})})},Jv=e=>(0,i.jsx)(rd,{as:id.Header,...od(e),css:{background:"white",borderBottom:e.hideBorder?"":"1px solid $gray200",padding:"$6 $7","& :is(h1, h2, h3, h4, h5, h6)":{fontSize:"$displayXs",lineHeight:"32px"},...e.css},children:e.children}),Qv=e=>(0,i.jsx)(rd,{...od(e),css:{background:"$gray50",flex:"1",padding:"$7",...e.css},direction:"column",children:e.children}),eb=e=>(0,i.jsx)(Jv,{align:"center",css:{paddingBlockEnd:"$4"},gap:"4",hideBorder:!0,children:e.isLoading?(0,i.jsx)(fm,{}):(0,i.jsxs)(rd,{direction:"column",gap:"6",width:1,children:[e.breadcrumbs,(0,i.jsxs)(rd,{gap:"3",children:[(0,i.jsxs)(rd,{css:{alignItems:"center",alignSelf:"stretch",flex:"1"},gap:"4",children:[e.icon&&(0,i.jsx)(rd,{align:"center",justify:"center",children:(0,i.jsx)(Xv,{color:e.color??void 0,css:{inlineSize:"56px",blockSize:"56px"},icon:e.icon})}),(0,i.jsxs)(rd,{css:{alignItems:"flex-start"},direction:"column",justify:"center",children:[(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(Dd,{children:e.name}),g(e.acronym)&&(0,i.jsx)(Yv,{css:{position:"relative",top:"6px"},children:e.acronym}),e.nameSuffix]}),e.subtext&&(0,i.jsx)(Od,{textStyle:"subtitle",children:e.subtext})]})]}),e.buttons]})]})}),tb=Jv,nb=e=>(0,i.jsx)(rd,{css:e.css,direction:"column",height:1,width:1,children:e.children}),ib=e=>{const t=Pi().pathname.includes(e.basePath||e.path);return(0,i.jsxs)(i.Fragment,{children:[e.disabled?(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{color:"grayCustom500",css:{borderBottom:"unset",paddingBlock:"$3",fontWeight:"$medium"},children:e.children})}),(0,i.jsx)(bp,{placement:"top",children:e.disabledMessage})]}):(0,i.jsx)(_d,{replace:!0,to:e.path,children:(0,i.jsx)(ka,{color:t?"primaryCustom500":"grayCustom500",css:{borderBottom:t?"2px solid $primaryCustom500":"unset",cursor:t?"inherit":"pointer",paddingBlock:"$3","&:hover":{color:t?"$primaryCustom600":"$grayCustom800"},fontWeight:"$medium"},children:e.children})}),(0,i.jsx)(ka,{width:24})]})},ob=e=>(0,i.jsxs)(rd,{"aria-orientation":"horizontal",as:id.Nav,css:{borderBottom:"1px solid $gray200",...e.css},width:1,children:[e.center&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(ka,{css:{flex:"1"}})}),e.children,(0,i.jsx)(ka,{css:{flex:"1"}})]}),sb=e=>(0,i.jsx)(i.Fragment,{children:e.children});sb.displayName="TabPanel";const rb=e=>{const[t,n]=(0,Bg.A)(V.Children.toArray(e.children),e=>V.isValidElement(e)&&e.type===sb);return(0,i.jsxs)(rd,{direction:"column",width:1,...od(e),children:[n,(0,i.jsx)(Ea.dO,{children:t.map((e,t)=>(0,i.jsx)(Ea.qh,{path:e.props.path,children:e},t))})]})},ab=V.createContext({}),lb=e=>(0,i.jsx)(ab.Provider,{value:{...e},children:e.children}),db=e=>(0,i.jsxs)(ka,{css:{background:"white",bd:!0,padding:"$6",width:"100%"},children:[(0,i.jsx)(ka,{color:"gray500",fontWeight:"medium",children:e.title}),(0,i.jsx)(ka,{color:"gray900",fontSize:"displayMd",fontWeight:"semiBold",children:e.content})]}),cb=xa(rd,{gap:"$3",variants:{avatarOnTop:{true:{flexDirection:"column",gap:"$2"},false:{alignItems:"center",flexDirection:"row"}}}}),ub=e=>{const{params:{organizationId:t,eventId:n}}=bd(),o=V.useMemo(()=>g(e.userInfo.name)?e.userInfo.name:"-",[e.userInfo.name]),s=()=>(0,i.jsx)(ka,{color:e.disabled?"gray300":"gray800",css:{ellipsis:""},disabled:e.disabled,fontWeight:"medium",title:o,children:o});return(0,i.jsxs)(cb,{avatarOnTop:{"@initial":!!e.badge,"@tablet":!1},width:1,children:[(0,i.jsx)(Gf,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:e.size||40}),(0,i.jsxs)(rd,{css:{flex:"1",overflow:"hidden"},direction:"column",justify:"center",children:[(0,i.jsxs)(rd,{align:"center",gap:"2",children:[e.isClickDisabled?s():(0,i.jsx)(bm,{to:e.clickPath??bx.MEMBER_INFORMATION({organizationId:t,eventId:n,userInfoId:e.userInfo.id}),children:s()}),(0,i.jsx)(ka,{css:{flexShrink:0},children:e.badge})]}),(0,i.jsx)(ka,{color:e.disabled?"gray300":"gray500",css:{ellipsis:""},fontSize:"textSm",title:e.userInfo.email,children:e.areContactLinksEnabled?(0,i.jsx)(bm,{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)(ka,{color:e.disabled?"gray300":"gray500",css:{ellipsis:""},fontSize:"textSm",title:e.userInfo.phone?.internationalFormat,children:e.areContactLinksEnabled?(0,i.jsx)(bm,{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 mb(e){switch(e){case dt.Waiting:case dt.Queued:return{color:"warning",leftIcon:"hourglass-empty"};case dt.Bounced:return{color:"error",leftIcon:"circle-exclamation"};default:return{color:"success",leftIcon:"check"}}}const hb=e=>{const{translate:t,params:{organizationId:n,eventId:o,campaignId:s}}=bd(),r=Ei(Cm),{mutate:a}=la(),{mutate:l}=Yr();return(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(ub,{userInfo:e.email.userInfo})}),(0,i.jsx)(Qu,{children:e.email.sentAt?r.toLocaleString(e.email.sentAt.toLocal(),zs.DateTime):""}),(0,i.jsxs)(Qu,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(vu,{...mb(e.email.state),children:t(e.email.state)}),e.email.state===dt.Bounced&&g(e.email.infos?.bounceDiagnosticCode)&&(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.email.infos.bounceDiagnosticCode,width:1,children:e.email.infos.bounceDiagnosticCode})]}),(0,i.jsx)(jm,{justify:"end",children:(0,i.jsx)(vm,{children:(0,i.jsx)(ru,{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")})})})]})},gb=e=>{const{params:{organizationId:t,campaignId:n},translate:o}=bd(),[s,r,a]=gm(""),[l,d]=(0,V.useState)(""),[c,u]=(0,V.useState)(0),{data:m,isLoading:h,reload:p}=Oi("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:g(r)?r:void 0,state:""!==l?l:void 0,offset:c},[js.EmailRecipientFragment]);const f=um();return(0,i.jsxs)(Qv,{direction:"column",gap:"7",children:[(0,i.jsxs)(rd,{gap:"6",children:[(0,i.jsx)(db,{content:e.campaign.numberOfRecipients,title:o("nombre_de_desti_21374")}),(0,i.jsx)(db,{content:e.campaign.numberOfOpen??0,title:o("nombre_d_ouvert_84187")}),(0,i.jsx)(db,{content:e.campaign.numberOfClick??0,title:o("nombre_de_clics_64232")})]}),(0,i.jsx)(dm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{width:200,children:(0,i.jsxs)(hh,{value:l,onChange:e=>{d(e),u(0)},children:[(0,i.jsx)("option",{value:"",children:o("tous_les_status_67644")}),f(Dn.filter(e=>e!==dt.Queued))]})}),(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{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)(pm,{children:o("nom_du_membre_69353")}),(0,i.jsx)(pm,{children:o("date_d_envoi_74668")}),(0,i.jsx)(pm,{children:o("State")}),(0,i.jsx)(pm,{width:100})]}),numberOfPages:m.organization?.campaign.emails.numberOfPages??0,offset:c,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:m.organization.campaign.emails.nodes.map((e,t)=>(0,i.jsx)(hb,{email:e,emailType:null,reload:p},t))}),setOffset:u,title:o("liste_des_desti_16448"),totalCount:m.organization?.campaign.emails.totalCount??0})]})},pb=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,userInfoId:r}}=bd(),[a,l,d]=gm(""),{usersInfosOptions:c,isLoading:u}=Lv({organizationId:o,eventId:s,hasSelected:!0,nameDebounced:l,userInfoIds:[r],populationsIds:e.populationsIds});return(0,i.jsxs)(rd,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7",...e.css},gap:"4",children:[(0,i.jsx)(ka,{font:"gray900 textMd semiBold",children:n("aper_u_pour_le_81451")}),(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Uu,{isSearchLoading:u,isSearchVisible:!0,searchElement:(0,i.jsx)(Qd,{icon:"magnifying-glass",name:a,placeholder:n("rechercher_un_m_05904"),state:"search",onChange:d}),values:[r],onChange:n=>{Bs(n)&&t.replace(e.getPath(n[0]))},children:c})}),g(e.downloadPath)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{css:{flex:"1"}}),(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",to:e.downloadPath,children:n("t_l_charger_03283")})})]})]})};function fb(e){switch(e){case ve.Assigned:return{color:"success",leftIcon:"check"};case ve.Refused:return{color:"error",leftIcon:"xmark"};case ve.PreAssigned:return{color:"pink",leftIcon:"wand-magic-sparkles"};case ve.WaitingAssignment:return{color:"warning",leftIcon:"hourglass-empty"};case ve.NotApplicable:return{color:"gray",leftIcon:"infinity"};default:return vd()}}function _b(e){switch(e){case We.Accredited:return{color:"success",leftIcon:"check"};case We.AutoAccredited:return{color:"success",leftIcon:"bolt-auto"};case We.Refused:return{color:"error",leftIcon:"xmark"};case We.WaitingAccreditation:return{color:"warning",leftIcon:"hourglass-empty"};case We.NotApplicable:return{color:"gray",leftIcon:"infinity"};default:return vd()}}const xb=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=bd(),{getVolunteersSegmentPath:r}=V.useContext(ab),a=(0,V.useMemo)(()=>e.campaign.positionsCategories.map(e=>({id:`pc-${e.id}`,name:e.name,link:Jo.POSITION_CATEGORY({organizationId:o,eventId:s,positionCategoryId:e.id})})).concat(e.campaign.positions.map(e=>({id:`p-${e.id}`,name:e.name,link:Jo.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:Jo.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,V.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:Mo.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:Mo.ACCREDITATION({organizationId:o,eventId:s,accreditationId:e.accreditation.id})}))),[e.campaign]),d=(0,V.useMemo)(()=>l.length+a.length,[l,a]);return(0,i.jsxs)(rd,{gap:"1",children:[(0,i.jsx)(ka,{color:"gray500",children:n("_96502")}),e.campaign.sendToEveryone?(0,i.jsx)(ka,{color:"gray800",children:n("tous_vos_membre_30731")}):Bs(e.campaign.states)?(0,i.jsx)(rd,{css:{flex:"1"},gap:"2",wrap:"wrap",children:e.campaign.states.map(e=>(0,i.jsx)(vu,{...fb(e),children:n(e)},e))}):Bs(e.campaign.usersInfos)?(0,i.jsx)(rd,{css:{flex:"1"},gap:"1",wrap:"wrap",children:e.campaign.usersInfos.map((n,r)=>(0,i.jsxs)(ka,{color:"primary500",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{t.push(bx.MEMBER_INFORMATION({organizationId:o,eventId:s,userInfoId:n.id}))},children:[n.nameOrEmail,r!==e.campaign.usersInfos.length-1&&", "]},n.id))}):Bs(e.campaign.segments)?(0,i.jsx)(rd,{css:{flex:"1"},gap:"1",wrap:"wrap",children:e.campaign.segments.map((n,o)=>(0,i.jsxs)(ka,{color:"primary500",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)(rd,{css:{flex:"1"},gap:"1",wrap:"wrap",children:a.concat(l).map((e,n)=>(0,i.jsxs)(ka,{color:g(e.link)?"primary500":"gray800",css:{cursor:g(e.link)?"pointer":"initial",textDecoration:"underline"},onClick:()=>{g(e.link)&&t.push(e.link)},children:[e.name,n!==d-1?", ":""]},e.id))})]})},Ib=e=>{const t=Ti(),n=(0,V.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)(rd,{css:{background:"$gray50",minHeight:"100%",py:"$6"},justify:"center",width:1,children:(0,i.jsxs)(rd,{css:{background:"white",borderRadius:"$2",boxShadow:"$md",minHeight:"100%",overflow:"hidden",paddingTop:e.userSelector?"0":"$6"},direction:"column",gap:"3",width:664,children:[e.userSelector,e.createdBy&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(ka,{color:"gray500",children:t("cr_e_par_16667")}),(0,i.jsx)(ka,{color:"gray800",children:e.createdBy})]}),(0,i.jsx)(ka,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.from&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(ka,{color:"gray500",children:t("de_70487")}),(0,i.jsx)(ka,{color:"gray800",children:e.from})]}),(0,i.jsx)(ka,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.to&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{css:{margin:"0 $6"},width:1,children:(0,i.jsx)(xb,{campaign:e.to})}),(0,i.jsx)(ka,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.subject&&(0,i.jsxs)(rd,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(ka,{color:"gray500",children:t("objet_86482")}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:e.subject})]}),e.content&&(0,i.jsxs)(rd,{css:{background:"$gray100",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",flexGrow:"1",padding:"$7"},direction:"column",gap:"6",children:[(0,i.jsx)(ka,{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})}),(Bs(e.attachments)||Bs(e.documents))&&(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(ka,{font:"gray900 textXl semiBold",children:t("pi_ces_jointes_36761")}),(0,i.jsx)(rd,{gap:"2",children:(e.attachments||[]).map(e=>(0,i.jsx)(vu,{color:"white",size:"md",children:Mx.includes(e)?t(e):kn.includes(e)?y_(e):e},e))}),(0,i.jsx)(rd,{direction:"column",gap:"3",children:(e.documents||[]).map(e=>(0,i.jsx)(iI,{acl:"public-read",document:e},e.id))})]})]})]})})},vb=()=>{const{params:{organizationId:e,eventId:t,campaignId:n,userInfoId:o}}=bd(),{data:s,loader:r}=ol({organizationId:e,campaignId:n,userInfoId:o}),a=(0,V.useMemo)(()=>s.organization?.campaign.createdBy?`${s.organization.campaign.createdBy.name} (${s.organization.campaign.createdBy.email})`:null,[s.organization]),l=(0,V.useMemo)(()=>s.organization?.campaign.emailSender?`${s.organization.campaign.emailSender.fromName} (${s.organization.campaign.emailSender.fromEmail})`:F.EMAIL_FROM,[s.organization]);return r||(0,i.jsx)(Qv,{children:(0,i.jsx)(Ib,{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,userSelector:(0,i.jsx)(pb,{css:{border:"none",px:"$6"},getPath:i=>Tx.CAMPAIGN_PREVIEW({organizationId:e,eventId:t,campaignId:n,userInfoId:i})})})})},bb=({children:e,color:t,fontWeight:n,returnPathFallback:o})=>{const s=$i();return(0,i.jsxs)(rd,{align:"center",css:{color:"primary"===t?"$primary500":"$gray900",cursor:"pointer",fontSize:"textXl",fontWeight:n??"normal",padding:0},gap:"2",onClick:()=>s.goBack(o),children:[(0,i.jsx)(Id,{icon:"arrow-left"}),e]})},jb=e=>{const{translate:t,params:{organizationId:n,eventId:o,campaignId:s}}=bd(),{canCampaignSend:r}=Dv();return(0,i.jsxs)(tb,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(bb,{returnPathFallback:Tx.CAMPAIGNS({organizationId:n,eventId:o})}),(0,i.jsx)(ka,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.campaign.name}),r&&(0,i.jsx)(kd,{to:Tx.UPDATE({organizationId:n,eventId:o,campaignId:s}),children:t("_diter_la_campa_04069")})]})};function Cb(e){switch(e){case Ne.Waiting:return{color:"warning",leftIcon:"hourglass-empty"};case Ne.Sent:case Ne.Delivered:return{color:"success",leftIcon:"check"};default:return{color:"error",leftIcon:"circle-exclamation"}}}const yb=e=>(0,i.jsx)(ka,{color:"gray800",css:{borderBottom:"1px solid $gray200",padding:"$6"},fontSize:"textXl",fontWeight:"medium",children:e.children}),Ab=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{gap:"3",width:1,children:[(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[e.message.createdBy&&(0,i.jsx)(ka,{color:"gray800",textAlign:"end",children:e.message.createdBy.name}),(0,i.jsx)(ka,{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)(ka,{children:(0,i.jsx)(Gf,{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)(V.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{gap:"3",width:1,children:[(0,i.jsx)(ka,{children:(0,i.jsx)(Gf,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:40})}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{color:"gray800",children:e.userInfo.name}),(0,i.jsx)(ka,{color:"gray800",css:{background:"$gray100",borderRadius:"$2",borderTopLeftRadius:"0",boxShadow:"$sm",padding:"$3"},width:1,children:unescape(t)})]})]})]},n))]}),Sb=e=>{const t=Ti(),{mutate:n}=function(e={}){return Di("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,V.useState)(""),{numberOfCharacters:r,numberOfSms:a}=MI(o,!1),l=g(o);return(0,i.jsxs)(rd,{direction:"column",gap:"3",width:1,children:[(0,i.jsx)(qp,{label:(0,i.jsxs)(rd,{justify:"between",children:[(0,i.jsx)(ka,{children:t("contenu_de_la_r_08075")}),(0,i.jsx)(ka,{color:"gray500",children:t("_1_caract_re_04414",r,a)})]}),value:o,onChange:s}),(0,i.jsx)(rd,{justify:"end",children:(0,i.jsx)(kd,{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")})})]})},kb=e=>{const t=Ti(),{data:n,loader:o,reload:s}=Oi("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},[js.CreatedByFragment]);const r=(0,V.useMemo)(()=>(0,cm.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)(Jm,{size:"sm",onClose:e.onClose,children:[(0,i.jsx)(yb,{children:t("r_ponse_de_1_77675",e.userInfo.name)}),o||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Qm,{children:[r.map((t,n)=>(0,i.jsx)(Ab,{message:t,userInfo:e.userInfo},n)),(0,i.jsx)(md,{height:"6"})]}),(0,i.jsx)(eh,{children:(0,i.jsx)(Sb,{eventId:e.eventId,organizationId:e.organizationId,parentId:e.textMessage.id,reload:s})})]})]})},wb=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),s=Ei(Cm),{mutate:r}=function(e={}){return Di("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,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(am,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(ub,{userInfo:e.textMessage.userInfo})}),(0,i.jsx)(Qu,{children:e.textMessage.userInfo.phone?.internationalFormat??""}),(0,i.jsx)(Qu,{children:e.textMessage.sentAt?s.toLocaleString(e.textMessage.sentAt,zs.DateTime):""}),(0,i.jsx)(Qu,{children:(0,i.jsx)(vu,{...Cb(e.textMessage.state),children:t(e.textMessage.state)})}),(0,i.jsx)(Qu,{children:e.textMessage.numberOfReplies>0?(0,i.jsx)(kd,{color:"white",size:"sm",onClick:async t=>{Gd(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)(kb,{createdBy:e.createdBy,eventId:o,organizationId:n,text:e.text,textMessage:e.textMessage,userInfo:e.textMessage.userInfo,onClose:()=>{l(!1)}})]})},Eb=e=>{const{params:{organizationId:t,campaignId:n},translate:o}=bd(),[s,r,a]=gm(""),[l,d]=(0,V.useState)(""),[c,u]=(0,V.useState)(""),[m,h]=(0,V.useState)(0),{data:p,isLoading:f}=Oi("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:g(r)?r:void 0,state:""!==l?l:void 0,replies:""!==c?c:void 0,offset:m},[js.CreatedByFragment,js.CampaignUserInfoFragment]);const _=um(),{numberOfPages:x,totalCount:I}=ah(p.organization?.campaign.textMessages);return(0,i.jsxs)(Qv,{direction:"column",gap:"7",children:[(0,i.jsxs)(rd,{gap:"6",children:[(0,i.jsx)(db,{content:e.campaign.numberOfRecipients,title:o("nombre_de_desti_21374")}),(0,i.jsx)(db,{content:e.campaign.numberOfDelivery??0,title:o("nombre_de_messa_93859")}),(0,i.jsx)(db,{content:e.campaign.cost,title:o("co_t_de_la_camp_54312")})]}),(0,i.jsx)(dm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{width:200,children:(0,i.jsxs)(hh,{value:l,onChange:e=>{d(e),h(0)},children:[(0,i.jsx)("option",{value:"",children:o("tous_les_status_67644")}),_(ci)]})}),(0,i.jsx)(ka,{width:240,children:(0,i.jsxs)(hh,{value:c,onChange:e=>{u(e),h(0)},children:[(0,i.jsx)("option",{value:"",children:o("avec_et_sans_r_23765")}),_(di)]})}),(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:o("rechercher_un_d_02329"),value:s,onChange:e=>{a(e),h(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:o("nom_du_membre_69353")}),(0,i.jsx)(pm,{children:o("Phone")}),(0,i.jsx)(pm,{children:o("date_d_envoi_74668")}),(0,i.jsx)(pm,{children:o("State")}),(0,i.jsx)(pm,{children:o("r_ponses_97000")})]}),numberOfPages:x,offset:m,rows:f?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{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:h,title:o("liste_des_desti_16448"),totalCount:I})]})},Tb=()=>{const{params:{organizationId:e,eventId:t,campaignId:n,userInfoId:o}}=bd(),s=Ei(Cm),{data:r,loader:a}=ol({organizationId:e,campaignId:n,userInfoId:o}),l=r.organization?.campaign.sentAt?.setZone(As.c9.local().zone);return a||(0,i.jsx)(Qv,{children:(0,i.jsx)(rd,{css:{background:"$gray50",py:"$6"},justify:"center",width:1,children:(0,i.jsxs)(rd,{css:{background:"white",borderRadius:"$2",boxShadow:"$md",overflow:"hidden",paddingBottom:"$6"},direction:"column",gap:"3",width:640,children:[(0,i.jsx)(pb,{css:{border:"none",px:"$6"},getPath:i=>Tx.CAMPAIGN_PREVIEW({organizationId:e,eventId:t,campaignId:n,userInfoId:i})}),(0,i.jsx)(ka,{css:{px:"$6"},children:(0,i.jsx)(xb,{campaign:r.organization.campaign})}),(0,i.jsx)(ka,{css:{borderTop:"1px solid $gray200",height:"1px",px:"$6"}}),(0,i.jsxs)(rd,{css:{px:"$6"},gap:"3",width:1,children:[r.organization.campaign.createdBy&&(0,i.jsx)(ka,{children:(0,i.jsx)(Gf,{email:r.organization.campaign.createdBy.email,image:r.organization.campaign.createdBy.picture?.url,name:r.organization.campaign.createdBy.name,size:40})}),(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(r.organization.campaign.createdBy||l)&&(0,i.jsxs)(rd,{gap:"3",width:1,children:[r.organization.campaign.createdBy&&(0,i.jsx)(ka,{color:"gray800",css:{flex:"1"},fontWeight:"medium",children:r.organization.campaign.createdBy.name}),l&&(0,i.jsx)(ka,{color:"gray500",children:s.toLocaleString(l,zs.DateTime)})]}),(0,i.jsx)(ka,{color:"gray800",css:{background:"$gray100",borderRadius:"$2",borderTopLeftRadius:"0",boxShadow:"$sm",padding:"$3"},dangerouslySetInnerHTML:{__html:r.organization.campaign.preview}})]})]})]})})})},Rb=()=>{const{params:{organizationId:e,eventId:t,campaignId:n},translate:o}=bd(),{data:s,loader:r}=Oi("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:e,eventId:t,campaignId:n},[]),a=(0,V.useMemo)(()=>s.organization?t?s.organization.event?.volunteersRegistrations.nodes[0]?.userInfoId:s.organization.usersInfos.nodes[0].id:-1,[t,s.organization]);Zc(`${s.organization?.campaign.name??""} ${o("campagne_97871")}`);const l=i=>({organizationId:i?":organizationId":e,eventId:t?i?":eventId":t:void 0,campaignId:i?":campaignId":n}),d=e=>({...l(e),userInfoId:e?":userInfoId":a}),c=Ui([Tx.CAMPAIGN(l(!1)),Hi.PREVIEW]);return r||(0,i.jsxs)(nb,{children:[(0,i.jsx)(jb,{campaign:s.organization.campaign}),(0,i.jsxs)(rb,{css:{flex:"1"},children:[(0,i.jsxs)(ob,{css:{px:"$7"},children:[(0,i.jsx)(ib,{path:Tx.CAMPAIGN_DASHBOARD(l(!1)),children:o("tableau_de_bord_24627")}),(0,i.jsx)(ib,{basePath:c,disabled:!a,disabledMessage:o("vous_devez_avoir_2345"),path:Tx.CAMPAIGN_PREVIEW(d(!1)),children:o("aper_u_25595")})]}),(0,i.jsx)(sb,{path:Tx.CAMPAIGN_DASHBOARD(l(!0)),children:s.organization?.campaign.campaignType===ue.Email?(0,i.jsx)(gb,{campaign:s.organization?.campaign}):(0,i.jsx)(Eb,{campaign:s.organization?.campaign})}),(0,i.jsx)(sb,{path:Tx.CAMPAIGN_PREVIEW(d(!0)),children:s.organization?.campaign.campaignType===ue.Email?(0,i.jsx)(vb,{}):(0,i.jsx)(Tb,{})})]})]})},Ob=()=>{const{organizationId:e,eventId:t}=zi();return(0,i.jsx)(lb,{getVolunteersSegmentPath:n=>fs.VOLUNTEERS_SEGMENT(e,t,n),isOrganizationCampaign:!1,children:(0,i.jsx)(Rb,{})})},Db=()=>{const{organizationId:e}=zi();return(0,i.jsx)(lb,{getVolunteersSegmentPath:t=>fs.COMMUNITY_USERS_SEGMENT(e,t),isOrganizationCampaign:!0,children:(0,i.jsx)(Rb,{})})};function zb(e){switch(e){case rt.Expired:return{color:"error",leftIcon:"clock"};case rt.Full:return{color:"error",leftIcon:"hundred-points"};case rt.Locked:return{color:"error",leftIcon:"lock-keyhole"};case rt.Ongoing:return{color:"success",leftIcon:"check"};default:return vd()}}let $b=class extends ic{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=Bs(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,delegationsSpaceLayoutId:e?.delegationsSpaceLayoutId??null,columns:e?.columns??t?.parentDelegation?.columns??["name","accreditations","accreditation_state"],canLeadersAddMembers:e?.canLeadersAddMembers??!0,canLeadersDeleteMembers:e?.canLeadersDeleteMembers??!0,canLeadersDuplicateMembers:e?.canLeadersDuplicateMembers??!1,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,showAllAccreditations:e?.showAllAccreditations??!1,tagsIds:e?.tagsIds??t?.parentDelegation?.tagsIds??[],customFields:e?.customFields||[],fields:e?.fields??{},campaignsIds:e?.campaignsIds??[],customDocumentsSlugs:e?.customDocumentsSlugs??[],usedCustomFieldsIds:e?.usedCustomFieldsIds??[],accreditationsProfiles:e?.accreditationsProfiles??[]}}delegationInputSchema(){return c.Ik().shape({parentId:c.ai().nullable(),name:c.Yj().when("parentId",{is:null,then:e=>e.required(this.t("le_nom_de_la_d_10042"))}),description:c.Yj(),delegationCategoryId:c.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:c.YO().of(c.ai()),formId:c.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:Yp.typeError(this.t("la_date_limite_91708")).nullable(),maxResources:c.ai().min(0).nullable(),showInDelegationSpace:c.zM().required(),showFormLinkInDelegationSpace:c.zM().required(),columns:c.YO().of(c.Yj()).required(this.t("vous_devez_choi_82605")).min(1,this.t("vous_devez_choi_82605")),canLeadersAddMembers:c.zM().required(),canLeadersDeleteMembers:c.zM().required(),canLeadersEditColumns:c.zM().required(),canLeadersEditMembers:c.zM().required(),canLeadersEditCustomFields:c.zM().required(),canLeadersImportMembers:c.zM().required(),canLeadersSeeHiddenAccreditationsSlots:c.zM().required(),privateNote:c.Yj(),accreditations:c.YO().of(c.Ik().shape({accreditationCategoryId:c.ai().required(),accreditationId:c.ai().required(),maxResources:c.gl().nullable(),willAutoAccredit:c.zM().required()})),accreditationsSlots:c.YO().of(c.Ik().shape({accreditationCategoryId:c.ai().required(),accreditationId:c.ai().required(),accreditationSlotId:c.ai().required(),isDefault:c.zM().required(),maxResources:c.gl().nullable()})),accreditationsProfiles:c.YO().of(c.Ik().shape({accreditationProfileId:c.ai().required(),maxResources:c.gl().nullable(),willAutoAccredit:c.zM().required()})),campaignsIds:c.YO().of(c.ai()),customDocumentsSlugs:c.YO().of(c.gl()),usedCustomFieldsIds:c.YO().of(c.ai())})}delegationUpdateFieldsSchema(e){return c.Ik().shape({fields:e})}createUpdateDelegationSchema(e){const t=this.delegationInputSchema();return c.Ik().shape({delegation:e?t.shape({fields:e}):t})}adminAddSchema(){return c.Ik().shape({usersInfosIds:c.YO().of(c.ai())})}getDefaultAccreditations(e){let t=e?.accreditationsCategories||[],n=e?.accreditations||[];const i=e?.accreditationsSlots||[];return Bs(i)&&(t=(0,Xh.A)(t.concat(i.map(e=>({accreditationCategoryId:e.accreditationCategoryId,maxResources:null}))),e=>e.accreditationCategoryId)),Bs(i)&&(n=(0,Xh.A)(n.concat(i.map(e=>({accreditationCategoryId:e.accreditationCategoryId,accreditationId:e.accreditationId,maxResources:null,willAutoAccredit:!1}))),e=>e.accreditationId)),{accreditationsCategories:t,accreditations:n,accreditationsSlots:i}}};$b=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],$b);var Pb=n(2662);const Mb=/^[0-9]{11}$/i,Fb=As.c9.now().year-2e3;function Nb(e){if(g(e)&&Mb.test(e)){const t=(0,Pb.A)(e.substring(0,2),10);let n=(0,Pb.A)(e.substring(0,9),10);const i=(0,Pb.A)(e.substring(9),10);return t<=Fb&&(n=2e9+n),i===97-n%97}return!1}const Lb=/^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$/,Bb={AD:24,AE:23,AL:28,AO:25,AT:20,AX:18,AZ:28,BA:20,BE:16,BF:28,BG:22,BH:22,BI:27,BJ:28,BL:27,BR:29,BY:28,CF:27,CG:27,CH:21,CI:28,CM:27,CR:22,CV:25,CY:28,CZ:24,DE:22,DJ:27,DK:18,DO:28,DZ:26,EA:24,EE:20,EG:29,ES:24,FI:18,FK:18,FO:18,FR:27,GA:27,GB:22,GE:22,GF:27,GG:22,GI:23,GL:18,GP:27,GQ:27,GR:27,GT:28,GW:25,HN:28,HR:21,HU:28,IC:24,IE:22,IL:23,IM:22,IQ:23,IR:26,IS:26,IT:27,JE:22,JO:30,KM:27,KW:30,KZ:20,LB:28,LC:32,LI:21,LT:20,LU:20,LV:21,LY:25,MA:28,MC:27,MD:24,ME:22,MF:27,MG:27,MK:19,ML:28,MN:20,MQ:27,MR:27,MT:31,MU:30,MZ:25,NC:27,NE:28,NI:28,NL:18,NO:15,OM:23,PF:27,PK:24,PL:28,PM:27,PS:29,PT:25,QA:29,RE:27,RO:24,RS:22,RU:33,SA:24,SC:31,SD:18,SE:24,SI:19,SK:24,SM:27,SN:28,SO:23,ST:25,SV:28,TD:27,TF:27,TG:28,TL:23,TN:24,TR:26,UA:29,VA:22,VG:24,WF:27,XK:20,YE:30,YT:27},Vb=[Oe.Checkbox,Oe.Select,Oe.Validation];function Ub(e,t){switch(t){case Te.Accreditation:return e("accr_ditations_39450");case Te.Delegation:return e("d_l_gations_78318");case Te.Event:return e("Event");case Te.Position:return e("missions_63972");case Te.UserInfo:return e("membres_11310");default:return vd()}}function Wb(e){return g(e.label)?`${e.name} (${e.label})`:e.name}function Gb(e){return e.fieldType===Oe.Select&&e.canSelectMultiple}const qb=["default","regex"],Hb=["all","numbers","noSymbols","uppercase","lowercase"],Kb=["any","past","between"];function Yb(e){switch(e.fieldType){case Oe.Text:return e.fieldSubtype===mt.Freeform?"text":null;case Oe.Textarea:return"text";case Oe.Number:return"number";case Oe.Date:case Oe.Datetime:return e.fieldProperty===pt.DateOfBirth?null:"date";default:return null}}function Zb(e){switch(e){case"text":return{mode:"default",allowedCharacters:"all"};case"date":return{range:"any"};default:return{}}}let Xb=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 Oe.Text:case Oe.Textarea:case Oe.Time:case Oe.Address:return t[e.slug]||"";case Oe.Sex:return this.getSexValue(e,t);case Oe.Language:return this.getLanguageValue(e,t);case Oe.Nationality:return this.getNationalityValue(e,t);case Oe.Country:return this.getCountryValue(e,t);case Oe.Select:return this.getSelectValue(e,t);case Oe.Checkbox:case Oe.Validation:return this.getBooleanValue(e,t);case Oe.Date:return this.getDateValue(e,t,n.dateFormat);case Oe.Datetime:return this.getDatetimeValue(e,t,n.datetimeFormat);case Oe.File:return"name"===n.fileReturnValue?t[e.slug]?.name||"":t[e.slug]?.url||"";case Oe.Phone:return this.getPhoneValue(e,t);case Oe.Number:return this.getIntValue(e,t);default:return vd(e.fieldType)}}getValue(e,t){return t[e.slug]}getSelectValues(e,t){const n=Ls(this.getValue(e,t)??[]);return(0,hd.A)(n.map(t=>e.values.find(e=>e.id===t)?.value))}getSelectCustomFieldValues(e,t){const n=Ls(this.getValue(e,t)??[]);return(0,hd.A)(n.map(t=>e.values.find(e=>e.id===t)))}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 g(i)&&(i=As.c9.fromISO(i,{zone:"utc"})),As.c9.isDateTime(i)&&i.isValid?g(n)?i.toFormat(n):this.dateTimeService.toLocaleString(i,zs.DateOnly.MonthLong):""}getDatetimeValue(e,t,n){let i=this.getValue(e,t);return g(i)&&(i=As.c9.fromISO(i,{zone:"utc"})),As.c9.isDateTime(i)&&i.isValid?g(n)?i.toFormat(n):this.dateTimeService.toLocaleString(i,zs.DateTime):""}getPhoneValue(e,t){return this.getValue(e,t)?.internationalFormat??""}getIntValue(e,t){return this.getValue(e,t)?.toString()??""}getSelectValue(e,t){const n=Ls(this.getValue(e,t)??[]);return(0,hd.A)(n.map(t=>e.values.find(e=>e.id===t)?.value)).join(", ")}};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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mm,Cm,Si])],Xb);const Jb=[Oe.Country,Oe.Language,Oe.Nationality,Oe.Select];function Qb(e,t,n){if(e.hasCondition&&e.conditionCustomField){const i=n.find(t=>t.id===e.conditionCustomField.id);if(i){if(Qb(i,t,n)){const n=t[e.conditionCustomField.slug];return"boolean"==typeof n&&e.conditionCustomField.fieldType===Oe.Checkbox?n===e.conditionValue:!(!Jb.includes(e.conditionCustomField.fieldType)||!Bs(e.conditionValue))&&(0,Pu.A)(Ls(n),e.conditionValue).length>0}return!1}return!1}return!0}const ej=["key","name","acl"];let tj=class extends ic{constructor(e){super(e)}documentInputDefault(){return{key:"",name:"",acl:""}}documentInputSchema(e){const t=g(e)?this.t("_1_est_requis_99856",e):this.t("le_document_est_86403");return c.Ik().shape({key:c.Yj().required(t),name:c.Yj().required(t),acl:c.Yj().required(t)})}documentInputSchemaNotRequired(){return c.Ik().shape({key:c.Yj(),name:c.Yj(),acl:c.Yj()})}};tj=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],tj);const nj=zs.DateOnly.Numeric,ij=Rc.concat(Gn);let oj=class extends ic{countriesService;dateTimeService;documentInputService;phoneInputService;translationService;constructor(e,t,n,i,o){super(o),this.countriesService=e,this.dateTimeService=t,this.documentInputService=n,this.phoneInputService=i,this.translationService=o}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)]}))}getValidationRuleError(e,t,n){switch(Yb(e)){case"text":return g(t)?this.textValidationRuleError(e.name,e.validationRules,t):null;case"number":return"number"==typeof t?this.numberValidationRuleError(e.name,e.validationRules,t):null;case"date":{const i=g(t)||As.c9.isDateTime(t)?$s(t):null;return i?.isValid?this.dateValidationRuleError(e.name,e.validationRules,i,n):null}default:return null}}changedFieldsSchema(e,t,n){return c.Ik().shape(Object.fromEntries(e.filter(({slug:e})=>!(0,La.A)(n[e],t[e])).map(e=>[e.slug,this.fieldSchema(e,!1)])))}fieldSchema(e,t){const n=t=>t.test("validation-rules","",(t,n)=>{const i=this.getValidationRuleError(e,t);return!i||n.createError({message:i})}),i=(i,o)=>{const s=()=>n(i()),r=()=>n(o());if(e.conditionCustomField)return c.Ik().when(e.conditionCustomField.slug,([n])=>t&&(e.conditionCustomField.fieldType===Oe.Checkbox&&n===e.conditionValue||Jb.includes(e.conditionCustomField.fieldType)&&Bs(e.conditionValue)&&(0,Pu.A)(Ls(n),e.conditionValue).length>0)?s():r());{let e;return e=t?s():r(),e}};switch(e.fieldType){case Oe.File:return i(()=>this.documentInputService.documentInputSchema(e.name),()=>this.documentInputService.documentInputSchemaNotRequired());case Oe.Phone:return i(()=>this.phoneInputService.phoneInputSchema(),()=>this.phoneInputService.phoneInputSchemaNotRequired());case Oe.Text:case Oe.Textarea:case Oe.Time:case Oe.Address:return e.fieldProperty===pt.Eid?i(()=>c.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"),e=>!(!g(e)||12!==e.length||!e.startsWith("********"))||Nb(e)),()=>c.Yj()):e.fieldSubtype!==mt.Freeform?i(()=>c.Yj().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)).test("valid-eid",this.t("_1_n_est_pas_a_14932",e.name),t=>{if(g(t)&&12===t.length&&t.startsWith("********"))return!0;switch(e.fieldSubtype){case mt.Eid:return Nb(t);case mt.Avs:return function(e){if(g(e)){const t=e.replace(/\D/g,"");if(13===t.length&&t.startsWith("756")){const e=t.substring(0,12).split("").reduce((e,t,n)=>n%2==0?e+Number(t):e+3*Number(t),0)%10;return(0===e?0:10-e)===Number(t[12])}return!1}return!1}(t);case mt.Iban:return function(e){if(g(e)){const t=e.toUpperCase().trim().replace(/\s+/g,"");if(Lb.test(t)){const e=t.substring(0,2);if(t.length===Bb[e]){const e=`${t.substring(4)}${t.substring(0,4)}`;let n="";for(const t of e)n=/[A-Z]/.test(t)?`${n}${t.charCodeAt(0)-55}`:`${n}${t}`;return BigInt(n)%97n==1n}return!1}return!1}return!1}(t);case mt.Freeform:return!0;default:return vd(e.fieldSubtype)}}),()=>c.Yj()):i(()=>c.Yj().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>c.Yj());case Oe.Number:return i(()=>c.ai().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>c.ai().nullable());case Oe.Checkbox:return i(()=>c.zM().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>c.zM());case Oe.Validation:return i(()=>c.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)),()=>c.zM());case Oe.Select:return e.canSelectMultiple?i(()=>c.YO().of(c.ai().required()).required(this.t("_1_est_requis_99856",e.name)).min(1,this.t("vous_devez_s_le_55757",e.name)),()=>c.YO().of(c.ai())):i(()=>c.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)),()=>c.ai().oneOf(e.values.map(({id:e})=>e),this.oneOfMessage(e.name,e.values.map(({value:e})=>e))));case Oe.Date:case Oe.Datetime:return e.fieldProperty===pt.DateOfBirth?i(()=>Yp.required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("la_date_est_inv_22002",e.name)).test("valid-date-of-birth",this.t("la_date_de_nais_19129"),e=>!(!As.c9.isDateTime(e)||!e.isValid)&&e>=fh&&e<=_h),()=>c.gl().nullable().test("valid-date-of-birth",this.t("la_date_de_nais_19129"),e=>!As.c9.isDateTime(e)||!e.isValid||e>=fh&&e<=_h)):i(()=>Yp.required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("la_date_est_inv_22002",e.name)),()=>c.gl().nullable());case Oe.Sex:return i(()=>c.Yj().oneOf(ai,this.oneOfMessage(e.name,ai)).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>c.Yj().oneOf(ai,this.oneOfMessage(e.name,ai)));case Oe.Language:return i(()=>c.Yj().oneOf(ij,this.oneOfMessage(e.name,ij)).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>c.Yj().oneOf(ij,this.oneOfMessage(e.name,ij)));case Oe.Nationality:case Oe.Country:return i(()=>c.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)),()=>c.Yj().oneOf(this.countriesService.countriesCodes,this.oneOfMessage(e.name,this.countriesService.countriesCodes)));default:return vd(e.fieldType)}}textValidationRuleError(e,t,n){if("regex"===t.mode)return g(t.regex)&&!new RegExp(t.regex).test(n)?t.regexMessage||this.t("_1_n_a_pas_le_68593",e):null;if(t.noLeadingTrailingSpaces&&n!==n.trim())return this.t("_1_ne_doit_pas_16247",e);if(t.noSpaces&&/\s/.test(n))return this.t("_1_ne_doit_pas_30149",e);if("number"==typeof t.minLength&&n.lengtht.maxLength)return this.t("_1_doit_conten_24426",e,t.maxLength);switch(t.allowedCharacters){case"numbers":return/^[0-9.,]*$/.test(n)?null:this.t("_1_ne_doit_con_32219",e);case"noSymbols":return/^[\p{L}\p{N}\s]*$/u.test(n)?null:this.t("_1_ne_doit_con_83191",e);case"uppercase":return n===n.toLocaleUpperCase()?null:this.t("_1_ne_doit_con_44580",e);case"lowercase":return n===n.toLocaleLowerCase()?null:this.t("_1_ne_doit_con_13605",e);default:return null}}numberValidationRuleError(e,t,n){return"number"==typeof t.min&&nt.max?this.t("_1_doit_tre_i_05381",e,t.max):null}dateValidationRuleError(e,t,n,i){const o=n.toISODate();if("past"===t.range)return o>As.c9.now().setZone(i??n.zone).toISODate()?this.t("_1_doit_tre_u_03177",e):null;if("between"===t.range){const n=t.start?$s(t.start):null,i=t.end?$s(t.end):null;return n?.isValid&&oi.toISODate()?this.t("_1_doit_tre_c_56697",e,n?this.dateTimeService.toLocaleString(n,nj):"",i?this.dateTimeService.toLocaleString(i,nj):""):null}return null}fieldUpdateInputDefault(e,t,n){switch(e.fieldType){case Oe.Checkbox:case Oe.Validation:return!!n&&void 0;case Oe.File:return this.documentInputService.documentInputDefault();case Oe.Phone:return this.phoneInputService.phoneInputDefault(t);case Oe.Select:return e.canSelectMultiple?[]:void 0;case Oe.Address:case Oe.Date:case Oe.Datetime:case Oe.Language:case Oe.Number:case Oe.Sex:case Oe.Text:case Oe.Textarea:case Oe.Time:return;case Oe.Country:return t.user.country;case Oe.Nationality:return t.user.nationality;default:return vd(e.fieldType)}}getFieldValue(e,t){const n=e[t.slug];return t.fieldType===Oe.Phone&&n?(0,Ta.A)(n,N_):t.fieldType===Oe.File?(0,Ta.A)(n,ej):t.fieldType===Oe.Date&&n?As.c9.fromISO(n,{zone:"UTC"}):n}};oj=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mm,Cm,tj,L_,Si])],oj);const sj=(0,V.forwardRef)(({borderRadius:e,size:t,value:n,onChange:o,...s},r)=>{const a=(0,V.useMemo)(()=>e??4,[e]),l=(0,V.useMemo)(()=>t??24,[t]),d=(0,V.useMemo)(()=>(0,mm.A)(e=>{o(e)},500),[o]);return(0,i.jsx)(ka,{css:{background:n,borderRadius:`${a}px`,height:`${l}px`,overflow:"hidden",width:`${l}px`,"& input":{background:"transparent",border:"none",borderRadius:"$1",cursor:"pointer",height:`${l}px`,padding:"0",width:`${l}px`,"&::-webkit-color-swatch-wrapper":{padding:0},"&::-webkit-color-swatch":{borderRadius:"$1",border:"none"},"&::-moz-color-swatch":{border:"none"}}},children:(0,i.jsx)("input",{ref:r,type:"color",value:n,onChange:e=>{d(e.target.value)},...s})})});sj.displayName="ColorPicker";const rj=({onChange:e,css:t,label:n,description:o,value:s,hint:r,state:a,initialValue:l,icon:d,...c})=>{const u=Ti(),m=(0,V.useRef)(null),{inputId:h,descId:g,errorId:p}=Hd();return(0,i.jsxs)(rd,{css:t,direction:"column",width:1,children:[(0,i.jsx)(Zd,{htmlFor:h,isClickable:!1,children:n}),(0,i.jsx)(Kd,{id:g,children:o}),(n||o)&&(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(Jd,{cursor:"default",icon:d,state:a,onClick:()=>{m.current?.click()},children:[(0,i.jsxs)(rd,{align:"center",css:{flex:"1"},height:1,children:[(0,i.jsx)(sj,{ref:m,"aria-describedby":o?g:void 0,"aria-errormessage":"error"===a?p:void 0,"aria-invalid":"error"===a,id:h,value:s,onChange:e,...c}),(0,i.jsx)(md,{width:"3"}),(0,i.jsx)(ka,{"aria-hidden":!0,color:"gray800",css:{flex:"1","& input[type=text]":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"}},height:1,onClick:Gd,children:(0,i.jsx)("input",{disabled:"disabled"===a,id:h,type:"text",value:s,onChange:t=>{e(t.target.value)},...c})})]}),l&&s!==l&&(0,i.jsx)(kd,{color:"invisible",css:{color:"$primary500"},onClick:t=>{Gd(t),e(l)},children:u("remettre_sa_v_90478")})]}),(0,i.jsx)(Yd,{id:p,state:a,children:r})]})},aj=({name:e,hint:t,state:n,...o})=>(0,i.jsx)(cd.D0,{name:e,render:s=>{const r=Wd(s.meta);return(0,i.jsx)(rj,{hint:r?s.meta.error:t,name:e,state:r?"error":n,value:s.input.value,onChange:e=>{s.input.onChange(e)},...o})}}),lj=({name:e,hint:t,state:n,...o})=>(0,i.jsx)(cd.D0,{name:e,render:s=>{const r=s.meta.data?.forceDisplayError&&s.meta.invalid||s.meta.touched&&s.meta.invalid;return(0,i.jsx)(Ch,{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})}}),dj=({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)(U_,{names:d,render:t=>{let d=null;g(t[r].input.value)&&g(t[a].input.value)&&g(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:Wd(t.meta)?{invalid:!0,hint:t.meta.error||t.meta.submitError}:e,{invalid:!1,hint:void 0});return(0,i.jsx)(pI,{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})}})},cj=xa("div",{alignItems:"center",borderRadius:"$1",color:"$gray600",cursor:"pointer",display:"flex",height:"40px",justifyContent:"center",width:"40px",variants:{active:{true:{background:"$primary100",color:"$primary500"},false:{"&:hover":{background:"$gray200",color:"$gray800"}}}}}),uj=({css:e,label:t,description:n,value:o,height:s,renderOnPortal:r,onChange:a,...l})=>{const d=Ti(),[c,u]=(0,V.useState)(!1),m=(0,V.useMemo)(()=>(0,cm.A)(Vn.map(e=>({value:e,name:d(e)})),e=>e.name),[]);return(0,i.jsxs)(rd,{css:e,direction:"column",width:1,children:[(0,i.jsx)(Zd,{children:t}),(0,i.jsx)(Kd,{children:n}),(t||n)&&(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(nu,{isOpen:c,onStateChange:u,children:[(0,i.jsx)(du,{children:(0,i.jsx)(Jd,{cursor:"pointer",icon:xd(o),rightIcon:c?"chevron-up":"chevron-down",...l,children:(0,i.jsx)(ka,{css:{flex:"1"},children:d(o)})})}),(0,i.jsx)(lu,{maxHeight:300,placement:"bottom",renderOnPortal:r,width:"match",children:(0,i.jsx)(rd,{css:{px:"$2"},gap:"2",width:1,wrap:"wrap",children:m.map(e=>(0,i.jsx)(cj,{active:o===e.value,onClick:()=>{u(!1),a(e.value)},children:(0,i.jsx)(Id,{icon:xd(e.value)})},e.value))})})]})]})},mj=({name:e,hint:t,state:n,...o})=>(0,i.jsx)(cd.D0,{name:e,render:s=>{const r=Wd(s.meta);return(0,i.jsx)(uj,{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})}}),hj=e=>{const t=Ti(),[n,o]=(0,V.useState)(!1);return(0,i.jsxs)(rd,{gap:"4",width:1,children:[(0,i.jsx)(ka,{css:{border:"1px solid $gray200",borderRadius:"$1",overflow:"hidden",cursor:e.allowCrop?"pointer":void 0},height:126,width:126,onClick:e.allowCrop?()=>o(!0):void 0,children:(0,i.jsx)("img",{src:e.url,style:{objectFit:"cover",inlineSize:"100%",blockSize:"100%"}})}),(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{color:"gray700",fontWeight:"medium",children:e.label}),e.hint&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray400",children:e.hint})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(ka,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",onClick:e.onDelete,children:t("supprimer_43083")})]}),e.allowCrop&&n&&(0,i.jsx)(uI,{image:{name:e.url.split("/").pop().split(".").join("-cropped."),src:`${e.url}?cacheblock=true`},onChange:e.onChange,onClose:()=>o(!1)})]})},gj=e=>(0,i.jsxs)(rd,{gap:"4",width:1,children:[(0,i.jsx)(rd,{align:"center",css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",cursor:"pointer"},height:126,justify:"center",width:126,children:(0,i.jsx)(rd,{height:64,width:64,children:(0,i.jsx)(jd,{color:Ia.colors.gray900.value,height:"64px",strokeWidth:"4",width:"64px"})})}),(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{color:"gray700",fontWeight:"medium",children:e.label}),e.hint&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray400",children:e.hint})]})]})]}),pj=({allowCrop:e,value:t,onChange:n,label:o,hint:s,organizationId:r,...a})=>{const[l,d]=(0,V.useState)(t?gI.File:gI.Uploader),c=async e=>{d(gI.Uploading);try{const t=await Kx(r,e,"public-read");n(t),d(gI.File)}catch{d(gI.Uploader)}};return l===gI.File&&t?(0,i.jsx)(hj,{allowCrop:e,hint:s,label:o,url:Zx(t,F.HEAVENT_AWS_UPLOADS_BUCKET),onChange:c,onDelete:()=>{n(null),d(gI.Uploader)}}):l===gI.Uploading?(0,i.jsx)(gj,{hint:s,label:o}):(0,i.jsx)(cI,{allowCrop:e,hint:s,label:o,onChange:c,...a})},fj=({prefix:e,...t})=>{const n=`${e}key`,o=`${e}name`,s=`${e}acl`;return(0,i.jsx)(U_,{names:[n,o,s],render:e=>{let r=null;return g(e[n].input.value)&&g(e[o].input.value)&&g(e[s].input.value)&&(r={key:e[n].input.value,name:e[o].input.value,acl:e[s].input.value}),(0,i.jsx)(pj,{value:r,onChange:t=>{e[n].input.onChange(t?.key??""),e[o].input.onChange(t?.name??""),e[s].input.onChange(t?.acl??"")},...t})}})};function _j(e,t){const n=Ei(Mm),o=um();return(0,V.useMemo)(()=>e?e.fieldType===Oe.Country?n.getCountriesIdName(t).map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e)):e.fieldType===Oe.Language?e.fieldProperty===pt.Language?o(Rc):o(Gn):e.fieldType===Oe.Nationality?n.getNationalitiesIdName(t).map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e)):e.fieldType===Oe.Sex?o(ai):e.values.map(({id:t,value:n,color:o})=>(0,i.jsx)("option",{"data-badge":e.listType===ht.Badge,"data-color":e.listType===ht.Default?void 0:o,value:t,children:n},t)):(0,i.jsx)(i.Fragment,{}),[e,t])}const xj=e=>{const{translate:t,params:{organizationId:n}}=bd(),o=Ei(tj),s=Ei(L_),r=_j(e.customField),a=(0,V.useMemo)(()=>vi.filter(e=>e!==Ge.Error),[]);if((0,V.useEffect)(()=>{e.slug===Bt.Acronym||e.slug===Bt.Address||e.slug===Bt.Color||e.slug===Bt.Description||e.slug===Bt.Icon||e.slug===Bt.Name||e.slug===Jt.Acronym||e.slug===Jt.Address||e.slug===Jt.Color||e.slug===Jt.Description||e.slug===Jt.Icon||e.slug===Jt.Name||e.slug===Ke.Description||e.slug===Ke.Name||e.customField?.fieldType===Oe.Address||e.customField?.fieldType===Oe.Country||e.customField?.fieldType===Oe.Language||e.customField?.fieldType===Oe.Nationality||e.customField?.fieldType===Oe.Sex||e.customField?.fieldType===Oe.Text||e.customField?.fieldType===Oe.Textarea||e.customField?.fieldType===Oe.Time?"string"!=typeof e.value&&e.change(e.name,""):e.slug===Bt.AutoAccredit||e.slug===Bt.WeezeventIsSynchronized||e.slug===qt.Privacy||e.slug===Ke.IsLocked||e.slug===Ke.ShowInDelegationSpace||e.slug===Ke.CanLeadersAddMembers||e.slug===Ke.CanLeadersEditCustomFields||e.slug===Ke.CanLeadersEditMembers||e.slug===Ke.CanLeadersDeleteMembers||e.slug===Ke.CanLeadersDuplicateMembers||e.slug===Ke.CanLeadersEditColumns||e.slug===Ke.CanLeadersImportMembers||e.slug===Ke.CanLeadersSeeHiddenAccreditationsSlots||e.slug===Ke.ShowAllAccreditations||e.slug===Ke.ShowFormLinkInDelegationSpace||e.slug===Jt.WeezeventIsSynchronized||e.customField?.fieldType===Oe.Checkbox||e.customField?.fieldType===Oe.Validation?"boolean"!=typeof e.value&&e.change(e.name,!1):e.slug===Bt.Category||e.slug===Ke.Category||e.slug===Jt.Category?"number"!=typeof e.value&&e.change(e.name,e.categories[0]?.id):e.slug===Bt.Index||e.slug===Bt.Latitude||e.slug===Bt.Longitude||e.slug===Jt.Latitude||e.slug===Jt.Longitude||e.slug===Jt.Zoom||e.slug===Ke.MaxResources||e.customField?.fieldType===Oe.Number?"number"!=typeof e.value&&e.change(e.name,0):e.slug===Bt.Tag||e.slug===Jt.Tag||e.slug===Ke.Campaigns||e.slug===Ke.Documents||e.slug===Ke.Tag||e.slug===Jt.Traces?Array.isArray(e.value)||e.change(e.name,[]):e.slug===Ke.DeadlineDate||e.customField?.fieldType===Oe.Date||e.customField?.fieldType===Oe.Datetime?As.c9.isDateTime(e.value)||g(e.value)||e.change(e.name,As.c9.invalid("Invalid")):e.customField?.fieldType===Oe.File?null!==e.value&&"object"==typeof e.value||e.change(e.name,o.documentInputDefault()):e.customField?.fieldType===Oe.Phone?null!==e.value&&"object"==typeof e.value||e.change(e.name,s.basePhoneInputDefault()):e.customField?.fieldType===Oe.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===Ke.Form?"number"!=typeof e.value&&e.change("massEdit.value",e.forms[0].id):e.slug===Ke.DelegationsSpaceLayout?"number"!=typeof e.value&&Bs(e.delegationsSpaceLayouts)&&e.change("massEdit.value",e.delegationsSpaceLayouts[0].id):e.slug===Jt.Layer?Hn.includes(e.value)||e.change("massEdit.value",de.Google):e.slug===an.State?a.includes(e.value)||e.change("massEdit.value",a[0]):e.slug===an.Frequency&&(fi.includes(e.value)||e.change("massEdit.value",Ze.Every10Minutes))},[e.customField,e.slug]),e.slug===Bt.Acronym||e.slug===Jt.Acronym||e.slug===Bt.Address||e.slug===Jt.Address||e.customField?.fieldType===Oe.Address||e.customField?.fieldType===Oe.Text)return(0,i.jsx)(ec,{name:e.name});if(e.slug===Bt.AutoAccredit||e.slug===Bt.WeezeventIsSynchronized||e.slug===Ke.IsLocked||e.slug===Ke.ShowFormLinkInDelegationSpace||e.slug===Ke.ShowInDelegationSpace||e.slug===Ke.CanLeadersAddMembers||e.slug===Ke.CanLeadersEditCustomFields||e.slug===Ke.CanLeadersEditMembers||e.slug===Ke.CanLeadersDeleteMembers||e.slug===Ke.CanLeadersDuplicateMembers||e.slug===Ke.CanLeadersEditColumns||e.slug===Ke.CanLeadersImportMembers||e.slug===Ke.CanLeadersSeeHiddenAccreditationsSlots||e.slug===Ke.ShowAllAccreditations||e.slug===Jt.WeezeventIsSynchronized||e.customField?.fieldType===Oe.Checkbox||e.customField?.fieldType===Oe.Validation)return(0,i.jsxs)(Ev,{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===qt.Privacy)return(0,i.jsxs)(Ev,{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===Bt.Category||e.slug===Ke.Category||e.slug===Jt.Category)return(0,i.jsx)(Gp,{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===Bt.Color||e.slug===Jt.Color)return(0,i.jsx)(aj,{name:e.name});if(e.slug===Bt.Description||e.slug===Ke.Description||e.slug===Jt.Description)return(0,i.jsx)(ka,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(SI,{name:e.name})});if(e.slug===Bt.Icon||e.slug===Jt.Icon)return(0,i.jsx)(mj,{name:e.name});if(e.slug===Bt.Latitude||e.slug===Jt.Latitude)return(0,i.jsx)(Bp,{name:e.name});if(e.slug===Bt.Longitude||e.slug===Jt.Longitude)return(0,i.jsx)(Bp,{name:e.name});if(e.slug===Bt.Name||e.slug===Jt.Name||e.slug===an.Name)throw new Error("Should not happen");return e.slug===an.State?(0,i.jsx)(Ev,{name:e.name,children:a.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))}):e.slug===an.Frequency?(0,i.jsx)(Ev,{name:e.name,children:fi.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))}):e.slug===Ke.Campaigns?(0,i.jsx)(Gp,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.campaigns.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):e.slug===Ke.Documents?(0,i.jsx)(Gp,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))}):e.slug===Bt.Tag||e.slug===Jt.Tag||e.slug===Ke.Tag?(0,i.jsx)(Gp,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.tags.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):e.slug===Jt.Traces?(0,i.jsx)(Gp,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.traces.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):e.slug===Bt.Index||e.slug===Ke.MaxResources||e.slug===Jt.Zoom||e.customField?.fieldType===Oe.Number?(0,i.jsx)(ec,{name:e.name,shouldParseAsInt:!0}):e.customField?.fieldType===Oe.Country?(0,i.jsx)(Gp,{isSearchVisible:!0,name:e.name,children:r}):e.slug===Ke.DeadlineDate||e.customField?.fieldType===Oe.Date?(0,i.jsx)(Np,{name:e.name}):e.customField?.fieldType===Oe.Datetime?(0,i.jsx)(lj,{name:e.name}):e.customField?.fieldType===Oe.File?e.customField.fileType===gt.Picture?(0,i.jsx)(fj,{allowCrop:!0,organizationId:n,prefix:`${e.name}.`}):(0,i.jsx)(dj,{accept:[Vx.Images,Vx.Pdf],acl:"private",organizationId:n,prefix:`${e.name}.`}):e.customField?.fieldType===Oe.Language?(0,i.jsxs)(Ev,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:t("s_lectionnez_un_31086")}),r]}):e.customField?.fieldType===Oe.Nationality?(0,i.jsx)(Gp,{isSearchVisible:!0,name:e.name,children:r}):e.customField?.fieldType===Oe.Phone?(0,i.jsx)(G_,{prefix:`${e.name}.`}):e.customField?.fieldType===Oe.Select?e.customField.canSelectMultiple?(0,i.jsx)(Gp,{isSearchVisible:!0,multiple:!0,name:e.name,children:r}):(0,i.jsx)(Gp,{isSearchVisible:!0,name:e.name,placeholder:t("s_lectionnez_un_44130"),children:r}):e.customField?.fieldType===Oe.Sex?(0,i.jsxs)(Ev,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:t("s_lectionnez_un_43620")}),r]}):e.customField?.fieldType===Oe.Textarea?(0,i.jsx)(Hp,{name:e.name}):e.customField?.fieldType===Oe.Time?(0,i.jsx)(wI,{name:e.name}):e.slug===Ke.Form?(0,i.jsx)(Gp,{isSearchVisible:!0,multiple:!1,name:"massEdit.value",children:e.forms.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):e.slug===Ke.DelegationsSpaceLayout?(0,i.jsx)(Gp,{isSearchVisible:!0,multiple:!1,name:"massEdit.value",children:e.delegationsSpaceLayouts.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):e.slug===Jt.Layer?(0,i.jsxs)(Ev,{name:e.name,children:[(0,i.jsx)("option",{value:de.Google,children:"Plan"}),(0,i.jsx)("option",{value:de.GoogleSatellite,children:"Satellite"}),(0,i.jsx)("option",{value:de.IgnPlan,children:"IGN Plan"})]}):null},Ij=e=>(0,i.jsxs)($p,{children:[(0,i.jsxs)(rd,{align:"center",gap:"4",children:[(0,i.jsx)(Dd,{css:{flex:"1",textTransform:"uppercase"},textStyle:"smallcapsheading",children:e.title}),e.buttons]}),e.children]});function vj(e){return(0,cm.A)(e,e=>m(e.name))}function bj(e){const t=(0,Vu.A)(e,e=>e.category.id);return vj((0,Xh.A)(e.map(e=>e.category),e=>e.id)).map(e=>({category:e,items:(0,cm.A)(t[e.id],e=>m(e.name))}))}function jj(e,t){switch(e){case Oe.Text:case Oe.Textarea:return"text";case Oe.Checkbox:return"square-check";case Oe.Validation:return"check";case Oe.Select:return"population"===t?"users":"list-ul";case Oe.Date:return"calendar";case Oe.Datetime:return"calendar-day";case Oe.Time:return"clock";case Oe.File:return"file";case Oe.Phone:return"phone";case Oe.Language:return"language";case Oe.Number:return"00";case Oe.Sex:return"venus-mars";case Oe.Nationality:case Oe.Country:return"flag";case Oe.Address:return"map-location";default:return vd()}}function Cj(e){return(0,cm.A)(Object.entries((0,Vu.A)(e,e=>e.category.name)),([e])=>e).flatMap(([e,t])=>[{id:W(),elementType:st.Section,section:e,hasCondition:!1,conditionValue:!1}].concat(t.map(e=>({id:W(),elementType:st.Field,customField:e,hasCondition:!1,conditionValue:!1}))))}function yj(e,t=e=>e.id){return bj(e).map(({category:e,items:n})=>(0,i.jsx)("optgroup",{label:e.name,children:n.map(e=>(0,i.jsx)("option",{"data-subtext":e.label,value:t(e),children:e.name},e.id))},e.id))}const Aj=/^\{user\.(.+)\}$/,Sj=e=>{const{translate:t}=bd(),n=e.customFields.find(t=>t.id===e.customFieldValues.customFieldId),o=!0===e.canLinkToField&&n?.fieldType!==Oe.Select,s=o&&(e.customFieldValues.fromField??(g(e.customFieldValues.value)&&Aj.test(e.customFieldValues.value.trim()))),r=(0,V.useMemo)(()=>n?e.customFields.filter(e=>e.fieldType===n.fieldType&&e.id!==n.id):[],[e.customFields,n]),a=(0,V.useMemo)(()=>yj(e.customFields),[e.customFields]),l=(0,V.useMemo)(()=>yj(r,e=>`{user.${e.slug}}`),[r]),d=n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xj,{campaigns:[],categories:[],change:e.change,customDocuments:[],customField:n,delegationsSpaceLayouts:[],forms:[],name:`${e.field}.value`,slug:n.slug,tags:[],traces:[],value:e.customFieldValues.value}),Gb(n)&&(0,i.jsx)(Fp,{name:`${e.field}.addValues`,children:t("ajouter_les_val_22996")})]}),c=t=>{t!==s&&(e.change(`${e.field}.fromField`,t),e.change(`${e.field}.value`,void 0),e.change(`${e.field}.addValues`,!1))};return(0,i.jsx)(Ij,{buttons:(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})})}),(0,i.jsx)(bp,{placement:"top",children:t("supprimer_43083")})]}),title:t("champ_de_formul_73221",e.index+1),children:(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsxs)(Gp,{isSearchVisible:!0,label:t("CustomField"),name:`${e.field}.customFieldId`,children:[(0,i.jsx)("option",{value:"-1",children:t("s_lectionner_un_48159")}),a]}),n&&(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray700 textSm medium",children:t("nouvelle_valeur_39039",n.name)}),o?(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(zu,{state:s?"unchecked":"checked",onClick:()=>c(!1),children:t("saisir_une_nouv_92931")}),!s&&(0,i.jsx)(rd,{css:{paddingLeft:"$6"},direction:"column",gap:"1",children:d}),(0,i.jsx)(zu,{state:s?"checked":"unchecked",onClick:()=>c(!0),children:t("lier_un_autre_51509")}),s&&(0,i.jsx)(ka,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Gp,{isSearchVisible:!0,name:`${e.field}.value`,placeholder:t("choisir_un_cham_67587"),children:l})})]}):d]})]})})},kj=e=>{const t=Ti();return(0,i.jsx)(rd,{direction:"column",gap:"3",children:Bs(e.values)?(0,i.jsxs)(i.Fragment,{children:[e.values.map((t,n)=>{const o=`${e.name}[${n}]`;return(0,i.jsx)(rd,{direction:"column",children:(0,i.jsx)(rd,{gap:"3",children:(0,i.jsx)(Sj,{canLinkToField:e.canLinkToField,change:e.change,customFieldValues:e.values[n],customFields:e.customFields,field:o,index:n,remove:()=>{e.change(e.name,qs(e.values,n))}})})},n)}),(0,i.jsx)(kd,{color:"invisible",css:{"::before":{content:"+",marginInlineEnd:"$1"}},onClick:()=>{e.change(e.name,e.values.concat([{customFieldId:-1,addValues:!1}]))},children:t("ajouter_un_nouv_22370")})]}):(0,i.jsx)($p,{align:"center",css:{background:"$gray50",textAlign:"center"},gap:"2",children:(0,i.jsxs)(rd,{align:"center",css:{textAlign:"center"},direction:"column",gap:"2",children:[(0,i.jsx)(Od,{css:{fontWeight:"$medium"},children:t("aucun_champ_est_98607")}),(0,i.jsx)(kd,{color:"invisible",css:{inlineSize:"fit-content","::before":{content:"+",marginInlineEnd:"$1"}},onClick:()=>{e.change(e.name,e.values.concat([{customFieldId:-1,addValues:!1}]))},children:t("_lier_un_champ_52842")})]})})})},wj=e=>(0,i.jsx)(rd,{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)(rd,{align:"center",css:{background:`$${e.color}100`,borderRadius:"32px"},height:32,justify:"center",width:32,children:(0,i.jsx)(Id,{icon:e.icon})})}),Ej=e=>{const t=Ti(),n=Ei(ld),o=Hd();return(0,i.jsx)(Om,{size:e.size||"sm",onClose:e.onClose,children:(0,i.jsx)(Vd,{css:{overflow:"hidden"},direction:"column",height:1,hideDefaultErrors:!0,initialValues:e.initialValues,render:n=>{const{handleSubmit:s,submitting:r}=n;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(wj,{color:"primary",icon:e.icon})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",fontWeight:"medium",id:o.labelId,textAlign:"center",children:e.title}),e.subtitle&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",id:o.descId,textAlign:"center",children:e.subtitle})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Nd,{}),(0,i.jsx)(rd,{css:{overflowY:"auto"},direction:"column",children:"function"==typeof e.children?e.children(n):e.children}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{isLoading:r,onClick:s,children:e.buttonText}),(0,i.jsx)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},validate:t=>e.schema?n.validateForForm(e.schema)(t):{},onSubmit:e.onSubmit})})},Tj=e=>{const t=Ti(),{mutate:n}=function(e={}){return Di("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)(Ej,{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)(ec,{label:t("nom_du_tag_95054"),name:"name"})})},Rj=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.tags),[s,r]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gp,{isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(fI,{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)(Tj,{organizationId:e.organizationId,onClose:()=>{r(!1)},onSuccess:t=>{o([...n,t]),e.change(`${e.name}tagsIds`,[...e.tagsIds,t.id])}})]})},Oj=({formattedAddressProps:e,hint:t,latitudeProps:n,longitudeProps:o,placeProps:s,state:r,...a})=>{const l=Ti(),d=(0,V.useRef)(null),c=Wd(e.meta);return(0,V.useEffect)(()=>{const t=new google.maps.places.Autocomplete(d.current,{types:["geocode"]});t.addListener("place_changed",async()=>{const i=t.getPlace(),r=i.geometry.location.lat(),a=i.geometry.location.lng();e.input.onChange(i.formatted_address),n?.input.onChange(r),o?.input.onChange(a),s?.input.onChange(i)})},[]),(0,i.jsx)(Qd,{ref:d,hint:c?e.meta.error||e.meta.submitError:t,placeholder:l("indiquez_un_lie_85634"),state:c?"error":r,value:e.input.value,onBlur:e.input.onBlur,onChange:e.input.onChange,onFocus:e.input.onFocus,...a})},Dj=({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)(U_,{names:r,render:r=>(0,i.jsx)(Oj,{formattedAddressProps:r[e],latitudeProps:t?r[t]:void 0,longitudeProps:n?r[n]:void 0,placeProps:o?r[o]:void 0,...s})})},zj=e=>{const{translate:t}=bd(),n=Ei(Mm),o=Ei(oj),s=_j(e.field,e.countryCode),r=e.isMandatory?e.field.name:(0,i.jsx)(fI,{children:e.field.name}),a=`${e.prefix}${e.field.slug}`,l=e.field.description,d=(0,V.useMemo)(()=>a.startsWith("formRegister.userInfo.fields."),[a]);if((0,V.useEffect)(()=>{e.display||e.change(a,o.fieldUpdateInputDefault(e.field,n.getDefaultCountryValues()))},[e.display,e.field,e.change]),!e.display)return null;switch(e.field.fieldType){case Oe.Text:return(0,i.jsx)(ec,{description:l,disabled:e.disabled,label:r,name:a});case Oe.Textarea:return(0,i.jsx)(Hp,{description:l,disabled:e.disabled,label:r,name:a});case Oe.Checkbox:return(0,i.jsx)(Fp,{disabled:e.disabled,name:a,subtext:l,children:r});case Oe.Validation:return(0,i.jsx)(Fp,{disabled:e.disabled,name:a,subtext:(0,i.jsxs)(i.Fragment,{children:[g(l)&&(0,i.jsx)("span",{children:l}),g(l)&&e.field.document&&(0,i.jsx)("br",{}),e.field.document&&(0,i.jsx)(bm,{css:{color:"$primary500"},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 Oe.Select:return e.field.canSelectMultiple?(0,i.jsx)(Gp,{description:l,disabled:e.disabled,isSearchVisible:!0,isSelectAllVisible:!0,label:r,multiple:!0,name:a,children:s}):(0,i.jsx)(Gp,{description:l,disabled:e.disabled,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:s});case Oe.Date:return"dateOfBirth"===e.field.slug?(0,i.jsx)(Np,{autoComplete:d?"bday":void 0,description:l,disabled:e.disabled,label:r,max:_h,min:fh,name:a}):(0,i.jsx)(Np,{description:l,disabled:e.disabled,label:r,name:a});case Oe.Datetime:return(0,i.jsx)(lj,{description:l,disabled:e.disabled,label:r,name:a});case Oe.Time:return(0,i.jsx)(wI,{description:l,disabled:e.disabled,label:r,name:a});case Oe.Phone:return(0,i.jsx)(G_,{description:l,disabled:e.disabled,label:r,prefix:`${a}.`});case Oe.Number:return(0,i.jsx)(ec,{description:l,disabled:e.disabled,label:r,name:a,shouldParseAsInt:!0});case Oe.Sex:return(0,i.jsxs)(Ev,{autoComplete:d?"sex":void 0,description:l,disabled:e.disabled,label:r,name:a,children:[(0,i.jsx)("option",{disabled:!0,value:"",children:t("choisir_une_val_00277")}),s]});case Oe.Language:return(0,i.jsx)(Gp,{autoComplete:d?"language":void 0,description:l,disabled:e.disabled,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:s});case Oe.Nationality:return(0,i.jsx)(Gp,{description:l,disabled:e.disabled,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:s});case Oe.Address:return(0,i.jsx)(Dj,{addressName:a,autoComplete:d?"street-address":void 0,description:l,disabled:e.disabled,label:r,placeName:e.field.fieldProperty===pt.Street?"place":e.field.fieldProperty===pt.BirthCity?"birthPlace":void 0});case Oe.Country:return(0,i.jsx)(Gp,{autoComplete:d?"country":void 0,description:l,disabled:e.disabled,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:s});case Oe.File:return e.field.fileType===gt.Picture?(0,i.jsx)(fj,{allowCrop:!0,disabled:e.disabled,hint:l,label:r,organizationId:e.organizationId,prefix:`${a}.`}):(0,i.jsx)(dj,{accept:[Vx.Images,Vx.Pdf,Vx.Videos],acl:e.fileAcl??"private",description:l,disabled:e.disabled,label:r,organizationId:e.organizationId,prefix:`${a}.`});default:return vd(e.field.fieldType)}},$j=e=>{const t=Ti(),[n,o]=(0,V.useState)(""),s=(0,V.useMemo)(()=>{if(g(n)){const t=m(n);return e.customFields.filter(e=>m(e.name).includes(t)||g(e.label)&&m(e.label).includes(t))}return e.customFields},[e.customFields,n]),r=(0,V.useMemo)(()=>bj(s),[s]);return(0,i.jsxs)(rd,{css:{padding:"$3"},direction:"column",width:1,children:[(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_un_c_86475"),state:"search",value:n,onChange:o}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(ka,{css:{maxHeight:"300px",overflowY:"auto"},children:r.map(({category:n,items:o},s)=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(Tu,{index:s,children:n.name}),o.map(n=>n.conditionCustomField&&!e.selectedCustomFieldsIds.has(n.conditionCustomField.id)?(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsxs)(rd,{align:"center",css:{px:"$3"},gap:"3",height:40,width:1,children:[(0,i.jsx)(wu,{disabled:!0,shouldPreventDefault:!1,state:"unchecked",onClick:hc.A}),(0,i.jsx)(ka,{color:"gray400",css:{ellipsis:!0,flex:"1"},title:n.name,children:n.name})]},n.id)}),(0,i.jsx)(bp,{placement:"top-start",children:t("ce_champ_d_pend_31209",n.conditionCustomField?.name)})]},n.id):(0,i.jsx)($u,{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))]},n.id))})]})},Pj=e=>{const{translate:t}=bd();return(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",children:t("ajouter_97327")})}),(0,i.jsx)(lu,{placement:"top-start",width:400,children:(0,i.jsx)($j,{customFields:e.customFields,selectedCustomFieldsIds:e.usedCustomFieldsIds,toggle:e.toggle})})]})},Mj=e=>{const{translate:t}=bd();return(0,i.jsxs)(rd,{align:"center",css:{background:"$gray50",bd:"gray200 2",padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("aucun_champ_per_21094")}),(0,i.jsx)(Pj,{customFields:e.customFields,toggle:e.toggle,usedCustomFieldsIds:e.usedCustomFieldsIds})]})},Fj=e=>{const{params:{organizationId:t}}=bd(),n=(0,V.useMemo)(()=>e.customFields.filter(t=>e.usedCustomFieldsIds.includes(t.id)),[e.customFields,e.usedCustomFieldsIds]),o=(0,V.useMemo)(()=>new Set(e.usedCustomFieldsIds),[e.usedCustomFieldsIds]),s=(0,V.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)(rd,{children:Bs(e.usedCustomFieldsIds)?(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"4",children:[n.map(n=>(0,i.jsxs)(rd,{align:"end",gap:"3",children:[(0,i.jsx)(ka,{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)(kd,{color:"white",leftIcon:"trash-can",onClick:()=>s(n)})]},n.id)),(0,i.jsx)(Pj,{customFields:e.customFields,toggle:s,usedCustomFieldsIds:o})]}):(0,i.jsx)(Mj,{customFields:e.customFields,toggle:s,usedCustomFieldsIds:o})})};function Nj(e){return(0,cm.A)(e,e=>m(e.name)).filter(e=>Bs(e.accreditationsProfiles)).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,cm.A)(e.accreditationsProfiles,e=>m(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))}const Lj=e=>(0,i.jsx)(rd,{css:{background:"$gray50",overflowX:"auto",padding:"$6",...e.css},direction:"column",gap:"4",height:1,width:1,children:e.children}),Bj=e=>(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(rd,{align:"center",css:{color:"$gray800",fontSize:"$textMd",fontWeight:"$medium"},gap:"3",children:e.category}),(0,i.jsx)(rd,{direction:"column",gap:"3",children:e.children})]}),Vj=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>hg(e.accreditation),[e.accreditation]),[o,s]=(0,V.useState)(!0),r=e.displaySlots||"function"==typeof e.renderCheckbox;return(0,i.jsxs)(rd,{css:{background:"white",bd:!0,overflow:"hidden",userSelect:"none"},direction:"column",children:[(0,i.jsxs)(rd,{align:"center",css:{cursor:r?"pointer":"default",padding:"$3 $4"},gap:"2",onClick:()=>{s(!o),e.onClick?.()},children:[e.displaySlots&&(0,i.jsx)(rd,{align:"center",css:{fontSize:"$textXs"},height:20,justify:"center",width:20,children:(0,i.jsx)(Id,{icon:o?"chevron-down":"chevron-right"})}),e.renderCheckbox?.(),(0,i.jsx)(Xv,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{font:"gray800 textSm semiBold",children:n}),e.badge]}),e.displayNumberOfSlots&&(0,i.jsx)(ka,{color:"gray500",children:t("creneau",e.numberOfSlots)})]}),e.renderActions?.()]}),(e.displayFormCustomFields||e.displaySlots&&o)&&(0,i.jsx)(rd,{css:{borderTop:"1px solid $gray200"},direction:"column",children:e.children})]})},Uj=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)(e.maxResources);return(0,i.jsxs)(Av,{children:[(0,i.jsx)(Sv,{children:(0,i.jsx)(ka,{css:{cursor:"pointer"},children:(0,i.jsx)(Id,{icon:"gear"})})}),(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"badge-check",children:t("ajout_d_un_quot_09767",e.name)}),(0,i.jsx)(jv,{children:(0,i.jsx)(Qd,{hint:t("laissez_vide_po_88385"),label:t("quel_quota_voul_63115"),min:1,rightIcon:"xmark",shouldParseAsInt:!0,value:n||"",onChange:o,onRightIconClick:()=>o(null)})}),(0,i.jsx)(bv,{children:o=>(0,i.jsx)(kd,{onClick:()=>{e.onChange(n),o()},children:t("ajouter_le_quot_40849")})})]})]})};function Wj(e,t,n,i){const o=(0,bs.A)(t.map(e=>e.accreditationId)).map(n=>e.accreditations.find(e=>e.accreditationId===n)??{accreditationCategoryId:t.find(e=>e.accreditationId===n).accreditationCategoryId,accreditationId:n,maxResources:null,willAutoAccredit:!0});i(`${n}accreditationsCategories`,(0,bs.A)(t.map(e=>e.accreditationCategoryId)).map(t=>e.accreditationsCategories.find(e=>e.accreditationCategoryId===t)??{accreditationCategoryId:t,maxResources:null})),i(`${n}accreditations`,o),i(`${n}accreditationsSlots`,t)}const Gj=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)(void 0),s=`${e.prefix}accreditationsSlots`,r=(0,V.useCallback)(t=>{e.change(s,(0,Wm.jM)(e.delegationAccreditations.accreditationsSlots,n=>{n.forEach(n=>{e.slotsIds.includes(n.accreditationSlotId)&&(n.maxResources=t)})})),o(t)},[s,e.slotsIds,e.delegationAccreditations,e.change,o]),a=(0,V.useMemo)(()=>e.delegationAccreditations.accreditationsSlots.find(t=>t.accreditationSlotId===e.selectedSlotsIds[0]),[e.selectedSlotsIds,e.delegationAccreditations.accreditationsSlots]),l=a?.isDefault??!1,d=a?.isVisible??!0,c=(0,V.useCallback)(()=>{e.change(s,(0,Wm.jM)(e.delegationAccreditations.accreditationsSlots,t=>{t.forEach(t=>{e.selectedSlotsIds.includes(t.accreditationSlotId)&&(l?(t.isDefault=!1,t.isVisible=!0):t.isDefault=!0)})})),e.change("selectedAccreditationsSlotsIds",[])},[s,e.selectedSlotsIds,e.delegationAccreditations,e.change,l]),u=(0,V.useCallback)(()=>{e.change(s,(0,Wm.jM)(e.delegationAccreditations.accreditationsSlots,t=>{t.forEach(t=>{e.selectedSlotsIds.includes(t.accreditationSlotId)&&(d?(t.isDefault=!0,t.isVisible=!1):t.isVisible=!0)})})),e.change("selectedAccreditationsSlotsIds",[])},[s,e.selectedSlotsIds,e.delegationAccreditations,e.change,d]),m=(0,V.useCallback)(()=>{e.change("selectedAccreditationsSlotsIds",(0,yu.A)(e.selectedAccreditationsSlotsIds,e.selectedSlotsIds)),Wj(e.delegationAccreditations,e.delegationAccreditations.accreditationsSlots.filter(t=>!e.selectedSlotsIds.includes(t.accreditationSlotId)),e.prefix,e.change)},[e.selectedSlotsIds,e.selectedAccreditationsSlotsIds,e.delegationAccreditations,e.prefix,e.change]);return Bs(e.selectedSlotsIds)?(0,i.jsxs)(rd,{gap:"3",onClick:Gd,children:[(0,i.jsxs)(rd,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:c,children:[(0,i.jsx)(ka,{fontSize:"textXs",children:(0,i.jsx)(Id,{icon:"badge"})}),(0,i.jsx)(ka,{fontWeight:"medium",children:t(l?"ne_pas_pr_coch_91856":"pr_cocher_par_18369")})]}),(0,i.jsxs)(rd,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:u,children:[(0,i.jsx)(ka,{fontSize:"textXs",children:(0,i.jsx)(Id,{icon:d?"eye-slash":"eye"})}),(0,i.jsx)(ka,{fontWeight:"medium",children:t(d?"masquer_34645":"rendre_visible_37057")})]}),(0,i.jsxs)(rd,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",children:[(0,i.jsx)(ka,{fontWeight:"medium",children:t("total_07173")}),(0,i.jsx)(ka,{width:100,children:(0,i.jsx)(Qd,{min:0,rightIcon:"xmark",shouldParseAsInt:!0,value:n??"",onChange:r,onRightIconClick:()=>r(void 0)})})]}),(0,i.jsxs)(rd,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:m,children:[(0,i.jsx)(ka,{fontSize:"textXs",children:(0,i.jsx)(Id,{icon:"trash-can"})}),(0,i.jsx)(ka,{fontWeight:"medium",children:t("supprimer_43083")})]})]}):(0,i.jsxs)(rd,{align:"center",gap:"6",onClick:Gd,children:[(0,i.jsx)(Kp,{name:`${e.prefix}accreditations[${e.accreditationIndex}].willAutoAccredit`,children:t("attribuer_autom_13895")}),e.hasSlots&&(0,i.jsx)(Uj,{maxResources:e.accreditationInput.maxResources,name:e.accreditation.name,onChange:t=>{e.change(`${e.prefix}accreditations[${e.accreditationIndex}].maxResources`,t)}})]})},qj=e=>{const{translate:t}=bd(),n=Ei(Cm),o=(0,V.useMemo)(()=>e.delegationAccreditations.accreditationsSlots.findIndex(t=>t.accreditationSlotId===e.slot.id),[e.delegationAccreditations.accreditationsSlots,e.slot]),s=e.delegationAccreditations.accreditationsSlots[o],r=`${e.prefix}accreditationsSlots[${o}].`,a=s?.isDefault?"checked":"unchecked",l=(0,V.useMemo)(()=>e.selectedAccreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked",[e.slot,e.selectedAccreditationsSlotsIds]),d=(0,V.useCallback)(t=>{e.change(`${r}isDefault`,"checked"===t),"checked"===t&&e.delegationAccreditations.accreditationsSlots.forEach((t,n)=>{t.accreditationSlotId!==s.accreditationSlotId&&t.accreditationId===s.accreditationId&&e.change(`${e.prefix}accreditationsSlots[${n}].isDefault`,!1)}),"unchecked"===t&&e.change(`${r}isVisible`,!0)},[r,s,e.delegationAccreditations,e.change]),c=(0,V.useCallback)(t=>{e.change(`${r}isDefault`,"checked"===t),"unchecked"===t&&e.change(`${r}isVisible`,!0)},[r,e.change]),u=(0,V.useCallback)(t=>{e.change("selectedAccreditationsSlotsIds",Us(e.selectedAccreditationsSlotsIds,e.slot.id,"checked"===t))},[e.slot,e.selectedAccreditationsSlotsIds,e.change]);return(0,i.jsxs)(am,{children:[e.displaySelectedCheckbox&&(0,i.jsx)(Qu,{width:48,children:(0,i.jsx)(wu,{state:l,onClick:u})}),(0,i.jsx)(Qu,{css:{textTransform:"capitalize"},children:e.slot.date?n.toLocaleString(e.slot.date,zs.DateOnly.WeekdayShortMonthShort):"-"}),(0,i.jsx)(Qu,{children:g(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(Qu,{children:e.accreditationDisplay===xe.Radio?(0,i.jsx)(zu,{state:a,onClick:d,children:t("pr_cocher_par_18369")}):(0,i.jsx)(Eu,{state:a,onClick:c,children:t("pr_cocher_par_18369")})}),(0,i.jsx)(Qu,{width:100,children:(0,i.jsx)(kd,{color:"white",disabled:!s.isDefault,leftIcon:s.isVisible?"eye":"eye-slash",onClick:()=>{e.change(`${r}isVisible`,!s.isVisible)}})}),(0,i.jsx)(Qu,{width:130,children:(0,i.jsx)(ec,{min:0,name:`${r}maxResources`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})})]})},Hj=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>e.delegationAccreditations.accreditations.findIndex(t=>t.accreditationId===e.accreditation.id),[e.delegationAccreditations.accreditations,e.accreditation]),o=(0,V.useMemo)(()=>e.delegationAccreditations.accreditations[n],[n,e.delegationAccreditations.accreditations]),s=(0,V.useMemo)(()=>Hg(e.slots.filter(t=>t.accreditationId===e.accreditation.id)),[e.slots,e.accreditation]),r=(0,V.useMemo)(()=>s.map(e=>e.id),[s]),a=(0,V.useMemo)(()=>{if(e.accreditation.hasSlots){const t=(0,bs.A)(s.map(t=>e.selectedAccreditationsSlotsIds.includes(t.id)));return 2===t.length?"indeterminate":t[0]?"checked":"unchecked"}return"unchecked"},[e.accreditation,e.selectedAccreditationsSlotsIds,s]),l=(0,V.useMemo)(()=>r.filter(t=>e.selectedAccreditationsSlotsIds.includes(t)),[e.selectedAccreditationsSlotsIds,r]),d=(0,V.useCallback)(t=>{"checked"===t?e.change("selectedAccreditationsSlotsIds",(0,bs.A)(e.selectedAccreditationsSlotsIds.concat(r))):e.change("selectedAccreditationsSlotsIds",(0,yu.A)(e.selectedAccreditationsSlotsIds,r))},[e.selectedAccreditationsSlotsIds,e.change,r]);return(0,i.jsx)(Vj,{accreditation:e.accreditation,badge:"number"==typeof o.maxResources&&(0,i.jsx)(vu,{color:"primary",leftIcon:"badge-check",children:t("quota_sur_l_acc_12936",o.maxResources)}),displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:s.length,renderActions:()=>(0,i.jsx)(Gj,{accreditation:e.accreditation,accreditationIndex:n,accreditationInput:o,change:e.change,delegationAccreditations:e.delegationAccreditations,hasSlots:e.accreditation.hasSlots,prefix:e.prefix,selectedAccreditationsSlotsIds:e.selectedAccreditationsSlotsIds,selectedSlotsIds:l,slotsIds:r}),children:(0,i.jsxs)(Hu,{hideBorder:!0,children:[(0,i.jsxs)(Wu,{children:[e.accreditation.hasSlots&&(0,i.jsx)(pm,{width:48,children:(0,i.jsx)(wu,{state:a,onClick:d})}),(0,i.jsx)(pm,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(pm,{children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(pm,{children:t("s_lection_par_d_61556")}),(0,i.jsx)(pm,{width:100,children:t("Privacy")}),(0,i.jsx)(pm,{width:130,children:t("total_07173")})]}),s.map((t,n)=>(0,i.jsx)(qj,{accreditationDisplay:e.accreditation.accreditationDisplay,change:e.change,delegationAccreditations:e.delegationAccreditations,displaySelectedCheckbox:e.accreditation.hasSlots,prefix:e.prefix,selectedAccreditationsSlotsIds:e.selectedAccreditationsSlotsIds,slot:t},`${t.id}-${n}`))]})})},Kj=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>e.delegationAccreditations.accreditationsCategories.findIndex(t=>t.accreditationCategoryId===e.category.id),[e.delegationAccreditations.accreditationsCategories,e.category]),o=(0,V.useMemo)(()=>e.delegationAccreditations.accreditationsCategories[n],[n,e.delegationAccreditations.accreditationsCategories]),s=(0,V.useMemo)(()=>_g(e.accreditations.filter(t=>t.accreditationCategoryId===e.category.id)),[e.accreditations,e.category]);return(0,i.jsx)(Bj,{category:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{children:e.category.name}),"number"==typeof o.maxResources&&(0,i.jsx)(vu,{color:"primary",leftIcon:"badge-check",children:t("quota_sur_la_ca_14699",o.maxResources)}),(0,i.jsx)(Uj,{maxResources:o.maxResources,name:e.category.name,onChange:t=>{e.change(`${e.prefix}accreditationsCategories[${n}].maxResources`,t)}})]}),children:s.map((t,n)=>(0,i.jsx)(Hj,{accreditation:t,change:e.change,delegationAccreditations:e.delegationAccreditations,prefix:e.prefix,selectedAccreditationsSlotsIds:e.selectedAccreditationsSlotsIds,slots:e.slots},`${t.id}-${n}`))})},Yj=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>e.delegationAccreditations.accreditationsCategories.map(e=>e.accreditationCategoryId),[e.delegationAccreditations.accreditationsCategories]),o=(0,V.useMemo)(()=>e.delegationAccreditations.accreditations.map(e=>e.accreditationId),[e.delegationAccreditations.accreditations]),s=(0,V.useMemo)(()=>e.delegationAccreditations.accreditationsSlots.map(e=>e.accreditationSlotId),[e.delegationAccreditations.accreditationsSlots]),r=(0,V.useMemo)(()=>(0,cm.A)(e.accreditationCategories.filter(e=>n.includes(e.id)),e=>m(e.name)),[e.accreditationCategories,n]),a=(0,V.useMemo)(()=>e.accreditationCategories.flatMap(e=>e.accreditations).filter(e=>o.includes(e.id)),[e.accreditationCategories,o]),l=(0,V.useMemo)(()=>a.flatMap(e=>e.slots).filter(e=>s.includes(e.id)),[a,s]);return Bs(r)?(0,i.jsx)(Lj,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:r.map(t=>(0,i.jsx)(Kj,{accreditations:a,category:t,change:e.change,delegationAccreditations:e.delegationAccreditations,prefix:e.prefix,selectedAccreditationsSlotsIds:e.selectedAccreditationsSlotsIds,slots:l},t.id))}):(0,i.jsx)(rd,{css:{background:"$gray50",bd:!0,padding:"$6"},justify:"center",children:t("aucune_accr_dit_27643")})},Zj=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>e.accreditationsProfiles.findIndex(t=>t.accreditationProfileId===e.accreditationProfile.id),[e.accreditationProfile,e.accreditationsProfiles]),o=(0,V.useMemo)(()=>e.accreditationsProfiles[n],[n,e.accreditationsProfiles]);return(0,i.jsx)(Vj,{accreditation:e.accreditationProfile,badge:!e.hideActions&&"number"==typeof o.maxResources&&(0,i.jsx)(vu,{color:"primary",leftIcon:"badge-check",children:t("quota_sur_le_pr_57811",o.maxResources)}),displayNumberOfSlots:!1,displaySlots:!1,numberOfSlots:0,renderActions:e.hideActions?void 0:()=>(0,i.jsxs)(rd,{align:"center",gap:"6",children:[(0,i.jsx)(Kp,{name:`${e.prefix}accreditationsProfiles[${n}].willAutoAccredit`,children:t("attribuer_autom_13895")}),(0,i.jsx)(Uj,{maxResources:o.maxResources,name:e.accreditationProfile.name,onChange:t=>{e.change(`${e.prefix}accreditationsProfiles[${n}].maxResources`,t)}})]})})},Xj=e=>{const t=(0,V.useMemo)(()=>e.category.accreditationsProfiles.filter(t=>e.accreditationsProfiles.some(e=>e.accreditationProfileId===t.id)),[e.category.accreditationsProfiles,e.accreditationsProfiles]);return(0,i.jsx)(Bj,{category:e.category.name,children:t.map(t=>(0,i.jsx)(Zj,{accreditationProfile:t,accreditationsProfiles:e.accreditationsProfiles,change:e.change,hideActions:e.hideActions,prefix:e.prefix},t.id))})},Jj=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>(0,cm.A)(e.accreditationsProfilesCategories.filter(t=>t.accreditationsProfiles.some(t=>e.accreditationsProfiles.some(e=>e.accreditationProfileId===t.id))),e=>m(e.name)),[e.accreditationsProfilesCategories,e.accreditationsProfiles]);return Bs(e.accreditationsProfiles)?(0,i.jsx)(Lj,{css:{border:"1px solid $gray200",borderRadius:"$1"},children:n.map(t=>(0,i.jsx)(Xj,{accreditationsProfiles:e.accreditationsProfiles,category:t,change:e.change,hideActions:e.hideActions,prefix:e.prefix},t.id))}):(0,i.jsx)(rd,{css:{background:"$gray50",bd:!0,padding:"$6"},justify:"center",children:t("aucun_profil_d_18230")})},Qj=({accreditationsProfilesCategories:e,allAccreditationCategories:t,change:n,values:o})=>{const{translate:s}=bd(),r=Ei(Cm),a=(0,V.useMemo)(()=>Nj(e),[e]),l=(0,V.useMemo)(()=>o.delegation.accreditationsProfiles.map(e=>e.accreditationProfileId),[o.delegation.accreditationsProfiles]),d=(0,V.useCallback)(e=>{const t=e.filter(e=>!o.delegation.accreditationsProfiles.some(t=>t.accreditationProfileId===e)),i=o.delegation.accreditationsProfiles.filter(t=>e.includes(t.accreditationProfileId)).concat(t.map(e=>({accreditationProfileId:e,willAutoAccredit:!0})));n("delegation.accreditationsProfiles",i)},[n,o.delegation.accreditationsProfiles]),c=(0,V.useMemo)(()=>Kg(r,t),[r,t]),u=(0,V.useMemo)(()=>new Map(t.flatMap(e=>e.accreditations.flatMap(t=>t.slots.map(n=>[n.id,{accreditationCategoryId:e.id,accreditationId:t.id}])))),[t]),m=(0,V.useMemo)(()=>o.delegation.accreditationsSlots.map(e=>e.accreditationSlotId),[o.delegation.accreditationsSlots]),h=(0,V.useCallback)(e=>{const{accreditationsSlots:t}=o.delegation,i=e.filter(e=>!t.some(t=>t.accreditationSlotId===e)),s=t.filter(t=>e.includes(t.accreditationSlotId)).concat(i.flatMap(e=>{const t=u.get(e);return t?[{...t,accreditationSlotId:e,isDefault:!1,isVisible:!0}]:[]}));Wj(o.delegation,s,"delegation.",n)},[n,u,o.delegation]),g=(0,V.useMemo)(()=>o.delegation.accreditationsSlots.some(({isDefault:e})=>e),[o]);return(0,i.jsxs)(rd,{direction:"column",children:[Bs(a)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{font:"gray900 textMd medium",children:s("liste_des_profi_98974")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(Jj,{accreditationsProfiles:o.delegation.accreditationsProfiles,accreditationsProfilesCategories:e,change:n,prefix:"delegation."}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Uu,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,triggerElem:(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",children:s("ajouter_des_pro_61834")}),values:l,onChange:d,children:a}),(0,i.jsx)(md,{height:"7"})]}),(0,i.jsx)(ka,{font:"gray900 textMd medium",children:s("liste_des_accr_46997")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(Yj,{accreditationCategories:t,change:n,delegationAccreditations:o.delegation,prefix:"delegation.",selectedAccreditationsSlotsIds:o.selectedAccreditationsSlotsIds}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Uu,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,triggerElem:(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",children:s("AddAccreditations")}),values:m,onChange:h,children:c}),g&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(ka,{font:"gray900 textMd medium",children:s("attribution_des_59896")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(Kp,{name:"delegation.addDefaultAccreditationsByAvailability",children:s("s_lectionner_pa_51634")})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(ka,{font:"gray900 textMd medium",children:s("affichage_des_a_55224")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(Kp,{name:"delegation.showAllAccreditations",subtext:s("afficher_galem_82855"),children:s("ShowAllAccreditations")})]})},eC=({disabled:e,...t})=>{const{descId:n}=Hd();return(0,i.jsx)(Pp.Provider,{value:{isDisabled:e},children:(0,i.jsxs)(rd,{"aria-describedby":n,as:"fieldset",className:"fieldset--row",css:{border:"unset",padding:"unset",margin:"unset","&:disabled :is(input, select, button)":{cursor:"not-allowed !important"},"& + &":{borderBlockStart:"1px solid $gray200",marginBlockStart:"$5",paddingBlockStart:"$5"},"& fieldset.fieldset--column":{gap:"$2","& header":{paddingBlockEnd:"unset",borderBlockEnd:"unset !important","& > div > :is(h1, h2, h3, h4, h5, h6)":{fontSize:"$textSm !important",fontWeight:"$medium !important"}}}},direction:"row",gap:"7",...t,children:[(0,i.jsx)(Vp,{heading:t.heading}),(0,i.jsxs)(rd,{as:id.Header,direction:"row",gap:"1",width:280,children:[(0,i.jsx)(Dd,{"aria-hidden":"true",color:"gray800",css:{fontSize:"$textSm"},textStyle:"subheading",children:t.heading}),(0,i.jsx)(Od,{id:n,textStyle:"subtitle",children:t.subtitle})]}),(0,i.jsx)(rd,{css:{flex:"1"},direction:"column",gap:"4",children:t.children})]})})},tC=e=>{const{translate:t,params:{organizationId:n}}=bd(),o=Ei(Fg),[s,r]=(0,V.useState)(!1),a=(0,V.useMemo)(()=>o.getDelegationMembersPossibleColumns(n,e.customFields,{forDelegationsSpace:!0,isWeezeventConnected:!0,positionDisplay:tt.Position,slotDisplay:Qe.Custom}),[n,o,e.customFields]),l=(0,V.useMemo)(()=>(0,hd.A)(e.columns.map(e=>a.find(t=>t.slug===e))),[a,e.columns]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{css:{bd:!0,overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(rd,{css:{background:"$gray50",borderBottom:"1px solid $gray200",color:"$gray500",padding:"$3 $6"},children:t("liste_des_colon_20101")}),(0,i.jsxs)(rd,{css:{padding:"$4"},direction:"column",gap:"4",children:[(0,i.jsx)(rd,{direction:"column",gap:"2",children:l.map(t=>(0,i.jsxs)(rd,{align:"center",css:{border:"1px solid $gray200",borderRadius:"$1",overflow:"hidden",padding:"$3"},gap:"3",children:[(0,i.jsx)(ka,{color:"gray700",css:{flex:"1"},children:t.name}),(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.change(`${e.prefix}columns`,(0,Cu.A)(e.columns,t.slug))}})]},t.slug))}),(0,i.jsx)(kd,{color:"invisible",leftIcon:"gear",onClick:()=>{r(!0)},children:t("_diter_les_colo_39630")})]})]}),s&&(0,i.jsx)(sh,{columns:a,initialSelectedColumns:e.columns,saveButtonText:t("_diter_62574"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_96096"),title:t("_dition_des_col_70300"),onClose:()=>r(!1),onSave:t=>{e.change(`${e.prefix}columns`,t)}})]})},nC=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)(!!e.values.delegation.delegationsSpaceLayoutId),s=(0,V.useCallback)(t=>{o(t),t?(e.change("delegation.campaignsIds",[]),e.change("delegation.customDocumentsSlugs",[])):e.change("delegation.delegationsSpaceLayoutId",null)},[o]);return(0,i.jsxs)(rd,{direction:"column",children:["event"===e.delegationType&&(0,i.jsx)(eC,{heading:t("DelegationsSpaceLayout"),children:(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(Zm,{value:n,onChange:s,children:t("utiliser_un_lay_31575")}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Gp,{label:t("choisissez_le_l_54992"),name:"delegation.delegationsSpaceLayoutId",children:e.layouts.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})]})}),!n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eC,{heading:t("liste_des_colon_20101"),children:(0,i.jsx)(tC,{change:e.change,columns:e.values.delegation.columns,customFields:e.customFields,prefix:"delegation."})}),(0,i.jsx)(eC,{heading:t("communication_05277"),children:(0,i.jsxs)(rd,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(Gp,{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)(Gp,{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))})]})})]})]})},iC=e=>{const t=Ti(),n=(0,V.useMemo)(()=>c.Ik().shape({name:c.Yj().required(t("le_nom_est_requ_61536"))}),[]);return(0,i.jsx)(Ej,{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)(ec,{label:t("nom_de_la_cat_g_03860"),name:"name"})})},oC=e=>{const{mutate:t}=xl();return(0,i.jsx)(iC,{initialName:"",isEdit:!1,mutate:async n=>(await t({organizationId:e.organizationId,eventId:e.eventId,delegationCategory:{name:n}})).delegationCategoryCreate,onClose:e.onClose,onSuccess:e.onSuccess})},sC=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),[s,r]=(0,V.useState)(!1),[a,l]=(0,V.useState)(vj(e.categories)),[d,c]=(0,V.useState)(!!e.initialParentId),u=(0,V.useCallback)(t=>{t||e.change("delegation.parentId",null),c(t)},[e.change,c]);return(0,i.jsxs)(i.Fragment,{children:["event"===e.delegationType&&Bs(e.organizationDelegations)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zm,{value:d,onChange:u,children:t("lier_cette_d_l_78975")}),(0,i.jsx)(md,{height:"6"})]}),d?(0,i.jsx)(Gp,{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)(ec,{label:t("nom_de_votre_d_69290"),name:"delegation.name"}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Gp,{isCreateVisible:!0,isSearchVisible:!0,label:t("cat_gorie_00291"),name:"delegation.delegationCategoryId",onCreateClick:()=>r(!0),children:a.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),s&&(0,i.jsx)(oC,{eventId:o,organizationId:n,onClose:()=>r(!1),onSuccess:t=>{l(vj([...a,t])),e.change("delegation.delegationCategoryId",t.id)}})]})},rC=e=>(0,i.jsx)(sC,{categories:e.categories,change:e.change,delegationType:"event",initialParentId:e.initialParentId,organizationDelegations:e.organizationDelegations}),aC=e=>(0,i.jsx)(sC,{categories:e.categories,change:e.change,delegationType:"organization",initialParentId:null,organizationDelegations:[]}),lC=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{mutate:s}=Bl(),r=(0,V.useMemo)(()=>({email:"",formRegister:{forOther:!0,userInfo:{fields:{firstName:"",lastName:""}},sendNotificationEmail:!1}}),[]),a=(0,V.useMemo)(()=>c.Ik().shape({email:c.Yj().required(t("l_e_mail_est_re_04856")).email(t("l_e_mail_est_re_04856"))}),[]);return(0,i.jsx)(Vd,{height:1,initialValues:r,render:({handleSubmit:n,submitting:s})=>(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"user-plus",children:"Nouveau membre"}),(0,i.jsx)(jv,{children:(0,i.jsxs)(rd,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(ec,{isEmail:!0,label:t("Email"),name:"email"}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(ec,{label:(0,i.jsx)(fI,{children:t("pr_nom_66988")}),name:"formRegister.userInfo.fields.firstName"}),(0,i.jsx)(ec,{label:(0,i.jsx)(fI,{children:t("last_name")}),name:"formRegister.userInfo.fields.lastName"})]}),(0,i.jsx)(Gp,{isSearchVisible:!0,label:(0,i.jsx)(fI,{children:t("population_38615")}),name:"formRegister.userInfo.fields.population",children:e.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),o&&(0,i.jsx)(Fp,{name:"formRegister.sendNotificationEmail",children:t("envoyer_l_email_75574")})]})}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{isLoading:s,onClick:n,children:t("ajouter_le_memb_57505")})})]}),schema:a,width:1,onSubmit:async t=>{const{userInfoAdminCreate:{id:i}}=await s({organizationId:n,eventId:o,email:t.email,userInfo:t.formRegister.userInfo,sendNotificationEmail:t.formRegister.sendNotificationEmail});e.onUserCreate(i),e.onClose()}})},dC=e=>{const{params:{organizationId:t}}=bd(),{data:n}=Oi('query CreateUserInfosLight($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n population: customFieldBySlug(slug: "population") {\n values {\n id\n value\n }\n }\n }\n}\n',{organizationId:t},[]);return(0,i.jsx)(Av,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsx)(lC,{values:n.organization?.population.values??[],onClose:e.onClose,onUserCreate:e.onUserCreate})})},cC=e=>{const{translate:t,params:{organizationId:n}}=bd(),{canMemberCreate:o}=Dv(),[s,r,a]=gm(""),{usersInfosOptions:l,isLoading:d}=Lv({organizationId:n,eventId:null,hasSelected:Bs(e.leadersIds),nameDebounced:r,reloadKey:e.reloadKey,userInfoIds:e.leadersIds}),[c,u]=(0,V.useState)(!1),m=(0,V.useCallback)(t=>{e.change("delegation.leadersIds",e.leadersIds.concat([t])),e.setRelodaKey(e=>e+1)},[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(eC,{heading:t("reponsable_82458_plural"),children:(0,i.jsx)(Gp,{createText:t("cr_er_un_membre_38547"),isCreateVisible:o,isSearchLoading:d,isSearchVisible:!0,label:t("s_lectionnez_le_30900"),multiple:!0,name:"delegation.leadersIds",searchElement:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),state:"search",value:s,onChange:a}),onCreateClick:()=>u(!0),children:l})}),(0,i.jsx)(eC,{heading:t("droits_des_resp_01552"),children:(0,i.jsxs)(rd,{direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Kp,{name:"delegation.showFormLinkInDelegationSpace",children:t("afficher_le_lie_05841")}),(0,i.jsx)(Kp,{name:"delegation.canLeadersAddMembers",children:t("CanLeadersAddMembers")}),(0,i.jsx)(Kp,{name:"delegation.canLeadersImportMembers",children:t("CanLeadersImportMembers")}),(0,i.jsx)(Kp,{name:"delegation.canLeadersEditMembers",children:t("CanLeadersEditMembers")}),(0,i.jsx)(Kp,{name:"delegation.canLeadersDeleteMembers",children:t("CanLeadersDeleteMembers")}),(0,i.jsx)(Kp,{name:"delegation.canLeadersDuplicateMembers",children:t("CanLeadersDuplicateMembers")}),(0,i.jsx)(Kp,{name:"delegation.canLeadersEditColumns",children:t("CanLeadersEditColumns")}),(0,i.jsx)(Kp,{name:"delegation.canLeadersEditCustomFields",children:t("CanLeadersEditCustomFields")}),(0,i.jsx)(Kp,{name:"delegation.canLeadersSeeHiddenAccreditationsSlots",children:t("CanLeadersSeeHiddenAccreditationsSlots")})]})})]}),c&&(0,i.jsx)(dC,{isOpen:c,onClose:()=>u(!1),onUserCreate:m})]})},uC=e=>{const t=Ti(),n=(0,V.useMemo)(()=>(0,cm.A)(e.forms,e=>e.name),[e.forms]),[o,s]=(0,V.useState)(!!e.initialValues.delegation.deadlineDate),[r,a]=(0,V.useState)(Number.isInteger(e.initialValues.delegation.maxResources));return(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(eC,{heading:t("Form"),children:(0,i.jsx)(Gp,{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)(eC,{heading:t("inscription_dan_16147"),children:(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{font:"gray800 textSm semiBold",children:t("les_inscription_64653")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(zu,{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)(md,{height:"2"}),(0,i.jsx)(Np,{name:"delegation.deadlineDate"}),(0,i.jsx)(md,{height:"3"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:o?"unchecked":"checked",onClick:()=>{s(!1),e.change("delegation.deadlineDate",null)},children:t("non_les_inscri_87979")}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{font:"gray800 textSm semiBold",children:t("les_inscription_76218")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(zu,{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)(md,{height:"2"}),(0,i.jsx)(ec,{name:"delegation.maxResources",shouldParseAsInt:!0}),(0,i.jsx)(md,{height:"3"})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:r?"unchecked":"checked",onClick:()=>{a(!1),e.change("delegation.maxResources",null)},children:t("non_les_inscri_07566")})]})})]})},mC=e=>{const{translate:t}=bd();return(0,i.jsx)(Av,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"triangle-exclamation",children:t("accr_ditations_34551")}),(0,i.jsx)(jv,{children:(0,i.jsxs)(rd,{align:"center",direction:"column",gap:"1",width:1,children:[(0,i.jsx)(ka,{font:"gray900 textLg medium",children:t("voulez_vous_met_24993")}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:t("les_accr_ditati_76418",e.deletedAccreditationsSlots.join(", "))})]})}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{isLoading:e.submitting,onClick:e.handleSubmit,children:t("mettre_jour_l_69948")})})]})})},hC=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),[s,r]=(0,V.useState)(0),a=(0,V.useMemo)(()=>g(e.initialValues.delegation.description)||g(e.initialValues.delegation.privateNote),[e.initialValues]),l=(0,V.useMemo)(()=>e.isEdit&&(Bs(e.initialValues.delegation.accreditationsSlots)||Bs(e.initialValues.delegation.accreditationsProfiles)||e.initialValues.delegation.showAllAccreditations),[e.initialValues,e.isEdit]),d=(0,V.useMemo)(()=>e.isEdit&&Bs(e.initialValues.delegation.usedCustomFieldsIds),[e.initialValues,e.isEdit]),c=(0,V.useMemo)(()=>e.isEdit&&Bs(e.initialValues.delegation.customFields),[e.initialValues,e.isEdit]),u=(0,V.useMemo)(()=>Bs(e.initialValues.delegation.tagsIds),[e.initialValues]),m=function(e,t,n){const i=Ei(Cm),o=(0,V.useMemo)(()=>{const e=t.delegation.accreditationsSlots.map(e=>e.accreditationSlotId),i=n.delegation.accreditationsSlots.map(e=>e.accreditationSlotId);return(0,yu.A)(e,i)},[t,n]);return(0,V.useMemo)(()=>e.flatMap(e=>e.accreditations.flatMap(e=>e.slots.flatMap(t=>o.includes(t.id)?[qg(i,t,e.name,{accreditation:{includeName:!0}})]:[]))),[o,e])}("event"===e.delegationType?e.accreditationsCategories:[],e.initialValues,e.values),[h,p]=(0,V.useState)(!1),f=(0,V.useCallback)(()=>{Bs(m)?p(!0):e.handleSubmit()},[m,p,e.handleSubmit]),_=(0,V.useMemo)(()=>e.isEdit?t("mise_jour_de_17055",e.initialValues.delegation.name):t("cr_ation_d_une_07120"),[e.initialValues,e.isEdit]);Zc(_);const x=(0,V.useCallback)(t=>{const n=e.organizationDelegations.find(e=>e.id===t);n&&(e.form.change("delegation.leadersIds",n.leadersIds),r(e=>e+1))},[e.organizationDelegations,e.values.delegation.leadersIds]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba.Yr,{name:"delegation.parentId",children:x}),(0,i.jsx)(zp,{button:e.isEdit?(0,i.jsx)(kd,{isLoading:e.submitting,onClick:f,children:t("mettre_jour_l_69948")}):null,category:_,color:"dark",fallbackClosePath:qo.DELEGATIONS({organizationId:n,eventId:o}),heading:e.isEdit?e.initialValues.delegation.name:t("nouvelle_d_l_ga_42871"),children:(0,i.jsxs)(Op,{ref:e.centeredContainerRef,children:[(0,i.jsx)(Nd,{}),(0,i.jsx)(Wp,{heading:t("informations_su_34607"),children:"event"===e.delegationType?(0,i.jsx)(rC,{categories:e.categories,change:e.form.change,initialParentId:e.initialValues.delegation.parentId,organizationDelegations:e.organizationDelegations}):(0,i.jsx)(aC,{categories:e.categories,change:e.form.change})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:t("param_tres_de_l_81810"),children:(0,i.jsx)(uC,{change:e.form.change,forms:e.forms,initialValues:e.initialValues})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:t("reponsable_82458_plural"),children:(0,i.jsx)(cC,{change:e.form.change,leadersIds:e.values.delegation.leadersIds,reloadKey:s,setRelodaKey:r})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:t("espace_d_l_gati_59251"),initialIsOpen:e.values.delegation.showInDelegationSpace,isToggleable:!0,subtitle:t("param_trer_les_35157"),onToggle:t=>{t||(e.form.change("delegation.delegationsSpaceLayoutId",null),e.form.change("delegation.campaignsIds",[]),e.form.change("delegation.customDocumentsSlugs",[])),e.form.change("delegation.showInDelegationSpace",t)},children:(0,i.jsx)(nC,{campaigns:e.campaigns,change:e.form.change,customDocuments:"event"===e.delegationType?e.customDocuments:[],customFields:e.customFields,delegationType:e.delegationType,layouts:e.layouts,values:e.values})}),(0,i.jsx)(md,{height:"5"}),"event"===e.delegationType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wp,{heading:t("accr_ditations_39450"),initialIsOpen:l,isToggleable:!0,subtitle:t("delegation_accreditations_desc"),onToggle:t=>{t||(e.form.change("delegation.accreditationsCategories",[]),e.form.change("delegation.accreditations",[]),e.form.change("delegation.accreditationsSlots",[]),e.form.change("delegation.accreditationsProfiles",[]),e.form.change("delegation.showAllAccreditations",!1))},children:(0,i.jsx)(Qj,{accreditationsProfilesCategories:e.accreditationsProfilesCategories,allAccreditationCategories:e.accreditationsCategories,change:e.form.change,values:e.values})}),(0,i.jsx)(md,{height:"5"})]}),(0,i.jsx)(Wp,{heading:t("champs_de_formu_64126"),initialIsOpen:d,isToggleable:!0,subtitle:t("ajouter_des_inf_57824"),onToggle:t=>{t||(e.form.change("delegation.usedCustomFieldsIds",[]),e.form.change("delegation.fields",(0,ma.A)(e.values.delegation.fields,e.delegationCustomFields.map(e=>e.slug))))},children:(0,i.jsx)(Fj,{change:e.form.change,customFields:e.delegationCustomFields,prefix:"delegation.",usedCustomFieldsIds:e.values.delegation.usedCustomFieldsIds})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:t("d_finir_la_vale_27863"),initialIsOpen:c,isToggleable:!0,subtitle:t("choisissez_une_24029"),onToggle:t=>{t||e.form.change("delegation.customFields",[])},children:(0,i.jsx)(kj,{change:e.form.change,customFields:e.customFields,name:"delegation.customFields",values:e.values.delegation.customFields})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:t("description_et_59312"),initialIsOpen:a,isToggleable:!0,subtitle:t("ajoutez_une_des_54307"),onToggle:t=>{t||(e.form.change("delegation.description",""),e.form.change("delegation.privateNote",""))},children:(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[(0,i.jsx)(SI,{label:(0,i.jsx)(fI,{children:t("description_58935")}),name:"delegation.description"}),(0,i.jsx)(SI,{label:(0,i.jsx)(fI,{children:t("note_priv_e_06303")}),name:"delegation.privateNote"})]})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:t("tags_79499"),initialIsOpen:u,isToggleable:!0,subtitle:t("ajouter_des_tag_35833"),onToggle:t=>{t||e.form.change("delegation.tagsIds",[])},children:(0,i.jsx)(Rj,{change:e.form.change,name:"delegation.",organizationId:n,tags:e.tags,tagsIds:e.values.delegation.tagsIds})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)($p,{children:(0,i.jsx)(kd,{isLoading:e.submitting,textAlign:"center",onClick:f,children:e.isEdit?t("mettre_jour_l_69948"):t("cr_er_la_d_l_ga_53268")})})]})}),(0,i.jsx)(mC,{deletedAccreditationsSlots:m,handleSubmit:e.handleSubmit,isOpen:h,submitting:e.submitting,onClose:()=>{p(!1)}})]})},gC=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=bd(),{showNotification:r}=HI(),a=Ei(ld),l=Ei(oj),d=Ei($b),c=(0,V.useRef)(null),u=(0,V.useCallback)(t=>a.validateForForm(d.createUpdateDelegationSchema(l.changedFieldsSchema(e.delegationCustomFields,e.initialValues.delegation.fields,t.delegation.fields)))(t),[e.delegationCustomFields,e.initialValues]);return(0,i.jsx)(Vd,{customErrorRef:c,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:n,submitting:o,values:s})=>(0,i.jsx)(hC,{...e,centeredContainerRef:c,form:t,handleSubmit:n,submitting:o,values:s}),validate:u,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(qo.DELEGATIONS({organizationId:o,eventId:s}))}})},pC=(e,t)=>{try{if(g(e)&&!isNaN((0,Pb.A)(e,10)))return{delegationCategoryId:(0,Pb.A)(e,10)};if(g(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{}}},fC=()=>{const{params:{organizationId:e,eventId:t,options:n}}=bd(),o=Ei($b),{data:s,isLoading:r}=Oi("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(\n eventId: $eventId\n variety: Delegation\n privacy: Public\n ) {\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},[js.CreatePositionTagsFragment,js.OrganizationCustomFieldsFragment,js.AttachCustomFieldFragment,js.CreateDelegationEventFragment]),{mutate:a}=ul(),{mutate:l}=xl(),[d,c]=(0,V.useState)(!0),[u,m]=(0,V.useState)({});return(0,V.useEffect)(()=>{(async()=>{if(s.organization){const{delegationCategoryId:i,parentId:r,parentDelegation:a}=pC(n,s.organization.delegations.nodes),d=s.organization.delegationsCategories.nodes;if(r&&a&&!d.find(e=>e.name==a.delegationCategory.name)){const{delegationCategoryCreate:n}=await l({organizationId:e,eventId:t,delegationCategory:{name:a.delegationCategory.name}});d.push(n)}m(o.createUpdateDelegationValuesDefault(null,{delegationCategoryId:i,delegationsCategories:d,forms:s.event.forms.nodes,parentId:r,parentDelegation:a})),c(!1)}})()},[n,s]),r||d?(0,i.jsx)(Cd,{}):(0,i.jsx)(gC,{accreditationsCategories:s.event.accreditationsCategories,accreditationsProfilesCategories:s.event.accreditationsProfilesCategories,campaigns:s.event.campaigns.nodes,categories:s.organization.delegationsCategories.nodes,closePath:qo.DELEGATIONS({organizationId:e,eventId:t}),customDocuments:s.event.customDocuments,customFields:s.organization.customFields.nodes,delegationCustomFields:s.organization.delegationCustomFields.nodes,delegationType:"event",forms:s.event.forms.nodes,initialValues:u,isEdit:!1,layouts:s.event.delegationsSpaceLayouts,mutate:a,organizationDelegations:s.organization.delegations.nodes,tags:s.organization.tags.nodes})},_C=()=>{const{params:{organizationId:e,options:t}}=bd(),n=Ei($b),{data:o,loader:s}=Oi("query DelegationOrganizationInfos($organizationId: OrganizationId!, $eventId: EventId) {\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},[js.CreatePositionTagsFragment,js.OrganizationCustomFieldsFragment,js.AttachCustomFieldFragment,js.CreateDelegationFormFragment]),{mutate:r}=ul(),a=(0,V.useMemo)(()=>{const{delegationCategoryId:e}=pC(t,[]);return n.createUpdateDelegationValuesDefault(null,{delegationCategoryId:e})},[]);return s||(0,i.jsx)(gC,{campaigns:o.organization.campaigns.nodes,categories:o.organization.delegationsCategories.nodes,closePath:fs.COMMUNITY_DELEGATIONS(e),customFields:o.organization.customFields.nodes,delegationCustomFields:o.organization.delegationCustomFields.nodes,delegationType:"organization",forms:o.organization.forms.nodes,initialValues:a,isEdit:!1,layouts:[],mutate:r,organizationDelegations:[],tags:o.organization.tags.nodes})},xC=()=>{const{params:{organizationId:e,eventId:t,delegationId:n}}=bd(),o=Ei($b),{data:s,loader:r}=Oi("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(\n eventId: $eventId\n variety: Delegation\n privacy: Public\n ) {\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 delegationsSpaceLayoutId\n columns\n privateNote\n tagsIds\n addDefaultAccreditationsByAvailability\n showAllAccreditations\n showInDelegationSpace\n showFormLinkInDelegationSpace\n fields\n canLeadersAddMembers\n canLeadersDeleteMembers\n canLeadersDuplicateMembers\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 accreditationsCategories {\n accreditationCategoryId\n maxResources\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 accreditationsProfiles {\n accreditationProfileId\n maxResources\n willAutoAccredit\n }\n }\n }\n}\n",{organizationId:e,eventId:t,delegationId:n},[js.CreatePositionTagsFragment,js.OrganizationCustomFieldsFragment,js.AttachCustomFieldFragment,js.CreateDelegationEventFragment]),{mutate:a}=ml(),l=(0,V.useMemo)(()=>o.createUpdateDelegationValuesDefault(s.event?.delegation,null),[s.event]);return r||(0,i.jsx)(gC,{accreditationsCategories:s.event.accreditationsCategories,accreditationsProfilesCategories:s.event.accreditationsProfilesCategories,campaigns:s.event.campaigns.nodes,categories:s.organization.delegationsCategories.nodes,closePath:qo.DELEGATION({organizationId:e,eventId:t,delegationId:n}),customDocuments:s.event.customDocuments,customFields:s.organization.customFields.nodes,delegationCustomFields:s.organization.delegationCustomFields.nodes,delegationType:"event",forms:s.event.forms.nodes,initialValues:l,isEdit:!0,layouts:s.event.delegationsSpaceLayouts,mutate:async e=>await a({...e,delegationId:n}),organizationDelegations:s.organization.delegations.nodes,tags:s.organization.tags.nodes})},IC=()=>{const{params:{organizationId:e,delegationId:t}}=bd(),n=Ei($b),{data:o,loader:s}=Oi("query DelegationOrganizationToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId!\n) {\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 showAllAccreditations\n showInDelegationSpace\n showFormLinkInDelegationSpace\n fields\n canLeadersAddMembers\n canLeadersDeleteMembers\n canLeadersDuplicateMembers\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},[js.CreatePositionTagsFragment,js.OrganizationCustomFieldsFragment,js.AttachCustomFieldFragment,js.CreateDelegationFormFragment]),{mutate:r}=ml(),a=(0,V.useMemo)(()=>n.createUpdateDelegationValuesDefault(o.organization?{...o.organization.delegation,accreditationsCategories:[],accreditations:[],accreditationsSlots:[],accreditationsProfiles:[]}:null,null),[o.organization]);return s||(0,i.jsx)(gC,{campaigns:o.organization.campaigns.nodes,categories:o.organization.delegationsCategories.nodes,closePath:fs.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,layouts:[],mutate:async e=>await r({...e,delegationId:t}),organizationDelegations:[],tags:o.organization.tags.nodes})};function vC(e,t,n,i){const{getLocalOrganization:o,updateLocalOrganization:s}=function(e){const t=(0,V.useCallback)(async()=>{let t=await sv.organizations.get(e);return t||(t={id:e},await sv.organizations.put(t)),t},[e]),n=(0,V.useCallback)(async n=>{const i=await t(),o=(0,rv.A)(i,{id:e},n);return await sv.organizations.put(o),o},[e,t]);return{getLocalOrganization:t,updateLocalOrganization:n}}(e),[r,a]=(0,V.useState)(n),[l,d]=(0,V.useState)(!0),c=(0,V.useCallback)(async e=>{a(e),await s({[t]:e})},[t,a,s]);return(0,V.useEffect)(()=>{(async()=>{const e=await o();e[t]&&(i?.includes(e[t])??1)&&a(e[t]),d(!1)})()},[e,i,o,a,d]),[r,c,l]}function bC(e,t,n,i,o,s){const r=vC(n,i,o,s);return(0,V.useMemo)(()=>e?[t(e),hc.A,!1]:r,[e,r])}function jC(e){return(0,V.useMemo)(()=>new Map(e.map(e=>[e.slug,e])),[e])}let CC=class{translationService;constructor(e){this.translationService=e}minutesToHoursMinutesString(e){const t=As.dw.fromObject({minutes:e},{locale:Oc(this.translationService.language)}).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"})}};function yC(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(),zs.DateTime):""}}return""}CC=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],CC);const AC=(0,V.createContext)({});function SC(){return(0,V.useContext)(AC)}const kC=e=>{const t=Ei(Xb),{isEditMode:n}=SC(),{isEditMode:o}=ip(),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)(Qu,{css:{border:"2px solid transparent","& > .h-checkbox-cell-hover":{display:"none"},"&:hover":{border:"2px solid $primary500"},"&:hover > .h-checkbox-cell-default":{display:"none"},"&:hover > .h-checkbox-cell-hover":{display:"block"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Gd,children:[(0,i.jsx)(ka,{className:"h-checkbox-cell-default",children:a}),(0,i.jsx)(ka,{className:"h-checkbox-cell-hover",children:(0,i.jsx)(wu,{state:l,onClick:async t=>{await e.mutate("checked"===t,e.customField.slug),e.reload()}})})]}):(0,i.jsx)(Qu,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:a})};class wC extends Error{}function EC(e,t){const n=Ei(oj);return(0,V.useCallback)(i=>{const o=n.getValidationRuleError(e,i);return o?Promise.reject(new wC(o)):t(i,e.slug)},[e,t])}const TC="h-update-cell-open",RC=e=>{const t=Ti(),n=(0,V.useRef)(W()),[o,s]=(0,V.useState)(!1),[r,a]=(0,V.useState)(e.initialValue),[l,d]=(0,V.useState)(!1),[c,u]=(0,V.useState)(null),m=(0,V.useCallback)(e=>{a(e),u(null)},[]),h=(0,V.useCallback)(t=>{s(t),document.body.dispatchEvent(new CustomEvent(TC,{bubbles:!0,detail:{uuid:n.current}})),e.onStateChange?.(t)},[s,e.onStateChange]),g=(0,V.useCallback)(e=>{e.detail.uuid!==n.current&&s(!1)},[s]),p=(0,V.useCallback)(()=>{h(!1),m(e.initialValue)},[e.initialValue,h,m]),f=(0,V.useCallback)(async()=>{d(!0);try{await e.onSave(r)}catch(e){if(!(e instanceof wC))throw e;u(e.message)}finally{d(!1)}},[e.onSave,r]);return(0,V.useEffect)(()=>(document.addEventListener(TC,g),()=>{document.removeEventListener(TC,g)}),[g]),(0,i.jsxs)(nu,{doNotCloseOnOtherOpen:!0,isOpen:o,onStateChange:h,children:[(0,i.jsx)(du,{children:(0,i.jsx)(Qu,{css:{...e.css,border:"2px solid transparent",cursor:"text","&:hover":{border:"2px solid $primary700"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Gd,children:"function"==typeof e.renderValue?e.renderValue():e.renderValue})}),(0,i.jsxs)(lu,{css:{padding:"0",overflowBlock:"auto",maxBlockSize:"50vh"},placement:"bottom-start",width:380,children:[(0,i.jsx)(rd,{css:{padding:"$4 $6"},onKeyDown:e=>{"Enter"===e.key&&f()},children:e.renderInput(r,a,c)}),(0,i.jsxs)(rd,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:p,children:t("annuler_48254")}),(0,i.jsx)(kd,{isLoading:l,size:"sm",onClick:f,children:t("appliquer_05753")})]})]})]})},OC=e=>{const{isEditMode:t}=SC(),{isEditMode:n}=ip();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)(Qu,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:"function"==typeof e.renderValue?e.renderValue():e.renderValue})},DC=e=>{const t=Ei(Xb),n=t.getValueString(e.customField,e.fields),o=(0,V.useMemo)(()=>{const n=t.getValue(e.customField,e.fields);return g(n)?As.c9.fromISO(n,{zone:"utc"}):n},[]),s=EC(e.customField,e.mutate);return(0,i.jsx)(OC,{column:e.column,initialValue:o,mutate:s,reload:e.reload,renderInput:(t,n,o)=>(0,i.jsx)(Ih,{hint:o,label:e.customField.name,state:g(o)?"error":"active",value:t,onChange:n}),renderValue:n,updatable:e.updatable})},zC=e=>{const t=Ei(Xb),n=t.getValueString(e.customField,e.fields),o=(0,V.useMemo)(()=>{const n=t.getValue(e.customField,e.fields);return g(n)?As.c9.fromISO(n,{zone:"utc"}):n},[]),s=EC(e.customField,e.mutate);return(0,i.jsx)(OC,{column:e.column,initialValue:o,mutate:s,reload:e.reload,renderInput:(t,n,o)=>(0,i.jsx)(Ch,{hint:o,label:e.customField.name,state:g(o)?"error":"active",value:t,onChange:n}),renderValue:n,updatable:e.updatable})},$C=e=>{const{params:{organizationId:t}}=bd(),n=Ei(Xb),o=n.getValueString(e.customField,e.fields,{fileReturnValue:"name"}),s=n.getValueString(e.customField,e.fields,{fileReturnValue:"url"}),r=(0,V.useMemo)(()=>n.getValue(e.customField,e.fields),[e.customField,e.fields]),a=EC(e.customField,e.mutate),l=e.customField.fileType===gt.Picture,d=e.customField.fieldProperty===pt.Picture?e.avatarUser:void 0;return(0,i.jsx)(OC,{column:e.column,initialValue:r,mutate:a,reload:e.reload,renderInput:(n,o)=>l?(0,i.jsx)(pj,{allowCrop:!0,label:e.customField.name,organizationId:t,value:n,onChange:o}):(0,i.jsx)(pI,{accept:[Vx.Images,Vx.Pdf],acl:"private",label:e.customField.name,organizationId:t,value:n,onChange:o}),renderValue:()=>l?(g(s)||d)&&(0,i.jsx)(Gf,{email:d?.email,image:s,name:d?.name,size:32}):(0,i.jsx)(bm,{css:{fontWeight:"$regular"},to:s,children:o}),updatable:e.updatable})},PC=e=>{const t=Ei(Xb),n=t.getValueString(e.customField,e.fields),o=(0,V.useMemo)(()=>t.getValue(e.customField,e.fields)||0,[e.customField,e.fields]),s=EC(e.customField,e.mutate);return(0,i.jsx)(OC,{column:e.column,initialValue:o,mutate:s,reload:e.reload,renderInput:(t,n,o)=>(0,i.jsx)(Qd,{hint:o,label:e.customField.name,shouldParseAsInt:!0,state:g(o)?"error":"active",value:t,onChange:n}),renderValue:n,updatable:e.updatable})},MC=e=>{const t=Ei(Xb),n=Ei(L_),o=t.getValueString(e.customField,e.fields),s=(0,V.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=EC(e.customField,e.mutate);return(0,i.jsx)(OC,{column:e.column,initialValue:s,mutate:r,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(W_,{label:e.customField.name,value:t,onChange:n}),renderValue:o,updatable:e.updatable})},FC=e=>(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{css:{background:e.color,borderRadius:"16px",overflow:"hidden"},height:16,width:16}),(0,i.jsx)(ka,{children:e.children})]});let NC=null;function LC(e,{fontSize:t,fontWeight:n}={}){NC||=document.createElement("canvas");const i=NC.getContext("2d");return i.font=`${n||"400"} ${t||"14px"} 'Open Sans`,i.measureText(e).width}const BC=({badge:e})=>(0,i.jsx)(vu,{color:e.color,count:e.count,css:{cursor:e.onClick?"pointer":"inherit"},leftIcon:e.icon?Vn.includes(e.icon)?xd(e.icon):e.icon:void 0,size:"md",onClick:e.onClick,children:e.text}),VC=({badges:e})=>(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(vu,{cursor:"pointer",size:"md",children:`+${e.length}`})}),(0,i.jsx)(lu,{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)(rd,{children:(0,i.jsx)(BC,{badge:e})},e.id))})]}),UC=e=>{const[t,n]=(0,V.useState)(0),o=(0,V.useCallback)(e=>{e&&n(e.getBoundingClientRect().width)},[]),s=(0,V.useMemo)(()=>e.badges.some(e=>"number"==typeof e.count||"string"==typeof e.count),[e.badges]),r=(0,V.useMemo)(()=>e.badges.some(e=>!!e.icon),[e.badges]),a=(0,V.useMemo)(()=>(s?28:0)+(r?12:0)+20,[s,r]),l=(0,V.useMemo)(()=>{const t=e.badges.map(e=>({...e,textWidth:Math.floor(LC(e.text,{fontSize:"12px"}))+a}));return!0===e.doNotSort?t:(0,cm.A)(t,({textWidth:e})=>e)},[a,e.badges,e.doNotSort]),[d,c]=(0,V.useMemo)(()=>{let e=37;const n=[],i=[];for(const o of l)e+=o.textWidth+8,eBs(c),[c]);return(0,i.jsxs)(rd,{ref:o,align:"center",css:{cursor:e.onClick?"pointer":"inherit","&:hover":{color:"black"}},gap:"2",height:1,width:1,onClick:t=>{e.onClick&&Bs(l)&&(Gd(t),e.onClick())},children:[d.map(e=>(0,i.jsx)(BC,{badge:e},e.id)),u&&(e.onClick?(0,i.jsx)(vu,{css:{cursor:"pointer"},size:"md",children:"+"+(l.length-d.length)}):(0,i.jsx)(VC,{badges:c}))]})},WC=e=>{const t=Ti(),n=Ei(Xb),o=(0,V.useMemo)(()=>{if(e.customField.canSelectMultiple){const t=n.getSelectCustomFieldValues(e.customField,e.fields);if(e.customField.listType==ht.Dot)return(0,i.jsx)(rd,{align:"center",gap:"3",wrap:"wrap",children:t.map(({value:e,color:t},n)=>(0,i.jsx)(FC,{color:t||"",children:e},n))});{const n=t.map(({value:t,color:n})=>({id:t,color:e.customField.listType===ht.Badge?n||"":"gray",icon:null,text:t}));return(0,i.jsx)(UC,{badges:n})}}{const t=n.getValueString(e.customField,e.fields);if(g(t)){if(e.customField.listType===ht.Default)return t;{const o=n.getValue(e.customField,e.fields),s=e.customField.values.find(({id:e})=>e===o)?.color??"";return e.customField.listType===ht.Dot?(0,i.jsx)(FC,{color:s,children:t}):(0,i.jsx)(vu,{color:s,children:t})}}return""}},[n,e.customField,e.fields]),s=(0,V.useMemo)(()=>{const t=n.getValue(e.customField,e.fields);return e.customField.canSelectMultiple?Bs(t)?t:[]:t||""},[n,e.customField,e.fields]),r=_j(e.customField),a=EC(e.customField,e.mutate);return(0,i.jsx)(OC,{column:e.column,initialValue:s,mutate:a,reload:e.reload,renderInput:(n,o)=>e.customField.canSelectMultiple?(0,i.jsx)(Uu,{isSearchVisible:!0,isSelectAllVisible:!0,label:e.customField.name,multiple:!0,renderOnPortal:!0,values:n,onChange:o,children:r}):(0,i.jsx)(Uu,{isSearchVisible:!0,label:e.customField.name,multiple:!1,placeholder:t("choisir_une_val_00277"),renderOnPortal:!0,values:[n],onChange:e=>{Bs(e)&&o(e[0])},children:r}),renderValue:o,updatable:e.updatable})},GC=e=>{const t=Ei(Xb).getValueString(e.customField,e.fields),n=EC(e.customField,e.mutate);return(0,i.jsx)(OC,{column:e.column,initialValue:t,mutate:n,reload:e.reload,renderInput:(t,n,o)=>(0,i.jsx)(qp,{hint:o,label:e.customField.name,state:g(o)?"error":"active",value:t,onChange:n,onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}}),renderValue:t,updatable:e.updatable})},qC=e=>{const t=Ei(Xb).getValueString(e.customField,e.fields),n=EC(e.customField,e.mutate),{isEditMode:o}=SC(),{isEditMode:s}=ip(),r=o||s,a="string"==typeof e.clickPath&&(e.column.slug===pt.FirstName||e.column.slug===pt.LastName),l=a&&!r;return(0,i.jsx)(OC,{column:e.column,initialValue:t,mutate:n,reload:e.reload,renderInput:(t,n,o)=>(0,i.jsx)(Qd,{autoFocus:!0,hint:o,label:e.customField.name,state:g(o)?"error":"active",value:t,onChange:n}),renderValue:()=>l?(0,i.jsx)(bm,{to:e.clickPath,children:t}):(0,i.jsx)(ka,{fontWeight:a?"medium":"inherit",children:t}),updatable:e.updatable})},HC=e=>{const t=Ei(Xb),n=t.getValueString(e.customField,e.fields),o=(0,V.useMemo)(()=>t.getValueString(e.customField,e.fields),[]),s=EC(e.customField,e.mutate);return(0,i.jsx)(OC,{column:e.column,initialValue:o,mutate:s,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(kI,{label:e.customField.name,value:t,onChange:n}),renderValue:n,updatable:e.updatable})},KC=e=>{const t=Ei(Xb);return e.customField?.fieldType===Oe.Checkbox?(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===Oe.Date?(0,i.jsx)(DC,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Oe.Phone?(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===Oe.Select||e.customField?.fieldType===Oe.Country||e.customField?.fieldType===Oe.Language||e.customField?.fieldType===Oe.Sex||e.customField?.fieldType===Oe.Nationality?(0,i.jsx)(WC,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Oe.Text?(0,i.jsx)(qC,{clickPath:e.clickPath,column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Oe.Textarea?(0,i.jsx)(GC,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Oe.Number?(0,i.jsx)(PC,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Oe.File?(0,i.jsx)($C,{avatarUser:e.avatarUser,column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Oe.Datetime?(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===Oe.Time?(0,i.jsx)(HC,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):(0,i.jsx)(Qu,{children:e.customField?t.getValueString(e.customField,e.fields,{fileReturnValue:"name"}):""})},YC=e=>{const{params:{organizationId:t,eventId:n}}=bd(),{isEditMode:o}=SC(),{isEditMode:s}=ip(),r=o||s,{mutate:a}=Ur(),l=(0,V.useCallback)(i=>a({organizationId:t,eventId:n,userInfoId:e.userInfo.id,email:i}),[e.userInfo,a]);return(0,i.jsx)(OC,{column:e.column,initialValue:e.userInfo.email,mutate:l,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(Qd,{isEmail:!0,label:e.column.name,value:t,onChange:n}),renderValue:()=>"string"!=typeof e.clickPath||r?(0,i.jsx)(ka,{fontWeight:"medium",children:e.userInfo.email}):(0,i.jsx)(bm,{to:e.clickPath,children:e.userInfo.email}),updatable:e.updatable})},ZC=e=>{const{translate:t}=bd(),{isEditMode:n}=SC(),{isEditMode:o}=ip(),s=n||o,r=(0,V.useMemo)(()=>({firstName:e.userInfo.fields.firstName||"",lastName:e.userInfo.fields.lastName||""}),[e.userInfo]),a=(0,V.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)(rd,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Qd,{label:t("pr_nom_66988"),value:e.firstName,onChange:t=>{n({...e,firstName:t})}}),(0,i.jsx)(Qd,{label:t("last_name"),value:e.lastName,onChange:t=>{n({...e,lastName:t})}})]}),renderValue:()=>(0,i.jsx)(ub,{clickPath:e.clickPath,isClickDisabled:!0,size:32,userInfo:e.userInfo}),onSave:a}):(0,i.jsx)(Qu,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ub,{clickPath:e.clickPath,size:32,userInfo:e.userInfo})})};function XC(e,t){if(e){const n=(e.usersOrganizations||[]).map(e=>({id:`uo-${e.id}`,color:"gray",icon:e.role.type===be.OrganizationAdmin?"gem":"glasses-round",text:`${e.role.name}`})).concat((e.usersEvents||[]).map(e=>({id:`ue-${e.id}`,color:"gray",icon:e.role.type===be.EventAdmin?"gem":"glasses-round",text:`${e.event.name} - ${e.role.name}`}))).concat((e.usersDelegations||[]).map(e=>({id:`ud-${e.id}`,color:"gray",icon:"user-group",text:`${e.delegation.name} - ${t("responsable_de_70462")}`}))).concat((e.usersDelegationsCategories||[]).map(e=>({id:`udc-${e.id}`,color:"gray",icon:"user-group",text:`${e.delegationCategory.name} - ${e.role.name}`}))).concat((e.usersPositions||[]).map(e=>({id:`up-${e.id}`,color:"gray",icon:"sitemap",text:`${e.position.name} - ${e.role.name}`}))).concat((e.usersPositionsCategories||[]).map(e=>({id:`upc-${e.id}`,color:"gray",icon:"sitemap",text:`${e.positionCategory.name} - ${e.role.name}`})));return(0,Xh.A)(n,({text:e})=>e)}return[]}const JC=e=>{const t=Ti(),n=(0,V.useMemo)(()=>XC(e.userPermissions,t),[e.userPermissions]);return(0,i.jsx)(Qu,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(UC,{badges:n,doNotSort:!0})})};function QC(e){return(0,cm.A)(e.map(e=>({id:e.id,category:e.accreditationProfileCategory.name,text:g(e.acronym)?e.acronym:e.name,color:e.color,icon:e.icon})),({category:e,text:t})=>[m(e),m(t)])}const ey=e=>{const{translate:t}=bd(),{mutate:n}=ur(),{isEditMode:o}=SC(),{isEditMode:s}=ip(),r=o||s,a=(0,V.useMemo)(()=>(0,hd.A)([e.volunteerRegistration.accreditationProfile?.id]),[e.volunteerRegistration]),[l,d]=(0,V.useState)(!0),[c,u]=(0,V.useState)(null),m=(0,V.useMemo)(()=>QC((0,hd.A)([e.volunteerRegistration.accreditationProfile])),[e.volunteerRegistration.accreditationProfile]),h=(0,V.useCallback)(async t=>{if(t&&l){const{event:t}=await(n={eventId:e.eventId},i=await X(),Js(rr,{variables:n,token:i||void 0,fragments:[]})),o=Nj(t.accreditationsProfilesCategories);u(o),d(!1)}var n,i},[e.eventId,l]),g=(0,V.useCallback)(async t=>{Vs(t)?await n({eventId:e.eventId,massProfileUpdate:{selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:yt.Delete}}):await n({eventId:e.eventId,massProfileUpdate:{accreditationProfileId:t[0],selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:yt.Replace}}),e.reload()},[n,e.eventId,e.volunteerRegistration,e.reload]);return r&&e.updatable?(0,i.jsx)(RC,{column:e.column,css:{gap:"$2"},initialValue:a,renderInput:(e,n)=>l?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ju,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("profil_d_accr_d_02274"),multiple:!1,renderOnPortal:!0,values:e,onChange:n,children:c}),renderValue:()=>(0,i.jsx)(UC,{badges:m}),onSave:g,onStateChange:h}):(0,i.jsx)(Qu,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:m})})},ty=({column:e,eventId:t,onClick:n,reload:o,updatable:s,volunteerRegistration:r})=>{const a=Ti(),{mutate:l}=hr(),{mutate:d}=Jr(),c=Ei(Cm),{isEditMode:u}=SC(),{isEditMode:m}=ip(),h=u||m,[g,p]=(0,V.useState)(!0),[f,_]=(0,V.useState)(null),x=(0,V.useMemo)(()=>r?.accreditationsUsersInfos||[],[r]),I=(0,V.useMemo)(()=>gg(x),[x]),v=(0,V.useMemo)(()=>x.map(e=>e.accreditationSlot.id),[x]),b=(0,V.useCallback)(async e=>{if(e&&g){const{event:e}=await qr({eventId:t,loadIsBlocked:!0},await X()),n=Kg(c,e.accreditationsCategories,{useAccreditationDisplay:!0,useIsBlocked:!0});_(n),p(!1)}},[c,t,g]),j=(0,V.useCallback)(async e=>{Bs(e)?await l({eventId:t,massAccredit:{accreditationsSlotsIds:e,selecteds:{ids:[r.userInfo.id]},strategy:yt.Replace}}):await d({eventId:t,massStateUpdate:{selecteds:{ids:[r.userInfo.id]},state:We.WaitingAccreditation}}),o()},[t,r,l,o]);return h&&s?(0,i.jsx)(RC,{column:e,css:{gap:"$2"},initialValue:v,renderInput:(e,t)=>g?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ju,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(Uu,{isSearchVisible:!0,label:a("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:e,onChange:t,children:f}),renderValue:()=>(0,i.jsx)(UC,{badges:I,doNotSort:!0}),onSave:j,onStateChange:b}):(0,i.jsx)(Qu,{css:{border:"2px solid transparent"},minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(UC,{badges:I,doNotSort:!0,onClick:n})})},ny=e=>{const t=(0,V.useMemo)(()=>(0,Xh.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)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:t})})},iy=e=>{const t=Ti(),{mutate:n}=oa();return(0,i.jsx)(rd,{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)(vu,{..._b(e.state),children:t(e.state)})})},oy=e=>{const t=Ti(),{isEditMode:n}=SC(),{isEditMode:o}=ip(),s=n||o,[r,a]=(0,V.useState)(!1),l=(0,V.useCallback)(e=>{s&&a(e)},[s,a]),d=(0,V.useCallback)(()=>{l(!1)},[l]);return s&&e.updatable?(0,i.jsx)(Qu,{css:{border:"2px solid transparent","&:hover":{border:"2px solid $primary500"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Gd,children:(0,i.jsxs)(nu,{isOpen:r,onStateChange:l,children:[(0,i.jsx)(du,{children:(0,i.jsxs)(rd,{align:"center",gap:"3",height:1,justify:"between",width:1,children:[(0,i.jsx)(vu,{..._b(e.state),cursor:"text",children:t(e.state)}),r&&(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"chevron-down"})})]})}),(0,i.jsxs)(lu,{offset:2,placement:"bottom",width:240,children:[e.state!==We.WaitingAccreditation&&(0,i.jsx)(iy,{close:d,eventId:e.eventId,reload:e.reload,state:We.WaitingAccreditation,volunteerRegistrationId:e.volunteerRegistrationId}),e.state!==We.NotApplicable&&(0,i.jsx)(iy,{close:d,eventId:e.eventId,reload:e.reload,state:We.NotApplicable,volunteerRegistrationId:e.volunteerRegistrationId})]})]})}):(0,i.jsx)(Qu,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(vu,{..._b(e.state),children:t(e.state)})})},sy=e=>{const t=Ei(Cm),n=Ei(Yh),o=(0,V.useMemo)(()=>function(e,t,n){return(0,cm.A)((n||[]).flatMap(e=>(e.slots||[]).map(t=>({range:t.range,display:e.form.slotDisplay}))),({range:e})=>e.start.toMillis()).map(n=>n.display===Qe.Calendar||n.display===Qe.DisplayDays?e.toLocaleString(n.range.start,zs.DateOnly.Numeric):t.toDisplayString(n.range,{formats:{localeFormat:zs.DateOnly.Numeric}}))}(t,n,e.volunteerRegistration.userInfo.formsUsersInfos).map((e,t)=>({id:t,color:"gray",icon:null,text:e})),[e.volunteerRegistration.userInfo.formsUsersInfos]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:o,doNotSort:!0,onClick:e.onClick})})},ry=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>e.volunteerRegistration.delegationBannerNumber||0,[e.volunteerRegistration]),o=e.volunteerRegistration.delegationBannerNumber?.toString(10)||"",s=(0,V.useCallback)(t=>e.mutate(t,"banner_number"),[e.mutate]);return(0,i.jsx)(OC,{column:e.column,initialValue:n,mutate:s,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Qd,{label:t("num_ro_de_bande_16203"),shouldParseAsInt:!0,value:e,onChange:n}),renderValue:o,updatable:e.updatable})},ay=e=>{const{translate:t}=bd();return(0,i.jsxs)(Av,{children:[(0,i.jsx)(Sv,{children:(0,i.jsx)(ka,{css:{cursor:"pointer"},height:e.size,width:e.size,children:(0,i.jsx)("img",{height:"100%",src:mf(e.ticketId,{height:e.size,width:e.size}),width:"100%"})})}),(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"qrcode",children:t("code_barres_1_82428",e.nameOrEmail)}),(0,i.jsxs)(jv,{align:"center",css:{padding:"$4"},gap:"3",justify:"center",children:[(0,i.jsx)(ka,{height:100,width:100,children:(0,i.jsx)("img",{height:"100%",src:mf(e.ticketId,{height:100,width:100}),width:"100%"})}),(0,i.jsx)(ka,{children:e.ticketId})]}),(0,i.jsx)(bv,{})]})]})},ly=e=>{const t=e.volunteerRegistration.ticketId;return(0,i.jsxs)(Qu,{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}),g(e.volunteerRegistration.weezeventTicketUrl)?(0,i.jsx)(bm,{css:{fontWeight:"normal"},to:e.volunteerRegistration.weezeventTicketUrl,children:t}):t]})},dy=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>(e.volunteerRegistration.userInfo.emails??[]).map(e=>{const{color:n,leftIcon:i}=mb(e.state);return{id:e.id,color:n,icon:i,text:`${e.campaign?.name??""} - ${t(e.state)}`}}),[e.volunteerRegistration]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:n})})},cy=e=>{const t=(0,V.useMemo)(()=>(e.volunteerRegistration.positionsSlotsUsersInfos||[]).filter(e=>e.state!==lt.Waiting),[e.volunteerRegistration]),n=(0,V.useMemo)(()=>mg(t),[t]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:n,doNotSort:!0,onClick:e.onClick})})},uy=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)("");return(0,i.jsx)(Av,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"print",children:t("impression_du_d_03836",e.customDocumentName)}),(0,i.jsxs)(jv,{gap:"6",children:[(0,i.jsxs)(zd,{alertStyle:"warning",children:[(0,i.jsx)($d,{children:t("le_document_a_d_84754")}),(0,i.jsx)(Pd,{children:t("afin_de_r_dite_85227")})]}),(0,i.jsx)(qp,{label:t("raison_de_l_imp_75064"),value:n,onChange:o})]}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{disabled:p(n),onClick:()=>e.onPrint(n),children:t("imprimer_le_doc_75788")})})]})})},my=e=>{const{mutate:t}=function(e={}){return Di("mutation VolunteerRegistrationCustomDocumentPrint(\n $eventId: EventId!\n $volunteerRegistrationId: VolunteersRegistrationId!\n $customDocumentSlug: String!\n $reason: String!\n) {\n link: volunteerRegistrationCustomDocumentPrint(\n eventId: $eventId\n volunteerRegistrationId: $volunteerRegistrationId\n customDocumentSlug: $customDocumentSlug\n reason: $reason\n )\n}\n",e)}(),n=(0,V.useMemo)(()=>!!e.customDocument&&zg(e.customDocument.populationsIds??[],e.volunteerRegistration.userInfo.fields?.population),[e.customDocument,e.volunteerRegistration]),o=(0,V.useMemo)(()=>(e.volunteerRegistration.exportedCustomDocumentsSlugs??[]).includes(e.customDocument?.slug??"")&&(e.customDocument?.shouldRegenerateTicketIdOnDownload??!1),[e.customDocument,e.volunteerRegistration]),[s,r]=(0,V.useState)(!1),[a,l]=(0,V.useState)(!1),{name:d,clearName:c}=e.search,u=(0,V.useCallback)(()=>{d.startsWith("185")&&c()},[d,c]),m=(0,V.useCallback)(async(n="")=>{l(!0),r(!1);try{await async function(i,o){const s=window.open("about:blank","_blank");if(!s)throw new Error("Could not open print window, it has probably been blocked");try{const i=await(async()=>{const{link:i}=await t({eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistration.id,customDocumentSlug:e.customDocument?.slug??"",reason:n});return gf(i,"html",{lang:e.volunteerRegistration.userInfo.fields?.language})})(),r=await fetch(i,{method:"GET"});if(!r.ok)throw new Error(`Could not load document to print: ${r.status}`);const a=await r.text();s.document.write(a),s.document.close(),await Promise.all(Array.from(s.document.images).map(e=>new Promise(t=>{e.complete?t():(e.addEventListener("load",()=>t(),{once:!0}),e.addEventListener("error",()=>t(),{once:!0}))}))),await(s.document.fonts?.ready),s.addEventListener("afterprint",()=>{o?.(),s.close()},{once:!0}),s.focus(),s.print()}catch(e){throw s.close(),e}}(0,u)}catch(e){console.error(`Could not print custom document: ${e.toString()}`)}finally{l(!1),e.reload()}},[t,u,e.customDocument,e.eventId,e.volunteerRegistration,e.reload]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:n&&(0,i.jsx)(kd,{color:"white",css:{overflow:"hidden","& .h-button-content":{overflow:"hidden"}},isLoading:a,leftIcon:"print",size:"sm",onClick:()=>o?r(!0):m(),children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.column.name,width:1,children:e.column.name})})}),s&&(0,i.jsx)(uy,{customDocumentName:e.customDocument?.name??"",isOpen:s,onClose:()=>r(!1),onPrint:m})]})},hy=e=>{const{clearNameCursors:t,name:n}=SC();return(0,i.jsx)(my,{column:e.column,customDocument:e.column.customDocument,eventId:e.eventId,reload:e.reload,search:{name:n,clearName:t},volunteerRegistration:e.volunteerRegistration})},gy=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{mutate:s}=ea(),{mutate:r}=Rr(),{isEditMode:a}=SC(),{isEditMode:l}=ip(),d=a||l,c=(0,V.useMemo)(()=>e.volunteerRegistration.delegation,[e.volunteerRegistration.delegation]),u=(0,V.useMemo)(()=>c?[c.id]:[],[c]),[m,h]=(0,V.useState)(!0),[g,p]=(0,V.useState)([]),f=(0,V.useCallback)(async e=>{if(e&&m){const{event:{delegations:e}}=await ia({eventId:o},await X());p(e.nodes),h(!1)}},[m]),_=(0,V.useCallback)(async t=>{Bs(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)=>m?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ju,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(Uu,{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)(vu,{cursor:"pointer",ellipsis:!0,title:c.name,children:c.name}):null,onSave:_,onStateChange:f}):(0,i.jsx)(Qu,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:c&&(0,i.jsx)(vu,{cursor:"pointer",ellipsis:!0,title:c.name,children:(0,i.jsx)(_d,{to:qo.DELEGATION({organizationId:n,eventId:o,delegationId:c.id}),children:c.name})})})},py=e=>{const{params:{organizationId:t,eventId:n}}=bd(),o=e.volunteerRegistration.delegation?.delegationCategory;return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:o&&(0,i.jsx)(vu,{cursor:"pointer",ellipsis:!0,title:o.name,children:(0,i.jsx)(_d,{to:qo.DELEGATION_CATEGORY({organizationId:t,eventId:n,delegationCategoryId:o.id}),children:o.name})})})},fy=e=>{const{history:t,params:{organizationId:n,eventId:o}}=bd(),s=(0,V.useMemo)(()=>(e.volunteerRegistration.userInfo?.formsUsersInfos??[]).flatMap(e=>e.form?[{id:e.form.id,color:"gray",icon:null,text:e.form.name,onClick(){t.push(jo.FORM_ELEMENTS({organizationId:n,eventId:o,formId:e.form.id}))}}]:[]),[e.volunteerRegistration.userInfo]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:s})})},_y=e=>{const t=(0,V.useMemo)(()=>function(e,t){const n=(0,cm.A)((0,Xh.A)(e.filter(e=>t.includes(e.accreditationCategoryId)),e=>e.accreditation.id),e=>e.accreditation.fields.cf50732).map(e=>e.accreditation.name.substring(9));return n[0]||""}((e.volunteerRegistration.accreditationsUsersInfos||[]).map(e=>({accreditationCategoryId:e.accreditationSlot.accreditationCategory.id,accreditation:e.accreditationSlot.accreditation})),[6870,5709]),[e.volunteerRegistration.accreditationsUsersInfos]);return(0,i.jsx)(Qu,{align:"center",gap:"2",minWidth:e.column.minWidth,width:e.column.width,children:t})},xy=e=>{const t=Ti(),{mutate:n}=Qr(),{mutate:o}=ta(),s=Ei(Yh),{isEditMode:r}=SC(),{isEditMode:a}=ip(),l=r||a,d=(0,V.useMemo)(()=>e.volunteerRegistration?.positionsSlotsUsersInfos||[],[e.volunteerRegistration]),c=(0,V.useMemo)(()=>mg(d),[d]),u=(0,V.useMemo)(()=>d.map(e=>e.positionSlot.id),[d]),[m,h]=(0,V.useState)(!0),[g,p]=(0,V.useState)([]),f=(0,V.useCallback)(async t=>{if(t&&m){const{event:t}=await Hr({eventId:e.eventId},await X());p(Yg(s,t.positionsCategories)),h(!1)}},[m]),_=(0,V.useCallback)(async t=>{Bs(t)?await n({eventId:e.eventId,massAssign:{positionsSlotsIds:t,selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:yt.Replace}}):await o({eventId:e.eventId,massStateUpdate:{selecteds:{ids:[e.volunteerRegistration.userInfo.id]},state:ve.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)=>m?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ju,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("missions_63972"),multiple:!0,renderOnPortal:!0,values:e,onChange:n,children:g}),renderValue:()=>(0,i.jsx)(UC,{badges:c,doNotSort:!0}),onSave:_,onStateChange:f}):(0,i.jsx)(Qu,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:c,doNotSort:!0,onClick:e.onClick})})},Iy=e=>{const t=(0,V.useMemo)(()=>(0,Xh.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)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:t})})},vy=e=>{const t=(0,V.useMemo)(()=>(e.volunteerRegistration?.preassignPositions||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:t})})},by=e=>{const t=(0,V.useMemo)(()=>(e.volunteerRegistration?.preassignPositionsCategories||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:t})})},jy=e=>{const t=(0,V.useMemo)(()=>(e.volunteerRegistration.accreditationsUsersInfos||[]).filter(e=>e.checkInAt?.isValid),[e.volunteerRegistration]),n=(0,V.useMemo)(()=>gg(t),[t]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:n,doNotSort:!0,onClick:e.onClick})})},Cy=e=>(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:g(e.volunteerRegistration.shortTag)&&g(e.volunteerRegistration.weezeventPayUrl)?(0,i.jsx)(bm,{css:{fontWeight:"normal"},to:e.volunteerRegistration.weezeventPayUrl,children:e.volunteerRegistration.shortTag}):e.volunteerRegistration.shortTag||""}),yy=(...e)=>({name:"canCommentFn",args:e}),Ay=(...e)=>({name:"canRegistrationStateUpdateFn",args:e}),Sy=(...e)=>({name:"canUserInfoSlotsUpdateFn",args:e});async function ky(e){try{const t=await X(),n=await function(e,t){return Js("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 wy=new Map;function Ey({checks:e}){const t=e.map(e=>[e,JSON.stringify(e)]),n=t.filter(([e,t])=>!wy.has(t));if(n.length>0){const e=ky({checks:n.map(([e,t])=>e)});n.forEach(([t,n],i)=>{wy.set(n,e.then(e=>e[i]))})}return Promise.all(t.map(([e,t])=>wy.get(t)))}function Ty({withCaching:e,checks:t}){const[{isLoading:n,permissions:i},o]=(0,V.useState)({isLoading:!0,permissions:new Array(t.length).fill(!1)}),s=e?Ey:ky;return(0,V.useEffect)(()=>{s({checks:t}).then(e=>{o({isLoading:!1,permissions:e})},()=>{o({isLoading:!1,permissions:i})})},[]),{isLoading:n,permissions:i}}function Ry(...e){return Ty({withCaching:!0,checks:e})}const Oy=e=>{const t=Ti(),{mutate:n}=oa();return(0,i.jsx)(rd,{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)(vu,{cursor:"pointer",...fb(e.state),children:t(e.state)})})},Dy=e=>{const{permissions:[t,n],isLoading:o}=function(...e){return Ty({withCaching:!1,checks:e})}(Ay(e.eventId,ve.PreAssigned,e.volunteerRegistrationId),Ay(e.eventId,ve.Assigned,e.volunteerRegistrationId));return o?null:(0,i.jsxs)(i.Fragment,{children:[n&&e.state!==ve.WaitingAssignment&&(0,i.jsx)(Oy,{close:e.close,eventId:e.eventId,reload:e.reload,state:ve.WaitingAssignment,volunteerRegistrationId:e.volunteerRegistrationId}),t&&(0,i.jsx)(Oy,{close:e.close,eventId:e.eventId,reload:e.reload,state:ve.PreAssigned,volunteerRegistrationId:e.volunteerRegistrationId}),n&&e.state!==ve.Refused&&(0,i.jsx)(Oy,{close:e.close,eventId:e.eventId,reload:e.reload,state:ve.Refused,volunteerRegistrationId:e.volunteerRegistrationId}),n&&e.state!==ve.NotApplicable&&(0,i.jsx)(Oy,{close:e.close,eventId:e.eventId,reload:e.reload,state:ve.NotApplicable,volunteerRegistrationId:e.volunteerRegistrationId})]})},zy=e=>{const t=Ti(),{isEditMode:n}=SC(),{isEditMode:o}=ip(),s=n||o,[r,a]=(0,V.useState)(!1),l=(0,V.useCallback)(e=>{s&&a(e)},[s,a]),d=(0,V.useCallback)(()=>{l(!1)},[l]);return s&&e.updatable?(0,i.jsx)(Qu,{css:{border:"2px solid transparent","&:hover":{border:"2px solid $primary500"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Gd,children:(0,i.jsxs)(nu,{isOpen:r,onStateChange:l,children:[(0,i.jsx)(du,{children:(0,i.jsxs)(rd,{align:"center",gap:"3",height:1,justify:"between",width:1,children:[(0,i.jsx)(vu,{...fb(e.state),cursor:"text",ellipsis:!0,children:t(e.state)}),r&&(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"chevron-down"})})]})}),(0,i.jsx)(lu,{offset:2,placement:"bottom",width:230,children:(0,i.jsx)(Dy,{close:d,...e})})]})}):(0,i.jsx)(Qu,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(vu,{...fb(e.state),children:t(e.state)})})},$y=e=>{const t=(0,V.useMemo)(()=>e.volunteerRegistration.userInfo.tags||[],[e.volunteerRegistration]),n=(0,V.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:n})})},Py=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,segmentId:r}}=bd(),{isEditMode:a}=SC(),{isEditMode:l}=ip(),d=a||l,{mutate:c}=oa(),u=(0,V.useMemo)(()=>e.volunteerRegistration.teams||[],[e.volunteerRegistration]),m=(0,V.useMemo)(()=>u.map(({teamCode:n})=>({id:n,color:"gray",icon:null,text:n,onClick:d?void 0:()=>{t.push(fs.VOLUNTEERS_LIST_USER_PANEL_TEAM(o,s,r,e.volunteerRegistration.userInfo.id,n))}})),[u,d]);return 1===u.length&&d?(0,i.jsx)(RC,{column:e.column,css:{gap:"$2"},initialValue:u[0].teamCode,renderInput:(e,t)=>(0,i.jsx)(Qd,{label:n("code_quipe_14296"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(UC,{badges:m}),onSave:async t=>{await c({eventId:s,volunteerRegistrationId:e.volunteerRegistration.id,slug:"team_code",value:t}),e.reload()}}):(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:m})})},My=e=>{const{params:{organizationId:t,eventId:n}}=bd(),o=(0,V.useMemo)(()=>(0,cm.A)(e.teamMembers,e=>m(e.name)),[e.teamMembers]);return(0,i.jsx)(rd,{children:o.map((e,o)=>(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{css:{cursor:"pointer",position:"relative",left:-4*o+"px"},children:(0,i.jsx)(_d,{to:bx.MEMBER_INFORMATION({organizationId:t,eventId:n,userInfoId:e.id}),children:(0,i.jsx)(Gf,{email:e.email,image:e.picture?.url,name:e.name,size:24})})})}),(0,i.jsx)(bp,{placement:"top",children:e.name})]},e.id))})},Fy=e=>{const t=(0,V.useMemo)(()=>(e.volunteerRegistration.userInfo.formsUsersInfos||[]).flatMap(e=>e.teamMembers||[]),[e.volunteerRegistration]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(My,{teamMembers:t})})},Ny=e=>{const t=(0,V.useMemo)(()=>(e.volunteerRegistration.weezaccessChecklists||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:t})})},Ly=e=>{const t=(0,V.useMemo)(()=>QC((e.volunteerRegistration.userInfo.formsUsersInfos??[]).flatMap(e=>e.accreditationProfile?[e.accreditationProfile]:[])),[e.volunteerRegistration]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:t,doNotSort:!0})})},By=e=>{const t=(0,V.useMemo)(()=>pg(e.volunteerRegistration?.accreditationsSlots||[]),[e.volunteerRegistration]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:t,doNotSort:!0,onClick:e.onClick})})},Vy=e=>{const t=Ei(Yh),n=(0,V.useMemo)(()=>function(e,t,n,i){return(0,Xh.A)(t,e=>e.id).map(e=>({id:`c-${e.id}`,color:"gray",icon:null,text:e.name})).concat((0,Xh.A)(n,e=>e.id).map(e=>({id:`p-${e.id}`,color:e.color,icon:e.icon,text:g(e.acronym)?e.acronym:e.name}))).concat((0,Xh.A)(i,e=>e.id).map(t=>{const n=g(t.position.acronym)?t.position.acronym:t.position.name,i=ng(e,t,n,{interval:{options:{formats:{localeFormat:zs.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)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:n,onClick:e.onClick})})},Uy=e=>{const{history:t,params:{organizationId:n,eventId:o}}=bd(),s=Ei(Cm),r=Ei(CC),a=(0,V.useMemo)(()=>function(e,t){return t.flatMap(t=>t.form?[`${t.form.name} : ${e.toLocaleString(t.insertedAt.toLocal(),zs.DateTime)}`]:[]).join(", ")}(s,e.row.userInfo.formsUsersInfos||[]),[e.row]),{mutate:l}=oa(),d=(0,V.useCallback)((t,n)=>l({eventId:e.eventId,volunteerRegistrationId:e.row.id,slug:n,value:t}),[e.eventId,e.row,l]),c=e.row.userInfo;switch(e.column.slug){case Pg.AccreditationProfile:return(0,i.jsx)(ey,{column:e.column,eventId:e.eventId,reload:e.reloadRow,updatable:e.canMemberAccredit,volunteerRegistration:e.row});case Pg.Accreditations:return(0,i.jsx)(ty,{column:e.column,eventId:e.eventId,reload:e.reloadRow,updatable:e.canMemberAccredit,volunteerRegistration:e.row,onClick:g(e.accreditationsPanelPath)?()=>{t.push(`${e.accreditationsPanelPath}/assigned`)}:void 0});case Pg.AccreditationsCategories:return(0,i.jsx)(ny,{column:e.column,volunteerRegistration:e.row});case Pg.AccreditationState:return(0,i.jsx)(oy,{column:e.column,eventId:e.eventId,field:e.column,reload:e.reloadRow,state:e.row.accreditationState,updatable:e.canMemberAccredit,volunteerRegistrationId:e.row.id});case Pg.ScannedAccreditations:return(0,i.jsx)(jy,{column:e.column,volunteerRegistration:e.row,onClick:g(e.accreditationsPanelPath)?()=>{t.push(`${e.accreditationsPanelPath}/scanned`)}:void 0});case"bracelet_a_delivrer":return(0,i.jsx)(_y,{column:e.column,volunteerRegistration:e.row});case Pg.Availability:return(0,i.jsx)(sy,{column:e.column,volunteerRegistration:e.row,onClick:g(e.availabilitiesPanelPath)?()=>{t.push(e.availabilitiesPanelPath)}:void 0});case Pg.Comments:return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:Bs(c.comments)?c.comments.map(e=>e.content).join("; "):""});case Pg.CampaignsStates:return(0,i.jsx)(dy,{column:e.column,volunteerRegistration:e.row});case Pg.CheckedInPositions:return(0,i.jsx)(cy,{column:e.column,volunteerRegistration:e.row,onClick:g(e.positionsPanelPath)?()=>{t.push(`${e.positionsPanelPath}/assigned`)}:void 0});case Pg.CompletedForms:return(0,i.jsx)(fy,{column:e.column,volunteerRegistration:e.row});case Pg.FormsInsertedAt:return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:a,children:a})});case Pg.Delegations:return(0,i.jsx)(gy,{column:e.column,reload:e.reloadRow,updatable:e.canChangeDelegation,volunteerRegistration:e.row});case Pg.DelegationBannerNumber:return(0,i.jsx)(ry,{column:e.column,mutate:d,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0,volunteerRegistration:e.row});case Pg.DuplicatedFrom:return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.duplicatedFrom?(0,i.jsx)(ub,{size:32,userInfo:e.row.duplicatedFrom.userInfo}):null});case Pg.DelegationCategory:return(0,i.jsx)(py,{column:e.column,volunteerRegistration:e.row});case Pg.Email:return(0,i.jsx)(YC,{clickPath:e.informationPanelPath??bx.MEMBER_INFORMATION({organizationId:n,eventId:o,userInfoId:e.row.userInfo.id}),column:e.column,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0,userInfo:c});case Pg.Id:return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:c.id});case Pg.LocalId:return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.localId});case Pg.InsertedAt:return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:s.toLocaleString(e.row.insertedAt.toLocal(),zs.DateTime)});case Pg.Name:return(0,i.jsx)(ZC,{clickPath:e.informationPanelPath,column:e.column,mutate:d,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0,userInfo:e.row.userInfo});case Pg.NumberOfAccreditations:return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAccreditations});case Pg.NumberOfAssignments:return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAssignments});case Pg.NumberOfAssignmentsDays:return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAssignmentsDays});case Pg.NumberOfAvailableDays:return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAvailableDays});case Pg.Positions:return(0,i.jsx)(xy,{column:e.column,eventId:e.eventId,reload:e.reloadRow,updatable:e.canMemberAssign,volunteerRegistration:e.row,onClick:g(e.positionsPanelPath)?()=>{t.push(`${e.positionsPanelPath}/assigned`)}:void 0});case Pg.PositionsCategories:return(0,i.jsx)(Iy,{column:e.column,volunteerRegistration:e.row});case Pg.PreassignedPositions:return(0,i.jsx)(vy,{column:e.column,volunteerRegistration:e.row});case Pg.PreassignedPositionsCategories:return(0,i.jsx)(by,{column:e.column,volunteerRegistration:e.row});case Pg.Roles:return(0,i.jsx)(JC,{minWidth:e.column.minWidth,userPermissions:e.row.userInfo,width:e.column.width});case Pg.Tags:return(0,i.jsx)($y,{column:e.column,volunteerRegistration:e.row});case Pg.TeamCode:return(0,i.jsx)(Py,{column:e.column,reload:e.reloadRow,volunteerRegistration:e.row});case Pg.TeamMembers:return(0,i.jsx)(Fy,{column:e.column,volunteerRegistration:e.row});case Pg.VolunteerMinutes:return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:r.minutesToHoursMinutesString(e.row.volunteerMinutes)});case Pg.VolunteerRegistrationState:return(0,i.jsx)(zy,{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 Pg.WishedAccreditationProfile:return(0,i.jsx)(Ly,{column:e.column,volunteerRegistration:e.row});case Pg.WishedAccreditationSlots:return(0,i.jsx)(By,{column:e.column,volunteerRegistration:e.row,onClick:g(e.accreditationsPanelPath)?()=>{t.push(`${e.accreditationsPanelPath}/wished`)}:void 0});case Pg.WishedPositions:return(0,i.jsx)(Vy,{column:e.column,volunteerRegistration:e.row,onClick:g(e.positionsPanelPath)?()=>{t.push(`${e.positionsPanelPath}/wished`)}:void 0});case Pg.WeezaccessChecklists:return(0,i.jsx)(Ny,{column:e.column,volunteerRegistration:e.row});case Pg.WeezeventBarcodeId:return(0,i.jsx)(ly,{column:e.column,volunteerRegistration:e.row});case Pg.WeezeventBarcodeVersion:return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.ticketIdVersion});case Pg.WeezeventPairedAt:return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.pairedAt?.isValid?s.toLocaleString(e.row.pairedAt.toLocal(),zs.DateTime):""});case Pg.WeezeventShortTag:return(0,i.jsx)(Cy,{column:e.column,volunteerRegistration:e.row});default:return Object.values(Pg).includes(e.column.slug)?(console.error(`003: Unhandled default column ${e.column.slug}`),(0,i.jsx)(Qu,{children:"ERR"})):e.column.slug.startsWith("form_inserted_at")?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:yC(s,e.column.slug,e.row.userInfo.formsUsersInfos||[])}):Dg(e.column.slug)?(0,i.jsx)(hy,{column:e.column,eventId:e.eventId,reload:e.reloadRow,volunteerRegistration:e.row}):(0,i.jsx)(KC,{avatarUser:e.row.userInfo,clickPath:e.informationPanelPath??bx.MEMBER_INFORMATION({organizationId:n,eventId:o,userInfoId:e.row.userInfo.id}),column:e.column,customField:e.customField,fields:e.row.userInfo.fields,mutate:d,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0})}},Wy=({title:e,subtitle:t})=>(0,i.jsx)(am,{css:{height:"fit-content"},children:(0,i.jsx)(Qu,{children:(0,i.jsxs)(rd,{align:"center",css:{padding:"$8 0"},direction:"column",justify:"center",width:1,children:[(0,i.jsx)(wj,{color:"primary",icon:"magnifying-glass"}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:e}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t})]})})}),Gy=(0,V.createContext)({}),qy=e=>{const{mutate:t}=hr(),{mutate:n}=da(),[o,s]=(0,V.useState)(e.volunteerRegistration.accreditationsUsersInfos.map(e=>e.accreditationSlot)),r=(0,V.useMemo)(()=>o.map(({id:e})=>e),[o]),[a,l]=(0,V.useState)(e.volunteerRegistration.accreditationsUsersInfos.flatMap(e=>e.checkInAt?.isValid?[e.accreditationSlot]:[])),[d,c]=(0,V.useState)(e.volunteerRegistration.accreditationsSlots),u=(0,V.useMemo)(()=>(0,cm.A)((0,Xh.A)(o.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[o]),m=(0,V.useMemo)(()=>(0,cm.A)((0,Xh.A)(a.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[a]),h=(0,V.useMemo)(()=>(0,cm.A)((0,Xh.A)(d.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[d]),g=(0,V.useMemo)(()=>(0,Xh.A)(o.map(e=>e.accreditation),e=>e.id),[o]),p=(0,V.useMemo)(()=>(0,Xh.A)(a.map(e=>e.accreditation),e=>e.id),[a]),f=(0,V.useMemo)(()=>(0,Xh.A)(d.map(e=>e.accreditation),e=>e.id),[d]),_=(0,V.useCallback)(async n=>{await t({eventId:e.eventId,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e.userInfoId]},strategy:yt.Delete}}),s(e=>e.filter(e=>e.id!==n)),l(e=>e.filter(e=>e.id!==n))},[e.eventId,e.userInfoId,s,l]),x=(0,V.useCallback)(async t=>{await n({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegationId,massAccredit:{accreditationsSlotsIds:[t],selecteds:{ids:[e.userInfoId]},strategy:yt.Delete}}),c(e=>e.filter(e=>e.id!==t))},[e.eventId,e.delegationId,e.userInfoId]),I=(0,V.useCallback)(async n=>{await t({eventId:e.eventId,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e.userInfoId]},strategy:yt.Add}});const i=d.find(e=>e.id===n);s(e=>[...e,i])},[e.eventId,e.volunteerRegistration,d,s]),v=(0,V.useCallback)(t=>e.volunteerRegistration.accreditationsUsersInfos.find(e=>e.accreditationSlot.id===t).checkInAt,[e.volunteerRegistration]);return(0,i.jsx)(Gy.Provider,{value:{assignSlot:I,assignedAccreditations:g,assignedCategories:u,assignedSlots:o,assignedSlotsIds:r,canDeleteCheckedIn:e.canDeleteCheckedIn,canMemberAccredit:e.canMemberAccredit,canWishedAccreditationsEdit:e.canWishedAccreditationsEdit,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,deleteAssignedSlot:_,deleteWishedSlot:x,scannedAccreditations:p,scannedCategories:m,scannedSlots:a,wishedAccreditations:f,wishedCategories:h,wishedSlots:d,getScannedAt:v},children:e.children})};function Hy(){return(0,V.useContext)(Gy)}const Ky=e=>{const{translate:t}=bd(),n=Ei(Cm),{assignSlot:o,assignedSlotsIds:s,canMemberAccredit:r,canWishedAccreditationsEdit:a,defaultHiddenAccreditationsSlotsIds:l,deleteAssignedSlot:d,deleteWishedSlot:c,getScannedAt:u}=Hy(),[m,h]=(0,V.useState)(!1);return"assigned"===e.state&&!e.isBlocked&&r?(0,i.jsx)(rd,{css:{flex:"1",px:"$4"},justify:"end",children:m?(0,i.jsx)(ju,{borderRadius:"$1",height:20,children:t("retirer_05155")}):(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"error700 textSm medium",onClick:async()=>{h(!0),await d(e.accreditationSlotId)},children:t("retirer_05155")})}):"wished"===e.state&&r?(0,i.jsx)(rd,{css:{flex:"1",px:"$4"},justify:"end",children:s.includes(e.accreditationSlotId)?(0,i.jsxs)(rd,{align:"center",gap:"1",children:[(0,i.jsx)(ka,{color:"success500",children:(0,i.jsx)(Id,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(ka,{font:"gray800 textXs medium",children:t("d_j_attribu_e_06450")})]}):e.isBlocked?null:(0,i.jsx)(kd,{isLoading:m,size:"sm",onClick:async()=>{h(!0),await o(e.accreditationSlotId),h(!1)},children:t("ajouter_97327")})}):"wished"!==e.state||!a||e.isBlocked||l.includes(e.accreditationSlotId)?"scanned"===e.state?(0,i.jsx)(rd,{css:{flex:"1",px:"$4"},children:(0,i.jsx)(ka,{css:{ellipsis:!0},children:n.toLocaleString(u(e.accreditationSlotId),zs.DateTime)})}):(0,i.jsx)(rd,{css:{flex:"1",px:"$4"}}):(0,i.jsx)(rd,{css:{flex:"1",px:"$4"},justify:"end",children:m?(0,i.jsx)(ju,{borderRadius:"$1",height:20,children:t("retirer_05155")}):(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"error700 textSm medium",onClick:async()=>{h(!0),await c(e.accreditationSlotId)},children:t("retirer_05155")})})},Yy=e=>{const t=Ei(Cm),{canDeleteCheckedIn:n,canMemberAccredit:o,canWishedAccreditationsEdit:s,scannedSlots:r}=Hy(),a="assigned"===e.state&&o||"scanned"===e.state||"wished"===e.state&&(o||s),l=g(e.slot.name)?e.slot.name:"-",d=(0,V.useMemo)(()=>e.slot.isBlocked?e.slot.isBlocked:!n&&r.some(t=>t.id===e.slot.id),[n,e.slot,r]);return(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{css:{textTransform:"capitalize"},children:e.slot.date?t.toLocaleString(e.slot.date,zs.DateOnly.WeekdayShortMonthShort):"-"}),(0,i.jsx)(Qu,{children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:l,width:1,children:l})}),a&&(0,i.jsx)(Ky,{accreditationSlotId:e.slot.id,isBlocked:d,state:e.state})]})},Zy=e=>{const{translate:t}=bd(),{assignedSlots:n,canDeleteCheckedIn:o,canMemberAccredit:s,canWishedAccreditationsEdit:r,scannedSlots:a,wishedSlots:l}=Hy(),d=(0,V.useMemo)(()=>(0,cm.A)(("assigned"===e.state?n:"scanned"===e.state?a:l).filter(t=>t.accreditationId===e.accreditation.id),e=>[e.date?.toMillis()??1,e.name?.toLowerCase()||""]),[n,a,l,e.accreditation,e.state]),c=(0,V.useMemo)(()=>!o&&a.some(t=>t.id===e.accreditation.hiddenSlotId),[o,e.accreditation,a]),u="assigned"===e.state&&s||"scanned"===e.state||"wished"===e.state&&(s||r);return(0,i.jsx)(Vj,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:e.accreditation.hasSlots,numberOfSlots:d.length,renderActions:!e.accreditation.hasSlots&&u?()=>(0,i.jsx)(Ky,{accreditationSlotId:e.accreditation.hiddenSlotId,isBlocked:c,state:e.state}):void 0,children:(0,i.jsxs)(Hu,{hideBorder:!0,children:[(0,i.jsxs)(Wu,{children:[(0,i.jsx)(pm,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(pm,{children:t("nom_du_cr_neau_54351")}),u&&(0,i.jsx)(pm,{children:"scanned"===e.state&&t("scann_e_le_27812")})]}),d.map(t=>(0,i.jsx)(Yy,{slot:t,state:e.state},t.id))]})})},Xy=e=>{const{assignedAccreditations:t,scannedAccreditations:n,wishedAccreditations:o}=Hy(),s=(0,V.useMemo)(()=>_g(("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)(Bj,{category:e.category.name,children:s.map(t=>(0,i.jsx)(Zy,{accreditation:t,state:e.state},t.id))})},Jy=e=>{const t=Ti(),{assignedCategories:n,scannedCategories:o,wishedCategories:s}=Hy(),r="assigned"===e.state?n:"scanned"===e.state?o:s;return(0,i.jsx)(Lj,{children:Bs(r)?r.map(t=>(0,i.jsx)(Xy,{category:t,state:e.state},t.id)):(0,i.jsx)(Wy,{title:t("no_accreditations")})})},Qy=e=>{const{translate:t}=bd();return(0,i.jsx)(qy,{canDeleteCheckedIn:e.canDeleteCheckedIn,canMemberAccredit:e.canMemberAccredit,canWishedAccreditationsEdit:e.canWishedAccreditationsEdit,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,delegationId:e.delegationId,eventId:e.eventId,organizationId:e.organizationId,userInfoId:e.volunteerRegistration.userInfo.id,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsxs)(Jm,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(yb,{children:t("accr_ditations_04710",e.volunteerRegistration.userInfo.name)}),(0,i.jsx)(Qm,{css:{padding:"0"},children:(0,i.jsxs)(rb,{height:1,children:[(0,i.jsxs)(ob,{center:!0,children:[(0,i.jsx)(ib,{path:`${e.basePath}/assigned`,children:t("attribu_es_48167")}),(0,i.jsx)(ib,{path:`${e.basePath}/wished`,children:t("souhait_es_78101")}),(0,i.jsx)(ib,{path:`${e.basePath}/scanned`,children:t("scann_es_13169")})]}),(0,i.jsx)(sb,{path:`${e.basePath}/assigned`,children:(0,i.jsx)(Jy,{state:"assigned"})}),(0,i.jsx)(sb,{path:`${e.basePath}/wished`,children:(0,i.jsx)(Jy,{state:"wished"})}),(0,i.jsx)(sb,{path:`${e.basePath}/scanned`,children:(0,i.jsx)(Jy,{state:"scanned"})})]})})]})})};function eA(e,t){return{name:t("commentaire_r_12290"),slug:`form${e}`,fieldType:Oe.Textarea,listType:ht.Default,values:[]}}const tA=xa(ka,{overflow:"hidden",textOverflow:"ellipsis",color:"$gray500",fontSize:"$textSm",fontWeight:"$regular","@tablet":{fontSize:"$textSm"}}),nA=e=>{const t=Ei(Xb);switch(e.field.fieldType){case Oe.File:{const n=t.getValue(e.field,e.fields);return n?(0,i.jsx)(iI,{acl:"public-read",document:n}):(0,i.jsx)(tA,{children:"-"})}case Oe.Phone:{const n=t.getValueString(e.field,e.fields);return(0,i.jsx)(tA,{children:g(n)?(0,i.jsx)(bm,{css:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},hideIcon:!0,to:`tel:${n}`,children:n}):"-"})}case Oe.Select:{const n=t.getSelectCustomFieldValues(e.field,e.fields);return(0,i.jsx)(rd,{align:"center",gap:"3",wrap:"wrap",children:n.map(({value:t,color:n},o)=>e.field.listType===ht.Dot?(0,i.jsx)(FC,{color:n||"",children:t},o):(0,i.jsx)(vu,{color:e.field.listType===ht.Badge?n||"":"gray",children:t},o))})}default:{const n=t.getValueString(e.field,e.fields);return(0,i.jsx)(tA,{children:g(n)?URL.canParse(n)?(0,i.jsx)(bm,{css:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},hideIcon:!0,to:n,children:n}):n:"-"})}}},iA=e=>(0,i.jsx)(ka,{color:"gray800",css:{overflow:"hidden",textOverflow:"ellipsis",...e.css},fontSize:"textSm",fontWeight:"medium",children:e.children}),oA=e=>(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(iA,{children:e.field.name}),(0,i.jsx)(nA,{field:e.field,fields:e.fields})]}),sA=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>e.form.elements.flatMap(e=>e.elementType===st.Field?[e.customField]:e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]),[e.form]),o=(0,V.useMemo)(()=>e.form.elements.filter(t=>t.elementType===st.Field?Qb(t.customField,e.userInfo.fields,n):t.elementType===st.Section&&Qb(t,e.userInfo.fields,n)),[n,e.form.elements,e.userInfo.fields]),s="all"!==e.form.id?eA(e.form.id,t):null;return(0,i.jsxs)(rd,{css:e.css,direction:"column",children:[o.map((t,n)=>{switch(t.elementType){case st.Field:return(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(oA,{field:t.customField,fields:e.userInfo.fields}),n!==o.length-1&&(0,i.jsx)(md,{height:"6"})]},t.id);case st.Section:return(0,i.jsxs)(V.Fragment,{children:[0!==n&&(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"semiBold",children:t.section}),n!==o.length-1&&(0,i.jsx)(md,{height:"4"})]},t.id);case st.Text:return null;default:return vd(t.elementType)}}),s&&g(e.userInfo.fields[s.slug])&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"semiBold",children:t("inscription_en_49989")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(oA,{field:s,fields:e.userInfo.fields})]})]})},rA=e=>{const{data:t,loader:n}=Oi("query DelegationMemberRightPanel(\n $organizationId: OrganizationId!\n $userInfoId: UsersInfoId!\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n id\n name\n email\n fields\n picture {\n url\n }\n\n formUserInfo(formId: $formId) {\n insertedAt\n form {\n ...FormMemberRegistration\n }\n }\n }\n }\n}\n",{organizationId:e.organizationId,userInfoId:e.userInfoId,formId:e.delegation.form.id},[js.FormMemberRegistrationFragment]);return(0,i.jsx)(Jm,{returnToFallback:e.returnPathFallback,size:"md",children:n||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yb,{children:(0,i.jsx)(ub,{areContactLinksEnabled:!0,isClickDisabled:!0,size:48,userInfo:t.organization.userInfo})}),(0,i.jsx)(Qm,{css:{background:"$gray50",py:"$6"},children:(0,i.jsx)($p,{children:(0,i.jsx)(sA,{form:t.organization.userInfo.formUserInfo.form,userInfo:t.organization.userInfo})})})]})})},aA=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{state:e.isChecked?"checked":"unchecked",onClick:e.onClick,children:e.text}),e.isChecked&&e.children&&(0,i.jsx)(rd,{css:{paddingBottom:"$3",paddingLeft:"$6"},gap:"4",children:e.children})]}),lA=e=>{const{translate:t}=bd(),{mutate:n}=Dr(),[o,s]=(0,V.useState)(At.CheckInOut),[r,a]=(0,V.useState)(e.positionSlotUserInfo.checkInAt?.toLocal()),[l,d]=(0,V.useState)(e.positionSlotUserInfo.checkOutAt?.toLocal()),[c,u]=(0,V.useState)(e.positionSlotUserInfo.breakTime),[m,h]=(0,V.useState)(!1),g=(0,V.useMemo)(()=>Ps(),[]),p=o===At.Reset||r?.isValid&&l?.isValid&&l>r||r?.isValid&&!l?.isValid;return(0,i.jsx)(Av,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"sliders",children:t("mise_jour_du_76261")}),(0,i.jsxs)(jv,{gap:"2",children:[(0,i.jsx)(ka,{font:"gray700 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsxs)(aA,{isChecked:o===At.CheckInOut,text:t("mettre_jour_l_00128"),onClick:()=>{s(At.CheckInOut)},children:[(0,i.jsx)(Ch,{hint:t("date_et_heure_d_93417"),rightIcon:"xmark",value:r,zone:g,onChange:a,onRightIconClick:()=>a(null)}),(0,i.jsx)(Ch,{hint:t("date_et_heure_d_65738"),rightIcon:"xmark",value:l,zone:g,onChange:d,onRightIconClick:()=>d(null)}),(0,i.jsx)(Qd,{hint:t("temps_de_pause_00051"),shouldParseAsInt:!0,value:c,onChange:u})]}),(0,i.jsx)(aA,{isChecked:o===At.Reset,text:t("remettre_z_ro_11572"),onClick:()=>{s(At.Reset)}})]}),(0,i.jsx)(bv,{children:s=>(0,i.jsx)(kd,{disabled:!p,isLoading:m,onClick:async()=>{h(!0),await n({eventId:e.positionSlotUserInfo.eventId,checkIn:{breakTime:c,checkInAt:r?.toUTC(),checkOutAt:l?.toUTC(),strategy:o,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),s()},children:t("mettre_jour_85141")})})]})})},dA=e=>{const{translate:t}=bd(),{mutate:n}=Dr(),{mutate:o}=Qr(),[s,r]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{triggerElem:e.triggerElem,children:[e.canCheckIn&&(0,i.jsx)(ru,{icon:"circle-check",onClick:()=>r(!0),children:t("mettre_jour_l_00128")}),e.canCheckIn&&e.psui.state!==lt.Waiting&&(0,i.jsx)(ru,{icon:"arrows-rotate",onClick:async()=>{await n({eventId:e.psui.eventId,checkIn:{strategy:At.Reset,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reloadCheckIn(e.psui.id)},children:t("remettre_z_ro_11572")}),e.canDelete&&(0,i.jsx)(ru,{color:"red",icon:"user-xmark",onClick:async()=>{await o({eventId:e.psui.eventId,massAssign:{positionsSlotsIds:[e.psui.positionSlotId],selecteds:{ids:[e.psui.userInfoId]},strategy:yt.Delete}}),e.onDelete(e.psui.id)},children:t("d_saffecter_du_47122")})]}),(0,i.jsx)(lA,{isOpen:s,positionSlotUserInfo:e.psui,onClose:()=>{e.reloadCheckIn(e.psui.id),r(!1)}})]})},cA=e=>{const{translate:t}=bd(),n=Ei(Cm),o=Ei(CC),s=Ei(Yh),{mutate:r}=Dr(),a=om(),l=(0,V.useMemo)(()=>{const t=e.positionSlotUserInfo.positionSlot;return g(t.name)?`${t.name} - ${s.toDisplayString(t.range)}`:s.toDisplayString(t.range)},[e.positionSlotUserInfo.positionSlot]),d=()=>(0,i.jsxs)(rd,{align:"center",css:{padding:"$3","@tablet":{padding:"$3 $4"}},gap:"3",width:1,wrap:"wrap",children:[(0,i.jsx)(Xv,{color:e.positionSlotUserInfo.position.color,icon:e.positionSlotUserInfo.position.icon}),(0,i.jsxs)(rd,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{color:"gray800",css:{fontWeight:"$medium",overflow:"hidden",textOverflow:"ellipsis","@tablet":{fontWeight:"$semiBold"}},children:e.positionSlotUserInfo.position.name}),(0,i.jsx)(ka,{color:"gray500",fontSize:"textSm",children:l})]})]});return(0,i.jsxs)(rd,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs","@tablet":{borderRadius:"$2"}},direction:"column",width:1,children:[e.canCheckIn?(0,i.jsx)(_d,{to:Jo.POSITION({organizationId:e.positionSlotUserInfo.organizationId,eventId:e.positionSlotUserInfo.eventId,positionId:e.positionSlotUserInfo.position.id}),children:d()}):d(),(e.canCheckIn||e.canDelete)&&(0,i.jsxs)(rd,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$3","@tablet":{padding:"$3 $4"}},justify:"between",width:1,children:[e.positionSlotUserInfo.state===lt.CheckedOut?(0,i.jsx)(vu,{leftIcon:"clock",children:t("temps_total_79448",o.minutesToHoursMinutesString(e.positionSlotUserInfo.timeDifferenceMinutes))}):e.positionSlotUserInfo.state===lt.CheckedIn?(0,i.jsx)(vu,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:t("point_le_1_63576",n.toLocaleString(e.positionSlotUserInfo.checkInAt.toLocal(),a?zs.ShortDateTime:zs.DateTime))}):(0,i.jsx)(vu,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:t("non_point_42145")}),(0,i.jsxs)(rd,{gap:"3",children:[e.canCheckIn&&e.positionSlotUserInfo.state===lt.Waiting&&(0,i.jsx)(kd,{size:"sm",onClick:async()=>{await r({eventId:e.positionSlotUserInfo.eventId,checkIn:{strategy:At.CheckIn,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),e.reloadCheckIn(e.positionSlotUserInfo.id)},children:t("pointer_80927")}),e.canCheckIn&&e.positionSlotUserInfo.state===lt.CheckedIn&&(0,i.jsx)(kd,{color:"white",size:"sm",onClick:async()=>{await r({eventId:e.positionSlotUserInfo.eventId,checkIn:{strategy:At.CheckOut,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),e.reloadCheckIn(e.positionSlotUserInfo.id)},children:t("d_pointer_25328")}),(0,i.jsx)(dA,{canCheckIn:e.canCheckIn,canDelete:e.canDelete,psui:e.positionSlotUserInfo,reloadCheckIn:e.reloadCheckIn,triggerElem:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",rightIcon:"ellipsis-vertical",size:"sm"})}),onDelete:e.onDelete})]})]})]})},uA=(0,V.createContext)({}),mA=e=>{const{data:t}=zr({organizationId:e.organizationId,eventId:e.eventId,userInfoId:e.volunteerRegistration.userInfo.id}),[n,o]=(0,V.useState)(e.volunteerRegistration.positionsSlotsUsersInfos),s=(0,V.useMemo)(()=>(0,cm.A)((0,Xh.A)(n.map(e=>e.positionCategory),e=>e.id),e=>e.name.toLowerCase()),[n]),r=(0,V.useCallback)(e=>{o(t=>t.filter(t=>t.id!==e))},[o]),a=(0,V.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 X(),Js("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:[js.UserPositionSlotUserInfoFragment]}));var r,a;o(e=>e.map(e=>e.id===t?s:e))},[e.eventId,e.volunteerRegistration,n,o]);return(0,i.jsx)(uA.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 hA(){return(0,V.useContext)(uA)}const gA=()=>{const{assignedCategories:e,assignedPsuis:t,canCheckIn:n,canDelete:o,onAssignedPsuiDelete:s,reloadCheckIn:r}=hA(),a=(0,V.useMemo)(()=>(0,Vu.A)(t,e=>e.positionCategory.id),[t]);return(0,i.jsx)(Lj,{children:e.map(e=>{const t=a[e.id];return(0,i.jsx)(Bj,{category:e.name,children:t.map(e=>(0,i.jsx)(cA,{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)})})},pA=e=>(0,i.jsxs)(rd,{align:"center",css:e.css,direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(ka,{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??Ec.WeezeventBlankPerson,width:"100%"})}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(ka,{css:{color:"$gray800",fontSize:"$textMd",fontWeight:"$semiBold","@tablet":{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}},textAlign:"center",children:e.title}),g(e.subtitle)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ka,{color:"gray500",fontSize:"textSm",textAlign:"center",children:e.subtitle})]}),e.button&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(rd,{justify:"center",children:e.button})]})]}),fA=({message:e,title:t})=>(0,i.jsxs)(zd,{alertStyle:"warning",children:[(0,i.jsx)($d,{children:t}),(0,i.jsx)(Pd,{children:e})]});function _A(e,t,n,i){return(0,cm.A)(e.map(e=>{const o=e.positions.map((o,s)=>({name:o.name,category:o.category.name,range:o.range?t.toDisplayString(o.range):"-",path:Jo.POSITION({organizationId:n,eventId:i,positionId:o.id}),form:e.form,rank:s+1})),s=e.positionsCategories.map((o,s)=>({name:o.name,category:"",range:o.range?t.toDisplayString(o.range):"-",path:Jo.POSITION_CATEGORY({organizationId:n,eventId:i,positionCategoryId:o.id}),form:e.form,rank:s+1})),r=e.positionsSlots.map((t,o)=>({name:t.position.name,category:t.positionCategory.name,range:t.nameOrRange,path:Jo.POSITION({organizationId:n,eventId:i,positionId:t.position.id}),form:e.form,rank:o+1}));return o.concat(s).concat(r)}).flat(),[e=>e.form.name,(e,t)=>t])}const xA=({editDisabled:e,eventId:t,form:n,organizationId:o})=>{const s=$i();return(0,i.jsx)(vu,{color:"primary",cursor:e?"default":"pointer",onContentClick:()=>{e||s.push(jo.FORM_ELEMENTS({organizationId:o,eventId:t??void 0,formId:n.id}))},children:n.name})},IA=({canMemberAssign:e,editPath:t,formsUsersInfos:n,isEditDisabled:o=!1})=>{const{history:s,params:{organizationId:r,eventId:a},translate:l}=bd(),d=Ei(Yh),c=(0,V.useMemo)(()=>_A(n,d,r,a),[n]),u=om();return(0,i.jsxs)(rd,{direction:"column",gap:"6",width:1,children:[o&&(0,i.jsx)(fA,{message:l("you_are_already_assigned_to_missions"),title:l("wished_positions_can_no_longer_be_changed")}),(0,i.jsx)(dm,{filters:e&&g(t)&&(0,i.jsx)(kd,{color:"white",disabled:o,size:"sm",to:t,children:l("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:l("nom_de_la_missi_64605")}),!u&&(0,i.jsx)(pm,{children:l("Date")}),!u&&(0,i.jsx)(pm,{children:l("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:Bs(c)?c.map((e,t)=>(0,i.jsxs)(am,{children:[(0,i.jsxs)(Qu,{align:"start",direction:"column",gap:"1",justify:"center",children:[g(e.category)&&(0,i.jsx)(ka,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:e.category}),(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray900 textSm medium",onClick:()=>{s.push(e.path)},children:e.name}),e.form.positionRanking===it.Ranked&&(0,i.jsx)(ka,{color:"gray500",children:l("choix_n_1_00613",e.rank)}),u&&(0,i.jsx)(ka,{color:"gray500",children:e.range})]}),!u&&(0,i.jsx)(Qu,{children:e.range}),!u&&(0,i.jsx)(Qu,{children:(0,i.jsx)(xA,{editDisabled:o,eventId:a,form:e.form,organizationId:r})})]},t)):(0,i.jsx)(am,{css:{height:"200px"},children:(0,i.jsx)(Qu,{children:(0,i.jsx)(pA,{title:l("aucune_mission_61179")})})})}),setOffset:hc.A,title:l("missions_souhai_23225"),totalCount:0})]})},vA=()=>{const{formsUsersInfos:e}=hA();return(0,i.jsx)(rd,{css:{background:"$gray50",padding:"$6"},height:1,width:1,children:(0,i.jsx)(IA,{canMemberAssign:!1,formsUsersInfos:e})})},bA=e=>{const{translate:t}=bd();return(0,i.jsx)(mA,{canCheckIn:e.canCheckIn,canDelete:e.canDelete,eventId:e.eventId,organizationId:e.organizationId,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsxs)(Jm,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(yb,{children:t("missions_de_1_99317",e.volunteerRegistration.userInfo.name)}),(0,i.jsx)(Qm,{css:{padding:"0"},children:(0,i.jsxs)(rb,{height:1,children:[(0,i.jsxs)(ob,{center:!0,children:[(0,i.jsx)(ib,{path:`${e.basePath}/assigned`,children:t("attribu_es_48167")}),(0,i.jsx)(ib,{path:`${e.basePath}/wished`,children:t("souhait_es_78101")})]}),(0,i.jsx)(sb,{path:`${e.basePath}/assigned`,children:(0,i.jsx)(gA,{})}),(0,i.jsx)(sb,{path:`${e.basePath}/wished`,children:(0,i.jsx)(vA,{})})]})})]})})},jA=V.createContext({}),CA=e=>{const{data:t,loader:n}=Oi("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},[js.UserInfoTeamRightPanelFragment]);const{mutate:o}=Qr(),[s,r]=V.useState([]),a=V.useMemo(()=>{const e=s.flatMap(e=>e.positionsCategories.flatMap(e=>e.positions.flatMap(e=>e.slots.map(t=>({...t,position:(0,Ta.A)(e,["id","name","icon","color"])}))))),t=s.flatMap(e=>e.positions.flatMap(e=>e.slots.map(t=>({...t,position:(0,Ta.A)(e,["id","name","icon","color"])})))),n=s.flatMap(e=>e.positionsSlots);return(0,Xh.A)(e.concat(t).concat(n),e=>e.id)},[s]),l=V.useMemo(()=>(0,Xh.A)(s.flatMap(e=>e.positionsSlotsUsersInfos.map(e=>({...e.positionSlot,position:e.position}))),e=>e.id),[s]),d=V.useMemo(()=>(0,cm.A)((0,Xh.A)(a.concat(l),e=>e.id),e=>[e.position.name.toLowerCase(),e.range.start.toMillis()]),[a,l]),c=V.useMemo(()=>Object.fromEntries(s.map(e=>{const t=(0,bs.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=V.useMemo(()=>Object.fromEntries(s.map(e=>{const t=e.positionsSlotsUsersInfos.map(e=>e.positionSlot.id);return[e.userInfo.id,t]})),[s]),m=V.useCallback(async(t,n)=>{await o({eventId:e.eventId,massAssign:{positionsSlotsIds:[n],selecteds:{ids:[t]},strategy:yt.Add}});const{event:i}=await function(e,t){return Js("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:[js.UserInfoTeamRightPanelFragment]})}({eventId:e.eventId,userInfoId:t},await X());r(e=>e.map(e=>e.userInfo.id===t?i.volunteerRegistration:e))},[e.eventId,r]);return V.useEffect(()=>{r(t.event?.team?.members??[])},[t.event,r]),(0,i.jsx)(jA.Provider,{value:{allSlots:d,form:t.event?.team?.form,loader:n,memberIdToAssignedSlotsIds:u,memberIdToWishedSlotsIds:c,members:s,assign:m},children:e.children})};function yA(){return V.useContext(jA)}const AA=e=>{const{translate:t}=bd(),{assign:n,memberIdToAssignedSlotsIds:o,memberIdToWishedSlotsIds:s}=yA(),[r,a]=(0,V.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)(am,{children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(ub,{size:32,userInfo:e.member.userInfo})}),(0,i.jsx)(Qu,{justify:"end",children:l?(0,i.jsxs)(rd,{align:"center",gap:"1",children:[(0,i.jsx)(ka,{color:"success500",children:(0,i.jsx)(Id,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(ka,{font:"gray800 textXs medium",children:t("d_j_affect_71706")})]}):d?(0,i.jsx)(kd,{isLoading:r,size:"sm",onClick:()=>{a(!0),n(e.member.userInfo.id,e.slot.id)},children:t("affecter_94255")}):(0,i.jsxs)(rd,{align:"center",gap:"1",children:[(0,i.jsx)(ka,{color:"error500",children:(0,i.jsx)(Id,{icon:"circle-xmark",iconStyle:"solid"})}),(0,i.jsx)(ka,{font:"gray800 textXs medium",children:t("non_souhait_46147")})]})})]})},SA=e=>{const{translate:t}=bd(),{members:n}=yA(),o=Ei(Yh),s=(0,V.useMemo)(()=>ng(o,e.slot,e.slot.position.name,{slot:{includeRange:!0}}),[e.slot]);return(0,i.jsxs)(rd,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(rd,{css:{padding:"$3 $4"},gap:"3",children:[(0,i.jsx)(Xv,{color:e.slot.position.color,icon:e.slot.position.icon}),(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{font:"gray800 textSm semiBold",children:e.slot.position.name}),(0,i.jsx)(ka,{color:"gray500",children:s})]})]}),(0,i.jsxs)(Hu,{hideBorder:!0,children:[(0,i.jsxs)(Wu,{children:[(0,i.jsx)(pm,{children:t("full_name")}),(0,i.jsx)(pm,{})]}),n.map(t=>(0,i.jsx)(AA,{member:t,slot:e.slot},t.userInfo.id))]})]})},kA=()=>{const{allSlots:e}=yA();return(0,i.jsx)(rd,{direction:"column",gap:"3",width:1,children:e.map(e=>(0,i.jsx)(SA,{slot:e},e.id))})},wA=e=>{const{translate:t}=bd(),{form:n,loader:o}=yA();return(0,i.jsxs)(Jm,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(yb,{children:(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{children:t("_quipe_1_19590",e.teamCode)}),(0,i.jsx)(ka,{color:"gray500",fontSize:"textSm",children:t("formulaire_1_39637",n?.name)})]})}),(0,i.jsx)(Qm,{css:{background:"$gray50",py:"$6"},children:o||(0,i.jsx)(kA,{})})]})},EA=e=>(0,i.jsx)(CA,{eventId:e.eventId,teamCode:e.teamCode,children:(0,i.jsx)(wA,{...e})}),TA=({editPath:e,eventId:t,organizationId:n,formsUsersInfos:o,showEditButton:s,isEditDisabled:r=!1})=>{const{translate:a}=bd(),l=Ei(Cm),d=Ei(Yh),c=(0,V.useMemo)(()=>(0,cm.A)(o.flatMap(e=>e.slots.map(t=>({range:t.range,display:e.form.slotDisplay,form:e.form}))),({range:e})=>e.start.toMillis()),[o]),u=om(),m=(0,V.useCallback)((e,t)=>{switch(t){case Qe.Calendar:case Qe.DisplayDays:return(0,i.jsx)(ka,{children:l.toLocaleString(e.start,zs.DateOnly.MonthLong)});case Qe.Display:case Qe.Custom:return(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{css:{lineHeight:"20px"},children:d.toDisplayString(e,{hideTime:!0})}),(0,i.jsx)(ka,{color:"gray500",css:{fontWeight:400,lineHeight:"20px"},fontSize:"textSm",children:d.toDisplayString(e,{hideDate:!0})})]});case Qe.Hide:return null;default:return vd()}},[]);return(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[r&&(0,i.jsx)(fA,{message:a("you_are_already_assigned_to_missions"),title:a("availabilities_can_no_longer_be_changed")}),(0,i.jsx)(dm,{filters:s&&(0,i.jsx)(kd,{color:"white",disabled:r,size:"sm",to:e,children:a("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:a("Date")}),!u&&(0,i.jsx)(pm,{children:a("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:Bs(c)?c.map((e,o)=>(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:m(e.range,e.display)}),!u&&(0,i.jsx)(Qu,{children:(0,i.jsx)(xA,{editDisabled:r,eventId:t,form:e.form,organizationId:n})})]},o)):(0,i.jsx)(am,{css:{height:"200px"},children:(0,i.jsx)(Qu,{children:(0,i.jsx)(pA,{title:a("aucune_disponib_15602")})})})}),setOffset:hc.A,title:a("disponibilit_s_49923"),totalCount:0})]})},RA=e=>{const t=Ti(),{data:n,loader:o}=Zr({organizationId:e.organizationId,eventId:e.eventId,userInfoId:e.userInfoId}),{permissions:[s],isLoading:r}=Ry(Sy({eventId:e.eventId,userInfoId:e.userInfoId}));return(0,i.jsxs)(Jm,{returnToFallback:e.returnPathFallback,size:"md",children:[(0,i.jsx)(yb,{children:t("disponibilit_s_49923")}),(0,i.jsx)(Qm,{children:o||r?o:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(TA,{editPath:fs.EDIT_USER_SLOTS(e.organizationId,e.eventId,e.userInfoId),eventId:e.eventId,formsUsersInfos:n.organization.userInfo.formsUsersInfos,organizationId:e.organizationId,showEditButton:s}),(0,i.jsx)(md,{height:"6"})]})})]})},OA=e=>{const{history:t,params:{organizationId:n}}=bd();return(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:e.accreditationsPanelPath,children:(0,i.jsx)(Qy,{basePath:e.accreditationsPanelPath,canDeleteCheckedIn:e.canDeleteCheckedIn,canMemberAccredit:e.canMemberAccredit,canWishedAccreditationsEdit:e.canWishedAccreditationsEdit,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,delegationId:e.delegation?.id,eventId:e.eventId,organizationId:e.organizationId,volunteerRegistration:e.volunteerRegistration,onClose:()=>{e.reloadRow(),t.goBack(e.returnPathFallback)}})}),(0,i.jsx)(Ea.qh,{path:e.availabilitiesPanelPath,children:(0,i.jsx)(RA,{delegationId:e.delegation?.id,eventId:e.eventId,organizationId:e.organizationId,returnPathFallback:e.availabilitiesPanelPath,userInfoId:e.volunteerRegistration.userInfo.id})}),e.informationPanelPath&&e.delegation&&(0,i.jsx)(Ea.qh,{path:e.informationPanelPath,children:(0,i.jsx)(rA,{delegation:e.delegation,organizationId:n,returnPathFallback:e.informationPanelPath,userInfoId:e.volunteerRegistration.userInfo.id})}),(0,i.jsx)(Ea.qh,{path:e.positionsPanelPath,children:(0,i.jsx)(bA,{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)(Ea.qh,{path:n,children:(0,i.jsx)(EA,{eventId:e.eventId,teamCode:(e.volunteerRegistration.teams||[])[o].teamCode,onClose:()=>{e.reloadRow(),t.goBack(e.returnPathFallback)}})},o))]})},DA=e=>{const t=Ti(),[n,o]=V.useState(!1),s=V.useCallback(async()=>{let t=!0;return o(!0),await e.onDelete(),t&&o(!1),()=>{t=!1}},[e.onDelete,n,o]);return(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(rd,{align:"center",css:{background:"$error100",borderRadius:"48px",color:"$error600",height:"48px",fontSize:"20px",width:"48px"},justify:"center",children:(0,i.jsx)(Id,{icon:"circle-exclamation",iconStyle:"light"})})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray900 textLg regular",textAlign:"center",title:e.text,children:e.text}),"subtext"in e&&Ls(e.subtext).map((e,t)=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:e})]},t)),"children"in e&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ka,{color:"gray500",css:{alignSelf:"center"},children:e.children})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{color:"error",isLoading:n,onClick:s,children:e.buttonText}),(0,i.jsx)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},zA=e=>(0,i.jsx)(ka,{css:{padding:"$2 $3"},font:"gray500 textXs semiBold",children:e.children}),$A=xa("div",{display:"flex",flexDirection:"column","& + &":{borderTop:"1px solid $gray100"}}),PA=e=>V.Children.toArray(e).some(e=>(0,V.isValidElement)(e)&&e.type===V.Fragment?PA(e.props.children):Boolean(e)),MA=e=>PA(e.children)?(0,i.jsxs)($A,{"aria-label":e.title,role:"group",children:[g(e.title)&&(0,i.jsx)(zA,{children:e.title}),e.children]}):null,FA=e=>{const{translate:t,params:{eventId:n,delegationId:o}}=bd(),{mutate:s}=Kr(),[r,a]=(0,V.useState)(1),[l,d]=(0,V.useState)(!1);return(0,i.jsx)(Av,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"clone",children:t("dupliquer_un_me_90016")}),(0,i.jsx)(jv,{children:(0,i.jsx)(Qd,{label:t("nombre_de_copie_37518"),min:1,shouldParseAsInt:!0,value:r,onChange:a})}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{isLoading:l,onClick:async()=>{d(!0),await s({eventId:n,delegationId:o,selecteds:{ids:[e.userInfoId]},numberOfCopies:r}),e.onClose(),e.reload()},children:t("dupliquer_1_94438",e.name)})})]})})},NA=e=>{const{translate:t,params:{organizationId:n,eventId:o,delegationId:s}}=bd(),{user:r}=Li(),{mutate:a}=Xr(),{mutate:l}=Rr(),{mutate:d}=Mr(),[c,u]=(0,V.useState)(!1),[m,h]=(0,V.useState)(!1),[g,p]=(0,V.useState)(!1),f=(0,V.useMemo)(()=>e.customDocuments.filter(t=>zg(t.populationsIds,e.member.fields.population)),[e.customDocuments,e.member]),_=o&&e.canMemberAccredit&&e.accreditationState===We.WaitingAccreditation,x=o&&e.showDocumentsDownload&&void 0!==e.member.links&&Bs(e.allowedCustomDocuments),I=x?e.allowedCustomDocuments.map((n,o)=>{const s=f.find(e=>e.slug===n);return s?(0,i.jsx)(ru,{download:`${e.member.nameOrEmail}-${s.name}`,icon:"arrow-down-to-bracket",target:"_blank",to:gf(e.member.links?.userCustomDocumentLinks[n],"pdf",{lang:r?.language}),children:t("t_l_charger_1_80752",s.name)},o):kn.includes(n)?(0,i.jsx)(ru,{download:`${e.member.nameOrEmail}-custom-badge`,icon:"arrow-down-to-bracket",target:"_blank",to:gf(e.member.links?.userCustomBadgeLinks[n],"pdf",{lang:r?.language}),children:t("t_l_charger_1_80752",y_(n))},o):null}):[];return _||x||e.canDuplicate||e.canDelete||e.showDeleteFromEvent?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{children:[(0,i.jsx)(MA,{children:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ru,{icon:"check",onClick:async()=>{await a({eventId:o,delegationId:s,selecteds:{ids:[e.member.id]}}),e.reload()},children:t("valider_les_acc_80801")}),(0,i.jsx)(ru,{icon:"badge-check",to:fs.ACCREDIT(n,o,e.member.id),children:t("accr_diter_70543")})]}):null}),(0,i.jsx)(MA,{children:I}),(0,i.jsxs)(MA,{children:[e.canDuplicate&&(0,i.jsx)(ru,{icon:"clone",onClick:()=>u(!0),children:t("dupliquer_28256")}),e.canDelete&&(0,i.jsx)(ru,{color:"red",icon:"user-xmark",onClick:()=>h(!0),children:t("retirer_de_la_d_64963")})]}),(0,i.jsx)(MA,{children:e.showDeleteFromEvent&&(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>p(!0),children:t("delete_from_eve_69290")})})]}),m&&(0,i.jsx)(DA,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_sur_d_88752")],text:t("suppression_de_73669",e.member.nameOrEmail),onClose:()=>h(!1),onDelete:async()=>{await l({organizationId:n,eventId:o,delegationId:s,selecteds:{ids:[e.member.id]},deleteFromEvent:e.deleteFromEvent}),e.reload()}}),e.canDuplicate&&c&&(0,i.jsx)(FA,{name:e.member.nameOrEmail,reload:e.reload,userInfoId:e.member.id,onClose:()=>u(!1)}),g&&e.volunteerRegistrationId&&(0,i.jsx)(DA,{buttonText:t("supprimer_43083"),subtext:[t("are_you_sure_yo_46668")],text:t("suppression_de_73669",e.member.nameOrEmail),onClose:()=>p(!1),onDelete:async()=>{await d({eventId:o,selecteds:{ids:[e.member.id]}}),e.reload()}})]}):null},LA=({displayName:e,isAddDeleteVisible:t,isResetVisible:n,massEditFieldInput:o,reset:s,strategy:r,change:a})=>{const{translate:l}=bd();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{font:"gray700 textSm medium",children:l("que_souhaitez_v_87607")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(zu,{state:s||r!==yt.Replace?"unchecked":"checked",onClick:()=>{a("massEdit.reset",!1),a("massEdit.strategy",yt.Replace)},children:l("remplacer_les_v_78885")}),!s&&r===yt.Replace&&o,(0,i.jsx)(md,{height:"3"}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{state:s||r!==yt.Add?"unchecked":"checked",onClick:()=>{a("massEdit.reset",!1),a("massEdit.strategy",yt.Add)},children:l("ajouter_des_val_80159")}),!s&&r===yt.Add&&o,(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:s||r!==yt.Delete?"unchecked":"checked",onClick:()=>{a("massEdit.reset",!1),a("massEdit.strategy",yt.Delete)},children:l("supprimer_des_v_96120")}),!s&&r===yt.Delete&&o,(0,i.jsx)(md,{height:"3"})]}),n&&(0,i.jsx)(zu,{state:s?"checked":"unchecked",onClick:()=>a("massEdit.reset",!0),children:l("r_initialiser_42983",e)})]})},BA=e=>{const t=Ti(),n=Ei(oj),o=(0,V.useMemo)(()=>(0,cm.A)(e.customFields??[],e=>e.name.toLowerCase()),[e.customFields]),s=(0,V.useMemo)(()=>(0,cm.A)([...o.map(e=>({slug:e.slug,name:e.name,label:e.label})),...e.properties.map(e=>({slug:e,name:t(e),label:null}))],e=>e.name.toLowerCase()),[o,e.properties]);return(0,i.jsx)(Om,{size:"md",onClose:e.onClose,children:(0,i.jsx)(cd.lV,{initialValues:{massEdit:{reset:!1,selecteds:e.selecteds,slug:"",value:"",strategy:yt.Replace}},initialValuesEqual:La.A,render:({form:n,handleSubmit:r,submitting:a,values:l})=>{const{reset:d,slug:c,strategy:u}=l.massEdit,m=s.find(e=>e.slug===c),h=o.find(e=>e.slug===c),p=g(c)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{css:{paddingLeft:"$6"},children:(0,i.jsx)(xj,{campaigns:e.campaigns,categories:e.categories,change:n.change,customDocuments:e.customDocuments,customField:h,delegationsSpaceLayouts:e.delegationsSpaceLayouts,forms:e.forms,name:"massEdit.value",slug:c,tags:e.tags,traces:e.traces,value:l.massEdit.value})})]}):null,f=c===Bt.Tag||c===Ke.Campaigns||c===Ke.Documents||!0===h?.canSelectMultiple,_=c!==Bt.Category&&c!==qt.Category&&c!==Ke.Category&&c!==Jt.Category&&c!==Jt.Layer&&c!==Jt.Zoom&&c!==Bt.WeezeventIsSynchronized&&c!==qt.Privacy&&c!==Ke.Form&&c!==Ke.IsLocked&&c!==Ke.ShowFormLinkInDelegationSpace&&c!==Ke.ShowInDelegationSpace&&c!==Ke.CanLeadersAddMembers&&c!==Ke.CanLeadersEditCustomFields&&c!==Ke.CanLeadersEditMembers&&c!==Ke.CanLeadersDeleteMembers&&c!==Ke.CanLeadersDuplicateMembers&&c!==Ke.CanLeadersEditColumns&&c!==Ke.CanLeadersImportMembers&&c!==Ke.CanLeadersSeeHiddenAccreditationsSlots&&c!==Ke.ShowAllAccreditations&&c!==Jt.WeezeventIsSynchronized&&c!==an.Frequency&&c!==an.State;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(wj,{color:"primary",icon:"sliders"})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("_dition_de_la_v_67585")}),(0,i.jsx)(md,{height:"7"}),e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ju,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(Gp,{isSearchVisible:!0,label:t("quel_est_le_cha_81138"),name:"massEdit.slug",placeholder:t("s_lectionnez_un_82446"),children:s.map(e=>(0,i.jsx)("option",{value:e.slug,children:Wb(e)},e.slug))}),m&&(0,i.jsx)(LA,{change:n.change,displayName:m.name,isAddDeleteVisible:f,isResetVisible:_,massEditFieldInput:p,reset:d,strategy:u}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{disabled:(x=l.massEdit,I=h,!(x.reset||!I||I.fieldType!==Oe.Select||I.canSelectMultiple||"number"==typeof x.value&&!isNaN(x.value))),isLoading:a,onClick:r,children:t("modifier_la_val_07602")}),(0,i.jsx)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]});var x,I},validate:e=>{const t=o.find(t=>t.slug===e.massEdit.slug),i=t&&!e.massEdit.reset?n.getValidationRuleError(t,e.massEdit.value):null;return i?{massEdit:{value:i}}:{}},onSubmit:async t=>{const n=(await e.mutate(t.massEdit)).numberOfEdited;e.onSuccess(n),e.onClose()}})})},VA=e=>{const{data:t,isLoading:n}=Oi("query PositionsMassEditInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(\n eventId: $eventId\n variety: Position\n sort: { attribute: Name, direction: Asc }\n ) {\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},[js.MassEditCustomFieldFragment]);const o=(0,V.useMemo)(()=>Xn.filter(e=>e!==Jt.Name),[]);return(0,i.jsx)(BA,{campaigns:[],categories:t.event?.positionsCategories??[],customDocuments:[],customFields:t.organization?.customFields.nodes??[],delegationsSpaceLayouts:[],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})},UA=e=>{const{data:t,isLoading:n}=Oi("query AccreditationsMassEditInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(\n eventId: $eventId\n variety: Accreditation\n sort: { attribute: Name, direction: Asc }\n ) {\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},[js.MassEditCustomFieldFragment]);const o=(0,V.useMemo)(()=>xn.filter(e=>e!==Bt.Name),[]);return(0,i.jsx)(BA,{campaigns:[],categories:t.event?.accreditationsCategories??[],customDocuments:[],customFields:t.organization?.customFields.nodes??[],delegationsSpaceLayouts:[],forms:[],isLoading:n,mutate:e.mutate,properties:o,selecteds:e.selecteds,tags:t.organization?.tags.nodes??[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},WA=e=>{const{data:t,isLoading:n}=Oi("query AccreditationsProfilesMassEditInfos($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfilesCategories {\n id\n name\n }\n }\n}\n",{eventId:e.eventId},[]);const o=(0,V.useMemo)(()=>In.filter(e=>e!==Vt.Name),[]);return(0,i.jsx)(BA,{campaigns:[],categories:t.event?.accreditationsProfilesCategories??[],customDocuments:[],customFields:[],delegationsSpaceLayouts:[],forms:[],isLoading:n,mutate:e.mutate,properties:o,selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},GA=e=>{const{data:t,isLoading:n}=(o={organizationId:e.organizationId},Oi(er,o,[]));var o;const s=(0,V.useMemo)(()=>wn.filter(e=>e!==qt.Label&&e!==qt.Name),[]);return(0,i.jsx)(BA,{campaigns:[],categories:t.organization?.customFieldsCategories.nodes??[],customDocuments:[],customFields:[],delegationsSpaceLayouts:[],forms:[],isLoading:n,mutate:e.mutate,properties:s,selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},qA=e=>{const{data:t,isLoading:n}=(o={organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?ke.Event:ke.Organization},Oi(tr,o,[js.MassEditCustomFieldFragment]));var o;const s=(0,V.useMemo)(()=>Tn.filter(e=>e!==Ke.Name&&e!==Ke.Columns&&e!==Ke.Parent),[]);return(0,i.jsx)(BA,{campaigns:t.organization?.campaigns.nodes??[],categories:t.organization?.delegationsCategories.nodes??[],customDocuments:t.organization?.event?.customDocuments??[],customFields:t.organization?.customFields.nodes??[],delegationsSpaceLayouts:t.organization?.event?.delegationsSpaceLayouts??[],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})},HA=e=>{const{data:t,isLoading:n}=Oi("query UsersInfosMassEditInfos($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n customFields(\n eventId: $eventId\n variety: UserInfo\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...MassEditCustomField\n }\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[js.MassEditCustomFieldFragment]);return(0,i.jsx)(BA,{campaigns:[],categories:[],customDocuments:[],customFields:t.organization?.customFields.nodes??[],delegationsSpaceLayouts:[],forms:[],isLoading:n,mutate:e.mutate,properties:[],selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},KA=e=>(0,i.jsx)(BA,{campaigns:[],categories:[],customDocuments:[],customFields:e.customFields,delegationsSpaceLayouts:[],forms:[],isLoading:!1,mutate:e.mutate,properties:[],selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess}),YA=e=>{const t=(0,V.useMemo)(()=>xi.filter(t=>t!==an.Name&&(e.canAccessBackoffice||t!==an.Frequency)),[e.canAccessBackoffice]);return(0,i.jsx)(BA,{campaigns:[],categories:[],customDocuments:[],customFields:[],delegationsSpaceLayouts:[],forms:[],isLoading:!1,mutate:e.mutate,properties:t,selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})};let ZA=class extends ic{translationService;constructor(e){super(e),this.translationService=e}step1Schema(){return c.Ik().shape({[this.inputName]:c.Ik().shape(this.step1Fields())})}step2Schema(){return c.Ik().shape({[this.inputName]:c.Ik().shape(this.step2Fields())})}schema(){return c.Ik().shape({...this.step1Fields(),...this.step2Fields()})}strategyField(e=Kn){return c.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(e,this.t("la_strat_gie_es_82287"))}};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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],ZA);let XA=class extends ZA{translationService;inputName="massAccredit";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField()}}step2Fields(){return{accreditationsSlotsIds:c.YO().of(c.ai()).required(this.t("vous_devez_s_le_72138")).when("accreditationProfile",{is:e=>!e,then:e=>e.min(1,this.t("vous_devez_s_le_72138"))})}}};XA=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],XA);const JA=e=>(0,pn.createPortal)((0,i.jsx)(ka,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"50",...e.css},height:1,width:1,children:e.children}),document.body),QA=({children:e,handleSubmit:t,nextText:n,prefix:o,strategies:s})=>{const r=Ti();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{font:"gray900 textSm medium",children:r("que_souhaitez_v_87607")}),s.map(({label:e,value:t})=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(FI,{name:`${o}strategy`,value:t,children:e})]},t)),e&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),e]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{onClick:t,children:n})})]})},eS=e=>{const t=Ti();return(0,i.jsx)(QA,{handleSubmit:e.handleSubmit,nextText:t("suivant_accr_25709"),prefix:"massAccredit.",strategies:[{label:t("ajouter_des_acc_17744"),value:yt.Add},{label:t("remplacer_les_a_92733"),value:yt.Replace},{label:t("supprimer_des_a_04246"),value:yt.Delete}]})};var tS=n(9120);const nS=e=>(0,cm.A)(e,e=>e.toMillis()),iS=xa("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:"$primary500",color:"white"}}},isSelected:{true:{background:"$primary500",color:"white",cursor:"pointer"}}},compoundVariants:[{isSelectable:!0,isSelected:!0,css:{background:"$primary500",color:"white",cursor:"pointer"}}]}),oS=({datesToTitle:e,disabledDates:t,firstDayOfMonth:n,max:o,min:s,onChange:r,startHour:a,values:l})=>{const d=Ti(),c=Ei(Cm),u=(0,V.useMemo)(()=>n.minus({day:n.weekday-1}),[n]),m=(0,V.useMemo)(()=>n.endOf("month"),[n]),h=(0,V.useMemo)(()=>{const e=m.plus({day:7-m.weekday});return Math.ceil(e.diff(u,"days").days)},[m]),g=(0,V.useMemo)(()=>(0,nm.A)(0,h).map(e=>{const i=u.plus({day:e}).set({hour:a||0}),r=i.toMillis(),d=l.some(e=>e.toMillis()===r),c=!!Bs(t)&&t.some(e=>e.toMillis()===r);return{day:i,isSelected:d,isDisabled:c,isSelectable:!c&&i.month===n.month&&i>=s&&i<=o}}),[u,h,l,t,a]),p=(0,V.useMemo)(()=>!g.some(({isSelectable:e,isSelected:t})=>e&&!t),[g]),f=(0,V.useCallback)(()=>{r(p?[]:g.flatMap(({day:e,isSelectable:t,isSelected:n})=>t||n?[e]:[]))},[g,p,r]);return(0,i.jsxs)(rd,{css:{background:"white",bd:!0,padding:"$5 $4"},direction:"column",children:[(0,i.jsx)(ka,{css:{textTransform:"capitalize"},font:"gray800 textXl semiBold",textAlign:"center",width:1,children:c.toLocaleString(n,{month:"long",year:"numeric"})}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(yc,{gap:"2",gridtemplatecolumns:"repeat(7, 32px)",gridtemplaterows:"auto",children:(0,nm.A)(0,7).map(e=>{const t=u.plus({day:e});return(0,i.jsx)(ka,{css:{textTransform:"capitalize"},font:"gray500 textXs medium",width:32,children:c.toLocaleString(t,{weekday:"short"})},e)})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(yc,{gap:"2",gridtemplatecolumns:"repeat(7, 32px)",gridtemplaterows:"auto",children:g.map(({day:t,isSelected:n,isSelectable:o},s)=>(0,i.jsx)(iS,{isSelectable:o,isSelected:n,title:e?.[t.toMillis()],onClick:e=>{if(o&&n)r(nS((0,tS.A)(l,[t],e=>e.toMillis())));else if(o&&!n){const n=l.findLast(e=>en.plus({day:e+1}));r(nS([...l,...i]))}else r(nS([...l,t]))}},children:t.day},s))}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(kd,{color:"white",textAlign:"center",onClick:f,children:d(p?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")})]})};function sS(e,t,n){const i=n-t;return i<=0?e("quota_atteint_12838"):e("quota_1_2_23970",t,n,i)}const rS=e=>{const{translate:t}=bd();return(0,V.useMemo)(()=>{const n=e.getAssignedMaxRemaining(e.slotId);return n?n.remaining<=0?(0,i.jsx)(vu,{color:"error",leftIcon:"circle-xmark",size:"sm",children:sS(t,n.assignedResources,n.maxResources)}):(0,i.jsx)(vu,{color:"white",size:"sm",children:sS(t,n.assignedResources,n.maxResources)}):null},[e.slotId,e.getAssignedMaxRemaining,t])},aS=e=>{const{translate:t}=bd(),{minDate:n,maxDate:o,numberOfMonths:s,totalDaysDiff:r}=(0,V.useMemo)(()=>function(e){const t=e.filter(e=>e.date?.isValid),n=(0,Lh.A)(t.map(e=>e.date),e=>e.toMillis()),i=(0,Bh.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}}(e.slots),[e.slots]),a=(0,V.useMemo)(()=>e.slots.flatMap(t=>t.date?.isValid&&e.accreditationsSlotsIds.includes(t.id)?[t.date]:[]),[e.slots,e.accreditationsSlotsIds]),l=(0,V.useMemo)(()=>(0,nm.A)(0,r).flatMap(t=>{const i=n.plus({day:t});return e.slots.some(e=>e.date?.isValid&&e.date.toMillis()===i.toMillis())?[]:[i]}),[n,r,e.slots]),d=(0,V.useMemo)(()=>Object.fromEntries(e.slots.flatMap(n=>{const i=e.slotIdToDas?.[n.id];return n.date?.isValid&&"number"==typeof i?.maxResources?[[n.date.toMillis(),sS(t,i.assignedResources,i.maxResources)]]:[]})),[e.slotIdToDas,e.slots,t]);return(0,i.jsx)(rd,{gap:"4",wrap:"wrap",children:(0,nm.A)(0,s).map(t=>{const r=n.plus({month:t}).startOf("month"),c=0===t?n:r,u=t===s-1?o:r.endOf("month"),m=a.filter(e=>e.startOf("month").equals(r));return(0,i.jsx)(oS,{datesToTitle:d,disabledDates:l,firstDayOfMonth:r,max:u,min:c,values:m,onChange:t=>{e.onChange(function(e,t,n,i){const o=(0,yu.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)}(e.accreditationsSlotsIds,e.slots,r,t))}},t)})})},lS=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>e.slots.filter(e=>e.date?.isValid),[e.slots]);return Bs(n)?(0,i.jsx)(aS,{...e,slots:n}):(0,i.jsx)(pA,{imageSrc:Ec.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})},dS=e=>{const{translate:t}=bd(),n=Ei(lI),o=(0,V.useMemo)(()=>hg(e.accreditation),[e.accreditation]),s=(0,V.useMemo)(()=>e.das?.assignedResources??e.slot.assignedResources,[e.das,e.slot]),r=(0,V.useMemo)(()=>e.das?.maxResources??e.slot.maxResources,[e.das,e.slot]),a=e.accreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(rd,{align:"center",css:{background:"white",bd:!0,cursor:"pointer",px:"$4",userSelect:"none"},gap:"2",height:64,onClick:()=>{e.onClick(e.slot.id,"unchecked"===a)},children:[(0,i.jsx)(wu,{shouldPreventDefault:!1,state:a,onClick:hc.A}),(0,i.jsx)(Xv,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsx)(ka,{css:{flex:"1"},font:"gray800 textSm semiBold",children:o}),(0,i.jsx)(rd,{css:{px:"$3"},width:310,children:(0,i.jsx)(vu,{color:s>=(r||1/0)?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",s,n.toNumberOrInfinity(r))})})]})},cS=e=>{const t=Ti(),n=Ei(Cm),o=Ei(lI),s=(0,V.useMemo)(()=>e.das?.assignedResources??e.slot.assignedResources,[e.das,e.slot]),r=(0,V.useMemo)(()=>e.das?.maxResources??e.slot.maxResources,[e.das,e.slot]),a=e.accreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(am,{css:{cursor:"pointer"},onClick:()=>{e.onClick(e.slot.id,"unchecked"===a)},children:[(0,i.jsx)(Qu,{justify:"center",width:48,children:e.shouldDisplayList?(0,i.jsx)(wu,{shouldPreventDefault:!1,state:a,onClick:hc.A}):(0,i.jsx)(Du,{shouldPreventDefault:!1,state:a,onClick:hc.A})}),(0,i.jsx)(Qu,{children:g(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(Qu,{children:e.slot.date?.isValid?n.toLocaleString(e.slot.date,zs.DateOnly.WeekdayLongMonthLong):"-"}),(0,i.jsx)(Qu,{children:(0,i.jsx)(vu,{color:s>=(r||1/0)?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",s,o.toNumberOrInfinity(r))})})]})},uS=e=>{const t=Ti(),n=(0,V.useMemo)(()=>(0,cm.A)(e.slots.filter(t=>t.accreditation.id===e.accreditation.id),e=>(0,hd.A)([e.date?.toMillis(),e.name.toLowerCase()])),[e.slots,e.accreditation]),o=(0,V.useMemo)(()=>n.map(e=>e.id),[n]),s=(0,V.useMemo)(()=>Object.fromEntries(e.delegationAccreditationsSlots.map(e=>[e.accreditationSlotId,e])),[e.delegationAccreditationsSlots]),r=(0,V.useMemo)(()=>{const t=(0,Pu.A)(e.accreditationsSlotsIds,o);return t.length===o.length?"checked":0===t.length?"unchecked":"indeterminate"},[o,e.accreditationsSlotsIds]),a=(0,V.useCallback)((t,n)=>{if(e.accreditation.accreditationDisplay===xe.Radio){const i=(0,yu.A)(e.accreditationsSlotsIds,o).concat(n?[t]:[]);e.change("massAccredit.accreditationsSlotsIds",i)}else e.change("massAccredit.accreditationsSlotsIds",Us(e.accreditationsSlotsIds,t,n))},[e.accreditation,e.accreditationsSlotsIds,e.change,o]),l=(0,V.useCallback)(t=>{e.change("massAccredit.accreditationsSlotsIds",t)},[e.change]),d=e.accreditation.accreditationDisplay===xe.List||e.strategy===yt.Delete;return e.accreditation.hasSlots?(0,i.jsx)(Vj,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:n.length,children:e.accreditation.accreditationDisplay===xe.Calendar?(0,i.jsx)(rd,{css:{background:"$gray50",padding:"$4"},children:(0,i.jsx)(lS,{accreditationsSlotsIds:e.accreditationsSlotsIds,slots:n,onChange:l})}):(0,i.jsxs)(Hu,{hideBorder:!0,children:[(0,i.jsxs)(Wu,{children:[(0,i.jsx)(pm,{justify:"center",width:48,children:d&&(0,i.jsx)(wu,{state:r,onClick:t=>{"checked"===t?e.change("massAccredit.accreditationsSlotsIds",(0,bs.A)(e.accreditationsSlotsIds.concat(o))):e.change("massAccredit.accreditationsSlotsIds",(0,yu.A)(e.accreditationsSlotsIds,o))}})}),(0,i.jsx)(pm,{children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(pm,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(pm,{})]}),n.map(t=>(0,i.jsx)(cS,{accreditationsSlotsIds:e.accreditationsSlotsIds,das:s[t.id]??null,shouldDisplayList:d,slot:t,onClick:a},t.id))]})}):(0,i.jsx)(dS,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,das:s[n[0].id]??null,slot:n[0],onClick:a})},mS=e=>{const t=(0,V.useMemo)(()=>_g(e.accreditations.filter(t=>t.accreditationCategoryId===e.category.id)),[e.accreditations,e.category]);return(0,i.jsx)(Bj,{category:e.category.name,children:t.map(t=>(0,i.jsx)(uS,{accreditation:t,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,delegationAccreditationsSlots:e.delegationAccreditationsSlots,slots:e.slots,strategy:e.strategy},t.id))})},hS=e=>{const t=Ti();return(0,i.jsxs)(nu,{doNotCloseOnOtherOpen:!0,isOpen:e.isOpen,onStateChange:e.onStateChange,children:[(0,i.jsx)(du,{children:(0,i.jsx)(ka,{children:(0,i.jsxs)(kd,{color:e.color,leftIcon:"bars-filter",children:[t("filtres_64574")," ",(e.numberOfAppliedFilters||0)>0?`(${e.numberOfAppliedFilters})`:""]})})}),(0,i.jsx)(lu,{placement:"bottom-end",width:385,children:(0,i.jsxs)(rd,{direction:"column",onChange:Gd,children:[(0,i.jsxs)(rd,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(ka,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),e.children]}),e.showButtons&&(0,i.jsxs)(rd,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:e.reinit,children:t("r_initialiser_77538")}),(0,i.jsx)(kd,{size:"sm",onClick:e.apply,children:t("appliquer_05753")})]})]})})]})},gS=e=>{const t=Ti(),[n,o]=(0,V.useState)(!1),[s,r]=(0,V.useState)(e.excludeEmpty?"checked":"unchecked"),[a,l]=(0,V.useState)(e.excludeFull?"checked":"unchecked"),[d,c]=(0,V.useState)(e.excludePast?"checked":"unchecked"),u=(e.excludeEmpty?1:0)+(e.excludeFull?1:0)+(e.excludePast?1:0);return(0,i.jsxs)(rd,{css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"3",children:[(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_une_65646"),value:e.name,onChange:t=>{e.setName(t)}})}),(0,i.jsxs)(hS,{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)(Eu,{state:s,onClick:r,children:t("cacher_les_cr_n_76382")}),(0,i.jsx)(Eu,{state:a,onClick:l,children:t("cacher_les_cr_n_31908")}),(0,i.jsx)(Eu,{state:d,onClick:c,children:t("masquer_les_cr_05336")})]})]})},pS=e=>{const t=Ti(),[n,o,s]=gm(""),[r,a]=(0,V.useState)(!1),[l,d]=(0,V.useState)(!1),[c,u]=(0,V.useState)(!1),{data:h,loader:p}=Oi("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 delegation: delegationMaybe(id: $delegationId) {\n accreditationsSlots {\n accreditationSlotId\n assignedResources\n maxResources\n }\n }\n\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 accreditationId\n name\n assignedResources\n maxResources\n date\n isBlocked\n isFull\n\n accreditation {\n id\n accreditationCategoryId\n accreditationCategoryName\n name\n accreditationDisplay\n hasSlots\n color\n icon\n index\n }\n\n accreditationCategory {\n id\n name\n }\n }\n }\n }\n}\n",{eventId:e.eventId,delegationId:e.delegationId,accreditationName:g(o)?o:void 0,excludeEmpty:r,excludeFull:l,excludePast:c},[]);const f=(0,V.useMemo)(()=>(h.event?.accreditationsSlots.nodes??[]).filter(e=>!e.isBlocked),[h.event]),_=(0,V.useMemo)(()=>(0,cm.A)((0,Xh.A)(f.map(e=>e.accreditationCategory),e=>e.id),e=>m(e.name)),[f]),x=(0,V.useMemo)(()=>(0,Xh.A)(f.map(e=>e.accreditation),e=>e.id),[f]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(gS,{excludeEmpty:r,excludeFull:l,excludePast:c,name:n,setExcludeEmpty:a,setExcludeFull:d,setExcludePast:u,setName:s}),(0,i.jsx)(md,{height:"6"}),p||(0,i.jsx)(Lj,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:_.map(t=>(0,i.jsx)(mS,{accreditations:x,accreditationsSlotsIds:e.values.massAccredit.accreditationsSlotsIds,category:t,change:e.change,delegationAccreditationsSlots:h.event.delegation?.accreditationsSlots??[],slots:f,strategy:e.values.massAccredit.strategy},t.id))}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{isLoading:e.submitting,onClick:e.handleSubmit,children:g(e.buttonText)?e.buttonText:t(e.values.massAccredit.strategy===yt.Add?"accr_diter_les_78545":e.values.massAccredit.strategy===yt.Replace?"r_accr_diter_le_34059":"d_saccr_diter_l_28590",e.numberOfSelected)})})]})},fS=({eventId:e,numberOfSelected:t,onClose:n,onSuccess:o,selecteds:s})=>{const r=Ti(),a=Ei(XA),{mutate:l}=hr();return(0,i.jsx)(JA,{children:(0,i.jsx)(zp,{category:r("Accreditation"),heading:r("accr_diter_les_48281"),onClose:n,children:(0,i.jsx)(Op,{children:(0,i.jsxs)(VI,{initialValues:{massAccredit:{selecteds:s,strategy:yt.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)(BI,{heading:r("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(eS,{handleSubmit:e}),schema:a.step1Schema()}),(0,i.jsx)(BI,{heading:r("accr_ditations_39450"),render:({form:n,handleSubmit:o,submitting:s,values:r})=>(0,i.jsx)(pS,{change:n.change,delegationId:null,eventId:e,handleSubmit:o,numberOfSelected:t,submitting:s,values:r}),schema:a.step2Schema()})]})})})})},_S=e=>{const{history:t,translate:n}=bd(),{mutate:o,isLoading:r}=la(),[a,l]=(0,V.useState)([]),d=Bs(a);return(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(wj,{color:"primary",icon:"people-group"})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{font:"gray900 textLg medium",textAlign:"center",children:n("SendCampaign")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(Uu,{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)(md,{height:"2"}),(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",onClick:()=>{const n=s(JSON.stringify({usersInfosIds:e.selecteds.ids}));t.push(Tx.CREATE({organizationId:e.organizationId,eventId:e.eventId||void 0,options:n}))},children:n("cr_er_une_nouve_86635")})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{disabled:!d,isLoading:r,onClick:async()=>{if(Bs(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)(kd,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},xS=e=>{const{data:t}=Oi("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?ke.Event:ke.Organization,eventId:e.eventId},[]);return(0,i.jsx)(_S,{campaigns:t.organization?.campaigns.nodes??[],canCreate:!0,delegationId:null,eventId:e.eventId,organizationId:e.organizationId,selecteds:e.selecteds,onClose:e.onClose,onSuccess:e.onSuccess})};let IS=class extends ic{translationService;constructor(e){super(e),this.translationService=e}default(e){return{...e,groupId:void 0,customDocumentId:void 0,eventDocumentId:void 0,zplDocumentId:void 0}}schema(){const e=this;return c.Ik().shape({input:c.Ik().shape({groupId:c.Yj().required(this.t("le_lieu_d_impre_60407")),customDocumentId:c.ai().nullable(),eventDocumentId:c.ai().nullable(),zplDocumentId:c.ai().nullable()}).test({name:"exactly-one-document",test:({customDocumentId:t,eventDocumentId:n,zplDocumentId:i},o)=>1===[t,n,i].filter(Boolean).length||o.createError({message:e.t("a_wristband_to_25340"),path:"input.zplDocumentId"})})})}};IS=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],IS);const vS=e=>(0,i.jsx)(rd,{css:{alignSelf:"stretch",alignItems:"start",padding:"$6",overflowY:"auto",...e.css},direction:"column",gap:"6",children:e.children}),bS=({handleSubmit:e,isLoading:t=!1,isSubmitDisabled:n=!1,setIsOpen:o,submitStyle:s,submitText:r,...a})=>{const{translate:l}=bd();return(0,i.jsxs)(rd,{as:"footer",css:{alignItems:"flex-end",alignSelf:"stretch",background:"$white",borderBlockStart:"1px solid $gray200",padding:"$6"},direction:"column",gap:"4",...a,children:[(0,i.jsxs)(rd,{align:"center",gap:"4",justify:"end",children:[(0,i.jsx)(kd,{color:"white",onClick:()=>o(!1),children:l("annuler_48254")}),(0,i.jsx)(kd,{color:s,disabled:n,isLoading:t,onClick:()=>e(),children:r??l("submit_21373")})]}),a.children]})},jS=({heading:e,leftIcon:t,leftIconColor:n,leftIconBorder:o,setIsOpen:s,...r})=>{const{translate:a}=bd();return(0,i.jsxs)(rd,{as:"header",css:{alignItems:"flex-start",alignSelf:"stretch",background:"$white",borderBlockEnd:"1px solid $gray200"},direction:"column",gap:"4",...r,children:[(0,i.jsxs)(rd,{css:{alignItems:"center",alignSelf:"stretch",padding:"$6 $7 $5 $7"},gap:"4",children:[t&&(0,i.jsx)(rd,{align:"center",css:{padding:"$3",bd:!0,border:o},justify:"center",children:(0,i.jsx)(rd,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(Id,{className:"fa-xl",color:n,icon:t})})}),(0,i.jsx)(rd,{css:{alignItems:"flex-start",flex:1},direction:"column",justify:"center",children:e})]}),(0,i.jsx)(rd,{align:"center",css:{padding:"$2",height:"$space$9",width:"$space$9",position:"absolute",right:"$space$4",top:"$space$4"},justify:"center",children:(0,i.jsx)(kd,{"aria-label":a("close_dialog_50926"),color:"invisible",css:{color:"$gray500",width:"$space$6",height:"$space$6",padding:0},textAlign:"center",onClick:()=>s(!1),children:(0,i.jsx)("i",{className:"far fa-xmark"})})}),r.children]})},CS=V.forwardRef(({shouldLightDismiss:e=!0,initialOpen:t=!1,isOpen:n,setIsOpen:o,onClose:s,children:r,...a},l)=>{const[d,c]=V.useState(t),u=V.useRef(null),m=n??d,h=o??c;return V.useEffect(()=>{const e=u.current;return m?function(e){e&&!e.open&&e.showModal()}(e):e?.close(),()=>{e?.close()}},[m]),V.useEffect(()=>{const t=u.current;function n(e){e.preventDefault(),e.stopPropagation(),a.onClose?.(),h(!1)}function i(e){const{target:t}=e;t instanceof Element&&"DIALOG"===t.nodeName&&n(e)}function o(e){"Escape"===e.code&&n(e)}return e&&t?.addEventListener("click",i),t?.addEventListener("keydown",o),()=>{e&&t?.removeEventListener("click",i),t?.removeEventListener("keydown",o)}},[e,h]),V.useImperativeHandle(l,()=>({close(){h(!1)},showModal(){h(!0)},isOpen:()=>m,addEventListener(e,t,n){u.current?.addEventListener(e,t,n)},removeEventListener(e,t,n){u.current?.removeEventListener(e,t,n)}}),[m,h]),(0,i.jsxs)(i.Fragment,{children:[false,(0,i.jsx)("dialog",{ref:u,"aria-describedby":a["aria-describedby"],"aria-label":a["aria-label"],"aria-labelledby":a["aria-labelledby"],style:a.style,onClose:s,...a["aria-description"]?{"aria-description":a["aria-description"]}:{},children:r})]})});CS.displayName="Dialog";const yS=({children:e,descId:t,labelId:n,isOpen:o,size:s,setIsOpen:r,...a})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n dialog::backdrop {\n background: rgba(52, 64, 84, 0.7)\n }\n "}}),(0,i.jsx)(CS,{"aria-describedby":t,"aria-labelledby":n,"data-testid":"modal-body",isOpen:o,setIsOpen:r,style:{border:"none",borderRadius:"var(--radii-3)",padding:0,inlineSize:"70vw",blockSize:"fit-content",maxWidth:"688px"},onClose:a.onClose,children:(0,i.jsx)(rd,{align:"center",direction:"column",...a,children:e})})]}),AS=({eventId:e,selecteds:t,sort:n,isOpen:o,setIsOpen:s})=>{const{translate:r}=bd(),a=Ei(IS),{data:l,isLoading:d}=Oi("query MassPrintGroupsAndDocuments($eventId: EventId!) {\n event(id: $eventId) {\n printerGroups {\n id\n name\n }\n zplDocuments {\n nodes {\n id\n name\n }\n }\n }\n}\n",{eventId:e},[]),{mutate:c}=function(e={}){return Di("mutation VolunteersRegistrationsMassPrint($eventId: EventId!, $input: MassPrintInput!) {\n count: volunteersRegistrationsMassPrint(eventId: $eventId, input: $input)\n}\n",e)}(),u=Hd(),m=(0,V.useRef)(null);return(0,i.jsx)(Vd,{css:{dialog:{overflow:"visible"},footer:{borderBottomLeftRadius:"$3",borderBottomRightRadius:"$3"},header:{borderTopLeftRadius:"$3",borderTopRightRadius:"$3"}},customErrorRef:m,initialValues:{input:a.default({selecteds:t,sort:n})},render:({handleSubmit:e,submitting:t})=>(0,i.jsx)(SS,{disabled:d||t,ids:u,isOpen:o,setIsOpen:s,onSubmit:()=>{d||t||e()},children:d?(0,i.jsxs)(rd,{direction:"column",gap:"6",width:"100%",children:[(0,i.jsx)(ju,{borderRadius:"$1",css:{marginTop:"$6"},height:40,width:1}),(0,i.jsx)(ju,{borderRadius:"$1",css:{marginTop:"$6"},height:40,width:1})]}):(0,i.jsxs)(ka,{width:"100%",children:[(0,i.jsx)(ka,{ref:m,children:(0,i.jsx)(Zu.Provider,{value:{designSystem:Yu},children:(0,i.jsx)(Nd,{})})}),(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[0===l.event.printerGroups.length&&(0,i.jsxs)(zd,{alertStyle:"warning",children:[(0,i.jsx)($d,{children:r("incomplete_prin_64421")}),(0,i.jsx)(Pd,{children:r("no_printing_loc_73059")})]}),(0,i.jsx)(Gp,{label:r("wristband_to_pr_39675"),name:"input.zplDocumentId",children:l.event.zplDocuments.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Gp,{label:r("printing_locati_10729"),name:"input.groupId",children:l.event.printerGroups.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})]})}),schema:a.schema(),onSubmit:async({input:t},n)=>{if(!n.getState().invalid)try{await c({eventId:e,input:t})}finally{s(!1)}}})},SS=({children:e,disabled:t,ids:n,isOpen:o,onSubmit:s,setIsOpen:r})=>{const{translate:a}=bd();return(0,i.jsxs)(yS,{descId:n.descId,isOpen:o,labelId:n.labelId,role:"dialog",setIsOpen:r,size:"md",onClose:()=>{r(!1)},children:[(0,i.jsx)(jS,{heading:(0,i.jsx)(Dd,{id:n.labelId,children:a("imprimer_un_bra_94539")}),id:n.labelId,leftIcon:"print",leftIconColor:"gray800",setIsOpen:r}),(0,i.jsx)(vS,{css:{backgroundColor:"white"},id:n.descId,children:e}),(0,i.jsx)(bS,{handleSubmit:s,isSubmitDisabled:t,setIsOpen:r,submitText:a("print_37582")})]})},kS=e=>{const{translate:t}=bd(),n=Ei(XA),{mutate:o}=da();return(0,i.jsx)(JA,{children:(0,i.jsx)(zp,{category:t("Accreditation"),heading:t("update_desired_accreditations"),onClose:e.onClose,children:(0,i.jsx)(Op,{css:{py:"$7"},children:(0,i.jsxs)(VI,{initialValues:{massAccredit:{selecteds:e.selecteds,strategy:yt.Add,accreditationsSlotsIds:[]}},isEdit:!1,onSubmit:async t=>{await o({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegationId,massAccredit:t.massAccredit}),e.onSuccess(),e.onClose()},children:[(0,i.jsx)(BI,{heading:t("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(eS,{handleSubmit:e}),schema:n.step1Schema()}),(0,i.jsx)(BI,{heading:t("accr_ditations_39450"),render:({form:n,handleSubmit:o,values:s,submitting:r})=>(0,i.jsx)(pS,{buttonText:s.massAccredit.strategy===yt.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.step2Schema()})]})})})})};let wS=class extends ZA{translationService;inputName="massProfileUpdate";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField([yt.Replace,yt.Delete])}}step2Fields(){return{accreditationProfileId:c.ai().nullable().when("strategy",{is:e=>e!==yt.Delete,then:e=>e.required(this.t("vous_devez_s_le_07918"))})}}};wS=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],wS);const ES=e=>{const t=Ti();return(0,i.jsx)(QA,{handleSubmit:e.handleSubmit,nextText:t("suivant_62774"),prefix:"massProfileUpdate.",strategies:[{label:t("remplacer_le_pr_39873"),value:yt.Replace},{label:t("supprimer_le_pr_54358"),value:yt.Delete}]})},TS=e=>{const t=Ti(),{data:n,loader:o}=Oi("query MassWishedProfileUpdateProfiles($eventId: EventId!, $delegationId: DelegationId!) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationsProfiles {\n accreditationProfile {\n id\n name\n\n accreditationProfileCategory {\n id\n name\n }\n }\n }\n }\n }\n}\n",{eventId:e.eventId,delegationId:e.delegationId},[]);const{accreditationProfileId:s,strategy:r}=e.values.massProfileUpdate,a=r===yt.Delete,l=(0,V.useMemo)(()=>(n.event?.delegation.accreditationsProfiles??[]).map(e=>e.accreditationProfile),[n.event]),d=(0,V.useMemo)(()=>Object.values((0,Vu.A)(l,e=>e.accreditationProfileCategory.id)).map(e=>({...e[0].accreditationProfileCategory,accreditationsProfiles:e})),[l]),c=(0,V.useMemo)(()=>Nj(d),[d]);return o||(0,i.jsxs)(i.Fragment,{children:[!a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("profil_d_accr_d_63000"),multiple:!1,placeholder:t("s_lectionner_un_45763"),values:(0,hd.A)([s]),onChange:t=>{e.change("massProfileUpdate.accreditationProfileId",t[0]??null)},children:c}),(0,i.jsx)(md,{height:"7"})]}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{isLoading:e.submitting,onClick:e.handleSubmit,children:t(a?"supprimer_le_pr_87965":"mettre_jour_l_05683",e.numberOfSelected)})})]})},RS=e=>{const{translate:t}=bd(),n=Ei(wS),{mutate:o}=ca();return(0,i.jsx)(JA,{children:(0,i.jsx)(zp,{category:t("Accreditation"),heading:t("mettre_jour_l_03244"),onClose:e.onClose,children:(0,i.jsx)(Op,{css:{py:"$7"},children:(0,i.jsxs)(VI,{initialValues:{massProfileUpdate:{accreditationProfileId:null,selecteds:e.selecteds,strategy:yt.Replace}},isEdit:!1,onSubmit:async t=>{await o({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegationId,massProfileUpdate:t.massProfileUpdate}),e.onSuccess(),e.onClose()},children:[(0,i.jsx)(BI,{heading:t("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(ES,{handleSubmit:e}),schema:n.step1Schema()}),(0,i.jsx)(BI,{heading:t("profil_d_accr_d_02274"),render:({form:t,handleSubmit:n,submitting:o,values:s})=>(0,i.jsx)(TS,{change:t.change,delegationId:e.delegationId,eventId:e.eventId,handleSubmit:n,numberOfSelected:e.numberOfSelected,submitting:o,values:s}),schema:n.step2Schema()})]})})})})},OS=e=>{const{translate:t,params:{organizationId:n,eventId:o,delegationId:s}}=bd(),{mutate:r}=Sr(),{mutate:a}=Xr(),{mutate:l}=Rr(),[d,c]=(0,V.useState)(!1),[u,m]=(0,V.useState)(!1),[h,g]=(0,V.useState)(!1),[p,f]=(0,V.useState)(!1),[_,x]=(0,V.useState)(!1),[I,v]=(0,V.useState)(!1),[b,j]=(0,V.useState)(!1),C=e.massActions.getSelectedsInput(e.predicates,e.scope),y=e.massActions.isAllSelected?e.totalCount:e.massActions.numberOfSelected,A=e.showAccreditationsValidate||Bs(e.campaigns)||e.showDelete;return(0,i.jsxs)(i.Fragment,{children:[e.canMemberEdit&&(0,i.jsx)(kd,{color:"invisible-gray",leftIcon:"pen",onClick:()=>c(!0),children:t("_diter_un_champ_64621")}),e.showWishedAccreditationsEdit&&(0,i.jsx)(kd,{color:"invisible-gray",leftIcon:"wand-magic-sparkles",onClick:()=>m(!0),children:t("_diter_les_accr_41957")}),e.showWishedProfileEdit&&(0,i.jsx)(kd,{color:"invisible-gray",leftIcon:"wand-magic-sparkles",onClick:()=>g(!0),children:t("_diter_le_profi_54032")}),e.showAccreditationsEdit&&(0,i.jsx)(kd,{color:"invisible-gray",leftIcon:"wand-magic-sparkles",onClick:()=>f(!0),children:t("_diter_les_accr_86042")}),A&&(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"invisible-gray",rightIcon:"chevron-down",children:t("plus_77692")})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[e.showAccreditationsValidate&&(0,i.jsx)(ru,{icon:"check",onClick:async()=>{await a({eventId:o,delegationId:s,selecteds:C}),e.onMassEditSuccess()},children:t("valider_les_acc_80801")}),e.showPrint&&(0,i.jsx)(ru,{icon:"print",onClick:()=>j(!0),children:t("imprimer_un_bra_94539")}),Bs(e.campaigns)&&(0,i.jsx)(ru,{icon:"paper-plane",onClick:()=>x(!0),children:t("SendCampaign")}),e.showDelete&&(0,i.jsx)(ru,{color:"red",icon:"user-xmark",onClick:()=>v(!0),children:t("retirer_de_la_d_64963")})]})]}),d&&(0,i.jsx)(KA,{customFields:e.customFields,mutate:e=>r({organizationId:n,eventId:o,delegationId:s,massEdit:e}),selecteds:C,onClose:()=>c(!1),onSuccess:e.onMassEditSuccess}),u&&(0,i.jsx)(kS,{delegationId:s,eventId:o,numberOfSelected:y,organizationId:n,selecteds:C,onClose:()=>m(!1),onSuccess:e.onMassEditSuccess}),h&&(0,i.jsx)(RS,{delegationId:s,eventId:o,numberOfSelected:y,organizationId:n,selecteds:C,onClose:()=>g(!1),onSuccess:e.onMassEditSuccess}),p&&(0,i.jsx)(fS,{eventId:o,numberOfSelected:y,selecteds:C,onClose:()=>f(!1),onSuccess:e.onMassEditSuccess}),_&&(0,i.jsx)(_S,{campaigns:e.campaigns,canCreate:!1,delegationId:s,eventId:o,organizationId:n,selecteds:C,onClose:()=>x(!1),onSuccess:e.onMassEditSuccess}),I&&(0,i.jsx)(DA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_sur_d_29974"),text:t("suppression_de_57689",y),onClose:()=>v(!1),onDelete:async()=>{await l({organizationId:n,eventId:o,delegationId:s,selecteds:C,deleteFromEvent:e.deleteFromEvent}),e.onMassEditSuccess()}}),b&&(0,i.jsx)(AS,{eventId:o,isOpen:b,selecteds:C,setIsOpen:j,sort:e.sort})]})},DS=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)(e.selectedSlotsIds),[s,r]=(0,V.useState)(e.selectedProfilesIds),[a,l]=(0,V.useState)(e.rendering),[d,c]=(0,V.useState)(e.showAccreditations),[u,m]=(0,V.useState)(e.showProfiles),[h,g]=(0,V.useState)(e.showQuota);return(0,i.jsxs)(rd,{direction:"column",onChange:Gd,children:[(0,i.jsxs)(rd,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(Zm,{value:d,onChange:c,children:t("afficher_les_ac_56952")}),d&&(0,i.jsx)(Uu,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:n,onChange:o,children:e.accreditationsOptions}),e.accreditationsProfilesOptions&&(0,i.jsx)(Zm,{value:u,onChange:m,children:t("afficher_les_pr_62371")}),e.accreditationsProfilesOptions&&u&&(0,i.jsx)(Uu,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("profils_d_accr_27825"),multiple:!0,renderOnPortal:!0,values:s,onChange:r,children:e.accreditationsProfilesOptions}),(0,i.jsxs)(hh,{label:t("grouper_les_acc_40252"),value:a,onChange:l,children:[(0,i.jsx)("option",{value:xg.Category,children:t("cat_gorie_00291")}),(0,i.jsx)("option",{value:xg.Date,children:t("Date")})]}),!e.hideQuotaOption&&(0,i.jsx)(Zm,{value:h,onChange:g,children:t("afficher_les_qu_20761")})]}),(0,i.jsxs)(rd,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{e.reset(),e.close()},children:t("r_initialiser_77538")}),(0,i.jsx)(kd,{size:"sm",onClick:()=>{e.setShowAccreditations(d),e.setSelectedSlotsIds(n),e.setShowProfiles(u),e.setSelectedProfilesIds(s),e.setRendering(a),e.hideQuotaOption||e.setShowQuota(h),e.close()},children:t("appliquer_05753")})]})]})};function zS(e){const t=$S(e);return(0,cm.A)((0,Xh.A)(e,e=>e.accreditationCategory.id).map(e=>({...e.accreditationCategory,accreditations:t.filter(t=>t.accreditationCategory.id===e.accreditationCategory.id)})),e=>m(e.name))}function $S(e){return _g((0,Xh.A)(e,e=>e.accreditation.id).map(t=>({...t.accreditation,accreditationCategory:t.accreditationCategory,slots:Hg(e.filter(e=>e.accreditation.id===t.accreditation.id))})))}function PS(e){return(0,cm.A)((0,Xh.A)(e.map(e=>e.accreditationProfileCategory),e=>e.id),e=>m(e.name)).map(t=>(0,i.jsx)("optgroup",{label:t.name,children:(0,cm.A)(e.filter(e=>e.accreditationProfileCategory.id===t.id),e=>m(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},t.id))}function MS(e,t){return e.flatMap(e=>{const n=e.slots.map(e=>e.id),i=Vs(t)?e.slots.length:(0,Pu.A)(n,t).length;return 0===i?[]:[{...e,numberOfSlots:i}]})}function FS(e,t,n){const i=e.flatMap(e=>e.slots.filter(e=>Vs(t)||t.includes(e.id)));return n===xg.Category?i:(0,cm.A)(i,e=>e.date?.isValid?e.date.toMillis():Number.POSITIVE_INFINITY)}const NS=e=>{const{translate:t}=bd(),n=V.useRef(null),o=Ei(Cm),s=Ei(lI),r=(0,V.useMemo)(()=>(0,Xh.A)((0,cm.A)(e.slots.flatMap(e=>e.date?.isValid?[e.date]:[]),e=>e.toMillis()),e=>e.toMillis()),[e.filteredAccreditations]),a=(0,V.useMemo)(()=>(0,Bu.A)((0,Vu.A)(e.slots,e=>e.date?.isValid?e.date.toMillis():"nodate"),e=>e.length),[e.slots]),l=(0,V.useMemo)(()=>Kg(o,e.allCategories),[o,e.allCategories]),d=(0,V.useMemo)(()=>Bs(e.allAccreditationsProfiles)?PS(e.allAccreditationsProfiles):null,[e.allAccreditationsProfiles]),[c,u]=(0,V.useState)(!1),m=(0,V.useCallback)(()=>{e.setShowAccreditations(!0),e.setSelectedSlotsIds([]),e.setShowProfiles(!0),e.setSelectedProfilesIds([]),e.setRendering(xg.Category),e.hideQuotaOption||e.setShowQuota(!1)},[e.hideQuotaOption,e.setRendering,e.setSelectedProfilesIds,e.setSelectedSlotsIds,e.setShowAccreditations,e.setShowProfiles,e.setShowQuota]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{ref:n,css:{background:"white",border:"1px solid $gray200"},children:[(0,i.jsxs)(rd,{css:{width:"calc(2 * $cellWidth)"},direction:"column",children:[(0,i.jsx)(rd,{align:"center",css:{borderBottom:"1px solid $gray200",borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},gap:"3",width:1,children:!e.hideOptions&&(0,i.jsxs)(nu,{doNotCloseOnOtherOpen:!0,isOpen:c,onStateChange:u,children:[(0,i.jsx)(du,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"bars-filter",size:"sm",children:t("filtres_64574")})})}),(0,i.jsx)(lu,{placement:"bottom-start",width:385,children:(0,i.jsx)(DS,{accreditationsOptions:l,accreditationsProfilesOptions:d,close:()=>u(!1),hideQuotaOption:e.hideQuotaOption,rendering:e.rendering,reset:m,selectedProfilesIds:e.selectedProfilesIds,selectedSlotsIds:e.selectedSlotsIds,setRendering:e.setRendering,setSelectedProfilesIds:e.setSelectedProfilesIds,setSelectedSlotsIds:e.setSelectedSlotsIds,setShowAccreditations:e.setShowAccreditations,setShowProfiles:e.setShowProfiles,setShowQuota:e.setShowQuota,showAccreditations:e.showAccreditations,showProfiles:e.showProfiles,showQuota:e.showQuota})})]})}),(0,i.jsx)(rd,{css:{borderRight:"1px solid $gray200",height:"$cellHeightSm"},width:1,onClick:()=>{n.current?.requestFullscreen()}}),e.showQuota&&(0,i.jsx)(rd,{css:{borderRight:"1px solid $gray200",height:"32px"},width:1}),e.data.map(t=>e.renderLeftColumn(t))]}),(0,i.jsx)(rd,{css:{flex:"1",overflowX:"auto"},children:(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsxs)(rd,{css:{borderBottom:"1px solid $gray200",height:"$cellHeightSm"},children:[Bs(e.accreditationsProfiles)&&(0,i.jsx)(rd,{css:{background:"$gray700",borderRight:"1px solid $gray200",color:"white",fontSize:"$textSm",fontWeight:"$medium",px:"$4",textAlign:"center",textTransform:"uppercase",width:`calc(${e.accreditationsProfiles.length} * ${e.cellWidth}px)`},direction:"column",height:1,justify:"center",children:t("profils_09110")}),e.rendering===xg.Category&&e.filteredAccreditations.map(t=>{const n=g(t.acronym)?t.acronym:t.name;return(0,i.jsxs)(rd,{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)(ka,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:n,width:1,children:n}),(0,i.jsx)(ka,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:t.accreditationCategory.name,width:1,children:t.accreditationCategory.name})]},t.id)}),e.rendering===xg.Date&&r.map(t=>{const n=t.toMillis(),s=a[n],r=o.toLocaleString(t,zs.DateOnly.MonthLong);return(0,i.jsx)(rd,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`calc(${s} * ${e.cellWidth}px)`},direction:"column",height:1,justify:"center",children:(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:r,width:1,children:r})},n)}),e.rendering===xg.Date&&(a.nodate??0)>0&&(0,i.jsx)(rd,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`calc(${a.nodate} * ${e.cellWidth}px)`},direction:"column",height:1,justify:"center",children:(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",width:1,children:"-"})})]}),(0,i.jsxs)(rd,{css:{height:"$cellHeightSm"},children:[e.accreditationsProfiles.map(t=>(0,i.jsxs)(rd,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`${e.cellWidth}px`},direction:"column",height:1,justify:"center",children:[(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:t.name,width:1,children:t.name}),(0,i.jsx)(ka,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:t.accreditationProfileCategory.name,width:1,children:t.accreditationProfileCategory.name})]},t.id)),e.slots.map(t=>{const n=e.rendering===xg.Category?t.name||"-":g(t.accreditation.acronym)?t.accreditation.acronym:t.accreditation.name,s=t.date?.isValid?o.toLocaleString(t.date,zs.DateOnly.Numeric):"-";return(0,i.jsxs)(rd,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`${e.cellWidth}px`},direction:"column",height:1,justify:"center",children:[(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:n,width:1,children:n}),e.rendering===xg.Category&&(0,i.jsx)(ka,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:s,width:1,children:s}),e.rendering===xg.Date&&(0,i.jsx)(ka,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:t.accreditationCategory.name,width:1,children:t.accreditationCategory.name})]},t.id)})]}),e.showQuota&&(0,i.jsxs)(rd,{height:32,children:[e.accreditationsProfiles.map(n=>{const o=n.maxResources??Number.POSITIVE_INFINITY,r=n.assignedResources/o;return(0,i.jsx)(rd,{align:"center",css:{borderRight:"1px solid $gray200",width:`${e.cellWidth}px`},height:1,justify:"center",children:(0,i.jsx)(vu,{color:xu(r,{higherIsBetter:!1}),size:"sm",children:t("_1_2_membres_04485",n.assignedResources,s.toNumberOrInfinity(o))})},n.id)}),e.slots.map(n=>{const o=n.maxResources??Number.POSITIVE_INFINITY,r=n.assignedResources/o;return(0,i.jsx)(rd,{align:"center",css:{borderRight:"1px solid $gray200",width:`${e.cellWidth}px`},height:1,justify:"center",children:(0,i.jsx)(vu,{color:xu(r,{higherIsBetter:!1}),size:"sm",children:t("_1_2_membres_04485",n.assignedResources,s.toNumberOrInfinity(o))})},n.id)})]}),e.data.map(t=>e.renderRow(t))]})})]}),(0,i.jsx)(lm,{children:(0,i.jsx)(rm,{limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,setLimit:e.setLimit,setOffset:e.setOffset,showLimits:!0,totalCount:e.totalCount})})]})},LS=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.isAutoAccredit?[e.accreditationSlotId]:[]),[e.vr]),o=(0,V.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.isAutoAccredit?[]:[e.accreditationSlotId]),[e.vr]),s=(0,V.useMemo)(()=>(e.vr.matrixWishedSlots||[]).map(e=>e.id),[e.vr]),r=(0,V.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.checkInAt?.isValid?[e.accreditationSlotId]:[]),[e.vr]),a=(0,V.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.accreditationProfileId?[e.accreditationSlotId]:[]),[e.vr]);return(0,i.jsxs)(rd,{css:{borderTop:"1px solid $gray200",height:"$cellHeightSm"},children:[e.accreditationsProfiles.map(n=>{const o=e.vr.accreditationProfileId===n.id,s=e.vr.wishedAccreditationProfileId===n.id,r=e.isEditMode&&("assigned"===e.editMode&&o||"wished"===e.editMode&&s),a=e.isEditMode&&("assigned"===e.editMode&&!o||"wished"===e.editMode&&!s);return(0,i.jsxs)(rd,{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:[r&&(0,i.jsx)(rd,{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.deleteAccreditationProfile(e.vr.userInfo.id,n.id),e.reloadRow(e.vr.id)},children:(0,i.jsx)(Id,{icon:"trash-can"})}),a&&(0,i.jsx)(rd,{align:"center",className:"h-accreditations-matrix-edit-cell",css:{background:"$primary100",bd:"primary500 1",color:"$primary500",cursor:"pointer"},height:1,justify:"center",width:1,onClick:async()=>{await e.addAccreditationProfile(e.vr.userInfo.id,n.id),e.reloadRow(e.vr.id)},children:(0,i.jsx)(Id,{icon:"plus"})}),o?(0,i.jsx)(rd,{align:"center",className:a||r?"h-accreditations-matrix-cell":"",css:{background:"$success200",bd:"success500 1",color:"$success700",fontSize:"$textMd"},height:1,justify:"center",width:1,children:(0,i.jsx)(Id,{icon:"check"})}):s?(0,i.jsx)(rd,{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)(ka,{font:"gray800 textXs medium",children:t("souhait_19593")})}):null]},n.id)}),e.slots.map(l=>{const d=n.includes(l.id),c=o.includes(l.id),u=s.includes(l.id),m=a.includes(l.id),h=e.isEditMode&&!l.isBlocked&&!m&&(e.canDeleteCheckedIn||!r.includes(l.id))&&("assigned"===e.editMode&&(d||c)||"wished"===e.editMode&&u),g=e.isEditMode&&!l.isBlocked&&("assigned"===e.editMode&&!d&&!c||"wished"===e.editMode&&!u);return(0,i.jsxs)(rd,{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:[h&&(0,i.jsx)(rd,{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,l.id),e.reloadRow(e.vr.id)},children:(0,i.jsx)(Id,{icon:"trash-can"})}),g&&(0,i.jsx)(rd,{align:"center",className:"h-accreditations-matrix-edit-cell",css:{background:"$primary100",bd:"primary500 1",color:"$primary500",cursor:"pointer"},height:1,justify:"center",width:1,onClick:async()=>{await e.addAccreditationSlot(e.vr.userInfo.id,l.id),e.reloadRow(e.vr.id)},children:(0,i.jsx)(Id,{icon:"plus"})}),d||c?(0,i.jsx)(rd,{align:"center",className:g||h?"h-accreditations-matrix-cell":"",css:{background:"$success200",bd:"success500 1",color:"$success700",fontSize:"$textMd"},height:1,justify:"center",width:1,children:(0,i.jsx)(Id,{icon:m?"layer-group":d?"bolt-auto":"check"})}):u?(0,i.jsx)(rd,{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)(ka,{font:"gray800 textXs medium",children:t("souhait_e_52100")})}):null]},l.id)})]})},BS=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>zS(e.allAccreditationsSlots),[e.allAccreditationsSlots]),o=(0,V.useMemo)(()=>$S(e.allAccreditationsSlots),[e.allAccreditationsSlots]),s=(0,V.useMemo)(()=>e.showAccreditations?MS(o,e.selectedSlotsIds):[],[o,e.selectedSlotsIds,e.showAccreditations]),r=(0,V.useMemo)(()=>FS(s,e.selectedSlotsIds,e.rendering),[s,e.selectedSlotsIds,e.rendering]),a=(0,V.useMemo)(()=>(0,cm.A)(e.allAccreditationsProfiles.filter(t=>e.showProfiles&&(Vs(e.selectedProfilesIds)||e.selectedProfilesIds.includes(t.id))),e=>[m(e.accreditationProfileCategory.name),m(e.name)]),[e.allAccreditationsProfiles,e.selectedProfilesIds,e.showProfiles]),l=(0,V.useCallback)(t=>e.isRowLoading(t.id)?(0,i.jsx)(fm,{css:{border:"none",borderTop:"1px solid $gray200",height:"$cellHeightSm"}},t.userInfo.id):(0,i.jsx)(LS,{accreditationsProfiles:a,addAccreditationProfile:e.addAccreditationProfile,addAccreditationSlot:e.addAccreditationSlot,canDeleteCheckedIn:e.canDeleteCheckedIn,deleteAccreditationProfile:e.deleteAccreditationProfile,deleteAccreditationSlot:e.deleteAccreditationSlot,editMode:e.editMode,isEditMode:e.isEditMode,reloadRow:e.reloadRow,slots:r,vr:t},t.userInfo.id),[e.addAccreditationProfile,e.addAccreditationSlot,e.deleteAccreditationProfile,e.deleteAccreditationSlot,e.editMode,e.isEditMode,e.isRowLoading,e.reloadRow,a,r]);return(0,i.jsx)(rd,{direction:"column",width:1,children:e.isLoading?(0,i.jsx)(Cd,{}):Vs(e.members)||Vs(s)&&Vs(a)?(0,i.jsx)(rd,{css:{background:"white",border:"1px solid $gray200"},height:400,children:Vs(e.members)?(0,i.jsx)(pA,{imageSrc:wc.Blanks.Member,title:t("aucun_membre_ne_07054")}):Bs(e.selectedSlotsIds)||Bs(e.selectedProfilesIds)||!e.showAccreditations||!e.showProfiles?(0,i.jsx)(rd,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(kd,{color:"white",leftIcon:"broom-wide",onClick:()=>{e.setShowAccreditations(!0),e.setSelectedSlotsIds([]),e.setShowProfiles(!0),e.setSelectedProfilesIds([])},children:t("remettre_les_fi_83263")})}):(0,i.jsx)(pA,{imageSrc:wc.Blanks.Accreditation,title:t("aucune_accr_dit_97505")})}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(NS,{accreditationsProfiles:a,allAccreditations:o,allAccreditationsProfiles:e.allAccreditationsProfiles,allCategories:n,cellWidth:120,data:e.members,filteredAccreditations:s,hideOptions:e.hideOptions,limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,renderLeftColumn:t=>(0,i.jsx)(rd,{css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},width:1,children:(0,i.jsx)(ub,{isClickDisabled:!!e.getInformationPanelPath,size:32,userInfo:t.userInfo})},t.userInfo.id),renderRow:l,rendering:e.rendering,selectedProfilesIds:e.selectedProfilesIds,selectedSlotsIds:e.selectedSlotsIds,setLimit:e.setLimit,setOffset:e.setOffset,setRendering:e.setRendering,setSelectedProfilesIds:e.setSelectedProfilesIds,setSelectedSlotsIds:e.setSelectedSlotsIds,setShowAccreditations:e.setShowAccreditations,setShowProfiles:e.setShowProfiles,setShowQuota:e.setShowQuota,showAccreditations:e.showAccreditations,showProfiles:e.showProfiles,showQuota:e.showQuota,slots:r,totalCount:e.totalCount})})})},VS=e=>{const{params:{organizationId:t,eventId:n,delegationId:o}}=bd(),{data:s,idToLoading:r,isEditMode:a,isLoading:l,limit:d,numberOfPages:c,offset:u,reloadRow:m,setLimit:h,setOffset:g,totalCount:p}=ip(),{mutate:f}=da(),{mutate:_}=ca(),{data:x,isLoading:I,reload:v}=Oi("query DelegationMembersAccreditationsMatrix($eventId: EventId!, $delegationId: DelegationId!) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationsProfiles {\n assignedResources\n maxResources\n\n accreditationProfile {\n ...AccreditationProfileMatrix\n }\n }\n\n allAccreditationsSlots(onlyVisible: true) {\n assignedResources\n maxResources\n\n accreditationSlot {\n ...AccreditationSlotMatrix\n }\n }\n }\n }\n}\n",{eventId:n,delegationId:o},[js.AccreditationProfileMatrixFragment,js.AccreditationSlotMatrixFragment]),b=(0,V.useMemo)(()=>(x.event?.delegation.allAccreditationsSlots??[]).map(e=>({...e.accreditationSlot,assignedResources:e.assignedResources,maxResources:e.maxResources})),[x]),j=(0,V.useMemo)(()=>(x.event?.delegation.accreditationsProfiles??[]).map(e=>({...e.accreditationProfile,assignedResources:e.assignedResources,maxResources:e.maxResources})),[x]),C=(0,V.useCallback)(e=>r[e]??!1,[r]),y=(0,V.useCallback)(async(i,s)=>{await _({organizationId:t,eventId:n,delegationId:o,massProfileUpdate:{accreditationProfileId:s,selecteds:{ids:[i]},strategy:yt.Replace}}),e.matrixShowQuota&&v()},[v,o,n,_,t,e.matrixShowQuota]),A=(0,V.useCallback)(async(i,s)=>{await f({organizationId:t,eventId:n,delegationId:o,massAccredit:{accreditationsSlotsIds:[s],selecteds:{ids:[i]},strategy:yt.Add}}),e.matrixShowQuota&&v()},[v,o,n,f,t,e.matrixShowQuota]),S=(0,V.useCallback)(async(i,s)=>{await _({organizationId:t,eventId:n,delegationId:o,massProfileUpdate:{accreditationProfileId:s,selecteds:{ids:[i]},strategy:yt.Delete}}),e.matrixShowQuota&&v()},[v,o,n,_,t,e.matrixShowQuota]),k=(0,V.useCallback)(async(i,s)=>{await f({organizationId:t,eventId:n,delegationId:o,massAccredit:{accreditationsSlotsIds:[s],selecteds:{ids:[i]},strategy:yt.Delete}}),e.matrixShowQuota&&v()},[v,o,n,f,t,e.matrixShowQuota]);return(0,i.jsx)(BS,{addAccreditationProfile:y,addAccreditationSlot:A,allAccreditationsProfiles:j,allAccreditationsSlots:b,canDeleteCheckedIn:!1,deleteAccreditationProfile:S,deleteAccreditationSlot:k,editMode:"wished",getInformationPanelPath:e.getInformationPanelPath,hideOptions:e.hideOptions,isEditMode:a,isLoading:l||I,isRowLoading:C,limit:d,members:s,numberOfPages:c,offset:u,reloadRow:m,rendering:e.matrixRendering,selectedProfilesIds:e.selectedProfilesIds,selectedSlotsIds:e.selectedSlotsIds,setLimit:h,setOffset:g,setRendering:e.setMatrixRendering,setSelectedProfilesIds:e.setSelectedProfilesIds,setSelectedSlotsIds:e.setSelectedSlotsIds,setShowAccreditations:e.setMatrixShowAccreditations,setShowProfiles:e.setMatrixShowProfiles,setShowQuota:e.setMatrixShowQuota,showAccreditations:e.matrixShowAccreditations,showProfiles:e.matrixShowProfiles,showQuota:e.matrixShowQuota,totalCount:p})},US=e=>{const{translate:t,params:{organizationId:n,eventId:o,delegationId:s}}=bd(),r=Ei(Fg),a=Mi(),[l,d,c]=bC(e.delegationsSpaceLayoutTab,e=>e.infos?.columns??[],n,"eventDelegationMembers.columns",e.columns),u=(0,V.useMemo)(()=>e.canEditColumns||e.delegationsSpaceLayoutTab?l:e.columns,[l,e.canEditColumns,e.columns,e.delegationsSpaceLayoutTab]),[m,h,g]=vC(n,"eventDelegationMembers.limit",em),[p,f,_]=vC(n,"eventDelegationMembers.predicates",[]),x=(0,V.useMemo)(()=>e.delegationsSpaceLayoutTab?.rendering===Cg.List&&Bs(e.delegationsSpaceLayoutTab?.infos?.accreditationsSlotsIds)?[{slug:"accreditationSlotId",operator:we.Is,value:e.delegationsSpaceLayoutTab.infos.accreditationsSlotsIds}]:p,[e.delegationsSpaceLayoutTab,p]),[I,v,b]=bC(e.delegationsSpaceLayoutTab,e=>e.rendering,n,"eventDelegationMembers.rendering",Cg.List),[j,C,y]=bC(e.delegationsSpaceLayoutTab,e=>e.infos?.matrixRendering||xg.Category,n,"eventDelegationMembers.matrixRendering",xg.Category),[A,S,k]=bC(e.delegationsSpaceLayoutTab,e=>e.infos?.accreditationsSlotsIds||[],n,"eventDelegationMembers.selectedSlotsIds",[]),[w,E,T]=bC(e.delegationsSpaceLayoutTab,e=>e.infos?.accreditationsProfilesIds||[],n,"eventDelegationMembers.selectedProfilesIds",[]),[R,O,D]=bC(e.delegationsSpaceLayoutTab,e=>e.infos?.matrixShowAccreditations??!0,n,"eventDelegationMembers.matrixShowAccreditations",!0),[z,$,P]=bC(e.delegationsSpaceLayoutTab,e=>e.infos?.matrixShowProfiles??!0,n,"eventDelegationMembers.matrixShowProfiles",!0),[M,N,L]=bC(e.delegationsSpaceLayoutTab,e=>e.infos?.matrixShowQuota??!1,n,"eventDelegationMembers.matrixShowQuota",!1),[B,U,W]=vC(n,"eventDelegationMembers.sort",null),{data:G,isLoading:q}=Oi("query EventDelegationMembersInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n $privacy: CustomFieldPrivacy!\n) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(eventId: $eventId, 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 id\n numberOfDelegationsAccreditationsSlots\n numberOfDelegationsAccreditationsProfiles\n\n accreditationsSlots(onlyDefault: true, onlyHidden: true) {\n accreditationSlotId\n }\n\n columnsCustomFields {\n ...SegmentCustomField\n }\n\n form {\n id\n positionDisplay\n slotDisplay\n\n elements {\n customField {\n ...SegmentCustomField\n }\n }\n }\n }\n }\n}\n",{organizationId:n,eventId:o,delegationId:s,privacy:e.customFieldsPrivacy},[js.SegmentCustomFieldFragment,js.CustomDocumentPopulationFragment]);const H=c||g||_||b||y||k||T||D||P||L||W||q,K=(0,V.useMemo)(()=>e.customFieldsPrivacy===Re.All?G.organization?.customFields.nodes??[]:(0,Xh.A)((0,hd.A)((G.event?.delegation.form.elements.map(e=>e.customField)||[]).concat(G.event?.delegation.columnsCustomFields||[])),e=>e.slug),[e.customFieldsPrivacy,G.organization,G.event]),Y=jC(K),Z=(0,V.useMemo)(()=>G.event?r.getDelegationMembersFilters(n,o,K,G.event,G.event.delegation.form,G.event.isWeezeventConnected):[],[o,K,G.event]),X=(0,V.useMemo)(()=>G.event?r.getDelegationMembersPossibleColumns(n,K,{forDelegationsSpace:e.forDelegationsSpace,isWeezeventConnected:G.event.isWeezeventConnected,positionDisplay:G.event.delegation.form.positionDisplay,slotDisplay:G.event.delegation.form.slotDisplay}):[],[e.forDelegationsSpace,n,K,G.event]),J=(0,V.useMemo)(()=>(G.event?.delegation.accreditationsSlots??[]).map(e=>e.accreditationSlotId),[G.event]),Q=(0,V.useMemo)(()=>"function"==typeof e.showEditMode?e.showEditMode(I):e.showEditMode,[e.showEditMode,I]),ee=(0,V.useMemo)(()=>Vs(e.delegationsSpaceLayoutTab?.infos?.accreditationsSlotsIds||[]),[e.delegationsSpaceLayoutTab]),te=(0,V.useMemo)(()=>Vs(e.delegationsSpaceLayoutTab?.infos?.accreditationsSlotsIds||[]),[e.delegationsSpaceLayoutTab]),ne=(0,V.useMemo)(()=>e.delegationsSpaceLayoutTab?void 0:[Cg.List,Cg.AccreditationsMatrix],[e.delegationsSpaceLayoutTab]),ie=3695!==n&&(G.event?.delegation.numberOfDelegationsAccreditationsSlots??0)>0,oe=(G.event?.delegation.numberOfDelegationsAccreditationsProfiles??0)>0,se=window.location.origin===F.HEAVENT_PUBLIC_URL.origin?t=>`${window.location.origin}${qo.DELEGATION_MEMBER_INFORMATION({organizationId:n,eventId:o,delegationId:s,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:t.userInfo.id})}`:void 0;return(0,V.useEffect)(()=>{a.setItem(tc.DELEGATIONS_SPACE_TAB,"members")},[]),H?(0,i.jsx)(Cd,{}):(0,i.jsx)(up,{columns:u,columnsSearch:[],columnsToIncludes:Mg,eventId:o,filters:Z,getMassActionId:e=>e.userInfo.id,limit:m,loadDataList:aa,loadDataListParams:{delegationId:s,onlyVisibleAccreditationsSlots:e.onlyVisibleAccreditationsSlots,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:sa,loadRowParams:{delegationId:s,onlyVisibleAccreditationsSlots:e.onlyVisibleAccreditationsSlots,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:n,possibleColumns:X,possibleRenderings:ne,predicates:x,renderActions:(t,n,o)=>(0,i.jsx)(OS,{campaigns:e.campaigns,canMemberEdit:e.canMemberEdit,customFields:K,deleteFromEvent:e.deleteFromEvent,massActions:t,predicates:x,scope:{delegationId:s},showAccreditationsEdit:e.showAccreditationsEdit,showAccreditationsValidate:e.showAccreditationsValidate,showDelete:e.canMemberDelete,showPrint:e.showPrint,showWishedAccreditationsEdit:ie,showWishedProfileEdit:oe,sort:B,totalCount:n,onMassEditSuccess:o}),renderAllSelectedText:e=>t("les_1_membres_71180",e),renderPageSelectedText:e=>t("les_1_membres_00895",e),renderSelectAllText:e=>t("s_lectionner_le_45277",e),rendering:I,setColumns:d,setLimit:h,setPredicates:f,setRendering:v,setSort:U,showEditColumns:I===Cg.List&&e.canEditColumns,showEditMode:Q,showFilters:ee,showMassActions:e.canMemberEdit||e.canMemberAccredit,showPredicatesBadges:te,showRowDropdown:!0,showRowEdit:e.canMemberEdit,showSearchColumns:!1,showSelectAll:!0,sort:B,children:I===Cg.AccreditationsMatrix?(0,i.jsx)(VS,{getInformationPanelPath:se,hideOptions:!!e.delegationsSpaceLayoutTab,matrixRendering:j,matrixShowAccreditations:R,matrixShowProfiles:z,matrixShowQuota:M,selectedProfilesIds:w,selectedSlotsIds:A,setMatrixRendering:C,setMatrixShowAccreditations:O,setMatrixShowProfiles:$,setMatrixShowQuota:N,setSelectedProfilesIds:E,setSelectedSlotsIds:S}):(0,i.jsx)(yp,{getEditPath:e.getEditPath,renderCell:(t,r,a)=>(0,i.jsx)(Uy,{accreditationsPanelPath:qo.DELEGATION_MEMBER_ACCREDITATIONS({organizationId:n,eventId:o,delegationId:s,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:r.userInfo.id}),availabilitiesPanelPath:qo.DELEGATION_MEMBER_AVAILABILITIES({organizationId:n,eventId:o,delegationId:s,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:r.userInfo.id}),canChangeDelegation:!1,canMemberAccredit:e.canMemberAccredit,canMemberAssign:!1,column:t,customField:Y.get(t.slug),eventId:o,informationPanelPath:se?.(r),positionsPanelPath:qo.DELEGATION_MEMBER_POSITIONS({organizationId:n,eventId:o,delegationId:s,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:r.userInfo.id}),reloadRow:a,row:r}),renderRowDropdown:(t,n)=>(0,i.jsx)(NA,{accreditationState:t.accreditationState,allowedCustomDocuments:e.customBadges,canDelete:e.canMemberDelete&&t.canDelete,canDuplicate:e.canDuplicateMembers,canMemberAccredit:e.canMemberAccredit,customDocuments:G.event?.customDocuments??[],deleteFromEvent:e.deleteFromEvent,member:t.userInfo,reload:n,showDeleteFromEvent:e.showDeleteFromEvent,showDocumentsDownload:e.showDocumentsDownload,volunteerRegistrationId:t.id}),renderRowPanels:(t,r)=>(0,i.jsx)(OA,{accreditationsPanelPath:qo.DELEGATION_MEMBER_ACCREDITATIONS({organizationId:n,eventId:o,delegationId:s,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:t.userInfo.id}),availabilitiesPanelPath:qo.DELEGATION_MEMBER_AVAILABILITIES({organizationId:n,eventId:o,delegationId:s,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:t.userInfo.id}),canCheckIn:!1,canDeleteCheckedIn:!1,canDeletePosition:()=>!1,canMemberAccredit:e.canMemberAccredit,canWishedAccreditationsEdit:!0,defaultHiddenAccreditationsSlotsIds:J,delegation:G.event.delegation,eventId:o,informationPanelPath:qo.DELEGATION_MEMBER_INFORMATION({organizationId:n,eventId:o,delegationId:s,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:t.userInfo.id}),organizationId:n,positionsPanelPath:qo.DELEGATION_MEMBER_POSITIONS({organizationId:n,eventId:o,delegationId:s,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:t.userInfo.id}),reloadRow:r,returnPathFallback:e.delegationsSpaceLayoutTab?qo.DELEGATION_TAB({organizationId:n,eventId:o,slug:e.delegationsSpaceLayoutTab?.slug,delegationId:s}):qo.DELEGATION_MEMBERS({organizationId:n,eventId:o,delegationId:s}),volunteerRegistration:t})})})};function WS(e){return{includeComments:e.includes("comments"),includeDelegations:e.includes("delegations")||e.includes("delegations_categories"),includeEmails:e.includes("campaigns_states"),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 GS=class extends Um{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(e),{slug:"tag",name:this.t("Tag"),category:this.t("autres_99130"),fieldType:Zt.Select,needLoading:!0,organizationId:e,tagContext:Fe.UsersInfos},{slug:"sameEmail",name:this.t("nombre_de_profi_42316"),category:this.t("autres_99130"),fieldType:Zt.Number,hideEmpty:!0},{slug:"segments",name:this.t("fait_partie_de_44650"),category:this.t("autres_99130"),fieldType:Zt.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:Zt.Checkbox},{slug:"isLeader",name:this.t("est_responsable_27270"),category:this.t("autres_99130"),fieldType:Zt.Checkbox},{slug:"roles",name:this.t("r_les_61679"),category:this.t("autres_99130"),fieldType:Zt.Select,needLoading:!0,organizationId:e}]}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:sn.InsertedAt,width:230},{slug:"last_seen_at",name:this.t("date_de_derni_r_38795"),isSortable:!0,sortAttribute:sn.LastSeenAt,width:230},{slug:"campaigns_states",name:this.t("statut_des_camp_25280"),minWidth:320},{slug:"tags",name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:"comments",name:this.t("commentaires_96492"),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:sn.Name,minWidth:240},{slug:"email",name:this.t("e_mail_du_membr_69509"),isSearchable:!0,isSortable:!0,sortAttribute:sn.Email,minWidth:180},{slug:"id",name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:sn.Id,width:100},{slug:"local_id",name:this.t("id_sur_l_organi_45566"),isSearchable:!0,isSortable:!0,sortAttribute:sn.LocalId,width:100}]}getBaseFilters(e){return[{slug:"email",name:this.t("Email"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Text},{slug:"registrationDate",name:this.t("date_d_inscript_31369"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Date,hideEmpty:!0},{slug:"id",name:this.t("id_51738"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Number,hideEmpty:!0},{slug:"local_id",name:this.t("id_sur_l_organi_45566"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Number,hideEmpty:!0},{slug:"lastSeenAt",name:this.t("date_de_derni_r_38795"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Datetime},...this.customFieldsToFilters(e)]}getEventsFilters(e){return[{slug:"event",name:this.t("_v_nement_22345"),category:this.t("Event"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"numberOfEvents",name:this.t("nombre_d_v_nem_14214"),category:this.t("Event"),fieldType:Zt.Number,hideEmpty:!0}]}getFormsFilters(e){return[{slug:"forms",name:this.t("formulaires_rem_62495"),category:this.t("Form_plural"),fieldType:Zt.Select,needLoading:!0,organizationId:e},{slug:"formsInsertedAt",name:this.t("dates_de_rempli_65075"),category:this.t("Form_plural"),fieldType:Zt.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:Zt.Text,hideEmpty:!0},{slug:"positionCategoryName",name:this.t("nom_de_la_cat_g_57279"),category:this.t("missions_63972"),fieldType:Zt.Text,hideEmpty:!0},{slug:"numberOfAssignments",name:this.t("nombre_d_affect_31455"),category:this.t("missions_63972"),fieldType:Zt.Number,hideEmpty:!0}]}getDelegationsFilters(e){return[{slug:"delegation",name:this.t("fait_partie_de_32196"),category:this.t("d_l_gations_78318"),fieldType:Zt.Select,needLoading:!0,organizationId:e},{slug:"delegationCategory",name:this.t("inscrit_via_la_12241"),category:this.t("d_l_gations_78318"),fieldType:Zt.Select,needLoading:!0,organizationId:e},{slug:"isDelegationLeader",name:this.t("est_responsable_87662"),category:this.t("d_l_gations_78318"),fieldType:Zt.Checkbox}]}getEmailsFilters(e){return[{slug:"campaign",name:this.t("campagne_97871"),category:this.t("e_mails_09850"),fieldType:Zt.Campaign,needLoading:!0,organizationId:e},{slug:"emailBlacklist",name:this.t("ne_souhaite_plu_08853"),category:this.t("e_mails_09850"),fieldType:Zt.Checkbox,hideEmpty:!0}]}getCommentsFilters(e){return[{slug:"comments",name:this.t("commentaires_96492"),category:this.t("commentaires_96492"),fieldType:Zt.Text},{slug:"lastCommentAt",name:this.t("date_du_dernier_73554"),category:this.t("commentaires_96492"),fieldType:Zt.Date,hideEmpty:!0},{slug:"commentWrittenBy",name:this.t("commentaire_cr_96610"),category:this.t("commentaires_96492"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,organizationId:e}]}};GS=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mm,Cm,Si])],GS);const qS=e=>{const{history:t,params:{organizationId:n}}=bd(),o=(0,V.useMemo)(()=>(e.user.events||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name,onClick(){t.push(So.EVENT({organizationId:n,eventId:e.id}))}})),[e.user]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:o})})},HS=e=>{const{translate:t,params:{organizationId:n}}=bd(),o=Ei(Cm),{mutate:s}=Nr(),r=(0,V.useCallback)((t,i)=>s({organizationId:n,userInfoId:e.row.id,slug:i,value:t}),[e.row,s]),a=(0,V.useMemo)(()=>(e.row.formsUsersInfos||[]).flatMap(e=>e.form?[{id:e.form.id,color:"gray",icon:null,text:e.form.name}]:[]),[e.row.formsUsersInfos]),l=(0,V.useMemo)(()=>(e.row.formsUsersInfos||[]).flatMap(e=>e.form?[`${e.form.name} : ${o.toLocaleString(e.insertedAt.toLocal(),zs.DateTime)}`]:[]).join(", "),[e.row.formsUsersInfos]),d=(0,V.useMemo)(()=>(e.row.delegations||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.row.delegations]),c=(0,V.useMemo)(()=>(0,Xh.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]),u=(0,V.useMemo)(()=>(e.row.emails??[]).map(e=>{const{color:n,leftIcon:i}=mb(e.state);return{id:e.id,color:n,icon:i,text:`${e.campaign?.name??""} - ${t(e.state)}`}}),[e.row.emails]),m=(0,V.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)(ZC,{clickPath:e.informationPanelPath,column:e.column,mutate:r,reload:e.reloadRow,updatable:e.updatable,userInfo:e.row}):"id"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):"local_id"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.localId}):"email"===e.column.slug?(0,i.jsx)(YC,{clickPath:e.informationPanelPath??bx.MEMBER_INFORMATION({organizationId:n,userInfoId:e.row.id}),column:e.column,reload:e.reloadRow,updatable:e.updatable,userInfo:e.row}):"events"===e.column.slug?(0,i.jsx)(qS,{column:e.column,user:e.row}):"number_of_events"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.events?.length??0}):"forms"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:a})}):"forms_inserted_at"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:l,children:l})}):"delegations"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:d})}):"delegations_categories"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:c})}):"inserted_at"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:o.toLocaleString(e.row.insertedAt.toLocal(),zs.DateTime)}):"last_seen_at"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.lastSeenAt?.isValid?o.toLocaleString(e.row.lastSeenAt.toLocal(),zs.DateTime):""}):"campaigns_states"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:u})}):"tags"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:m})}):"comments"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:Bs(e.row.comments)?e.row.comments.map(e=>e.content).join("; "):""}):"roles"===e.column.slug?(0,i.jsx)(JC,{minWidth:e.column.minWidth,userPermissions:e.row,width:e.column.width}):(0,i.jsx)(KC,{avatarUser:e.row,clickPath:e.informationPanelPath??bx.MEMBER_INFORMATION({organizationId:n,userInfoId:e.row.id}),column:e.column,customField:e.customField,fields:e.row.fields,mutate:r,reload:e.reloadRow,updatable:e.updatable})},KS=e=>{const{params:{organizationId:t}}=bd();return(0,i.jsx)(Ea.dO,{children:e.informationPanelPath&&e.delegation&&(0,i.jsx)(Ea.qh,{path:e.informationPanelPath,children:(0,i.jsx)(rA,{organizationId:t,delegation:e.delegation,userInfoId:e.userInfo.id,returnPathFallback:e.informationPanelPath})})})},YS=e=>{const{translate:t,params:{organizationId:n,delegationId:o}}=bd(),s=Ei(GS),r=Mi(),[a,l,d]=vC(n,"organizationDelegationMembers.columns",e.columns),[c,u,m]=vC(n,"organizationDelegationMembers.limit",em),[h,g,p]=vC(n,"organizationDelegationMembers.predicates",[]),[f,_,x]=vC(n,"organizationDelegationMembers.sort",null),{data:I,isLoading:v}=Oi("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 id\n columnsCustomFields {\n ...SegmentCustomField\n }\n\n form {\n id\n elements {\n customField {\n ...SegmentCustomField\n }\n }\n }\n }\n }\n}\n",{organizationId:n,privacy:e.canCustomFieldRead?Re.All:Re.Public,delegationId:o},[js.SegmentCustomFieldFragment]);const b=d||m||p||x||v,j=(0,V.useMemo)(()=>e.canCustomFieldRead?I.organization?.customFields.nodes??[]:(0,hd.A)((I.organization?.delegation.form.elements.map(e=>e.customField)||[]).concat(I.organization?.delegation.columnsCustomFields??[])),[I.organization]),C=jC(j),y=(0,V.useMemo)(()=>s.getDelegationMembersFilters(j),[j]),A=(0,V.useMemo)(()=>s.getDelegationMembersPossibleColumns(j),[j]);return(0,V.useEffect)(()=>{r.setItem(tc.DELEGATIONS_SPACE_TAB,"members")},[]),b?(0,i.jsx)(Cd,{}):(0,i.jsx)(up,{columns:e.canEditColumns?a:e.columns,columnsSearch:[],columnsToIncludes:WS,eventId:null,filters:y,limit:c,loadDataList:Lr,loadDataListParams:{delegationId:o},loadRow:Fr,organizationId:n,possibleColumns:A,predicates:h,renderActions:(t,n,s)=>(0,i.jsx)(OS,{campaigns:e.campaigns,canMemberEdit:e.canMemberEdit,customFields:j,deleteFromEvent:!1,massActions:t,predicates:h,scope:{delegationId:o},showAccreditationsEdit:!1,showAccreditationsValidate:!1,showDelete:e.canMemberDelete,showPrint:!1,showWishedAccreditationsEdit:!1,showWishedProfileEdit:!1,sort:f,totalCount:n,onMassEditSuccess:s}),renderAllSelectedText:e=>t("les_1_membres_71180",e),renderPageSelectedText:e=>t("les_1_membres_00895",e),renderSelectAllText:e=>t("s_lectionner_le_45277",e),rendering:Cg.List,setColumns:l,setLimit:u,setPredicates:g,setSort:_,showEditColumns:e.canEditColumns,showEditMode:e.showEditMode,showFilters:!0,showMassActions:!0,showPredicatesBadges:!0,showRowDropdown:!0,showRowEdit:e.canMemberEdit,showSearchColumns:!1,showSelectAll:!0,sort:f,children:(0,i.jsx)(yp,{getEditPath:e.getEditPath,renderCell:(t,s,r)=>(0,i.jsx)(HS,{column:t,customField:C.get(t.slug),informationPanelPath:o?`${window.location.origin}${qo.DELEGATION_MEMBER_INFORMATION({organizationId:n,delegationId:o,userInfoId:s.id})}`:void 0,reloadRow:r,row:s,updatable:e.canMemberEdit}),renderRowDropdown:(t,n)=>(0,i.jsx)(NA,{accreditationState:null,allowedCustomDocuments:e.customBadges,canDelete:e.canMemberDelete,canDuplicate:!1,canMemberAccredit:!1,customDocuments:[],deleteFromEvent:!1,member:t,reload:n,showDeleteFromEvent:!1,showDocumentsDownload:e.showDocumentsDownload,volunteerRegistrationId:null}),renderRowPanels:e=>(0,i.jsx)(KS,{delegation:I.organization.delegation,informationPanelPath:qo.DELEGATION_MEMBER_INFORMATION({organizationId:n,delegationId:o,userInfoId:e.id}),userInfo:e})})})},ZS=e=>(0,i.jsx)(rd,{align:"end",css:{background:"gray"===e.background?"$gray50":"none",borderRight:"1px solid $gray200",overflow:"hidden",px:"$4"},direction:"column",height:1,justify:"center",width:1,children:e.children}),XS=(0,V.createContext)({});function JS(){return(0,V.useContext)(XS)}const QS=e=>{const{translate:t}=bd(),n=Ei(lI),{accreditationIdToOpen:o,accreditationIdToValues:s,accreditationKeyToStats:r,accreditationValueKeyToStats:a,dates:l,hasNoDate:d,hasScanned:c,showTotal:u}=JS(),m=r[`a${e.accreditation.id}__no_date`],h=s[e.accreditation.id]||[],g=Bs(h),p=o[e.accreditation.id]??!0,{assignedTotal:f,scannedTotal:_}=(0,V.useMemo)(()=>{const t=(0,hd.A)(l.map(t=>r[`a${e.accreditation.id}__${t.toSQLDate()}`]));return{assignedTotal:(0,_f.A)(t,e=>e.assigned??0)+(d?m?.assigned??0:0),scannedTotal:(0,_f.A)(t,e=>e.scanned??0)+(d?m?.scanned??0:0)}},[r,m,l,d,e.accreditation]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{css:{borderTop:"1px solid $gray200",height:"$cellHeightSm"},children:[l.map(o=>{const s=`a${e.accreditation.id}__${o.toSQLDate()}`,a=r[s];return e.accreditation.hasDateSlots?(0,i.jsxs)(ZS,{background:"none",children:[(0,i.jsxs)(ka,{children:[a?.assigned??0,n.toNumberOrInfinity(a?.max,{prefix:"/"})]}),c&&(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:a?.scanned?t("_1_scann_e_19753",a.scanned):"-"})]},o.toISO()):(0,i.jsx)(ZS,{background:"none"},o.toISO())}),d&&(e.accreditation.hasDateSlots?(0,i.jsx)(ZS,{background:"none"}):(0,i.jsxs)(ZS,{background:"none",children:[(0,i.jsxs)(ka,{children:[m?.assigned??0,n.toNumberOrInfinity(m?.max,{prefix:"/"})]}),c&&(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:m?.scanned?t("_1_scann_e_19753",m.scanned):"-"})]})),u&&(0,i.jsxs)(ZS,{background:"none",children:[(0,i.jsxs)(ka,{children:[f,n.toNumberOrEmpty(e.accreditation.maxResources,{prefix:"/"})]}),c&&(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:_>0?t("_1_scann_e_19753",_):"-"})]})]}),p&&g&&h.map(({id:n})=>{const o=a[`a${e.accreditation.id}__${n}__no_date`];return(0,i.jsxs)(rd,{css:{borderTop:"1px solid $gray200",height:"$cellHeightSm"},children:[l.map(o=>{const s=`a${e.accreditation.id}__${n}__${o.toSQLDate()}`,r=a[s];return e.accreditation.hasDateSlots?(0,i.jsxs)(ZS,{background:"none",children:[(0,i.jsx)(ka,{children:r?.assigned??0}),c&&(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:r?.scanned?t("_1_scann_e_19753",r.scanned):"-"})]},o.toISO()):(0,i.jsx)(ZS,{background:"none"},o.toISO())}),d&&(e.accreditation.hasDateSlots?(0,i.jsx)(ZS,{background:"none"}):(0,i.jsxs)(ZS,{background:"none",children:[(0,i.jsx)(ka,{children:o?.assigned??0}),c&&(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:o?.scanned?t("_1_scann_e_19753",o.scanned):"-"})]})),u&&(0,i.jsx)(ZS,{background:"none"})]},n)})]})},ek=e=>{const{translate:t}=bd(),n=Ei(lI),{categoryIdToAccreditations:o,categoryIdToOpen:s,categoryKeyToStats:r,dates:a,hasNoDate:l,hasScanned:d,showTotal:c}=JS(),u=(0,V.useMemo)(()=>o[e.category.id],[o,e.category.id]),m=s[e.category.id]??!0,h=r[`c${e.category.id}__no_date`],{assignedTotal:g,scannedTotal:p}=(0,V.useMemo)(()=>{const t=(0,hd.A)(a.map(t=>r[`c${e.category.id}__${t.toSQLDate()}`]));return{assignedTotal:(0,_f.A)(t,e=>e.assigned??0)+(l?h?.assigned??0:0),scannedTotal:(0,_f.A)(t,e=>e.scanned??0)+(l?h?.scanned??0:0)}},[r,a,l,h,e.category]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{css:{borderTop:"1px solid $gray200",height:"$cellHeightSm"},children:[a.map(n=>{const o=`c${e.category.id}__${n.toSQLDate()}`,s=r[o];return(0,i.jsxs)(ZS,{background:"gray",children:[(0,i.jsx)(ka,{children:s?.assigned??0}),d&&(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:s?.scanned?t("_1_scann_e_19753",s.scanned):"-"})]},n.toISO())}),l&&(0,i.jsxs)(ZS,{background:"gray",children:[(0,i.jsx)(ka,{children:h?.assigned??0}),d&&(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:h?.scanned?t("_1_scann_e_19753",h.scanned):"-"})]}),c&&(0,i.jsxs)(ZS,{background:"gray",children:[(0,i.jsxs)(ka,{children:[g,n.toNumberOrEmpty(e.category.maxResources,{prefix:"/"})]}),d&&(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:p>0?t("_1_scann_e_19753",p):"-"})]})]}),m?u.map(e=>(0,i.jsx)(QS,{accreditation:e},e.id)):null]})},tk=e=>{const{translate:t}=bd(),{categories:n,categoryIdToAccreditations:o,customFields:s,links:r,setLinks:a}=JS(),[l,d]=(0,V.useState)(r),c=(0,V.useMemo)(()=>(0,cm.A)(s,e=>m(e.name)).filter(e=>!e.canSelectMultiple).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id)),[s]),u=(0,V.useCallback)((e,t)=>{d((0,Wm.jM)(n=>{n[e].customFieldSlug=t}))},[d]),h=(0,V.useCallback)((e,t)=>{d((0,Wm.jM)(n=>{n[e].accreditationsIds=t}))},[d]),g=l.every(e=>""!==e.customFieldSlug&&Bs(e.accreditationsIds));return(0,i.jsxs)(Jm,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(yb,{children:t("ventiler_les_st_00770")}),(0,i.jsx)(Qm,{css:{padding:"$6"},children:(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[l.map((e,s)=>(0,i.jsxs)(rd,{css:{bd:!0},direction:"column",children:[(0,i.jsxs)(rd,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$5 $6 $4 $6"},gap:"4",children:[(0,i.jsx)(ka,{css:{flex:"1"},font:"gray800 textMd medium",children:t("liaison_n_1_48160",s+1)}),(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>d(qs(l,s))})]}),(0,i.jsxs)(rd,{css:{padding:"$4 $6 $6 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("CustomField"),values:[e.customFieldSlug],onChange:e=>{Bs(e)&&u(s,e[0])},children:c}),(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("accr_ditations_39450"),multiple:!0,values:e.accreditationsIds,onChange:e=>h(s,e),children:n.map(e=>{const t=o[e.id];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)})})]})]},s)),(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",onClick:()=>d([...l,{accreditationsIds:[],customFieldSlug:""}]),children:t("ajouter_une_lia_43639")})]})}),(0,i.jsx)(eh,{children:(0,i.jsxs)(rd,{gap:"3",justify:"end",width:1,children:[(0,i.jsx)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")}),(0,i.jsx)(kd,{disabled:!g,onClick:()=>{a(l),e.onClose()},children:t("ventiler_10014")})]})})]})},nk=e=>{const{accreditationIdToOpen:t,accreditationIdToValues:n,setAccreditationIdToOpen:o}=JS(),s=n[e.accreditation.id]||[],r=Bs(s),a=t[e.accreditation.id]??!0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"center",css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",cursor:r?"pointer":"default",height:"$cellHeightSm",paddingLeft:"$6",paddingRight:"$4",userSelect:"none"},gap:"2",onClick:()=>{r&&o(t=>({...t,[e.accreditation.id]:!(t[e.accreditation.id]??1)}))},children:[(0,i.jsx)(ka,{css:{visibility:r?"visible":"hidden"},children:(0,i.jsx)(Id,{icon:a?"chevron-up":"chevron-right"})}),(0,i.jsx)(Xv,{color:e.accreditation.color,icon:e.accreditation.icon,size:"sm"}),(0,i.jsx)(rd,{align:"center",css:{flex:"1",overflow:"hidden"},height:1,wrap:"wrap",children:(0,i.jsx)(ka,{color:"gray800",title:e.accreditation.name,children:e.accreditation.name})})]}),a&&r&&s.map(({id:e,value:t})=>(0,i.jsx)(rd,{align:"center",css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",height:"$cellHeightSm",paddingLeft:"88px",paddingRight:"$4",userSelect:"none"},gap:"2",children:t},e))]})},ik=e=>{const{categoryIdToAccreditations:t,categoryIdToOpen:n,setCategoryIdToOpen:o}=JS(),s=(0,V.useMemo)(()=>t[e.category.id],[t,e.category.id]),r=n[e.category.id]??!0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"center",css:{background:"$gray50",borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",cursor:"pointer",height:"$cellHeightSm",px:"$4",userSelect:"none"},gap:"2",onClick:()=>o(t=>({...t,[e.category.id]:!(t[e.category.id]??1)})),children:[(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:r?"chevron-up":"chevron-right"})}),(0,i.jsx)(ka,{css:{textTransform:"uppercase"},font:"gray800 textXs medium",children:e.category.name})]}),r?s.map(e=>(0,i.jsx)(nk,{accreditation:e},e.id)):null]})},ok=()=>{const{translate:e}=bd(),{categories:t,links:n,hideOptions:o}=JS(),[s,r]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{css:{width:"calc(2 * $cellWidth)"},direction:"column",children:[(0,i.jsx)(rd,{align:"center",css:{borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},width:1,children:!o&&(0,i.jsx)(kd,{color:"white",size:"sm",onClick:()=>r(!0),children:`${e("ventiler_par_ch_78972")} (${n.length})`})}),t.map(e=>(0,i.jsx)(ik,{category:e},e.id))]}),s&&(0,i.jsx)(tk,{onClose:()=>r(!1)})]})},sk=e=>{const{translate:t}=bd(),n=Ei(Cm),o=(0,V.useMemo)(()=>(0,cm.A)((0,Xh.A)(e.slots.flatMap(e=>e.date?.isValid?[e.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),[e.slots]),s=(0,V.useMemo)(()=>e.slots.some(e=>!e.date?.isValid),[e.slots]),r=(0,V.useMemo)(()=>e.slots.some(e=>(e.scannedResources??0)>0),[e.slots]),a=(0,V.useMemo)(()=>e.showTotal&&(Bs(o)||e.categories.some(e=>"number"==typeof e.maxResources)||e.accreditations.some(e=>"number"==typeof e.maxResources)),[o,e.accreditations,e.categories,e.showTotal]),l=(0,V.useMemo)(()=>(0,cm.A)(e.categories,e=>m(e.name)),[e.categories]),[d,c]=(0,V.useState)({}),[u,h]=(0,V.useState)({}),g=(0,V.useMemo)(()=>(0,Vu.A)(_g(e.accreditations),e=>e.accreditationCategoryId),[e.accreditations]),p=(0,V.useMemo)(()=>Object.fromEntries(e.accreditations.map(t=>{const n=e.links.find(e=>e.accreditationsIds.includes(t.id));if(n){const i=(0,cm.A)(e.customFields.find(e=>e.slug===n.customFieldSlug)?.values??[],e=>m(e.value));return[t.id,i]}return[t.id,[]]})),[e.accreditations,e.customFields,e.links]),f=(0,V.useMemo)(()=>(0,Bu.A)((0,Vu.A)(e.slots,e=>{const t=e.date?.isValid?e.date.startOf("day").toSQLDate():"no_date";return`c${e.accreditationCategoryId}__${t}`}),e=>({assigned:(0,_f.A)(e,e=>e.assignedResources),scanned:(0,_f.A)(e,e=>e.scannedResources??0)})),[e.slots]),_=(0,V.useMemo)(()=>Object.fromEntries(e.slots.map(e=>{const t=e.date?.isValid?e.date.startOf("day").toSQLDate():"no_date";return[`a${e.accreditationId}__${t}`,{assigned:e.assignedResources,max:e.maxResources,scanned:e.scannedResources??0}]})),[e.slots]),x=(0,V.useMemo)(()=>Object.fromEntries(e.slots.flatMap(e=>Object.entries(e.resourcesByFields).flatMap(([t,n])=>{const i=e.date?.isValid?e.date.startOf("day").toSQLDate():"no_date";return n.map(({customFieldValueId:t,assignedResources:n,scannedResources:o})=>[`a${e.accreditationId}__${t}__${i}`,{assigned:n,scanned:o}])}))),[e.slots]);return(0,i.jsx)(XS.Provider,{value:{accreditationKeyToStats:_,accreditationValueKeyToStats:x,accreditationIdToOpen:u,accreditationIdToValues:p,categories:l,categoryIdToAccreditations:g,categoryIdToOpen:d,categoryKeyToStats:f,customFields:e.customFields,dates:o,hasNoDate:s,hasScanned:r,hideOptions:e.hideOptions,links:e.links,showTotal:a,setAccreditationIdToOpen:h,setCategoryIdToOpen:c,setLinks:e.setLinks},children:(0,i.jsxs)(rd,{css:{background:"white",border:"1px solid $gray200"},children:[(0,i.jsx)(ok,{}),(0,i.jsx)(rd,{css:{flex:"1",overflowX:"auto"},children:(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsxs)(rd,{css:{height:"$cellHeightSm"},children:[o.map(e=>(0,i.jsx)(rd,{align:"center",css:{borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},justify:"center",width:120,children:(0,i.jsx)(ka,{font:"gray800 textSm medium",children:n.toLocaleString(e,zs.DateOnly.MonthShort)})},e.toISO())),s&&(0,i.jsx)(rd,{align:"center",css:{borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},justify:"center",width:120,children:(0,i.jsx)(ka,{font:"gray800 textSm medium",textAlign:"center",children:t("tout_l_v_nemen_70929")})}),a&&(0,i.jsx)(rd,{align:"center",css:{borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},justify:"center",width:120,children:(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("total_07173")})})]}),l.map(e=>(0,i.jsx)(ek,{category:e},e.id))]})})]})})};function rk(){return im(fa.desktop)}const ak=e=>{const t=rk(),n=(0,V.useMemo)(()=>e.min.startOf("week").equals(e.value.startOf("week")),[e.min,e.value]),o=(0,V.useMemo)(()=>e.max.endOf("week").equals(e.value.endOf("week")),[e.max,e.value]);return(0,i.jsxs)(rd,{gap:"2",children:[(0,i.jsx)(kd,{color:"white",disabled:n,leftIcon:"chevron-left",onClick:()=>{e.onChange(e.value.minus(t?{week:1}:{day:1}))}}),(0,i.jsx)(ka,{width:160,children:(0,i.jsx)(Ih,{...e})}),(0,i.jsx)(kd,{color:"white",disabled:o,leftIcon:"chevron-right",onClick:()=>{e.onChange(e.value.plus(t?{week:1}:{day:1}))}})]})},lk=(0,V.createContext)({}),dk=e=>{const{days:t,interval:n}=(0,V.useContext)(lk),o=t[0],s=t[6]??t[0],r=(0,V.useMemo)(()=>(e.startAt??As.c9.max(o,n.start)).startOf("day"),[e.startAt,o,n]),a=(0,V.useMemo)(()=>(e.endAt??As.c9.min(s,n.end)).endOf("day"),[e.endAt,s,n]),l=(0,V.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=(0,V.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=(0,V.useMemo)(()=>{if("week"===e.display){const t=e.date.startOf("week");return(0,nm.A)(0,7).map(e=>t.plus({day:e}))}return[e.date]},[e.date]),n=(0,V.useMemo)(()=>As.IX.fromDateTimes(e.minDate.startOf("day"),e.maxDate.endOf("day")),[e.minDate,e.maxDate]),[o,s]=(0,V.useState)(300),r=(0,V.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)(lk.Provider,{value:{days:t,interval:n},children:(0,i.jsxs)(rd,{css:{...a,...e.css},direction:"column",children:[(0,i.jsx)(rd,{css:{borderBottom:"1px solid $gray200"},height:60,width:1,children:t.map(e=>(0,i.jsxs)(rd,{align:"center",css:{background:"$gray50"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(ka,{css:{textTransform:"capitalize"},font:"gray500 textXs medium",children:e.toLocaleString({weekday:"long"})}),(0,i.jsx)(ka,{font:"gray800 textXl semiBold",children:e.day})]},e.toISO()))}),(0,i.jsxs)(rd,{className:"h-calendar-events-container",css:{position:"relative"},direction:"column",height:o,width:1,children:[(0,i.jsx)(yc,{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)(rd,{css:{background:n.contains(e)?"white":"$primary50",borderRight:"1px solid $gray200",gridColumn:`${t+1} / ${t+2}`,gridRow:"1 / 2"}},e.toISO()))}),(0,i.jsx)(yc,{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})]})]})})},uk=e=>(0,i.jsxs)(rd,{align:"center",gap:"2",width:1,children:[(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:e.icon})}),(0,i.jsx)(ka,{css:{flex:"1"},fontSize:"textXs",children:e.text}),(0,i.jsx)(rd,{align:"center",css:{background:e.background,borderRadius:"$1",fontSize:"$textXs",fontWeight:"$medium",padding:"2px 8px",minWidth:"30px"},justify:"center",children:e.count})]}),mk=n.p+"img/unavailableCell-148d1ec075614a0e294d.png",hk=xa(ka,{alignItems:"center",color:"$gray900",display:"flex",height:"40px",justifyContent:"center",variants:{border:{gray100:{borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100"},gray200:{borderBottom:"1px solid $gray200",borderRight:"1px solid $gray200"}}},defaultVariants:{border:"gray100"}}),gk=xa(ka,{alignItems:"center",borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100",color:"$gray700",display:"flex",gap:"$2",height:"48px",px:"$4",width:"200px"}),pk=xa(ka,{alignItems:"center",borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100",color:"$gray800",display:"flex",height:"48px",padding:"$2",width:"100px","& > div":{alignItems:"center",background:"$success400",borderRadius:"$1",display:"flex",height:"100%",justifyContent:"center",width:"100%","& svg":{height:"50%"}}}),fk=xa(ka,{background:`url(${mk}) no-repeat`,borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100",color:"$gray700",height:"48px",width:"100px"}),_k=e=>{const{translate:t}=bd();return(0,i.jsx)(am,{children:(0,i.jsxs)(Qu,{children:[(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(ub,{userInfo:e.userInfo})}),(0,i.jsx)(rd,{align:"center",gap:"3",children:e.isAssigned?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"center",gap:"1",children:[(0,i.jsx)(ka,{color:"success500",children:(0,i.jsx)(Id,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(ka,{font:"gray800 textXs medium",children:e.assignedText})]}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsx)(lu,{placement:"bottom-end",children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:e.onDelete,children:e.deleteText})})]})]}):(0,i.jsx)(kd,{size:"sm",onClick:e.onAdd,children:t("ajouter_97327")})})]})})},xk=e=>{const{translate:t}=bd();return(0,i.jsx)(rd,{css:{background:"white",bd:!0,padding:"$4 $6"},direction:"column",gap:"2",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"badge-check"})}),(0,i.jsx)(ka,{css:{flex:"1"},children:t("attribu_es_48167")}),(0,i.jsx)(ka,{children:e.stats.assignedResources})]}),(0,i.jsxs)(rd,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"hand-holding-heart"})}),(0,i.jsx)(ka,{css:{flex:"1"},children:t("souhait_es_78101")}),(0,i.jsx)(ka,{children:e.stats.wishedResources})]}),void 0!==e.stats.scannedResources&&(0,i.jsxs)(rd,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"scanner-gun"})}),(0,i.jsx)(ka,{css:{flex:"1"},children:t("scann_es_13169")}),(0,i.jsx)(ka,{children:e.stats.scannedResources})]})]})})},Ik=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)(!1),[s,r]=(0,V.useState)(e.stats),[a,l]=(0,V.useState)((0,cm.A)(e.members,e=>m(e.userInfo.name))),[d,c]=(0,V.useState)({}),u=(0,V.useCallback)(async t=>{o(!0),c(e=>({...e,[t]:!0}));const{member:n,stats:i}=await e.reloadMember(t);l(e=>e.flatMap(e=>e.userInfo.id===t?n?[n]:[]:[e])),r(i),c(e=>({...e,[t]:!1})),o(!1)},[e.reloadMember,o,r,c,l]),h=(0,V.useCallback)(async t=>{c(e=>({...e,[t]:!0})),await e.add(t),await u(t)},[e.add,u,c]),g=(0,V.useCallback)(async t=>{c(e=>({...e,[t]:!0})),await e.delete(t),await u(t)},[e.delete,u,c]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yb,{children:e.name}),(0,i.jsxs)(Qm,{css:{background:"$gray50",gap:"$6",padding:"$6"},children:[(0,i.jsx)(xk,{isLoading:n,stats:s}),(0,i.jsxs)(Hu,{children:[(0,i.jsx)(Wu,{children:(0,i.jsx)(hk,{children:t("nom_du_membre_69353")})}),a.map(t=>d[t.userInfo.id]?(0,i.jsx)(fm,{bx:!0},t.id):(0,i.jsx)(_k,{assignedText:e.assignedText,deleteText:e.deleteText,isAssigned:e.isAssigned(t),userInfo:t.userInfo,onAdd:()=>h(t.userInfo.id),onDelete:()=>g(t.userInfo.id)},t.id))]})]})]})},vk=e=>{const{params:{eventId:t,delegationId:n},translate:o}=bd(),{mutate:s}=hr(),r=(0,V.useMemo)(()=>`${e.accreditation.name}${g(e.accreditationSlot.name)?` - ${e.accreditationSlot.name}`:""}`,[e.accreditation,e.accreditationSlot]),a=(0,V.useCallback)(t=>t.accreditationsUsersInfos.some(t=>t.accreditationSlotId===e.accreditationSlotId),[e.accreditationSlotId]),l=(0,V.useCallback)(async i=>{const{event:o}=await(s={eventId:t,delegationId:n,accreditationSlotId:e.accreditationSlotId,userInfoId:i},r=await X(),Js("query CalendarAccreditationSlotMember(\n $eventId: EventId!\n $delegationId: DelegationId\n $accreditationSlotId: AccreditationsSlotId!\n $userInfoId: UsersInfoId!\n) {\n event(id: $eventId) {\n accreditationSlot(id: $accreditationSlotId) {\n ...AccreditationSlotStats\n }\n\n delegationMaybe(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:[js.AccreditationSlotStatsFragment,js.DelegationAccreditationSlotStatsFragment,js.VolunteerRegistrationDelegationAccreditationSlotFragment]}));var s,r;const l=o.member.accreditationsSlots.some(t=>t.id===e.accreditationSlotId);return{member:a(o.member)||l?o.member:null,stats:o.delegationMaybe?.accreditationSlot??o.accreditationSlot}},[e.accreditationSlotId,n,t,a]),d=(0,V.useCallback)((n,i)=>s({eventId:t,massAccredit:{accreditationsSlotsIds:[e.accreditationSlotId],selecteds:{ids:[n]},strategy:i}}),[t,s,e.accreditationSlotId]),c=(0,V.useCallback)(e=>d(e,yt.Add),[d]),u=(0,V.useCallback)(e=>d(e,yt.Delete),[d]);return(0,i.jsx)(Ik,{add:c,assignedText:o("d_j_attribu_e_06450"),delete:u,deleteText:o("retirer_l_accr_62187"),isAssigned:a,members:e.volunteersRegistrations,name:r,reloadMember:l,stats:e.stats})},bk=e=>{const{data:t,loader:n}=Oi("query AccreditationSlotMembers($eventId: EventId!, $accreditationSlotId: AccreditationsSlotId!) {\n event(id: $eventId) {\n accreditationSlot(id: $accreditationSlotId) {\n ...AccreditationSlotStats\n date\n name\n\n accreditation {\n name\n }\n\n volunteersRegistrations {\n ...VolunteerRegistrationDelegationAccreditationSlot\n }\n }\n }\n}\n",{eventId:e.eventId,accreditationSlotId:e.accreditationSlotId},[js.AccreditationSlotStatsFragment,js.VolunteerRegistrationDelegationAccreditationSlotFragment]);return(0,i.jsx)(Jm,{size:"md",onClose:e.onClose,children:n||(0,i.jsx)(vk,{accreditation:t.event.accreditationSlot.accreditation,accreditationSlot:t.event.accreditationSlot,accreditationSlotId:e.accreditationSlotId,stats:t.event.accreditationSlot,volunteersRegistrations:t.event.accreditationSlot.volunteersRegistrations})})},jk=e=>{const{data:t,loader:n}=Oi("query DelegationAccreditationSlotMembers(\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 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},[js.DelegationAccreditationSlotStatsFragment,js.VolunteerRegistrationDelegationAccreditationSlotFragment]);return(0,i.jsx)(Jm,{size:"md",onClose:e.onClose,children:n||(0,i.jsx)(vk,{accreditation:t.event.delegation.accreditationSlot.accreditation,accreditationSlot:t.event.delegation.accreditationSlot.accreditationSlot,accreditationSlotId:e.accreditationSlotId,stats:t.event.delegation.accreditationSlot,volunteersRegistrations:t.event.delegation.accreditationSlot.volunteersRegistrations})})},Ck=e=>{const{translate:t,params:{eventId:n,delegationId:o}}=bd(),[s,r]=(0,V.useState)(e.stats),a=(0,V.useMemo)(()=>pu(e.accreditation.color),[e.accreditation]),l=(0,V.useMemo)(()=>({background:a[50],border:`1px solid ${a[500]}`,color:a[700]}),[a]),d=(0,V.useMemo)(()=>`${e.accreditation.name}${g(e.accreditationSlot.name)?` - ${e.accreditationSlot.name}`:""}`,[e.accreditation,e.accreditationSlot]),c=(0,V.useCallback)(async()=>{if(o){const{event:{delegation:t}}=await wr({eventId:n,delegationId:o,accreditationSlotId:e.accreditationSlot.id},await X());r(t.accreditationSlot)}else{const{event:{accreditationSlot:o}}=await(t={eventId:n,accreditationSlotId:e.accreditationSlot.id},i=await X(),Js("query AccreditationSlotStats($eventId: EventId!, $accreditationSlotId: AccreditationsSlotId!) {\n event(id: $eventId) {\n accreditationSlot(id: $accreditationSlotId) {\n assignedResources\n maxResources\n scannedResources\n wishedResources\n }\n }\n}\n",{variables:t,token:i||void 0,fragments:[]}));r(o)}var t,i},[e.accreditationSlot,r]),[u,m]=(0,V.useState)(!1),h=s.maxResources?`/${s.maxResources}`:"",p=`${s.assignedResources}${h}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"start",css:{...l,borderRadius:"$1",cursor:e.canMemberAccredit?"pointer":"default",minHeight:"32px",padding:"$2"},direction:"column",gap:"2",width:1,onClick:()=>{e.canMemberAccredit&&m(!0)},children:[(0,i.jsx)(ka,{css:{flex:"1"},fontSize:"textXs",fontWeight:"medium",children:d}),(0,i.jsx)(uk,{background:a[100],count:p,icon:"badge-check",text:t("attribu_es_48167")}),e.showWished&&"number"==typeof s.wishedResources&&(0,i.jsx)(uk,{background:a[100],count:s.wishedResources,icon:"hand-holding-heart",text:t("souhait_es_78101")}),"number"==typeof s.scannedResources&&(0,i.jsx)(uk,{background:a[100],count:s.scannedResources,icon:"scanner-gun",text:t("scann_es_13169")})]}),e.canMemberAccredit&&u?o?(0,i.jsx)(jk,{accreditationSlotId:e.accreditationSlot.id,delegationId:o,eventId:n,onClose:()=>(m(!1),c())}):(0,i.jsx)(bk,{accreditationSlotId:e.accreditationSlot.id,eventId:n,onClose:()=>(m(!1),c())}):null]})},yk=e=>{const t=rk(),n=(0,V.useMemo)(()=>(0,cm.A)(e.accreditationsSlots.filter(e=>!e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name,fg(e.accreditation.index),e.accreditation.name.toLowerCase()]),[e.accreditationsSlots]),o=(0,V.useMemo)(()=>(0,cm.A)(e.accreditationsSlots.filter(e=>e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name,fg(e.accreditation.index),e.accreditation.name.toLowerCase()]),[e.accreditationsSlots]),s=(0,V.useMemo)(()=>Object.fromEntries(e.accreditations.map(e=>[e.accreditationId,e.willAutoAccredit||e.accreditation.willAutoAccredit])),[e.accreditations]);return(0,i.jsxs)(ck,{css:{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)(dk,{children:(0,i.jsx)(Ck,{accreditation:t.accreditation,accreditationSlot:t.accreditationSlot,canMemberAccredit:e.canMemberAccredit,showWished:!s[t.accreditationId],stats:t})},t.accreditationSlot.id)),o.map(t=>(0,i.jsx)(dk,{endAt:t.accreditationSlot.date,startAt:t.accreditationSlot.date,children:(0,i.jsx)(Ck,{accreditation:t.accreditation,accreditationSlot:t.accreditationSlot,canMemberAccredit:e.canMemberAccredit,showWished:!s[t.accreditationId],stats:t})},t.accreditationSlot.id))]})},Ak=e=>{const{translate:t,params:{organizationId:n}}=bd(),[o,s]=(0,V.useState)(""),[r,a]=bC(e.delegationsSpaceLayoutTab,e=>e.rendering,n,"eventDelegationAccreditations.rendering",Ig.WeeklyCalendar,[Ig.Table,Ig.WeeklyCalendar]),[l,d]=(0,V.useState)(e.event.delegation.minAccreditationSlotDate),c=(0,V.useMemo)(()=>l?.isValid?l:e.event.startAt,[e.event,l]),[u,h]=(0,V.useState)(null),p=(0,V.useMemo)(()=>{const t=m(o||""),n=e.delegationsSpaceLayoutTab?.infos.accreditationsSlotsIds;return e.event.delegation.allAccreditationsSlots.filter(e=>{const i=!g(t)||m(e.accreditation.name).includes(t)||m(e.accreditationSlot.name).includes(t)||r===Ig.Table&&m(e.accreditationCategory.name).includes(t),o=!u?.isValid||!!e.accreditationSlot.date?.isValid&&u.toSQLDate()===e.accreditationSlot.date.toSQLDate(),s=!Bs(n)||n.includes(e.accreditationSlotId);return i&&o&&s})},[e.delegationsSpaceLayoutTab,e.event,o,r,u]),f=(0,V.useMemo)(()=>p.map(e=>({accreditationCategoryId:e.accreditationCategory.id,accreditationId:e.accreditationSlot.accreditationId,date:e.accreditationSlot.date,assignedResources:e.assignedResources,maxResources:e.maxResources,resourcesByFields:e.resourcesByFields,scannedResources:e.scannedResources})),[p]),_=(0,V.useMemo)(()=>{const t=p.map(e=>e.accreditationId);return e.event.delegation.allAccreditations.filter(e=>t.includes(e.accreditationId))},[e.event,p]),x=(0,V.useMemo)(()=>_.map(e=>({id:e.accreditation.id,accreditationCategoryId:e.accreditation.accreditationCategoryId,index:e.accreditation.index,name:e.accreditation.name,color:e.accreditation.color,icon:e.accreditation.icon,hasDateSlots:e.accreditation.hasDateSlots,maxResources:e.maxResources})),[_]),I=(0,V.useMemo)(()=>{const t=p.map(e=>e.accreditationCategoryId);return e.event.delegation.allAccreditationsCategories.filter(e=>t.includes(e.accreditationCategoryId)).map(e=>({id:e.accreditationCategory.id,name:e.accreditationCategory.name,maxResources:e.maxResources}))},[p,e.event]),v=(0,V.useMemo)(()=>!e.delegationsSpaceLayoutTab,[e.delegationsSpaceLayoutTab]),b=(0,V.useMemo)(()=>g(e.delegationsSpaceLayoutTab?.infos.customFieldSlug)&&Bs(x)?[{accreditationsIds:x.map(e=>e.id),customFieldSlug:e.delegationsSpaceLayoutTab.infos.customFieldSlug}]:[],[e.delegationsSpaceLayoutTab,x]);return(0,i.jsxs)(rd,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(rd,{css:{background:"white",padding:"$5 $5"},gap:"3",children:[(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_une_65646"),value:o,onChange:s})}),(0,i.jsx)(ka,{css:{flex:"1"}}),r===Ig.WeeklyCalendar&&(0,i.jsx)(ak,{max:e.event.endAt,min:e.event.startAt,value:c,onChange:d}),r===Ig.Table&&(0,i.jsx)(ka,{width:160,children:(0,i.jsx)(Ih,{max:e.event.endAt,min:e.event.startAt,value:u,onChange:h})}),v&&(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:yg(r),children:Ag(t,r)})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsx)(ru,{icon:yg(Ig.WeeklyCalendar),onClick:()=>a(Ig.WeeklyCalendar),children:Ag(t,Ig.WeeklyCalendar)}),(0,i.jsx)(ru,{icon:yg(Ig.Table),onClick:()=>a(Ig.Table),children:Ag(t,Ig.Table)})]})]})]}),r===Ig.Table?(0,i.jsx)(sk,{accreditations:x,categories:I,customFields:e.organization.customFields.nodes,hideOptions:!0,links:b,setLinks:hc.A,showTotal:!0,slots:f}):(0,i.jsx)(yk,{accreditations:_,accreditationsSlots:p,canMemberAccredit:e.canMemberAccredit,event:e.event,selectedDay:c})]})},Sk=()=>{const e=Ti();return(0,i.jsx)(rd,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs"},height:1,justify:"center",width:1,children:(0,i.jsx)(ka,{height:250,width:1,children:(0,i.jsx)(pA,{title:e("aucune_accr_dit_27643")})})})},kk=e=>{const{params:{organizationId:t,eventId:n,delegationId:o}}=bd(),{data:s,loader:r}=Oi("query DelegationAccreditations(\n $organizationId : OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n $onlyVisible: Boolean!\n) {\n organization(id: $organizationId){\n customFields(eventId: $eventId, fieldTypes: [Select], variety: UserInfo, privacy: Public){\n nodes {\n ...ConditionCustomField\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n\n delegation(id: $delegationId) {\n minAccreditationSlotDate\n\n allAccreditationsCategories {\n accreditationCategoryId\n maxResources\n\n accreditationCategory {\n id\n name\n }\n }\n\n allAccreditations {\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 hasDateSlots\n }\n }\n\n allAccreditationsSlots(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",{organizationId:t,eventId:n,delegationId:o,onlyVisible:e.onlyVisible},[js.ConditionCustomFieldFragment,js.DelegationAccreditationSlotStatsFragment]);return r||(Vs(s.event?.delegation.allAccreditationsSlots)?(0,i.jsx)(Sk,{}):(0,i.jsx)(Ak,{canMemberAccredit:e.canMemberAccredit,delegationsSpaceLayoutTab:e.delegationsSpaceLayoutTab,event:s.event,organization:s.organization}))},wk=e=>{const{params:{organizationId:t,eventId:n,delegationId:o},translate:s}=bd(),{mutate:r,isLoading:a}=Tr(),l=(0,V.useMemo)(()=>e.customDocuments.filter(t=>t.slug===e.slug),[e.customDocuments,e.slug]),d=(0,V.useMemo)(()=>Bs(l)?l.map(e=>e.name).join(", "):kn.includes(e.slug)?y_(e.slug):null,[l,e.slug]),c=Bs(l);return d?(0,i.jsxs)(rd,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4 $6","&:last-child":{borderBottom:"none"}},gap:"3",children:[(0,i.jsx)(rd,{align:"center",css:{background:"$blueGray100",borderRadius:"12px",color:"$blueGray700"},height:40,justify:"center",width:40,children:(0,i.jsx)(Id,{icon:"file-lines"})}),(0,i.jsx)(ka,{css:{flex:"1"},font:"gray900 textSm medium",children:d}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",isLoading:a,leftIcon:"download",onClick:()=>r({organizationId:t,eventId:n,delegationId:o,documentsExport:{badgeType:c?null:e.slug,customDocumentSlug:c?e.slug:null,documentType:c?_t.UserCustomDocument:_t.CustomBadge,language:ae.Fr,oneFile:!1,segmentsIds:[],strategy:Tt.OnePerPage}})})})}),(0,i.jsx)(bp,{placement:"top",children:s("recevoir_les_do_31669")})]})]}):null},Ek=e=>{const{translate:t}=bd();return(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(ka,{font:"gray900 textMd medium",children:t("documents_dispo_46996")}),(0,i.jsx)(rd,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",flex:"1",overflow:"hidden"},direction:"column",children:e.delegationsSpaceCustomBadges.map(t=>(0,i.jsx)(wk,{customDocuments:e.customDocuments,slug:t},t))})]})};var Tk=n(6502),Rk=n(2716);const Ok=e=>{Su("common-front/src/designSystem/components/__deprecated/progressGauge.tsx","common-front/src/designSystem/components/progressGauge.tsx");const t=(0,V.useMemo)(()=>(0,Rk.A)().innerRadius(70).outerRadius(90).cornerRadius(20).startAngle(-Math.PI/2).endAngle(Math.PI/2),[]),n=(0,V.useMemo)(()=>e.total===1/0?1:0===e.total?1/0:e.count/e.total,[e.count,e.total]),o=(0,V.useMemo)(()=>{const e=(0,Tk.A)().domain([0,1]).range([-Math.PI/2,Math.PI/2]);return(0,Rk.A)().innerRadius(70).outerRadius(90).cornerRadius(20).startAngle(-Math.PI/2).endAngle(e(n<=1?n:1))},[n]);return(0,i.jsxs)(ka,{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:Ia.colors.gray100.value}),(0,i.jsx)("path",{d:o(void 0),fill:xu(n)})]})}),(0,i.jsxs)(rd,{align:"baseline",css:{bottom:"0",left:"0",position:"absolute"},gap:"2",justify:"center",width:1,children:[(0,i.jsx)(ka,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:e.count}),(0,i.jsxs)(ka,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:["/",e.total===1/0?"∞":e.total]})]})]})},Dk=e=>{const{designSystem:t}=Xu(),n=t===Yu?({children:e})=>(0,i.jsx)(rd,{className:"h-detail-box-content",css:{flex:"1",padding:"$6"},width:1,children:e}):({children:e})=>(0,i.jsx)(ka,{className:"h-detail-box-content",css:{flex:"1",padding:"$6"},width:1,children:e});return(0,i.jsx)(rd,{css:{background:"white",bd:!0,...e.css},direction:"column",width:1,children:(0,i.jsxs)(rd,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(rd,{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)(Dd,{css:{flex:"1",alignContent:"center"},children:e.title}),e.rightIcon&&(0,i.jsx)(ka,{color:"gray900",css:{cursor:"pointer"},fontSize:"textMd",fontWeight:"semiBold",textAlign:"center",width:20,onClick:t=>{e.rightIconClick?.(t)},children:(0,i.jsx)(Id,{icon:e.rightIcon})}),e.select]}),(0,i.jsx)(n,{children:e.children})]})})},zk=({css:e,title:t,children:n})=>(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:t}),(0,i.jsx)(rd,{css:{bd:!0,padding:"$4",...e},direction:"column",children:n})]}),$k=({children:e,...t})=>om()?(0,i.jsx)(zk,{...t,children:e}):(0,i.jsx)(Dk,{...t,children:e});var Pk=n(141);const Mk=(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:Mk(i,o,n)}),n);const Fk=/(\{([\w\.]+)\})/g;let Nk=class{fieldService;dateTimeService;constructor(e,t){this.fieldService=e,this.dateTimeService=t}renderText(e,t={},n="HTML"){const i=t.delegation?this.getDelegation(t.delegation,t):t.volunteerRegistration?.delegation?this.getDelegation(t.volunteerRegistration.delegation,t):void 0,o={organization:t.organization||void 0,event:t.event?this.getEvent(t.event,t):void 0,delegation:i,team:i,invitedBy:t?.invitedBy?this.getUser(t.invitedBy,null,t):void 0,recipient:t?.recipient?this.getUser(t.recipient,null,t):void 0,user:t.userInfo?this.getUser(t.userInfo,i,t):void 0,...t.extraInfos};var s;const r=("HTML"===n?Object.entries((s=o,Mk(s))).reduce((e,[t,n])=>e.replaceAll(`{${t}}`,n),e):(0,Pk.A)(e,{interpolate:/{([\s\S]+?)}/g})(o)).replace(Fk,(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")?gf(e.userPlanningDaysLink,"pdf",l):i.includes("planningList")?gf(e.userPlanningListLink,"pdf",l):i.includes("planning")?gf(e.userPlanningLink,"pdf",l):i.includes("assignments")?gf(e.userAssignmentsLink,"pdf",l):i.includes("paris20kmassignment")&&e?.userCustomBadgeLinks[Se.Paris20kmassignment]?gf(e.userCustomBadgeLinks[Se.Paris20kmassignment],"pdf",l):""}return""});return r}getDelegation(e,t){const n=t.customFields||[],i=this.getFields(e.fields,n);return{...e,...i,leader:{email:e.leaders?.[0]?.email??"",firstName:e.leaders?.[0]?.firstName??"",lastName:e.leaders?.[0]?.lastName??"",phone:e.leaders?.[0]?.phone?.internationalFormat??""},formLink:cf({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.id,formId:e.formId}),spaceLink:df(e.organizationId,Ki(io.ORGANIZATION_DELEGATIONS({organizationId:e.organizationId})))}}getEvent(e,t){const n=t.customFields||[],i=this.getFields(e.fields,n);return{id:e.id,name:e.name,...i}}getUser(e,t,n){const i=n.customFields||[],o=this.getFields(e.fields,i),s=this.getLanguage(e),r=s?{lang:s.toString()}:{},a=e.links?gf(e.links.userAssignmentsLink,"pdf",r):"",l=e.links?gf(e.links.userPlanningLink,"pdf",r):"",d=e.links?gf(e.links.userPlanningListLink,"pdf",r):"",c=e.links?gf(e.links.userPlanningDaysLink,"pdf",r):"",u=e.links?{assignments:a,badge:gf(e.links.userBadgeLink,"pdf",r),certificate:gf(e.links.userCertificateLink,"pdf",r),planning:l,planningList:d,planningDays:c,...Object.fromEntries(Object.entries(e.links.userCustomBadgeLinks).map(([e,t])=>[e.toLowerCase(),gf(t,"pdf",r)])),...Object.fromEntries(Object.entries(e.links.userCustomDocumentLinks).map(([e,t])=>[e,gf(t,"pdf",r)]))}:{},m=n.volunteerRegistration?.ticketId??"",h=(e.fields.isExpanded?e.fields?.firstName?.value:e.fields.firstName)||"",g=(e.fields.isExpanded?e.fields?.lastName?.value:e.fields.lastName)||"",p=`\n
\n
`;return{id:e.id,organizationLocalId:e.localId,localId:n.volunteerRegistration?.localId||"",email:e.email,...o,firstName:h,lastName:g,ticketId:m,qrcode:p,memberCode:n.volunteerRegistration?.weezevent?.memberCode||"",name:Nf({firstName:h,lastName:g}),registrationDate:e.registrationDate?.toFormat(n.organization?.dateFormat??"yyyy-MM-dd")??"",registrationDatetime:e.registrationDate?.toFormat(n.organization?.datetimeFormat??"yyyy-MM-dd HH:mm")??"",assignmentSheet:n.event?a:"",documents:u,team:t,delegation:{...t,name:t?.name??"",leader:{email:t?.leader?.email??"",firstName:t?.leader?.firstName??"",lastName:t?.leader?.lastName??"",phone:t?.leader?.phone??""},spaceLink:t?.spaceLink??""},weezevent:{barcode:m,qrcode:p,identificationNumber:""},profile:n.volunteerRegistration?.accreditationProfile?.name??"",profileCategory:n.volunteerRegistration?.accreditationProfile?.accreditationProfileCategory.name??""}}getFields(e,t){return e.isExpanded?Object.fromEntries(Object.entries(e).flatMap(([e,{label:t,value:n}])=>{const i=Bs(n)?n.join(", "):g(n)?n:"";return(0,hd.A)([[e,i],g(t)?[h(t),i]:null])})):Object.fromEntries(t.flatMap(t=>{const n=this.fieldService.getValueString(t,e);return(0,hd.A)([[t.slug,n],g(t.label)?[h(t.label),n]:null])}))}getLanguage(e){return e.fields.isExpanded?e.fields?.language?.rawValue:e.fields?.language}};Nk=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Xb,Cm])],Nk);const Lk={DESIGN:"design",LAYOUTS:{PLURAL:"layouts",SINGLE:"layout"}},Bk="delegations-space",Vk={DELEGATIONS_SPACE:e=>Ui([So.EVENT(e),Bk]),DELEGATIONS_SPACE_DESIGN:e=>Ui([Vk.DELEGATIONS_SPACE(e),Lk.DESIGN]),DELEGATIONS_SPACE_LAYOUTS:e=>Ui([Vk.DELEGATIONS_SPACE(e),Lk.LAYOUTS.PLURAL]),DELEGATIONS_SPACE_LAYOUTS_CREATE:e=>Yi(Vk.DELEGATIONS_SPACE_LAYOUTS(e)),DELEGATIONS_SPACE_LAYOUTS_UPDATE:e=>Zi(Ui([Vk.DELEGATIONS_SPACE(e),Lk.LAYOUTS.SINGLE,e.delegationsSpaceLayoutId]))},Uk=({description:e})=>{const t=Ti();return(0,i.jsx)($k,{title:t("description_58935"),children:g(e)?(0,i.jsx)(jf,{text:e}):(0,i.jsx)(ka,{color:"gray500",textAlign:"center",width:1,children:t("aucune_descript_25737")})})},Wk=({privateNote:e})=>{const t=Ti();return(0,i.jsx)($k,{title:(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(Id,{icon:"lock"}),(0,i.jsx)(ka,{children:t("note_priv_e_06303")})]}),children:g(e)?(0,i.jsx)(jf,{text:e}):(0,i.jsx)(ka,{color:"gray500",textAlign:"center",width:1,children:t("aucune_note_pri_86832")})})};let Gk=class extends ic{constructor(e){super(e)}associateTagsIdsSchema(){return c.Ik().shape({tagsIds:c.YO().of(c.ai())})}};Gk=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],Gk);const qk=e=>{const t=Ti(),n=Ei(Gk),[o,s]=(0,V.useState)(e.tags),[r,a]=(0,V.useState)(!1);return(0,i.jsx)(Ej,{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)(Gp,{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)(Tj,{organizationId:e.organizationId,onClose:()=>{a(!1)},onSuccess:e=>{s([...o,e]),t.change("tagsIds",[...n.tagsIds,e.id])}})]})})},Hk=e=>{const{data:t,loader:n}=(o={organizationId:e.organizationId},Oi(or,o,[]));var o;return n?null:(0,i.jsx)(qk,{organizationId:e.organizationId,subtitle:e.subtitle,tags:t.organization.tags.nodes,tagsIds:e.tagsIds,onClose:e.onClose,onSave:e.onSave})},Kk=e=>{const t=Ti(),{organizationId:n}=zi(),[o,s]=(0,V.useState)(!1);return"associateTags"in e?(0,i.jsxs)($k,{rightIcon:"pen",rightIconClick:()=>{s(!0)},title:t("tags_79499"),children:[Bs(e.tags)?(0,i.jsx)(rd,{gap:"2",wrap:"wrap",children:e.tags.map(e=>(0,i.jsx)(vu,{children:e.name},e.id))}):(0,i.jsx)(ka,{color:"gray500",textAlign:"center",width:1,children:t("aucun_tag_ajout_63348")}),o&&(0,i.jsx)(Hk,{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)($k,{title:t("tags_79499"),children:Bs(e.tags)?(0,i.jsx)(rd,{gap:"2",wrap:"wrap",children:e.tags.map(e=>(0,i.jsx)(vu,{children:e.name},e.id))}):(0,i.jsx)(ka,{color:"gray500",textAlign:"center",width:1,children:t("aucun_tag_ajout_63348")})})},Yk=e=>{const{translate:t,params:{organizationId:n,eventId:o,delegationId:s}}=bd(),{hasFeature:r}=_v(),a=Ei(Cm),l=Ei(Nk),{canDelegationRead:d}=zv(),{mutate:c}=jr(),u=(0,V.useMemo)(()=>cf({organizationId:n,eventId:o,delegationId:s,formId:e.delegation?.form.id}),[e.delegation]),m=(0,V.useMemo)(()=>df(n,qo.DELEGATION({organizationId:n,eventId:o,delegationId:s})),[e.delegation]),h=(0,V.useMemo)(()=>g(e.delegation.description)?l.renderText(e.delegation.description,{delegation:e.delegation}):"",[e.delegation]),p=(0,V.useMemo)(()=>e.delegation.usedCustomFields.concat(e.customFields),[e.customFields,e.delegation]),f=(e,t)=>(0,i.jsxs)(rd,{children:[(0,i.jsx)(ka,{textAlign:"start",children:e}),(0,i.jsx)(ka,{css:{borderBlockEnd:"2px dotted $gray500",flex:"1",marginBlockEnd:"$1"}}),(0,i.jsx)(ka,{color:"gray900",css:{fontSize:"$textMd"},textAlign:"end",children:t})]});return(0,i.jsx)(Qv,{children:(0,i.jsxs)(rd,{direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(rd,{gap:"6",children:[(0,i.jsx)(rd,{css:{flex:"3",height:"100%"},direction:"column",gap:"6",children:(0,i.jsx)($k,{css:{flex:"1 1"},title:t("limite_de_membr_42978"),children:(0,i.jsxs)(rd,{css:{justifyContent:"space-between"},direction:"column",height:1,children:[(0,i.jsx)(ka,{css:{margin:"auto"},children:(0,i.jsx)(Ok,{count:e.delegation.numberOfResources,total:e.delegation.maxResources??1/0})}),(0,i.jsx)(rd,{direction:"column",gap:"4",children:r(Ae.Accreditation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{color:"gray700",css:{fontSize:"$textXs",fontWeight:600,fontFamily:"Open Sans",lineHeight:"18px",textTransform:"uppercase"},children:t("dont_76603")}),(0,i.jsxs)(rd,{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)(rd,{css:{flex:"6"},direction:"column",gap:"6",children:(0,i.jsx)($k,{title:t("param_tres_78420"),children:(0,i.jsxs)(rd,{direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(rd,{gap:"3",justify:"between",children:[(0,i.jsx)(ka,{color:"gray500",children:t("cat_gorie_00291")}),(0,i.jsx)(ka,{children:(0,i.jsx)(bm,{to:qo.DELEGATION_CATEGORY({organizationId:n,eventId:o,delegationCategoryId:e.delegation.category.id}),children:e.delegation.category.name})})]}),(0,i.jsx)(Oh,{direction:"horizontal"}),d&&e.delegation.parent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{gap:"3",justify:"between",children:[(0,i.jsx)(ka,{color:"gray500",children:t("d_l_gation_pare_68507")}),(0,i.jsx)(rd,{align:"center",css:{color:"$primary500",fontWeight:"$medium","&:hover":{textDecoration:"underline"}},gap:"2",children:(0,i.jsx)(_d,{to:qo.DELEGATION({organizationId:n,delegationId:e.delegation.parent.id}),children:(0,i.jsx)(vu,{color:"white",cursor:"pointer",size:"md",children:e.delegation.parent.name},e.delegation.parent.id)})})]}),(0,i.jsx)(Oh,{direction:"horizontal"})]}),(0,i.jsxs)(rd,{gap:"3",justify:"between",children:[(0,i.jsx)(ka,{color:"gray500",children:t("State")}),(0,i.jsx)(ka,{color:"gray800",children:(0,i.jsx)(vu,{color:"success",children:t(e.delegation.state)})})]}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsxs)(rd,{gap:"3",justify:"between",children:[(0,i.jsx)(ka,{color:"gray500",children:t("date_limite_d_i_79779")}),(0,i.jsx)(ka,{color:"gray800",children:e.delegation.deadlineDate?a.toLocaleString(e.delegation.deadlineDate,zs.DateOnly.MonthLong):"-"})]}),e.delegation.delegationsSpaceLayout&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsxs)(rd,{gap:"3",justify:"between",children:[(0,i.jsx)(ka,{color:"gray500",children:t("DelegationsSpaceLayout")}),(0,i.jsx)(bm,{to:Vk.DELEGATIONS_SPACE_LAYOUTS_UPDATE({organizationId:n,eventId:o,delegationsSpaceLayoutId:e.delegation.delegationsSpaceLayout.id}),children:e.delegation.delegationsSpaceLayout.name})]})]}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsxs)(rd,{gap:"3",justify:"between",children:[(0,i.jsx)(ka,{color:"gray500",children:t("Form")}),(0,i.jsx)(bm,{css:{color:"$primary500"},to:u,children:e.delegation.form.name})]}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsxs)(rd,{gap:"3",justify:"between",children:[(0,i.jsx)(ka,{color:"gray500",children:t("DelegationSpaceLink")}),(0,i.jsx)(bm,{css:{color:"$primary500"},to:m,children:t("portail_d_l_gat_06817")})]})]})})})]}),Bs(p)&&(0,i.jsx)($k,{title:t("champs_de_formu_64126"),children:(0,i.jsx)(rd,{direction:"column",gap:"4",width:1,children:p.map((t,n)=>(0,i.jsxs)(V.Fragment,{children:[0!==n&&(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsxs)(rd,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(ka,{color:"gray500",css:{flex:"1"},children:t.name}),(0,i.jsx)(rd,{justify:"end",width:300,children:(0,i.jsx)(nA,{field:t,fields:e.delegation.fields})})]})]},t.slug))})}),(0,i.jsxs)(rd,{gap:"6",children:[(0,i.jsxs)(rd,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)($k,{title:t("reponsable_82458_plural"),children:Bs(e.delegation.leaders)?e.delegation.leaders.map((e,t)=>(0,i.jsxs)(V.Fragment,{children:[0!==t&&(0,i.jsx)(Dh,{height:"4"}),(0,i.jsx)(ub,{userInfo:e})]},e.id)):(0,i.jsx)(ka,{color:"gray500",textAlign:"center",width:1,children:t("aucun_reponsabl_38504")})}),(0,i.jsx)(Kk,{associateTags:e=>c({organizationId:n,eventId:o,massEdit:{reset:!1,selecteds:{ids:[s]},slug:Ke.Tag,strategy:yt.Replace,value:e}}),modalSubtitle:t("ajouter_des_tag_35833"),reload:e.reload,tags:e.delegation.tags})]}),(0,i.jsxs)(rd,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Uk,{description:h}),(0,i.jsx)(Wk,{privateNote:e.delegation.privateNote})]})]})]})})},Zk=()=>{const{params:{organizationId:e,eventId:t,delegationId:n}}=bd(),{data:o,loader:s,reload:r}=Oi('query DelegationDashboard(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: Delegation, privacy: Private) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n\n delegation(id: $delegationId) {\n id\n organizationId\n eventId\n formId\n name\n description\n deadlineDate\n privateNote\n state\n numberOfResources\n maxResources\n numberOfMembersAccredited\n numberOfMembersWaitingAccreditation\n numberOfMembersRefusedAccreditation\n fields\n\n category: delegationCategory {\n id\n name\n }\n\n parent {\n id\n name\n }\n\n delegationsSpaceLayout {\n id\n name\n }\n\n form {\n id\n name\n }\n\n leaders {\n id\n email\n name\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\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,eventId:t,delegationId:n},[js.CustomFieldWithConditionFragment]);return s||(0,i.jsx)(Yk,{customFields:o.organization.customFields.nodes,delegation:o.organization.delegation,reload:r})},Xk=({children:e,isCurrent:t,to:n})=>{const o=t?"$primary500":"$gray500";return n?(0,i.jsx)(bm,{css:{color:o},to:n,children:e}):(0,i.jsx)(ka,{as:"span",css:{color:o},children:e})},Jk=({css:e,children:t})=>{const n=V.Children.toArray(t).filter(V.isValidElement);return(0,i.jsx)(rd,{align:"center",as:"nav",css:{color:"$gray300",fontSize:"$textSm",fontWeight:"$medium","& i":{fontSize:"12px"},...e},gap:"2",children:n.map((e,t)=>(0,i.jsxs)(V.Fragment,{children:[t>0&&(0,i.jsx)(Id,{icon:"chevron-right",role:"presentation"}),e]},e.key??t))})},Qk=e=>{switch(e){case ew.Event:return{color:"success",leftIcon:"calendar"};case ew.ParentDelegation:return{color:"pink",leftIcon:"people-group"};default:return vd()}};var ew;!function(e){e.Event="event",e.ParentDelegation="parent-delegation"}(ew||(ew={}));const tw=({state:e,userInfo:t,onClick:n})=>{const o=Ti(),s=g(t.name);return(0,i.jsxs)(rd,{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)(wu,{shouldPreventDefault:!1,state:e,onClick:hc.A}),(0,i.jsx)(md,{width:"3"}),(0,i.jsx)(Gf,{email:t.email,image:t.picture?.url,name:t.name,size:40}),(0,i.jsx)(md,{width:"4"}),(0,i.jsxs)(rd,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(ka,{ellipsis:!0,color:"gray700",children:s?t.name:t.email}),s&&(0,i.jsx)(ka,{ellipsis:!0,color:"gray500",children:t.email})]}),t.source&&(0,i.jsx)(ka,{children:(0,i.jsx)(vu,{...Qk(t.source),leftIconStyle:"solid",children:t.source===ew.Event?o("_v_nement_22345"):o("d_l_gation_pare_68507")})})]})},nw=({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)(tw,{state:o,userInfo:e,onClick:()=>{t(e.id)}},e.id)})}),iw=({delegationId:e,nameOrEmail:t,organizationId:n,usersInfosIds:o,select:s})=>{const{data:r,loader:a}=Gl({organizationId:n,excludedDelegationId:e,name:g(t)?t:null});return a||(0,i.jsx)(nw,{availableMembers:r.organization.usersInfos.nodes,select:s,usersInfosIds:o})},ow=({delegationId:e,eventId:t,nameOrEmail:n,usersInfosIds:o,select:s})=>{const{data:r,loader:a}=Oi("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:g(n)?n:null},[js.ExistingVolunteerFragment]);const l=(0,V.useMemo)(()=>{if(r.event){const e=r.event.volunteersRegistrations.nodes.map(e=>({...e.userInfo,source:ew.Event})),t=e.map(({id:e})=>e),n=r.event.delegation.parentUsersInfos.flatMap(e=>t.includes(e.id)?[]:[{...e,source:ew.ParentDelegation}]);return e.concat(n)}return[]},[r.event]);return a||(0,i.jsx)(nw,{availableMembers:l,select:s,usersInfosIds:o})},sw=({delegationId:e,eventId:t,organizationId:n,onClose:o,reload:s})=>{const r=Ti(),a=Ei($b),[l,d,c]=gm(""),{mutate:u}=ea(),{mutate:m}=Zl();return(0,i.jsx)(Ej,{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 m({organizationId:n,delegationId:e,selecteds:{ids:i.usersInfosIds}}),o(),s()},children:({form:o,values:s})=>{const a=e=>{o.change("usersInfosIds",Ws(s.usersInfosIds,e))};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:r("rechercher_un_m_05904"),value:l,onChange:c}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Nd,{}),(0,i.jsx)(rd,{css:{flex:"1",overflowY:"auto"},direction:"column",children:t?(0,i.jsx)(ow,{delegationId:e,eventId:t,nameOrEmail:d,select:a,usersInfosIds:s.usersInfosIds}):(0,i.jsx)(iw,{delegationId:e,nameOrEmail:d,organizationId:n,select:a,usersInfosIds:s.usersInfosIds})})]})}})},rw=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{showNotification:s}=HI(),{mutate:r}=pl();return(0,i.jsx)(DA,{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()}})},aw=e=>{const{params:{organizationId:t,eventId:n,delegationId:o},translate:s}=bd();return(0,i.jsxs)(Jk,{children:[(0,i.jsx)(Xk,{to:qo.DELEGATIONS({organizationId:t,eventId:n}),children:s("d_l_gations_78318")}),(0,i.jsx)(Xk,{to:qo.DELEGATION_CATEGORY({organizationId:t,eventId:n,delegationCategoryId:e.delegation.delegationCategory.id}),children:e.delegation.delegationCategory.name}),(0,i.jsx)(Xk,{isCurrent:!0,to:qo.DELEGATION({organizationId:t,eventId:n,delegationId:o}),children:e.delegation.name})]})},lw=({delegation:e,reload:t})=>{const{history:n,translate:o,params:{organizationId:s,eventId:r,delegationId:a}}=bd(),l=Ei(lI),{user:d}=Li(),{showNotification:c}=HI(),{canDelegationEdit:u,canMemberAccredit:m,canMemberCreate:h}=Dv(),{mutate:g}=hl(),{mutate:p}=Xr(),{mutate:f}=jr(),{mutate:_}=fl(),[x,I]=(0,V.useState)(!1),[v,b]=(0,V.useState)(!1),j=e.lockedAt?.isValid;return(0,i.jsx)(eb,{breadcrumbs:(0,i.jsx)(aw,{delegation:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[h&&(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",disabled:e.numberOfResources>=(e.maxResources??1/0),children:o("ajouter_un_memb_33261")})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsx)(ru,{icon:"user-plus",onClick:()=>{n.push(bx.CREATE({organizationId:s,eventId:r,delegationId:a}))},children:o("ajouter_un_nouv_29283")}),(0,i.jsx)(ru,{icon:"user-group",onClick:e=>{eu(e.target),b(!0)},children:o("ajouter_des_mem_06922")})]})]}),u&&(0,i.jsx)(kd,{to:Zi(qo.DELEGATION({organizationId:s,eventId:r,delegationId:e.id})),children:o("_diter_la_d_l_g_30300")}),(u||m)&&(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsxs)(MA,{children:[r&&(0,i.jsx)(ru,{download:`${e.name}-delegation-calendar`,icon:"arrow-down-to-bracket",target:"_blank",to:gf(e.links.delegationCalendarLink,"pdf",{lang:d?.language}),children:o("t_l_charger_le_85972")}),m&&r&&(0,i.jsx)(ru,{icon:"check",onClick:async()=>{await p({eventId:r,delegationId:e.id,selecteds:{scope:{delegationId:e.id}}}),t()},children:o("valider_les_acc_80801")}),u&&(0,i.jsx)(ru,{icon:"paper-plane",onClick:()=>(async()=>{await _({organizationId:s,eventId:r,selecteds:{ids:[a]}}),c(o("l_e_mail_d_invi_08417"))})(),children:o("envoyer_l_e_mai_17491")}),u?j?(0,i.jsx)(ru,{icon:"lock-keyhole-open",onClick:async()=>{await f({organizationId:s,eventId:r,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:Ke.IsLocked,strategy:yt.Replace,value:!1}}),t()},children:o("d_verrouiller_67042")}):(0,i.jsx)(ru,{icon:"lock-keyhole",onClick:async()=>{await f({organizationId:s,eventId:r,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:Ke.IsLocked,strategy:yt.Replace,value:!0}}),t()},children:o("verrouiller_24528")}):null,u&&(0,i.jsx)(ru,{icon:"clone",onClick:async()=>{const{delegationDuplicate:t}=await g({organizationId:s,eventId:r,delegationId:e.id});n.push(Zi(qo.DELEGATION({organizationId:s,eventId:r,delegationId:t.id})))},children:o("dupliquer_28256")})]}),(0,i.jsx)(MA,{children:u&&(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>{I(!0)},children:o("supprimer_43083")})})]})]}),x&&(0,i.jsx)(rw,{delegation:e,onClose:()=>I(!1),onSuccess:()=>n.replace(r?qo.DELEGATIONS({organizationId:s,eventId:r}):fs.COMMUNITY_DELEGATIONS(s))}),v&&(0,i.jsx)(sw,{delegationId:e.id,eventId:r,organizationId:s,reload:t,onClose:()=>{b(!1)}})]}),name:e.name,nameSuffix:j&&(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{color:"error600",fontSize:"textMd",children:(0,i.jsx)(Id,{icon:"lock-keyhole"})})}),(0,i.jsx)(bp,{placement:"top",children:o("cette_d_l_gatio_29556")})]}),subtext:o("_1_2_membres_04485",e.numberOfResources,l.toNumberOrInfinity(e.maxResources))})};var dw=n(6349);const cw=e=>({title:{display:!0,font:{weight:500},padding:{bottom:30},text:e}}),uw=()=>({border:{display:!1},grid:{color:Ia.colors.gray100.value}}),mw=({datasets:e,labels:t,options:n})=>{const o=(0,V.useMemo)(()=>(0,qd.A)("chart-"),[]),s=(0,V.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:uw()}};return(0,V.useEffect)(()=>{s.current&&s.current.destroy(),s.current=new dw.Ay(document.getElementById(o),{type:"bar",options:(0,gd.A)(r,n),data:{labels:t,datasets:e}})},[e,t,n]),(0,i.jsx)(ka,{height:1,width:1,children:(0,i.jsx)("canvas",{id:o})})},hw=e=>{const t=Ti(),n=Ei(Cm),o=(0,V.useMemo)(()=>Hg(e.slots),[e.slots]),s=(0,V.useMemo)(()=>e.accreditation.hasSlots?o.map(e=>qg(n,e,"",{accreditation:{includeName:!1}})):[e.accreditation.name],[o,e.accreditation]),r=(0,V.useMemo)(()=>{const n=o.some(e=>"number"==typeof e.maxResources),i=o.some(e=>"number"==typeof e.delegationsTotalResources&&e.delegationsTotalResources>0);return(0,hd.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)?Ia.colors.primary400.value:mu(Ia.colors.primary400.value,.5)):Ia.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)?Ia.colors.primary500.value:mu(Ia.colors.error500.value,.7)):Ia.colors.primary500.value},{label:t("scann_es_13169"),data:o.map(e=>e.scannedResources),backgroundColor:Ia.colors.primary900.value},n?{label:t("maximum_56225"),data:o.map(e=>e.maxResources??1/0),backgroundColor:Ia.colors.gray200.value}:null,i?{label:t("total_attribu_e_97130"),data:o.map(e=>e.delegationsTotalResources??0),backgroundColor:Ia.colors.gray400.value}:null])},[o]);return(0,i.jsx)(mw,{datasets:r,labels:s,options:{scales:{y:{...uw(),ticks:{precision:0},...cw(t("nb_d_accr_dita_23359"))},x:{grid:{display:!1},...cw(t(e.accreditation.hasSlots?"slots_05517":"Accreditation"))}}}})},gw=e=>{const t=(0,V.useMemo)(()=>e.event.delegation.allAccreditationsSlots.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)($k,{title:e.accreditation.name,children:(0,i.jsx)(ka,{height:380,width:1,children:(0,i.jsx)(hw,{accreditation:e.accreditation,slots:t})})})},pw=e=>{const t=(0,V.useMemo)(()=>_g((0,Xh.A)(e.event.delegation.allAccreditations.map(e=>{const t=e.willAutoAccredit||e.accreditation.willAutoAccredit;return{...e.accreditation,willAutoAccredit:t}}),e=>e.id)),[e.event]);return(0,i.jsx)(rd,{direction:"column",gap:"4",children:Bs(t)?t.map(t=>(0,i.jsx)(gw,{accreditation:t,event:e.event},t.id)):(0,i.jsx)(Sk,{})})},fw=()=>{const{params:{eventId:e,delegationId:t}}=bd(),{data:n,loader:o}=Oi("query DelegationReporting($eventId: EventId!, $delegationId: DelegationId!) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n allAccreditations {\n accreditationId\n willAutoAccredit\n\n accreditation {\n id\n name\n accreditationCategoryName\n hasSlots\n index\n willAutoAccredit\n }\n }\n\n allAccreditationsSlots {\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)(pw,{event:n.event})},_w=e=>{const{translate:t,params:{organizationId:n,eventId:o,delegationId:s}}=bd(),{hasFeature:r}=_v(),{canAccreditationRead:a,canCustomFieldRead:l,canMemberAccredit:d,canMemberDelete:c,canMemberEdit:u,canPrint:m}=Dv(),h=(0,V.useMemo)(()=>e.organization.allowDelegationSpaceDownload||Bs(e.organization.delegation.customDocuments??[]),[e.organization]),g=(0,V.useMemo)(()=>m&&!!e.organization.delegation.event?.weezeventEventId&&!!e.organization.delegation.event?.numberOfZplDocuments,[m,e.organization]),p=(0,V.useMemo)(()=>(e.organization.delegationsSpaceCustomBadges??[]).concat(e.organization.delegation.customDocuments.map(e=>e.slug)??[]),[e.organization]),f=(0,V.useMemo)(()=>e.organization.delegation.event?.customDocuments??[],[e.organization]),_=e=>({organizationId:e?":organizationId":n,eventId:o?e?":eventId":o:void 0,delegationId:e?":delegationId":s});return Zc(e.organization.delegation.name),(0,i.jsxs)(nb,{children:[(0,i.jsx)(lw,{delegation:e.organization.delegation,reload:e.reload}),(0,i.jsxs)(rb,{css:{flex:"1"},children:[(0,i.jsxs)(ob,{css:{px:"$7"},children:[(0,i.jsx)(ib,{path:qo.DELEGATION_DASHBOARD(_(!1)),children:t("tableau_de_bord_24627")}),(0,i.jsx)(ib,{path:qo.DELEGATION_MEMBERS(_(!1)),children:t("membres_125561",e.organization.delegation.numberOfResources)}),o&&r(Ae.Accreditation)&&(0,i.jsx)(ib,{path:qo.DELEGATION_ACCREDITATIONS(_(!1)),children:t("accr_ditations_39450")}),o&&r(Ae.Accreditation)&&(0,i.jsx)(ib,{path:qo.DELEGATION_REPORTING(_(!1)),children:"Reporting"}),o&&h&&(0,i.jsx)(ib,{path:qo.DELEGATION_DOCUMENTS(_(!1)),children:t("Documents")})]}),(0,i.jsx)(sb,{path:qo.DELEGATION_DASHBOARD(_(!0)),children:(0,i.jsx)(Zk,{})}),(0,i.jsx)(sb,{path:qo.DELEGATION_MEMBERS(_(!0)),children:o?(0,i.jsx)(Qv,{children:(0,i.jsx)(US,{campaigns:e.organization.delegation.campaigns,canDuplicateMembers:u,canEditColumns:!0,canMemberAccredit:d,canMemberDelete:c,canMemberEdit:u,columns:e.organization.delegation.columns,customBadges:e.organization.delegationsSpaceCustomBadges,customFieldsPrivacy:Re.All,deleteFromEvent:!1,forDelegationsSpace:!1,getEditPath:t=>fs.EDIT_USER_FORM(n,o,t.userInfo.id,e.organization.delegation.formId),onlyVisibleAccreditationsSlots:!a,showAccreditationsEdit:d,showAccreditationsValidate:d,showDeleteFromEvent:c,showDocumentsDownload:!0,showEditMode:u,showPrint:g})}):(0,i.jsx)(Qv,{children:(0,i.jsx)(YS,{campaigns:e.organization.delegation.campaigns,canCustomFieldRead:l,canEditColumns:!0,canMemberDelete:c,canMemberEdit:u,columns:e.organization.delegation.columns,customBadges:e.organization.delegationsSpaceCustomBadges,getEditPath:e=>fs.COMMUNITY_EDIT_USER(n,e.id),showDocumentsDownload:!0,showEditMode:u})})}),(0,i.jsx)(sb,{path:qo.DELEGATION_ACCREDITATIONS(_(!0)),children:(0,i.jsx)(Qv,{children:(0,i.jsx)(kk,{canMemberAccredit:d,onlyVisible:!a})})}),(0,i.jsx)(sb,{path:qo.DELEGATION_REPORTING(_(!0)),children:(0,i.jsx)(Qv,{children:(0,i.jsx)(fw,{})})}),(0,i.jsx)(sb,{path:qo.DELEGATION_DOCUMENTS(_(!0)),children:(0,i.jsx)(Qv,{children:(0,i.jsx)(Ek,{customDocuments:f,delegationsSpaceCustomBadges:p})})})]})]})},xw=()=>{const{params:{organizationId:e,eventId:t,delegationId:n}}=bd(),{data:o,loader:s,reload:r}=Oi("query Delegation(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId!\n) {\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 delegationCategory {\n id\n name\n }\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 numberOfZplDocuments\n weezeventEventId\n }\n\n links {\n delegationCalendarLink\n }\n }\n }\n}\n",{organizationId:e,eventId:t,delegationId:n},[js.OrganizationCustomFieldsFragment]);return s||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{exact:!0,path:qo.DELEGATION({organizationId:":organizationId",eventId:t?":eventId":void 0,delegationId:":delegationId"}),children:(0,i.jsx)(Fi,{path:qo.DELEGATION_DASHBOARD({organizationId:e,eventId:t,delegationId:n}),replace:!0})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(_w,{organization:o.organization,reload:r})})]})},Iw=({backgroundColor:e,button:t,iconColor:n,value:o,icon:s,text:r})=>(0,i.jsxs)(rd,{css:{backgroundColor:e??"$white",bd:!0,flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(rd,{css:{borderBottom:t?"1px solid $gray200":"none",padding:"$6"},direction:"column",children:[s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wj,{color:n??"primary",icon:s}),(0,i.jsx)(md,{height:"6"})]}),(0,i.jsx)(ka,{color:"gray500",children:r}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"displayMd",fontWeight:"semiBold",children:o})]}),t&&(0,i.jsx)(rd,{css:{background:"$gray50",padding:"$4 $6"},gap:"4",justify:"end",children:t})]}),vw=e=>{const t=Ti(),[n,o,s]=gm(""),{data:r,loader:a}=Oi("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:g(o)?o:void 0},[js.LeaderUserInfoFragment]);const[l,d]=(0,V.useState)(!1),[c,u]=(0,V.useState)(null),[m,h]=(0,V.useState)(null),{styles:p,attributes:f,update:_}=(0,au.E)(c,m,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,8]}}]}),x=(0,V.useMemo)(()=>c?.getBoundingClientRect().width??100,[c]),I=(0,V.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,V.useEffect)(()=>{_?.()},[_,l,c,I]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rd,{ref:u,onClick:e=>{Gd(e),d(!l)},children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_17775"),value:n,onChange:s})}),(0,i.jsx)(rd,{ref:h,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:x,onClick:e=>{Gd(e)},...f.poppeer,children:a||I.map(n=>(0,i.jsxs)(rd,{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)(ub,{badge:n.isAdmin&&(0,i.jsx)(vu,{color:"primary",children:t("administrateur_38490")}),disabled:n.isDisabled,userInfo:n}),!n.isDisabled&&(0,i.jsx)(kd,{color:"white",leftIcon:"plus",size:"sm",onClick:()=>{e.onAdd(n)}})]},n.id))})]})},bw=e=>{const t=Ti();return(0,i.jsxs)(rd,{align:"center",gap:"5",children:[(0,i.jsx)(ka,{css:{flex:1,maxWidth:"calc(50% - 32px)"},children:(0,i.jsx)(ub,{userInfo:e.leader.userInfo})}),(0,i.jsx)(ka,{css:{flex:1,maxWidth:"calc(50% - 32px)"},children:(0,i.jsx)(hh,{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)(ka,{color:"gray500",css:{cursor:"pointer",width:"$6",padding:"$1"},onClick:e.onDelete,children:(0,i.jsx)(Id,{icon:"trash-can"})})]})},jw=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.currentLeaders),s=e.roles[0];return(0,i.jsxs)(Om,{size:"lg",onClose:e.onClose,children:[(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(wj,{color:"primary",icon:"user-gear"})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("modification_de_24714")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:t("les_responsable_92946")}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(vw,{currentLeaders:n,eventId:e.eventId,organizationId:e.organizationId,onAdd:e=>{o(n.concat([{userInfo:e,role:s}]))}}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(rd,{css:{flex:"1",overflowY:"auto"},direction:"column",gap:"4",children:n.map((t,s)=>(0,i.jsx)(bw,{leader:t,roles:e.roles,onDelete:()=>{o((0,Cu.A)(n,t))},onRoleChange:t=>{o((0,Wm.jM)(n=>{n[s].role=e.roles.find(e=>e.id===t)}))}},t.userInfo.id))}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{onClick:()=>{e.onSave(n.map(e=>({userInfoId:e.userInfo.id,roleId:e.role.id})))},children:t("enregistrer_06519")}),(0,i.jsx)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},Cw=({leaders:e})=>{const{translate:t}=bd(),{designSystem:n}=Xu(),o=n===Yu?({children:e})=>(0,i.jsx)(rd,{direction:"column",width:1,children:e}):({children:e})=>(0,i.jsx)(i.Fragment,{children:e});return Bs(e)?(0,i.jsx)(o,{children:e.map((e,n)=>(0,i.jsxs)(V.Fragment,{children:[0!==n&&(0,i.jsx)(Dh,{height:"4"}),(0,i.jsx)(ub,{badge:(0,i.jsx)(vu,{color:"gray",children:t(e.role.name)}),userInfo:e.userInfo})]},e.userInfo.id))}):(0,i.jsx)(ka,{color:"gray500",textAlign:"center",width:1,children:t("aucun_reponsabl_38504")})},yw=e=>{const{translate:t,params:n,params:{organizationId:o,eventId:s}}=bd(),{canPositionEdit:r,canDelegationEdit:a}=Dv(),l=(0,V.useMemo)(()=>(n.positionId||n.positionCategoryId)&&r||(n.delegationId||n.delegationCategoryId)&&a,[a,r,n]),[d,c]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($k,{rightIcon:l?"pen":void 0,rightIconClick:()=>{c(!0)},title:t("reponsable_82458_plural"),children:(0,i.jsx)(Cw,{leaders:e.leaders})}),l&&d&&(0,i.jsx)(jw,{currentLeaders:e.leaders,eventId:s,organizationId:o,roles:e.roles,onClose:()=>{c(!1)},onSave:async t=>{await e.onSave(t),e.reload()}})]})},Aw=e=>{const t=Ti();return"onSave"in e?(0,i.jsx)(yw,{...e}):(0,i.jsx)($k,{title:t("reponsable_82458_plural"),children:(0,i.jsx)(Cw,{leaders:e.leaders})})},Sw=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,delegationCategoryId:s}}=bd(),[r,a,l]=gm(""),[d,c]=(0,V.useState)(0),{data:u,isLoading:m}=Oi("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?ke.Event:ke.Organization,delegationCategoryId:s,name:g(a)?a:void 0,offset:d},[]);const{numberOfPages:h,totalCount:p}=ah(u.organization?.delegations);return(0,i.jsx)(dm,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_une_31213"),value:r,onChange:l})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:t("nom_de_la_d_l_g_28087")}),(0,i.jsx)(pm,{children:t("State")})]}),numberOfPages:h,offset:d,rows:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):u.organization.delegations.nodes.map(s=>(0,i.jsxs)(am,{css:{cursor:"pointer"},onClick:()=>{e.push(qo.DELEGATION({organizationId:n,eventId:o,delegationId:s.id}))},children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(ka,{font:"gray900 textSm medium",children:s.name})}),(0,i.jsx)(Qu,{children:(0,i.jsx)(vu,{...zb(s.state),children:t(s.state)})})]},s.id)),setOffset:c,title:t("liste_des_d_l_g_86270"),totalCount:p})},kw=e=>{const{translate:t,params:{organizationId:n,eventId:o,delegationCategoryId:s}}=bd(),{roles:r}=_v(),{mutate:a}=function(e={}){return Di("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)(Qv,{children:(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[(0,i.jsxs)(rd,{gap:"6",width:1,children:[(0,i.jsx)(Iw,{text:t("nombre_de_d_l_g_45708"),value:e.delegationCategory.numberOfDelegations}),(0,i.jsx)(Iw,{text:t("number_of_membe_24698"),value:e.delegationCategory.numberOfResources})]}),(0,i.jsx)(rd,{children:(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(Sw,{})})}),o&&(0,i.jsx)(rd,{children:(0,i.jsx)(Aw,{leaders:e.delegationCategory.leaders,reload:e.reload,roles:r.delegationCategoryRoles,onSave:e=>a({organizationId:n,eventId:o,massLeaders:{leaders:e,selecteds:{ids:[s]},strategy:yt.Replace}})})})]})})},ww=e=>{const t=Ti(),{mutate:n}=function(e={}){return Di("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)(DA,{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()}})},Ew=e=>{const{params:{organizationId:t,eventId:n},translate:o}=bd();return(0,i.jsxs)(Jk,{children:[(0,i.jsx)(Xk,{to:qo.DELEGATIONS({organizationId:t,eventId:n}),children:o("d_l_gations_78318")}),(0,i.jsx)(Xk,{isCurrent:!0,to:qo.DELEGATION_CATEGORY({organizationId:t,eventId:n,delegationCategoryId:e.category.id}),children:e.category.name})]})},Tw=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=bd(),{canDelegationEdit:r}=Dv(),{mutate:a}=function(e={}){return Di("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)}(),[l,d]=(0,V.useState)(!1);return(0,i.jsx)(eb,{breadcrumbs:(0,i.jsx)(Ew,{category:e.category}),buttons:(0,i.jsxs)(i.Fragment,{children:[r&&(0,i.jsx)(kd,{color:"white",onClick:()=>t.push(qo.DELEGATION_CATEGORY_UPDATE({organizationId:o,eventId:s,delegationCategoryId:e.category.id})),children:n("_diter_62574")}),r&&(0,i.jsx)(kd,{onClick:()=>{t.push(s?fs.CREATE_DELEGATION(o,s,e.category.id):fs.COMMUNITY_CREATE_DELEGATION(o,e.category.id))},children:n("ajouter_une_d_l_79133")}),r&&(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{icon:"copy",onClick:async()=>{const{delegationCategoryDuplicate:{id:n}}=await a({organizationId:o,eventId:s,delegationCategoryId:e.category.id});t.push(qo.DELEGATION_CATEGORY({organizationId:o,eventId:s,delegationCategoryId:n}))},children:n("dupliquer_28256")})}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>{d(!0)},children:n("supprimer_43083")})})]})]}),l&&(0,i.jsx)(ww,{delegationCategory:e.category,eventId:s,organizationId:o,onClose:()=>{d(!1)},onSuccess:()=>{t.replace(qo.DELEGATIONS({organizationId:o,eventId:s}))}})]}),name:e.category.name,subtext:n("_1_d_l_gation_80027_plural",e.category.numberOfDelegations)})},Rw=()=>{const{translate:e,params:{organizationId:t,eventId:n,delegationCategoryId:o}}=bd(),s=Ei(Fg),r=Ei(GS),{canMemberAccredit:a,canMemberDelete:l,canMemberEdit:d}=Dv(),[c,u,m]=vC(t,"delegationCategoryMembers.columns",["name","delegations"]),[h,g,p]=vC(t,"delegationCategoryMembers.limit",em),[f,_,x]=vC(t,"delegationCategoryMembers.predicates",[]),[I,v,b]=vC(t,"delegationCategoryMembers.sort",null),{data:j,isLoading:C}=Oi("query DelegationCategoryMembersInfos($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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:t,eventId:n},[js.SegmentCustomFieldFragment]),y=m||p||x||b||C,A=(0,V.useMemo)(()=>j.organization?.customFields.nodes??[],[j.organization]),S=jC(A),k=(0,V.useMemo)(()=>j.organization?n?s.getDelegationCategoryMembersFilters(t,n,A,j.organization.event,j.organization?.event?.isWeezeventConnected??!1):r.getDelegationMembersFilters(A):[],[n,A]),w=(0,V.useMemo)(()=>n?s.getDelegationCategoryMembersPossibleColumns(t,A,j.organization?.event?.isWeezeventConnected??!1):r.getDelegationMembersPossibleColumns(A),[t,n,A,j]);return y?(0,i.jsx)(Cd,{}):(0,i.jsx)(Qv,{children:(0,i.jsx)(up,{columns:c,columnsSearch:[],columnsToIncludes:n?Mg:WS,eventId:n,filters:k,getMassActionId:e=>n?e.userInfo.id:e.id,limit:h,loadDataList:n?aa:Lr,loadDataListParams:{delegationCategoryId:o,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:n?sa:Fr,loadRowParams:{includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:t,possibleColumns:w,predicates:f,renderActions:(e,t,s)=>(0,i.jsx)(OS,{campaigns:[],canMemberEdit:d,customFields:A,deleteFromEvent:!1,massActions:e,predicates:f,scope:{delegationCategoryId:o},showAccreditationsEdit:!1,showAccreditationsValidate:!!n&&a,showDelete:!!n&&l,showPrint:!1,showWishedAccreditationsEdit:!1,showWishedProfileEdit:!1,sort:I,totalCount:t,onMassEditSuccess:s}),renderAllSelectedText:t=>e("les_1_membres_80039",t),renderPageSelectedText:t=>e("les_1_membres_00895",t),renderSelectAllText:t=>e("s_lectionner_le_81345",t),rendering:Cg.List,setColumns:u,setLimit:g,setPredicates:_,setSort:v,showEditColumns:!0,showEditMode:d,showFilters:!0,showMassActions:d,showPredicatesBadges:!0,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,showSelectAll:!0,sort:I,children:(0,i.jsx)(yp,{renderCell:(e,t,o)=>n?(0,i.jsx)(Uy,{canChangeDelegation:!0,canMemberAccredit:!0,canMemberAssign:!1,column:e,customField:S.get(e.slug),eventId:n,reloadRow:o,row:t}):(0,i.jsx)(HS,{column:e,customField:S.get(e.slug),reloadRow:o,row:t,updatable:!0})})})})},Ow=e=>{const{translate:t,params:{organizationId:n,eventId:o,delegationCategoryId:s}}=bd(),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)(nb,{children:[(0,i.jsx)(Tw,{category:a,reload:e.reload}),(0,i.jsxs)(rb,{css:{flex:"1"},children:[(0,i.jsxs)(ob,{css:{px:"$7"},children:[(0,i.jsx)(ib,{path:qo.DELEGATION_CATEGORY_DASHBOARD(r(!1)),children:t("tableau_de_bord_24627")}),(0,i.jsx)(ib,{path:qo.DELEGATION_CATEGORY_MEMBERS(r(!1)),children:t("membres_125561",a.numberOfResources)})]}),(0,i.jsx)(sb,{path:qo.DELEGATION_CATEGORY_DASHBOARD(r(!0)),children:(0,i.jsx)(kw,{delegationCategory:a,reload:e.reload})}),(0,i.jsx)(sb,{path:qo.DELEGATION_CATEGORY_MEMBERS(r(!0)),children:(0,i.jsx)(Rw,{})})]})]})},Dw=e=>{const{params:{organizationId:t,eventId:n,delegationCategoryId:o}}=bd(),{data:s,loader:r,reload:a}=Oi("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},[js.LeaderInfosFragment]);return r||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{exact:!0,path:qo.DELEGATION_CATEGORY({organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(Fi,{path:qo.DELEGATION_CATEGORY_DASHBOARD({organizationId:t,eventId:n,delegationCategoryId:o}),replace:!0})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Ow,{organization:s.organization,reload:a})})]})},zw=()=>{const e=Ti();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zd,{alertStyle:"primary",children:(0,i.jsx)(Pd,{children:e("votre_import_es_05273")})}),(0,i.jsx)(md,{height:"6"})]})};let $w=class extends ic{constructor(e){super(e)}schema(){const e=this.t("le_document_est_86403");return c.Ik().shape({acl:c.Yj().required(e),key:c.Yj().required(e).test("is-a-zip",this.t("le_fichier_n_es_91526"),e=>Hx(Lx(e).extension)===Ux.Zip),name:c.Yj().required(e),file:c.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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],$w);let Pw=class extends ic{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 c.Ik().shape({input:c.Ik().shape({archive:this.archiveInputService.schema(),fieldId:c.Yj().required(this.t("le_champ_person_80074")).typeError(this.t("le_champ_person_80074"))})})}};Pw=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[tj,$w,Si])],Pw);const Mw=()=>{const{translate:e,params:{organizationId:t}}=bd();return(0,i.jsx)(Wp,{heading:e("votre_fichier_d_51776"),subtitle:(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e("s_lectionnez_vo_27155",lI.bytesToGigabytes(Fx),lI.bytesToMegabytes(2e7))}}),children:(0,i.jsx)(dj,{accept:Vx.Archives,acl:"private",organizationId:t,prefix:"input.archive.",withFileField:!0})})},Fw=({customFields:e})=>{const t=Ti();return(0,i.jsx)(Wp,{heading:t("correspondance_10480"),subtitle:(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:t("_ditez_la_corre_24969")}}),children:(0,i.jsxs)(Ev,{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))]})})},Nw=({customFileFields:e})=>(0,i.jsx)(Fw,{customFields:e}),Lw=e=>!!e.getFieldState("input.archive.key")?.valid&&!!e.getFieldState("input.archive.file")?.valid,Bw=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=bd(),o=Ei(Pw),s=Ei(ld),r=(0,V.useRef)(null),{data:a,loader:l}=Oi("query FilesImportCustomFields($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n customFileFields: customFields(eventId: $eventId, variety: UserInfo, fieldTypes: [File]) {\n nodes {\n ...CustomFieldImport\n }\n }\n }\n}\n",{organizationId:t,eventId:n},[js.CustomFieldImportFragment]),{mutate:d}=function(e={}){return Di("mutation FilesImport(\n $organizationId: OrganizationId!\n $eventId: EventId\n $input: FilesImportInput!\n) {\n jobId: filesImport(organizationId: $organizationId, eventId: $eventId, input: $input)\n}\n",e)}(),{checkFilesImport:c}=HI();return l||(0,i.jsx)(Vd,{customErrorRef:r,height:1,initialValues:{input:o.default().input},render:({form:o,handleSubmit:s,submitting:l,values:d})=>(0,i.jsx)(zp,{button:(0,i.jsx)(kd,{isLoading:l,onClick:s,children:e("importer_la_lis_12866")}),category:e("importe_des_fic_85041"),color:"dark",fallbackClosePath:n?fs.VOLUNTEERS(t,n):ro.COMMUNITY_USERS({organizationId:t}),heading:e("nouvel_import_48306"),children:(0,i.jsxs)(Op,{ref:r,children:[o.getState().submitSucceeded&&(0,i.jsx)(zw,{}),(0,i.jsx)(Nd,{}),(0,i.jsxs)(rd,{direction:"column",gap:"5",children:[(0,i.jsx)(Mw,{}),d.input.archive?.file&&Lw(o)&&(0,i.jsx)(Nw,{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({organizationId:t,eventId:n,input:i});r.current&&(r.current.scrollTop=0),c(e,t,n)}catch{}}})},Vw=e=>{const{translate:t}=bd(),{data:n}=Er({organizationId:e.organizationId}),[o,s]=(0,V.useState)(!1),[r,a]=(0,V.useState)([]),l=(0,V.useMemo)(()=>(0,cm.A)((n.organization?.events.nodes??[]).filter(t=>t.id!==e.eventId),e=>m(e.name)),[n.organization,e.eventId]);return(0,i.jsx)(Av,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"clone",children:t("dupliquer_vers_48809")}),(0,i.jsxs)(jv,{gap:"6",children:[(0,i.jsxs)(zd,{alertStyle:"warning",children:[(0,i.jsx)($d,{children:t("toutes_les_info_60876")}),(0,i.jsx)(Pd,{children:t("certains_param_76352")})]}),(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("sur_quel_v_nem_94155"),renderOnPortal:!0,values:r,onChange:a,children:l.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{disabled:Vs(r),isLoading:o,onClick:async()=>{s(!0),await e.onSuccess(r[0]),e.onClose()},children:t("dupliquer_28256")})})]})})},Uw=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{canFormEdit:s}=zv(),{showNotification:r}=HI(),{mutate:a}=function(e={}){return Di("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)}(),{mutate:l}=function(e={}){return Di("mutation FormDelete($organizationId: OrganizationId!, $eventId: EventId, $formId: FormId!) {\n formDelete(organizationId: $organizationId, eventId: $eventId, formId: $formId) {\n id\n }\n}\n",e)}(),[d,c]=(0,V.useState)(!1),[u,m]=(0,V.useState)(!1),h=(0,V.useCallback)(t=>a({organizationId:n,eventId:o,formId:e.form.id,newEventId:t}),[o,a,n,e.form]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"center",css:{background:"white",bd:!0,padding:"$4 $6"},gap:"6",width:1,children:[(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(bm,{to:jo.FORM_ELEMENTS({organizationId:n,eventId:o,formId:e.form.id}),children:e.form.name})}),(0,i.jsxs)(ka,{color:"gray500",children:[t("nombre_de_champ_91879")," ",(0,i.jsx)(Jp,{color:"gray800",children:e.form.numberOfCustomFields})]}),(0,i.jsx)(Mv,{permissions:Ov.FORM_EDIT,children:(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsxs)(MA,{children:[e.canDuplicate&&(0,i.jsx)(ru,{icon:"clone",onClick:async t=>{Gd(t),await a({organizationId:n,eventId:o,formId:e.form.id}),e.reload()},children:t("dupliquer_28256")}),s&&o&&e.canDuplicate&&(0,i.jsx)(ru,{icon:"clone",onClick:()=>c(!0),children:t("dupliquer_sur_u_11076")})]}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:e=>{Gd(e),m(!0)},children:t("supprimer_43083")})})]})]})})]}),d&&(0,i.jsx)(Vw,{eventId:o,organizationId:n,onClose:()=>c(!1),onSuccess:h}),u&&(0,i.jsx)(DA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_75358"),text:t("suppression_de_73669",e.form.name),onClose:()=>m(!1),onDelete:async()=>{await l({organizationId:n,eventId:o,formId:e.form.id}),r(t("le_formulaire_76783",e.form.name)),e.reload()}})]})};let Ww=class extends ic{constructor(e){super(e)}formInputDefault(){return{name:""}}formInputSchema(){return c.Ik().shape({name:c.Yj().required(this.t("le_nom_est_requ_61536"))})}createFormSchema(){return c.Ik().shape({form:this.formInputSchema()})}};Ww=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],Ww);const Gw=e=>{const t=Ti(),n=Ei(Ww),{mutate:o}=function(e={}){return Di("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)(Ej,{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)(ec,{label:t("nom_du_formulai_14952"),name:"form.name"})})},qw=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=bd(),{canFormEdit:r}=Dv(),[a,l]=(0,V.useState)(e.isCreateOpen);return(0,i.jsxs)(tb,{gap:"4",children:[(0,i.jsx)(ka,{css:{flex:"1"},font:"gray900 displayXs semiBold",children:n("Form_plural")}),e.isSearchVisible&&(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:n("rechercher_un_f_28561"),value:e.name,onChange:e.setName})}),r&&e.canCreateNewForm&&(0,i.jsx)(kd,{onClick:()=>{l(!0)},children:n("cr_er_un_formul_78352")}),a&&(0,i.jsx)(Gw,{eventId:s,organizationId:o,onClose:()=>{l(!1)},onSuccess:e=>{t.push(jo.FORM_ELEMENTS({organizationId:o,eventId:s,formId:e}))}})]})},Hw=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ju,{borderRadius:"$2",height:72,width:1}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(ju,{borderRadius:"$2",height:72,width:1}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(ju,{borderRadius:"$2",height:72,width:1})]}),Kw=e=>{const{translate:t}=bd(),{event:n}=dv(),{hasFeature:o}=_v();Zc(`${n?.name??t("communaut_20896")} ${t("Form_plural")}`);const[s,r]=(0,V.useState)(""),a=(0,V.useMemo)(()=>g(s)?e.forms.filter(e=>e.name.toLowerCase().includes(s.toLowerCase())||e.id.toString(10)===s):e.forms,[e.forms,s]),l=(0,V.useMemo)(()=>0===e.forms.length||o(Ae.Multiform),[e.forms]);return(0,i.jsxs)(nb,{children:[(0,i.jsx)(qw,{canCreateNewForm:l,isCreateOpen:e.isCreateOpen,isSearchVisible:Bs(e.forms),name:s,setName:r}),(0,i.jsx)(Qv,{children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(Hw,{})]}):0===e.forms.length?(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(pA,{subtitle:t("cr_er_vos_formu_26049"),title:t("aucun_formulair_74743")})}):(0,i.jsxs)(i.Fragment,{children:[!l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(zd,{alertStyle:"warning",children:[(0,i.jsx)($d,{children:t("vous_avez_attei_23858")}),(0,i.jsx)(Pd,{children:t("votre_abonnemen_18069")})]}),(0,i.jsx)(md,{height:"7"})]}),a.map(t=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(Uw,{canDuplicate:l,form:t,reload:e.reload}),(0,i.jsx)(md,{height:"3"})]},t.id))]})})]})},Yw=e=>{const{organizationId:t,eventId:n}=zi(),{data:o,isLoading:s,reload:r}=vl({organizationId:t,level:ke.Event,eventId:n}),a=(0,V.useMemo)(()=>(0,cm.A)(o.organization?.forms.nodes??[],e=>e.name.toLowerCase()),[o.organization]);return(0,i.jsx)(Kw,{forms:a,isCreateOpen:e.isCreateOpen,isLoading:s,reload:r})},Zw=e=>{const{organizationId:t}=zi(),{data:n,isLoading:o,reload:s}=vl({organizationId:t,level:ke.Organization}),r=(0,V.useMemo)(()=>(0,cm.A)(n.organization?.forms.nodes??[],e=>e.name.toLowerCase()),[n.organization]);return(0,i.jsx)(Kw,{forms:r,isCreateOpen:e.isCreateOpen,isLoading:o,reload:s})};var Xw=n(5848);const Jw=e=>{const{translate:t}=bd(),{isLoading:n,copy:o}=RI(),s=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("script",{async:!0,defer:!0,src:`https://${F.HEAVENT_PUBLIC_URL.subdomain}.${F.WEEZEVENT_DOMAIN}/weez.js`,type:"text/javascript"}),(0,i.jsx)("a",{className:"weezevent-widget-integration grootlink","data-iframe-background":"transparent","data-type":"groot",href:e.link,children:"WeezCrew"})]});return(0,i.jsxs)(rd,{direction:"column",gap:"7",children:[e.alert,(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(Dd,{css:{fontWeight:"$medium"},textStyle:"bodyText",children:e.iframeLabel}),(0,i.jsx)(ka,{css:{bd:!0,borderRadius:"$1",padding:"$2 $3"},children:(0,i.jsx)("code",{children:(0,Xw.renderToStaticMarkup)((0,i.jsx)(s,{}))})})]}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{isLoading:n,leftIcon:"copy",onClick:()=>o((0,Xw.renderToStaticMarkup)((0,i.jsx)(s,{}))),children:t("copier_75889")})})]})]})},Qw=e=>{const{translate:t}=bd(),{isLoading:n,copy:o}=RI();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"end",gap:"5",children:[(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Dd,{css:{fontWeight:"$medium"},textStyle:"bodyText",children:e.heading}),(0,i.jsx)(ka,{css:{bd:!0,borderRadius:"$1",padding:"$2 $3"},children:(0,i.jsx)(bm,{css:{inlineSize:"max-content",fontWeight:"normal",textDecoration:"underline"},hideIcon:!0,to:e.link,children:e.link})})]}),(0,i.jsx)(kd,{isLoading:n,leftIcon:"copy",onClick:()=>o(e.link),children:t("copier_75889")})]}),(0,i.jsxs)(rd,{align:"center",css:{bd:!0,borderRadius:"$1",padding:"$6 $8"},direction:"column",gap:"6",children:[(0,i.jsxs)(rd,{align:"center",direction:"column",children:[(0,i.jsx)(Dd,{children:t("qr_code_60722")}),(0,i.jsx)(Od,{textStyle:"subtitle",children:e.qrCodeDescription})]}),(0,i.jsx)(ka,{height:120,width:120,children:(0,i.jsx)("img",{height:"100%",src:mf(e.link,{height:120,width:120}),width:"100%"})}),(0,i.jsx)(kd,{download:"qr-code",to:mf(e.link,{height:120,width:120}),children:t("t_l_charger_le_18439")})]})]})},eE=({children:e,isActive:t,onClick:n,replace:o=!0,to:s})=>{const r=Pi(),a=t?.(r.pathname)??r.pathname===s;return(0,i.jsx)(rd,{align:"center",css:{borderBottom:a?"2px solid $primary500":"2px solid transparent",borderTop:"2px solid transparent",color:a?"$primary500":"$gray500",fontWeight:"$medium",px:"$3",userSelect:"none"},height:1,children:(0,i.jsx)(_d,{height:1,replace:o,to:s,width:1,onClick:async()=>{n&&await n()},children:e})})},tE=e=>(0,i.jsx)(rd,{as:id.Nav,css:{borderBottom:"1px solid $gray200"},gap:"2",height:e.height,justify:"center",role:"menubar",width:e.width,children:e.children}),nE=()=>{const{translate:e,params:t}=bd();return(0,i.jsxs)(tE,{height:1,width:1,children:[(0,i.jsx)(eE,{to:jo.FORM_ELEMENTS(t),children:e("champs_91671")}),(0,i.jsx)(eE,{isActive:e=>null!==e.match(/\/form\/\d+\/parameters/),to:jo.FORM_PARAMETERS_GENERAL(t),children:e("param_tres_78420")}),(0,i.jsx)(eE,{to:jo.FORM_INTEGRATION(t),children:e("int_gration_10662")}),(0,i.jsx)(eE,{to:jo.FORM_EMAILS(t),children:e("mod_les_e_mail_91257")}),(0,i.jsx)(eE,{to:jo.FORM_PREVIEW(t),children:e("aper_u_25595")})]})},iE=e=>{const{translate:t}=bd(),{canFormEdit:n}=Dv();return(0,i.jsx)(zp,{button:n&&e.button,category:t("cr_ation_d_un_f_67278"),color:"dark",heading:e.title,onClose:e.onClose,children:(0,i.jsxs)(yc,{gridtemplatecolumns:"1fr",gridtemplaterows:"55px 1fr",height:1,width:1,children:[(0,i.jsx)(nE,{}),(0,i.jsx)(ka,{css:{overflowY:"auto"},children:e.children})]})})},oE=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,formId:s}}=bd(),{data:r}=bl({organizationId:n,formId:s});Zc(r.organization?.form.name??"");const a=cf({organizationId:n,eventId:o,formId:s});return(0,i.jsx)(iE,{title:r.organization?.form.name??"-",onClose:()=>{e.push(jo.FORMS({organizationId:n,eventId:o}))},children:(0,i.jsx)(rd,{justify:"center",width:1,children:(0,i.jsxs)(rd,{css:{paddingBlockStart:"$8"},gap:"8",width:"$container",children:[(0,i.jsx)(rd,{direction:"column",gap:"6",children:(0,i.jsx)(Qw,{heading:t("FormLink"),link:a,qrCodeDescription:t("facilitez_la_co_59826")})}),(0,i.jsx)(rd,{direction:"column",gap:"6",children:(0,i.jsx)(Jw,{alert:(0,i.jsxs)(zd,{alertStyle:"warning",children:[(0,i.jsx)($d,{children:t("comment_marche_73229")}),(0,i.jsx)(Pd,{children:t("ce_code_va_vous_31197")})]}),heading:t("iframe_27513"),iframeLabel:t("code_html_pour_12471"),link:a})})]})})})},sE=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,formId:s}}=bd(),{data:r}=bl({organizationId:n,formId:s});Zc(r.organization?.form.name??"");const[a,l]=(0,V.useState)("opened"),d=cf({organizationId:n,eventId:o,formId:s,query:{preview:!0,previewState:a}});return(0,i.jsx)(iE,{title:r.organization?.form.name??"-",onClose:()=>{e.push(jo.FORMS({organizationId:n,eventId:o}))},children:(0,i.jsxs)(rd,{align:"center",direction:"column",height:1,width:1,children:[(0,i.jsxs)(rd,{direction:"column",width:"$container",children:[(0,i.jsx)(md,{height:"8"}),(0,i.jsxs)(rd,{align:"center",gap:"4",children:[(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(ka,{font:"gray900 textLg semiBold",children:t("aper_u_du_formu_51076")}),(0,i.jsx)(ka,{color:"gray500",children:t("pr_visualiser_v_58073")})]}),(0,i.jsx)(ka,{width:200,children:(0,i.jsxs)(hh,{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)(md,{height:"5"}),(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)("iframe",{height:"100%",src:d,style:{border:"none"},width:"100%"})})]})})},rE=e=>{const{history:t,translate:n}=bd();return(0,i.jsx)(Av,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"triangle-exclamation",children:n("changements_non_17558")}),(0,i.jsx)(jv,{children:(0,i.jsxs)(rd,{align:"center",direction:"column",gap:"1",width:1,children:[(0,i.jsx)(ka,{font:"gray900 textLg medium",children:n("voulez_vous_qui_84408")}),(0,i.jsx)(ka,{color:"gray500",children:n("des_donn_es_ne_27178")})]})}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{color:"error",onClick:()=>t.goBack(e.fallbackPath),children:n("quitter_sans_sa_28486")})})]})})},aE=e=>(0,pn.createPortal)((0,i.jsx)(ka,{css:{background:"$gray50",inset:0,position:"fixed",zIndex:"100"},children:e.children}),document.body),lE=xa("div",{alignItems:"center",borderRadius:"$1",cursor:"pointer",display:"flex",fontWeight:"$semiBold",overflow:"hidden",userSelect:"none",variants:{color:{primary:{background:"$primary500",color:"white","& > .h-button-dropdown-content":{border:"1px solid $primary500",borderRadius:"$1",borderBottomRightRadius:"0",borderTopRightRadius:"0",borderRight:"none"},"& > .h-button-dropdown-icon":{border:"1px solid $primary500",borderRadius:"$1",borderBottomLeftRadius:"0",borderTopLeftRadius:"0",borderLeft:"1px solid $primary600"},"& > .h-button-dropdown-content:hover":{background:"$primary600",border:"1px solid $primary600",borderRight:"none"},"& > .h-button-dropdown-icon:hover":{background:"$primary600",border:"1px solid $primary600"}},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"}}),dE=V.forwardRef((e,t)=>{const{history:n}=bd();return(0,i.jsxs)(lE,{color:e.color,size:e.size,children:[(0,i.jsx)(rd,{ref:t,align:"center",className:"h-button-dropdown-content",css:{flex:"1",px:"$4"},height:1,onClick:t=>{e.onClick&&e.onClick(t),g(e.path)&&n.push(e.path)},children:e.children}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(rd,{align:"center",className:"h-button-dropdown-icon",height:40,justify:"center",width:40,children:(0,i.jsx)(Id,{icon:"chevron-down"})})}),(0,i.jsx)(lu,{placement:"bottom-end",renderOnPortal:!0,children:e.menu})]})]})});dE.displayName="ButtonDropdown";let cE=class extends ic{documentInputService;constructor(e,t){super(t),this.documentInputService=e}customFieldInputDefault(e,t){const n=e?.fieldType??Oe.Text,i=e?.fieldSubtype??mt.Freeform;return{name:e?.name??"",label:e?.label??"",customFieldCategoryId:e?.customFieldCategoryId??t[0].id,description:e?.description??"",variety:e?.variety??Te.UserInfo,fieldType:n,fieldSubtype:i,listType:e?.listType??ht.Default,fileType:e?.fileType??gt.Default,isPrivate:e?.isPrivate??!1,values:Bs(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,canBeUpdatedByUrl:e?.canBeUpdatedByUrl??!1,validationRules:{...Zb(Yb({fieldType:n,fieldSubtype:i,fieldProperty:e?.fieldProperty})),...e?.validationRules}}}customFieldInputSchema(){return c.Ik().shape({name:c.Yj().required(this.t("le_nom_du_champ_17959")),label:c.Yj(),customFieldCategoryId:c.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:c.Yj().required(this.t("le_type_est_req_41180")).oneOf(Fn,this.t("le_type_est_req_41180")),fieldSubtype:c.Yj().required(this.t("le_sous_type_es_85221")).oneOf(Mn,this.t("le_sous_type_es_85221")),listType:c.Yj().required(this.t("le_style_des_op_46016")).oneOf(qn,this.t("le_style_des_op_46016")),fileType:c.Yj().required(this.t("l_affichage_du_11344")).oneOf(Nn,this.t("l_affichage_du_11344")),isPrivate:c.zM().nullable(),hasCondition:c.zM().nullable(),values:c.YO().when("fieldType",{is:Oe.Select,then:e=>e.of(c.Ik().shape({id:c.ai(),value:c.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:c.ai().when("hasCondition",{is:!0,then:e=>e.required(),otherwise:e=>e.nullable()}),conditionValue:c.gl(),canSelectMultiple:c.zM().nullable(),document:this.documentInputService.documentInputSchemaNotRequired(),isEncrypted:c.zM().required(),canBeUpdatedByUrl:c.zM().required(),validationRules:c.Ik().required().when(["fieldType","fieldSubtype"],([e,t])=>this.validationRulesSchema(e,t))})}validationRulesSchema(e,t){const n=()=>c.ai().nullable().integer(this.t("ce_nombre_doit_35487")),i=e=>n().min(e,this.t("ce_nombre_doit_66066",e)),o=(e,t)=>e.when(t,([e],t)=>"number"==typeof e?t.min(e,this.t("le_maximum_doit_04562")):t);switch(Yb({fieldType:e,fieldSubtype:t})){case"text":return c.Ik().shape({mode:c.Yj().oneOf([...qb]),minLength:i(0),maxLength:o(i(1),"minLength"),allowedCharacters:c.Yj().oneOf([...Hb]),regex:c.Yj().when("mode",{is:"regex",then:e=>e.required(this.t("l_expression_r_88693")).test("valid-regex",this.t("l_expression_r_68347"),e=>function(e){try{return new RegExp(e??""),!0}catch{return!1}}(e))}),regexMessage:c.Yj().when("mode",{is:"regex",then:e=>e.required(this.t("le_message_d_er_84907"))})});case"number":return c.Ik().shape({min:n(),max:o(n(),"min")});case"date":return c.Ik().shape({range:c.Yj().oneOf([...Kb]),start:Yp.nullable().when("range",{is:"between",then:e=>e.required(this.t("la_date_de_d_bu_05030"))}),end:Yp.nullable().when("range",{is:"between",then:e=>e.required(this.t("la_date_de_fin_32246"))}).test("end-after-start",this.t("la_date_de_fin_21930"),function(e){const t=this.parent.start;return!t||!e||$s(e)>=$s(t)})});default:return c.Ik()}}createUpdateCustomFieldSchema(){return c.Ik().shape({customField:this.customFieldInputSchema()})}};cE=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[tj,Si])],cE);const uE=({name:e,...t})=>(0,i.jsx)(cd.D0,{name:e,render:e=>(0,i.jsx)(sj,{value:e.input.value,onChange:t=>{e.input.onChange(t)},...t})}),mE=e=>{const{user:t}=Li(),{setNodeRef:n,style:o,handleProps:s}=Hm(e.value.id);return(0,i.jsxs)(rd,{ref:n,align:"center",gap:"4",style:o,children:[(0,i.jsx)(ka,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...s,children:(0,i.jsx)(Id,{icon:"grip-vertical",iconStyle:"solid"})}),e.isEdit&&(r=t.email,["ben.goldsworthy@weezevent.com","florent.odier@weezevent.com","matthieu.ravey@weezevent.com"].includes(r))&&(0,i.jsx)(ka,{css:{width:"fit-content"},fontSize:"textXs",textAlign:"center",children:e.value.id}),e.showColor&&(0,i.jsx)(ka,{children:(0,i.jsx)(uE,{borderRadius:16,name:`customField.values[${e.index}].color`,size:16})}),(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(ec,{name:`customField.values[${e.index}].value`})}),(0,i.jsx)(ka,{color:"gray500",css:{cursor:"pointer"},onClick:e.onDelete,children:(0,i.jsx)(Id,{icon:"trash-can"})})]});var r},hE=e=>{const t=Ti(),n=(0,V.useCallback)((t,n)=>{e.change("customField.values",Gs(e.values,t,n))},[e.values,e.change]),o=!e.isEdit||e.isSelectV2;return(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray700 textSm medium",children:t("valeurs_de_la_l_43599")}),(0,i.jsxs)(rd,{css:{background:"$gray100",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[o?(0,i.jsx)(oh,{ids:e.values.map(e=>e.id),onReorder:n,children:(0,i.jsx)(rd,{direction:"column",gap:"3",children:e.values.map((t,n)=>(0,i.jsx)(mE,{index:n,isEdit:e.isEdit,showColor:e.showColor,value:t,onDelete:()=>{e.change("customField.values",qs(e.values,n))}},t.id))})}):e.values.map((e,t)=>(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(ec,{name:`customField.values[${t}].value`})},t)),(0,i.jsxs)(ka,{css:{cursor:"pointer"},font:"primary500 textSm medium",onClick:()=>{const t=Math.min(0,...e.values.map(e=>e.id??0))-1;e.change("customField.values",e.values.concat([{id:t,value:""}]))},children:["+ ",t("ajouter_une_nou_98358")]})]})]})},gE=xa("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:"$primary50",border:"1px solid $primary500",boxShadow:"$xs","& .radio-row-text":{color:"$primary800"},"& .radio-row-button":{background:"$primary500",border:"1px solid $primary500"}}}},defaultVariants:{state:"unchecked"}}),pE=e=>(Su("common-front/src/designSystem/components/radioRow.tsx","common-front/src/designSystem/components/radioCard.tsx for card-style radio buttons, or create a new component following that pattern for other styles of radio button"),(0,i.jsxs)(gE,{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)(Id,{icon:"check"})})]})),fE=({description:e,label:t,name:n,value:o})=>{const{inputId:s,descId:r}=Hd();return(0,i.jsx)(cd.D0,{name:n,render:n=>{const a=n.input.checked?"checked":"unchecked";return(0,i.jsx)(pE,{descId:r,inputId:s,state:a,onClick:()=>{n.input.onChange(o)},children:(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(Zd,{htmlFor:s,children:(0,i.jsx)(ka,{children:t})}),e&&(0,i.jsx)(ka,{fontWeight:"regular",id:r,children:e})]})})},type:"radio",value:o})},_E="customField.validationRules",xE=e=>{const{translate:t}=bd(),n=Yb({...e.customField,fieldProperty:e.fieldProperty});if(null===n)return null;{const o=e.customField.validationRules,s=e.customField.validationRules;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"5"}),(0,i.jsxs)(Wp,{heading:t("r_gles_de_valid_33082"),subtitle:t("les_valeurs_sai_90911"),children:["text"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(eC,{heading:t("type_de_r_gles_26838"),children:[(0,i.jsx)(fE,{label:t("r_gles_par_d_fa_31067"),name:`${_E}.mode`,value:"default"}),(0,i.jsx)(fE,{description:t("la_valeur_doit_29705"),label:t("expression_r_gu_99597"),name:`${_E}.mode`,value:"regex"})]}),"regex"===o.mode?(0,i.jsxs)(eC,{heading:t("expression_r_gu_99597"),children:[(0,i.jsx)(ec,{label:t("expression_r_gu_99597"),name:`${_E}.regex`,placeholder:"^[A-Z]{2}[0-9]{4}$"}),(0,i.jsx)(ec,{label:t("message_d_erreu_68530"),name:`${_E}.regexMessage`})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(eC,{heading:t("espaces_22926"),children:[(0,i.jsx)(Fp,{name:`${_E}.noLeadingTrailingSpaces`,children:t("pas_d_espace_au_17159")}),(0,i.jsx)(Fp,{name:`${_E}.noSpaces`,children:t("aucun_espace_57608")})]}),(0,i.jsx)(eC,{heading:t("nombre_de_carac_58931"),children:(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(ec,{label:t("minimum_26731"),name:`${_E}.minLength`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})}),(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(ec,{label:t("maximum_56225"),name:`${_E}.maxLength`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})})]})}),(0,i.jsx)(eC,{heading:t("caract_res_auto_81544"),children:(0,i.jsxs)(Ev,{label:t("caract_res_auto_81544"),name:`${_E}.allowedCharacters`,children:[(0,i.jsx)("option",{value:"all",children:t("tous_les_caract_05992")}),(0,i.jsx)("option",{value:"numbers",children:t("chiffres_unique_20331")}),(0,i.jsx)("option",{value:"noSymbols",children:t("pas_de_symboles_28799")}),(0,i.jsx)("option",{value:"uppercase",children:t("majuscules_uniq_62106")}),(0,i.jsx)("option",{value:"lowercase",children:t("minuscules_uniq_30465")})]})})]})]}),"number"===n&&(0,i.jsx)(eC,{heading:t("valeur_22437"),children:(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(ec,{label:t("minimum_26731"),name:`${_E}.min`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})}),(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(ec,{label:t("maximum_56225"),name:`${_E}.max`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})})]})}),"date"===n&&(0,i.jsxs)(eC,{heading:t("dates_accept_es_28396"),children:[(0,i.jsx)(fE,{label:t("toutes_les_date_15702"),name:`${_E}.range`,value:"any"}),(0,i.jsx)(fE,{label:t("dates_pass_es_u_19138"),name:`${_E}.range`,value:"past"}),(0,i.jsx)(fE,{label:t("entre_deux_date_48809"),name:`${_E}.range`,value:"between"}),"between"===s.range&&(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(Np,{label:t("d_but_41840"),name:`${_E}.start`})}),(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(Np,{label:t("fin_60104"),name:`${_E}.end`})})]})]})]})]})}};var IE;!function(e){e.Basic="Basic",e.Advanced="Advanced"}(IE||(IE={}));const vE=e=>{const{translate:t}=bd(),{showNotification:n}=HI(),o=Ei(cE),s=um(),r=Ei(ld),{mutate:a}=function(e={}){return Di("mutation CustomFieldCategoryCreate(\n $organizationId: OrganizationId!\n $category: CustomFieldsCategoryInput!\n) {\n customFieldCategoryCreate(organizationId: $organizationId, customFieldCategory: $category) {\n id\n name\n }\n}\n",e)}(),{canCustomFieldEdit:l}=zv(),d=(0,V.useRef)(null);Zc((0,V.useMemo)(()=>e.isEdit?t("mise_jour_de_17055",e.initialValues.customField.name):t("nouveau_champ_p_27686"),[e.isEdit,e.initialValues]));const c=(0,V.useMemo)(()=>(0,cm.A)(e.organization.customFields.nodes.filter(t=>t.id!==e.customFieldId),e=>e.name.toLowerCase()),[e.customFieldId,e.organization]),[u,m]=(0,V.useState)(vj(e.organization.customFieldsCategories.nodes)),[h,p]=(0,V.useState)(e.initialValues.customField.fieldType),[f,_]=(0,V.useState)(e.initialValues.customField.hasCondition),[x,I]=(0,V.useState)(c.find(t=>t.id===e.initialValues.customField.conditionCustomFieldId)),[v,b]=(0,V.useState)(e.isEdit&&((j=e.initialValues.customField).variety!==Te.UserInfo||g(j.label)||j.fieldSubtype!==mt.Freeform||j.listType!==ht.Default||j.fileType!==gt.Default||j.isEncrypted||j.canBeUpdatedByUrl||!0===j.isPrivate||!0===j.hasCondition||function(e){const t=e,n=e,i=e;return"regex"===t.mode||!0===t.noLeadingTrailingSpaces||!0===t.noSpaces||"number"==typeof t.minLength||"number"==typeof t.maxLength||void 0!==t.allowedCharacters&&"all"!==t.allowedCharacters||"number"==typeof n.min||"number"==typeof n.max||void 0!==i.range&&"any"!==i.range}(j.validationRules))?IE.Advanced:IE.Basic);var j;const[C,y]=(0,V.useState)(!1),A=v===IE.Advanced,S=!e.isFromForm,k=x?.fieldType===Oe.Checkbox,w=_j(x);return(0,i.jsx)(Vd,{customErrorRef:d,height:1,initialValues:e.initialValues,render:({form:n,handleSubmit:o,submitting:r,values:g})=>{const j=(t,i)=>{n.batch(()=>{n.change("customField.fieldType",t),n.change("customField.fieldSubtype",i),n.change("customField.validationRules",Zb(Yb({fieldType:t,fieldSubtype:i,fieldProperty:e.fieldProperty})))})},E=(g.customField.variety===Te.Delegation||g.customField.variety===Te.UserInfo)&&h===Oe.Text,T=e.isEdit||g.customField.fieldSubtype!==mt.Freeform,R=(g.customField.variety===Te.Delegation||g.customField.variety===Te.UserInfo)&&h!==Oe.Validation&&!0!==e.isFromForm,O=g.customField.variety===Te.UserInfo&&Bs(c),D=A&&g.customField.fieldType===Oe.Text,z=A&&g.customField.fieldType===Oe.Select,$=A&&g.customField.fieldType===Oe.File,P=g.customField.variety===Te.UserInfo&&Vb.includes(h);return(0,i.jsx)(zp,{button:e.isEdit?(0,i.jsx)(kd,{isLoading:r,onClick:o,children:t("mettre_jour_85141")}):null,category:e.isEdit?t("CustomFieldUpdate"):t("CustomFieldCreate"),color:"dark",heading:e.isEdit?e.initialValues.customField.name:t("nouveau_champ_p_27686"),onClose:e.onClose,children:(0,i.jsxs)(Op,{ref:d,children:[(0,i.jsx)(Ba.Yr,{name:"customField.fieldType",children:e=>{p(e),e===Oe.Validation&&n.change("customField.isPrivate",!1)}}),(0,i.jsx)(Ba.Yr,{name:"customField.fieldSubtype",children:e=>{n.change("customField.isEncrypted",e!==mt.Freeform)}}),(0,i.jsx)(Ba.Yr,{name:"customField.hasCondition",children:e=>{n.change("customField.conditionCustomFieldId",c[0].id),_(e)}}),(0,i.jsx)(Ba.Yr,{name:"customField.conditionCustomFieldId",children:e=>{const t=c.find(t=>t.id===e);t&&(n.change("customField.conditionValue",t.fieldType===Oe.Checkbox||[]),I(t))}}),(0,i.jsx)(Nd,{}),(0,i.jsxs)(Wp,{heading:t("informations_su_14015"),children:[(0,i.jsxs)(eC,{heading:t("initialisation_38640"),children:[(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("type_de_cr_atio_50953")}),(0,i.jsxs)(vI,{selectedItem:v,onChange:e=>{b(e)},children:[(0,i.jsx)(bI,{item:IE.Basic,children:t("basique_25478")}),(0,i.jsx)(bI,{item:IE.Advanced,children:t("avanc_08814")})]})]}),A&&S&&(0,i.jsxs)(Ev,{label:t("typologie_34041"),name:"customField.variety",state:e.isEdit?"disabled":"active",children:[(0,i.jsx)("option",{value:Te.Accreditation,children:t("accr_ditations_39450")}),(0,i.jsx)("option",{value:Te.Delegation,children:t("d_l_gations_78318")}),!e.eventId&&(0,i.jsx)("option",{value:Te.Event,children:t("Event")}),(0,i.jsx)("option",{value:Te.Position,children:t("missions_63972")}),(0,i.jsx)("option",{value:Te.UserInfo,children:t("membres_11310")})]}),(0,i.jsx)(Gp,{isCreateVisible:l,isSearchVisible:!0,label:t("cat_gorie_00291"),name:"customField.customFieldCategoryId",placeholder:t("rechercher_ou_c_16469"),onCreateClick:()=>{y(!0)},children:u.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsxs)(eC,{heading:t("nom_du_champ_48329"),children:[(0,i.jsx)(ec,{hint:t("titre_de_la_que_69079"),label:t("nom_du_champ_48329"),name:"customField.name"}),(0,i.jsx)(ec,{hint:t("sous_titre_de_l_90967"),label:(0,i.jsx)(fI,{children:t("sous_titre_97472")}),name:"customField.description"}),A&&(0,i.jsx)(ec,{hint:t("nom_technique_u_74183"),label:(0,i.jsx)(fI,{children:t("label_08243")}),name:"customField.label"})]}),(0,i.jsxs)(eC,{heading:t("Type de champ"),children:[(0,i.jsx)(hh,{label:t("type_35427"),state:e.isEdit?"disabled":"active",value:g.customField.fieldType,onChange:e=>{j(e,g.customField.fieldSubtype)},children:s(Fn)}),D&&(0,i.jsx)(hh,{label:t("sous_type_de_ch_73883"),state:e.isEdit?"disabled":"active",value:g.customField.fieldSubtype,onChange:e=>{j(g.customField.fieldType,e)},children:s(Mn)}),z&&(0,i.jsx)(Ev,{label:t("style_des_optio_82329"),name:"customField.listType",children:s(qn)}),$&&(0,i.jsx)(Ev,{label:t("affichage_du_fi_79168"),name:"customField.fileType",children:s(Nn)}),h===Oe.Select&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hE,{change:n.change,isEdit:e.isEdit,isSelectV2:e.isSelectV2,showColor:g.customField.listType!==ht.Default,values:g.customField.values}),(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("est_ce_qu_il_es_10680")}),(0,i.jsx)(Fp,{disabled:e.isEdit,name:"customField.canSelectMultiple",children:t("oui_il_est_pos_25233")})]})]}),h===Oe.Validation&&(0,i.jsx)(dj,{accept:[Vx.Images,Vx.Pdf],acl:"public-read",label:(0,i.jsx)(fI,{children:t("document_87149")}),organizationId:e.organizationId,prefix:"customField.document."})]}),A&&E&&(0,i.jsx)(eC,{heading:t("chiffrement_des_84602"),children:(0,i.jsx)(Kp,{disabled:T,name:"customField.isEncrypted",subtext:t("seuls_les_4_der_85542"),children:t("les_donn_es_son_85588")})}),A&&P&&(0,i.jsx)(eC,{heading:t("modification_pa_97786"),children:(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("la_valeur_de_ce_49938")}),(0,i.jsx)(Fp,{name:"customField.canBeUpdatedByUrl",children:t("oui_la_valeur_72738")})]})})]}),A&&(R||O)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"5"}),(0,i.jsxs)(Wp,{heading:t("affichage_du_ch_62974"),children:[R&&(0,i.jsx)(eC,{heading:t("Privacy"),children:(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("ce_champ_est_il_98722")}),(0,i.jsx)(Fp,{name:"customField.isPrivate",children:t("oui_le_champ_n_99925")})]})}),O&&(0,i.jsxs)(eC,{heading:t("d_pendance_du_c_85763"),children:[(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("l_affichage_de_99189")}),(0,i.jsx)(Fp,{name:"customField.hasCondition",children:t("oui_le_champ_d_00513")})]}),f&&(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},direction:"column",gap:"4",children:[(0,i.jsx)(Gp,{isSearchVisible:!0,label:t("nom_du_champ_do_17104"),name:"customField.conditionCustomFieldId",children:c.map(e=>(0,i.jsx)("option",{value:e.id,children:Wb(e)},e.id))}),x&&(k?(0,i.jsxs)(Ev,{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)(Gp,{isSearchVisible:!0,label:t("pour_quelle_val_60529",x.name),multiple:!0,name:"customField.conditionValue",children:w},x.id))]})]})]})]}),A&&(0,i.jsx)(xE,{customField:g.customField,fieldProperty:e.fieldProperty}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)($p,{children:(0,i.jsx)(kd,{isLoading:r,onClick:o,children:(0,i.jsx)(ka,{textAlign:"center",children:e.isEdit?t("mettre_jour_l_31784"):t("cr_er_le_champ_05516")})})}),C&&(0,i.jsx)(iC,{initialName:"",isEdit:!1,mutate:async t=>{const{customFieldCategoryCreate:n}=await a({organizationId:e.organizationId,category:{name:t}});return n},onClose:()=>{y(!1)},onSuccess:e=>{m(vj([...u,e])),n.change("customField.customFieldCategoryId",e.id)}})]})})},validate:r.validateForForm(o.createUpdateCustomFieldSchema()),width:1,onSubmit:async i=>{const{customField:o}=await e.mutate({organizationId:e.organizationId,eventId:e.eventId,customField:{...i.customField,description:i.customField.description||"",values:i.customField.values.map(e=>(e.id??0)<0?{...e,id:void 0}:e)}});n(e.isEdit?t("le_champ_person_31517"):t("le_champ_person_90348")),e.onClose(),e.onSuccess(o)}})},bE=e=>{const t=Ei(cE),{data:n,loader:o}=Oi("query OrganizationInfos($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n ...CreateCustomFieldInfos\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[js.CreateCustomFieldInfosFragment]);const{mutate:s}=function(e={}){return Di("mutation CustomFieldCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $customField: CustomFieldInput!\n) {\n customField: customFieldCreate(\n organizationId: $organizationId\n eventId: $eventId\n customField: $customField\n ) {\n id\n name\n label\n fieldType\n listType\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 color\n }\n }\n}\n",e)}({redirectOnSuccess:!0});return o||(0,i.jsx)(vE,{customFieldId:null,eventId:e.eventId,fieldProperty:pt.Custom,initialValues:{customField:t.customFieldInputDefault(null,n.organization.customFieldsCategories.nodes)},isEdit:!1,isFromForm:e.isFromForm,isSelectV2:!0,mutate:s,organization:n.organization,organizationId:e.organizationId,onClose:e.onClose,onSuccess:e.onSuccess})},jE=e=>{const t=Ei(cE),{data:n,loader:o}=Oi("query CustomFieldToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $customFieldId: CustomFieldId!\n) {\n organization(id: $organizationId) {\n ...CreateCustomFieldInfos\n\n customField(id: $customFieldId) {\n name\n label\n customFieldCategoryId\n description\n variety\n fieldType\n fieldSubtype\n fieldProperty\n listType\n fileType\n isPrivate\n hasCondition\n conditionCustomFieldId\n canSelectMultiple\n conditionValue\n isSelectV2\n isEncrypted\n canBeUpdatedByUrl\n validationRules\n\n document {\n acl\n name\n key\n }\n\n values {\n id\n value\n color\n }\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId,customFieldId:e.customFieldId},[js.CreateCustomFieldInfosFragment]);const{mutate:s}=function(e={}){return Di("mutation CustomFieldUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $customFieldId: CustomFieldId!\n $customField: CustomFieldInput!\n) {\n customField: customFieldUpdate(\n organizationId: $organizationId\n eventId: $eventId\n customFieldId: $customFieldId\n customField: $customField\n ) {\n id\n name\n label\n fieldType\n listType\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 color\n }\n }\n}\n",e)}({redirectOnSuccess:!0});return o||(0,i.jsx)(vE,{customFieldId:e.customFieldId,eventId:e.eventId,fieldProperty:n.organization.customField.fieldProperty,initialValues:{customField:t.customFieldInputDefault(n.organization.customField,n.organization.customFieldsCategories.nodes)},isEdit:!0,isSelectV2:n.organization.customField.isSelectV2,mutate:t=>s({...t,customFieldId:e.customFieldId}),organization:n.organization,organizationId:e.organizationId,onClose:e.onClose,onSuccess:e.onSuccess})},CE=()=>{const{history:e,params:{organizationId:t,eventId:n}}=bd();return(0,i.jsx)(bE,{eventId:n,organizationId:t,onClose:()=>{e.goBack(tx.CUSTOM_FIELDS({organizationId:t,eventId:n}))},onSuccess:hc.A})},yE=()=>{const{history:e,params:{organizationId:t,eventId:n,customFieldId:o}}=bd();return(0,i.jsx)(jE,{customFieldId:o,eventId:n,organizationId:t,onClose:()=>{e.goBack(tx.CUSTOM_FIELDS({organizationId:t,eventId:n}))},onSuccess:hc.A})},AE=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.initialName);return(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(wj,{color:"primary",icon:"sliders"})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("nouvelle_sectio_88105")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:t("ajouter_des_sec_58545")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(Qd,{label:t("nom_de_la_secti_38728"),value:n,onChange:o}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{onClick:()=>{e.onAdd(n),e.onClose()},children:g(e.initialName)?t("renommer_la_sec_00650"):t("cr_er_la_sectio_96175")}),(0,i.jsx)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},SE=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.initialText);return(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(wj,{color:"primary",icon:"sliders"})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("champ_texte_lib_91587")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:t("ajouter_des_cha_68672")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(ka,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(AI,{initialValue:n,onChange:o})}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{onClick:()=>{e.onAdd(n),e.onClose()},children:g(e.initialText)?t("mettre_jour_l_69246"):t("ajouter_le_cham_74670")}),(0,i.jsx)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},kE=e=>{const{translate:t,params:{organizationId:n}}=bd(),o=$v(),[s,r]=(0,V.useState)(!1),{setNodeRef:a,style:l,handleProps:d}=Hm(e.elementId);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{ref:a,align:"center",css:{bd:!0,padding:"$4 $6",...e.css},gap:"5",style:l,children:[(0,i.jsx)(Mv,{permissions:Ov.FORM_EDIT,children:(0,i.jsx)(ka,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...d,children:(0,i.jsx)(Id,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(rd,{gap:"2",children:[(0,i.jsx)(ka,{color:"gray800",fontWeight:"semiBold",children:e.field.name}),e.field.conditionCustomField&&(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{color:"gray800",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(Id,{icon:"split"})})}),(0,i.jsx)(bp,{placement:"top",children:t("ce_champ_d_pend_31209",e.field.conditionCustomField?.name)})]})]}),(0,i.jsx)(ka,{color:"gray500",children:t(e.field.fieldType)})]}),(0,i.jsxs)(Mv,{permissions:Ov.FORM_EDIT,children:[(0,i.jsx)(Zm,{value:e.isMandatory,onChange:t=>{e.toggleIsMandatory(e.index,t)},children:t("obligatoire_35326")}),(0,i.jsxs)(rd,{gap:"2",children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.onDelete(e.index)}})})}),(0,i.jsx)(bp,{placement:"top",children:t("supprimer_le_ch_99740")})]}),e.showEdit&&o(e.field)&&(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{r(!0)}})})}),(0,i.jsx)(bp,{placement:"top",children:t("_diter_le_champ_78018")})]})]})]})]}),s&&(0,i.jsx)(aE,{children:(0,i.jsx)(jE,{customFieldId:e.field.id,eventId:e.field.eventId,organizationId:n,onClose:()=>r(!1),onSuccess:e.updateCustomField})})]})},wE=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>e.conditionCustomFields.map(e=>(0,i.jsx)("option",{value:e.id,children:Wb(e)},e.id)),[e.conditionCustomFields]),o=e.conditionCustomFields.find(t=>t.id===e.conditionCustomFieldId),s=_j(o);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("champ_sur_leque_68198"),renderOnPortal:!0,values:e.conditionCustomFieldId?[e.conditionCustomFieldId]:[],onChange:t=>{Bs(t)?e.setConditionCustomFieldId(t[0]):e.setConditionCustomFieldId(null)},children:n}),o&&(0,i.jsx)(i.Fragment,{children:o.fieldType===Oe.Checkbox?(0,i.jsxs)(hh,{label:t("pour_quelle_val_60529",o.name),shouldParseAsBoolean:!0,value:e.conditionValue,onChange:e.setConditionValue,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]}):(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("pour_quelle_val_60529",o.name),multiple:!0,renderOnPortal:!0,values:e.conditionValue,onChange:e.setConditionValue,children:s},o.id)})]})},EE=e=>{const{translate:t}=bd(),[n,o]=V.useState(e.element.conditionCustomFieldId),[s,r]=V.useState(e.element.conditionValue),a=null!==n&&("boolean"==typeof s||Bs(s));return(0,i.jsx)(Av,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"split",children:t("ajouter_une_con_66324")}),(0,i.jsx)(jv,{gap:"4",children:(0,i.jsx)(wE,{conditionCustomFieldId:n,conditionCustomFields:e.conditionCustomFields,conditionValue:s,setConditionCustomFieldId:t=>{const n=e.conditionCustomFields.find(e=>e.id===t);n&&(r(n.fieldType===Oe.Checkbox||[]),o(t))},setConditionValue:r})}),(0,i.jsxs)(bv,{hideCancelButton:!0,children:[(0,i.jsx)(kd,{disabled:!a,onClick:()=>{e.onConditionAdd(e.index,n,s),e.onClose()},children:t("ajouter_une_con_66324")}),(0,i.jsx)(kd,{color:"white",onClick:()=>{e.onConditionDelete(e.index),e.onClose()},children:t("supprimer_la_co_57888")})]})]})})},TE=e=>{const t=Ti(),[n,o]=(0,V.useState)(!1),[s,r]=(0,V.useState)(!1),a=(0,V.useMemo)(()=>e.conditionCustomFields.find(t=>t.id===e.element.conditionCustomFieldId),[e.element.conditionCustomFieldId,e.conditionCustomFields]),{setNodeRef:l,style:d,handleProps:c}=Hm(e.element.id);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{ref:l,align:"center",css:{background:"$gray900",bd:"gray900 2",color:"white",marginBottom:"$2",marginTop:"$5",padding:"$4 $6"},gap:"5",style:d,children:[(0,i.jsx)(Mv,{permissions:Ov.FORM_EDIT,children:(0,i.jsx)(ka,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...c,children:(0,i.jsx)(Id,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(rd,{css:{flex:"1"},gap:"2",children:[(0,i.jsx)(ka,{fontWeight:"semiBold",children:e.element.section||""}),a&&(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{color:"white",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(Id,{icon:"split"})})}),(0,i.jsx)(bp,{placement:"top",children:t("cette_section_d_50768",a.name)})]})]}),(0,i.jsx)(Mv,{permissions:Ov.FORM_EDIT,children:(0,i.jsxs)(rd,{gap:"2",children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"split",size:"sm",onClick:()=>r(!0)})})}),(0,i.jsx)(bp,{placement:"top",children:t("ajouter_une_con_66324")})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>e.onDelete(e.index)})})}),(0,i.jsx)(bp,{placement:"top",children:t("supprimer_43083")})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>o(!0)})})}),(0,i.jsx)(bp,{placement:"top",children:t("renommer_42135")})]})]})})]}),n&&(0,i.jsx)(AE,{initialName:e.element.section||"",onAdd:t=>{e.onRename(e.index,t)},onClose:()=>{o(!1)}}),s&&(0,i.jsx)(EE,{conditionCustomFields:e.conditionCustomFields,element:e.element,index:e.index,isOpen:s,onClose:()=>r(!1),onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete})]})},RE=e=>{const t=Ti(),[n,o]=(0,V.useState)(!1),[s,r]=(0,V.useState)(!1),a=(0,V.useMemo)(()=>e.conditionCustomFields.find(t=>t.id===e.element.conditionCustomFieldId),[e.element.conditionCustomFieldId,e.conditionCustomFields]),{setNodeRef:l,style:d,handleProps:c}=Hm(e.element.id);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{ref:l,align:"center",css:{bd:!0,padding:"$4 $6"},gap:"5",style:d,children:[(0,i.jsx)(Mv,{permissions:Ov.FORM_EDIT,children:(0,i.jsx)(ka,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...c,children:(0,i.jsx)(Id,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(rd,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(ka,{children:(0,i.jsx)(jf,{text:e.element.text||""})}),a&&(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{color:"gray800",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(Id,{icon:"split"})})}),(0,i.jsx)(bp,{placement:"top",children:t("ce_texte_d_pend_87251",a.name)})]})]}),(0,i.jsx)(Mv,{permissions:Ov.FORM_EDIT,children:(0,i.jsxs)(rd,{gap:"2",children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"split",size:"sm",onClick:()=>r(!0)})})}),(0,i.jsx)(bp,{placement:"top",children:t("ajouter_une_con_66324")})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>e.onDelete(e.index)})})}),(0,i.jsx)(bp,{placement:"top",children:t("supprimer_43083")})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>o(!0)})})}),(0,i.jsx)(bp,{placement:"top",children:t("_diter_62574")})]})]})})]}),n&&(0,i.jsx)(SE,{initialText:e.element.text||"",onAdd:t=>{e.onEdit(e.index,t)},onClose:()=>o(!1)}),s&&(0,i.jsx)(EE,{conditionCustomFields:e.conditionCustomFields,element:e.element,index:e.index,isOpen:s,onClose:()=>r(!1),onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete})]})},OE=e=>{const t=(0,V.useMemo)(()=>Object.fromEntries(e.customFields.map(e=>[e.id,e])),[e.customFields]),n=(0,V.useMemo)(()=>e.customFields.filter(e=>[Oe.Checkbox,Oe.Country,Oe.Language,Oe.Nationality,Oe.Select].includes(e.fieldType)),[e.customFields]);return(0,i.jsx)(oh,{ids:e.elements.map(e=>e.id),onReorder:e.onReorder,children:(0,i.jsx)(rd,{direction:"column",gap:"3",width:1,children:e.elements.map((o,s)=>{switch(o.elementType){case st.Field:{const n=t[o.customFieldId];return n?(0,i.jsx)(kE,{elementId:o.id,field:n,index:s,isMandatory:o.isMandatory,showEdit:!0,toggleIsMandatory:e.fieldsToggleMandatory,updateCustomField:e.updateCustomField,onDelete:e.onDelete},o.id):null}case st.Section:return(0,i.jsx)(TE,{conditionCustomFields:n,element:o,index:s,onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete,onDelete:e.onDelete,onRename:e.sectionOnRename},o.id);case st.Text:return(0,i.jsx)(RE,{conditionCustomFields:n,element:o,index:s,onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete,onDelete:e.onDelete,onEdit:e.textOnEdit},o.id);default:return vd(o.elementType)}})})})},DE=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{canCustomFieldEdit:s}=Dv(),[r,a]=V.useState(!1),[l,d]=V.useState(!1),[c,u]=V.useState(!1),[m,h]=V.useState(e.customFields),g=V.useMemo(()=>new Set(e.elements.flatMap(e=>e.elementType===st.Field?[e.customFieldId]:[])),[e.elements]),p=V.useCallback((t,n)=>{e.setElements(Gs(e.elements,t,n))},[e.elements,e.setElements]),f=V.useCallback(t=>{g.has(t.id)?e.setElements(e.elements.filter(e=>!e.customFieldId||e.customFieldId!==t.id)):e.setElements([...e.elements,{id:W(),elementType:st.Field,customFieldId:t.id,isMandatory:!0,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements,g]),_=V.useCallback((t,n)=>{e.setElements((0,Wm.jM)(e=>{e[t].isMandatory=n}))},[e.setElements]),x=V.useCallback(t=>{e.setElements([...e.elements,{id:W(),elementType:st.Section,section:t,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements]),I=V.useCallback((t,n)=>{e.setElements((0,Wm.jM)(e=>{e[t].section=n}))},[e.setElements]),v=V.useCallback(t=>{e.setElements([...e.elements,{id:W(),elementType:st.Text,text:t,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements]),b=V.useCallback((t,n)=>{e.setElements((0,Wm.jM)(e=>{e[t].text=n}))},[e.setElements]),j=V.useCallback(t=>{e.setElements((0,Wm.jM)(e=>{e.splice(t,1)}))},[e.setElements]),C=V.useCallback(e=>{h(m.map(t=>t.id===e.id?e:t))},[m]),y=V.useCallback((t,n,i)=>{e.setElements((0,Wm.jM)(e=>{e[t].hasCondition=!0,e[t].conditionCustomFieldId=n,e[t].conditionValue=i}))},[e.setElements]),A=V.useCallback(t=>{e.setElements((0,Wm.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)(ka,{height:.5,width:1,children:(0,i.jsx)(pA,{subtitle:t("ajouter_des_cha_37944"),title:t("aucun_champ_ou_18338")})}):(0,i.jsx)(OE,{customFields:m,elements:e.elements,fieldsToggleMandatory:_,sectionOnRename:I,textOnEdit:b,updateCustomField:C,onConditionAdd:y,onConditionDelete:A,onDelete:j,onReorder:p}),(0,i.jsxs)(Mv,{permissions:Ov.FORM_EDIT,children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{gap:"4",justify:0===e.elements.length?"center":"start",width:1,children:[(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:s?(0,i.jsx)(dE,{menu:(0,i.jsx)(ru,{icon:"pen-field",onClick:()=>{u(!0)},children:t("cr_eer_un_champ_08883")}),children:t("ajouter_des_cha_35843")}):(0,i.jsx)(kd,{children:t("ajouter_des_cha_35843")})}),(0,i.jsx)(lu,{css:{padding:"0"},placement:"top-start",width:400,children:(0,i.jsx)($j,{customFields:m,selectedCustomFieldsIds:g,toggle:f})})]}),(0,i.jsx)(kd,{color:"white",onClick:()=>{a(!0)},children:t("ajouter_une_sec_90063")}),(0,i.jsx)(kd,{color:"white",onClick:()=>{d(!0)},children:t("ajouter_un_cham_31151")})]})]}),r&&(0,i.jsx)(AE,{initialName:"",onAdd:x,onClose:()=>{a(!1)}}),l&&(0,i.jsx)(SE,{initialText:"",onAdd:v,onClose:()=>{d(!1)}}),c&&(0,i.jsx)(aE,{children:(0,i.jsx)(bE,{eventId:o,isFromForm:!0,organizationId:n,onClose:()=>u(!1),onSuccess:async t=>{h([...m,t]),setTimeout(()=>{f(t),e.onSave()}),u(!1)}})})]})},zE=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ju,{borderRadius:"$2",height:76,width:1}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(ju,{borderRadius:"$2",height:76,width:1}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(ju,{borderRadius:"$2",height:76,width:1})]}),$E=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,formId:s}}=bd(),{data:r,isLoading:a}=Oi("query FormElements($organizationId: OrganizationId!, $eventId: EventId, $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,eventId:o,formId:s},[js.FormCustomFieldsFragment,js.FormElementsElementFragment]);Zc(r.organization?.form.name??"");const{mutate:l,isLoading:d}=function(e={}){return Di("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,V.useState)([]),[m,h]=(0,V.useState)(""),g=(0,V.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}))}),h(JSON.stringify(c))},[l,c]),[p,f]=(0,V.useState)(!1),_=(0,V.useCallback)(()=>{JSON.stringify(c)===m?e.push(jo.FORMS({organizationId:n,eventId:o})):f(!0)},[c,m]);return(0,V.useEffect)(()=>{u(r.organization?.form.elements??[]),h(JSON.stringify(r.organization?.form.elements??[]))},[r.organization]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(iE,{button:(0,i.jsx)(kd,{isLoading:d,onClick:g,children:t("enregistrer_06519")}),title:r.organization?.form.name??"-",onClose:_,children:(0,i.jsx)(rd,{justify:"center",width:1,children:(0,i.jsxs)(rd,{direction:"column",width:"$container",children:[(0,i.jsx)(md,{height:"8"}),a?(0,i.jsx)(zE,{}):(0,i.jsx)(DE,{customFields:r.organization.formCustomFields.nodes,elements:c,setElements:u,onSave:g}),(0,i.jsx)(md,{height:"8"})]})})}),(0,i.jsx)(rE,{fallbackPath:jo.FORMS({organizationId:n,eventId:o}),isOpen:p,onClose:()=>{f(!1)}})]})},PE=e=>(0,i.jsx)(am,{css:{background:e.isSelected?"$primary50":"white",cursor:"pointer","&:hover":{background:"$gray100"}},onClick:e.onClick,children:(0,i.jsxs)(Qu,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(ka,{color:"gray900",fontWeight:"medium",children:e.title}),(0,i.jsx)(ka,{color:"gray500",children:e.subtitle})]})});let ME=class extends ic{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??[],hasCalendarInvite:n?.hasCalendarInvite??!1,calendarInviteName:n?.calendarInviteName??null,calendarInviteStartDate:n?.calendarInviteStartDate??null,calendarInviteStartTime:n?.calendarInviteStartTime??null,calendarInviteEndDate:n?.calendarInviteEndDate??null,calendarInviteEndTime:n?.calendarInviteEndTime??null,...s}}emailTemplateSchema(){return c.Ik().shape({useDefault:c.zM().required(""),emailType:c.Yj().required(this.t("le_type_d_e_mai_84281")).oneOf(zn,this.t("le_type_d_e_mai_84281")),subject:c.Yj().when("useDefault",{is:!1,then:e=>e.required(this.t("le_sujet_est_re_18923"))}),content:c.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:c.YO().of(c.Yj()),hasCalendarInvite:c.zM().required(),calendarInviteName:c.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("nom_de_l_v_nem_58512")),otherwise:e=>e.nullable()}),calendarInviteStartDate:Yp.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:c.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("heure_de_d_but_90785")),otherwise:e=>e.nullable()}),calendarInviteEndDate:Yp.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:c.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("l_heure_de_fin_78626")),otherwise:e=>e.nullable()})})}updateEmailTemplateSchema(){return c.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.AccreditationsImport:case ze.AccreditationsProfilesImport:case ze.DelegationsImport:case ze.EventsImport:case ze.FilesImport:case ze.Documents:case ze.EventInvite:case ze.Export:case ze.MembersImport:case ze.NewMember:case ze.OrganizationInvite:case ze.PositionsImport:throw new Error("Impossible to change this email");default:return vd()}}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,$c)}}delegationCategoryLeaderAssign(e){return{subject:this.t("_event_name_69973"),content:this.t("_p_bonjour_use_97817",$c,e.href,$c)}}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",$c,e.href,$c)}}positionLeaderAssign(e){return{subject:this.t("_event_name_60486"),content:this.t("leader_assign_default_1",$c,e.href,$c)}}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")}}};ME=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],ME);const FE=e=>{const{history:t,translate:n}=bd(),{organization:o}=_v(),{event:s}=dv(),{data:r,loader:a}=Oi("query EmailTemplate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId\n $source: LoginCodeSource\n $emailType: EmailType!\n) {\n organization(id: $organizationId) {\n emailsSenders(isValidToSendEmail: true) {\n id\n name\n }\n\n customFields(\n variety: UserInfo\n fieldTypes: [Checkbox, Select, Validation]\n onlyUpdatableByUrl: true\n ) {\n nodes {\n ...CustomField\n }\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 hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId,formId:e.formId,source:e.source,emailType:e.emailType},[js.CustomFieldFragment]);const{mutate:l,isLoading:d}=function(e={}){return Di("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)}(),c=Ei(ME),u=Ei(ld),m=s?.useDocuments&&(e.emailType===ze.Accreditations||e.emailType===ze.Assignments||e.emailType===ze.FormSubmit&&e.eventId),h=e.emailType===ze.Accreditations||e.emailType===ze.Assignments||e.emailType===ze.FormSubmit||e.emailType===ze.VolunteerRegistration;return a||(0,i.jsx)(Vd,{direction:"column",initialValues:{emailTemplate:c.emailTemplateDefault(e.emailType,F.HEAVENT_APP_URL,r.organization.emailTemplate,e.eventId,e.formId)},render:({handleSubmit:s,values:a})=>(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[(0,i.jsx)(Dd,{children:n("contenu_de_l_e_19848")}),(0,i.jsx)(Fp,{name:"emailTemplate.useDefault",children:n("utiliser_le_mod_93521")}),!a.emailTemplate.useDefault&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ec,{label:n("sujet_de_l_e_ma_66809"),name:"emailTemplate.subject"}),(0,i.jsx)(Gp,{hint:n("cet_metteur_se_80394"),isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(fI,{children:n("_metteur_de_l_e_51616")}),name:"emailTemplate.emailSenderId",onCreateClick:()=>{t.push(fs.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:(r.organization?.emailsSenders??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(SI,{hint:(0,i.jsx)(ka,{css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:n("vous_pouvez_ajo_23408")}}),label:n("contenu_de_l_e_19848"),name:"emailTemplate.content"}),Bs(r.organization.customFields.nodes)&&(0,i.jsx)($x,{heading:n("attribution_d_u_18785"),isOpen:!1,isOpenToggleLabel:n("je_souhaite_cr_46006"),subtitle:n("cr_ez_une_varia_07170"),children:(0,i.jsx)(OI,{customFields:r.organization.customFields.nodes})}),m&&(0,i.jsxs)(Gp,{isSearchVisible:!0,label:n("pi_ce_s_jointe_82370"),multiple:!0,name:"emailTemplate.attachments",children:[(r.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:y_(e)},e)),Mx.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))]}),h&&(0,i.jsx)(EI,{hasCalendarInvite:a.emailTemplate.hasCalendarInvite,prefix:"emailTemplate."})]}),(0,i.jsx)(Mv,{permissions:Ov.EMAIL_EDIT,children:(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{isLoading:d,onClick:s,children:n("enregistrer_le_77369")})})})]}),validate:u.validateForForm(c.updateEmailTemplateSchema()),width:1,onSubmit:async t=>{await l({organizationId:e.organizationId,eventId:e.eventId,formId:e.formId,source:e.source,emailTemplate:t.emailTemplate})}})},NE=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,formId:s}}=bd(),{data:r}=bl({organizationId:n,formId:s});Zc(r.organization?.form.name??"");const[a,l]=(0,V.useState)(ze.FormSubmit);return(0,i.jsx)(iE,{title:r.organization?.form.name??"-",onClose:()=>{e.push(jo.FORMS({organizationId:n,eventId:o}))},children:(0,i.jsx)(rd,{justify:"center",width:1,children:(0,i.jsxs)(rd,{direction:"column",width:"$container",children:[(0,i.jsx)(md,{height:"8"}),(0,i.jsxs)(rd,{gap:"7",children:[(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("liste_des_e_mai_73508")}),(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(Hu,{children:[(0,i.jsx)(Wu,{children:(0,i.jsx)(pm,{children:t("type_d_e_mail_06577")})}),(0,i.jsx)(PE,{isSelected:a===ze.FormSubmit,subtitle:t("cet_e_mail_est_29404"),title:t("remplissage_du_09925"),onClick:()=>l(ze.FormSubmit)}),(0,i.jsx)(PE,{isSelected:a===ze.Code,subtitle:t("cet_e_mail_est_49525"),title:t("code_20843"),onClick:()=>l(ze.Code)}),o&&(0,i.jsx)(PE,{isSelected:a===ze.FormInvite,subtitle:t("cet_email_est_e_46197"),title:t("invitation_d_un_88753"),onClick:()=>l(ze.FormInvite)})]})]}),(0,i.jsx)(ka,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(rd,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(FE,{emailType:a,eventId:o,formId:s,organizationId:n,source:null})})]}),(0,i.jsx)(md,{height:"8"})]})})})};let LE=class extends ic{constructor(e){super(e)}formParametersBroadcastInputDefault(e){return{segmentsIds:(e?.segments??[]).map(e=>e.segmentId),noAccessTitle:e?.noAccessTitle||"",noAccessMessage:e?.noAccessMessage||""}}formParametersBroadcastInputSchema(){return c.Ik().shape({segmentsIds:c.YO().of(c.ai())})}updateFormParametersBroadcastSchema(){return c.Ik().shape({form:this.formParametersBroadcastInputSchema()})}};LE=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],LE);const BE=({children:e,isActive:t,replace:n=!0,to:o})=>{const s=Pi(),r=t?.(s.pathname)??s.pathname===o;return(0,i.jsx)(ka,{css:{background:r?"$primary50":"transparent",borderRadius:"6px",color:r?"$primary500":"$gray500",cursor:r?"default":"pointer",padding:"$2 $3"},children:(0,i.jsx)(_d,{replace:n,to:o,children:e})})},VE=e=>(0,i.jsx)(rd,{"aria-orientation":"vertical",as:id.Nav,direction:"column",gap:"2",role:"menubar",width:1,children:e.children}),UE=e=>{const{translate:t,params:n}=bd(),{hasFeature:o}=_v(),{event:s}=dv();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(yc,{css:{py:"$8"},gridtemplatecolumns:"1fr 210px 80px 880px 1fr",gridtemplaterows:"1fr",width:1,children:[(0,i.jsx)(ka,{css:{gridColumn:"2 / 3"},children:(0,i.jsxs)(VE,{children:[(0,i.jsx)(BE,{to:jo.FORM_PARAMETERS_GENERAL(n),children:t("g_n_ral_64953")}),(0,i.jsx)(BE,{to:jo.FORM_PARAMETERS_DESIGN(n),children:t("design_15043")}),n.eventId&&(0,i.jsx)(BE,{to:jo.FORM_PARAMETERS_AVAILABILITIES(n),children:t("disponibilit_s_49923")}),n.eventId&&s.usePositions&&(0,i.jsx)(BE,{to:jo.FORM_PARAMETERS_MISSIONS(n),children:t("missions_63972")}),n.eventId&&s.useAccreditations&&o(Ae.Accreditation)&&(0,i.jsx)(BE,{to:jo.FORM_PARAMETERS_ACCREDITATIONS(n),children:t("accr_ditations_39450")}),(0,i.jsx)(BE,{to:jo.FORM_PARAMETERS_BROADCAST(n),children:t("diffusion_56689")}),(0,i.jsx)(BE,{to:jo.FORM_PARAMETERS_STATE(n),children:t("cl_turer_88223")})]})}),(0,i.jsx)(ka,{css:{gridColumn:"4 / 5"},width:1,children:e.children})]}),(0,i.jsx)(rE,{fallbackPath:jo.FORMS({organizationId:n.organizationId,eventId:n.eventId}),isOpen:e.isNotSavedOpen,onClose:e.onNotSavedClose})]})};function WE(e,t,n){const{history:i,params:{organizationId:o,eventId:s}}=bd(),[r,a]=(0,V.useState)(!1),[l,d]=(0,V.useState)(JSON.stringify(e)),c=(0,V.useCallback)(()=>{const e=JSON.stringify(t);l===e?i.push(jo.FORMS({organizationId:o,eventId:s})):a(!0)},[l,t]),u=(0,V.useCallback)(()=>{a(!1)},[a]),m=(0,V.useCallback)(()=>{n(),d(JSON.stringify(t))},[n,t]);return(0,V.useEffect)(()=>{d(JSON.stringify(e))},[e]),{isNotSavedModalOpen:r,onClose:c,onNotSavedClose:u,onSave:m}}const GE=e=>{const t=Ti(),{isNotSavedModalOpen:n,onClose:o,onNotSavedClose:s,onSave:r}=WE(e.initialValues,e.values,e.handleSubmit),[a,l]=V.useState(Bs(e.initialValues.form.segmentsIds)),d=V.useMemo(()=>Bs(e.eventSegments)&&Bs(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))})]}):Bs(e.eventSegments)?(0,i.jsx)(i.Fragment,{children:e.eventSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):Bs(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 V.useEffect(()=>{l(Bs(e.initialValues.form.segmentsIds))},[e.initialValues.form.segmentsIds]),(0,i.jsx)(iE,{button:(0,i.jsx)(kd,{isLoading:e.isMutateLoading,onClick:r,children:t("enregistrer_06519")}),title:e.name,onClose:o,children:(0,i.jsx)(UE,{isNotSavedOpen:n,onNotSavedClose:s,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("diffusion_du_fo_47764")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("personnalisez_l_57514")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:t("_qui_s_adresse_82507")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:a?"unchecked":"checked",onClick:()=>{l(!1),e.change("form.segmentsIds",[])},children:t("_tout_le_monde_35921")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:a?"checked":"unchecked",onClick:()=>{l(!0)},children:t("_certaines_vue_55512")}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(Gp,{isSearchVisible:!0,multiple:!0,name:"form.segmentsIds",children:d})]}),(0,i.jsx)(Dh,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ec,{label:t("nom_de_l_tape_85862"),name:"form.noAccessTitle"}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(SI,{label:t("message_affich_57692"),name:"form.noAccessMessage"})]})]})})})},qE=e=>{const{params:{organizationId:t,eventId:n,formId:o}}=bd(),s=Ei(ld),r=Ei(LE),{mutate:a,isLoading:l}=function(e={}){return Di("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=V.useMemo(()=>({form:r.formParametersBroadcastInputDefault(e.form)}),[e.form]);return(0,i.jsx)(Vd,{direction:"column",height:1,initialValues:d,render:({form:t,handleSubmit:n,values:o})=>(0,i.jsx)(GE,{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})})},HE=()=>{const{params:{organizationId:e,formId:t}}=bd(),{data:n,loader:o}=Oi("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 Zc(n.organization?.form.name??""),(0,i.jsx)(qE,{eventSegments:[],form:n.organization?.form,loader:o,organizationSegments:n.organization?.segments??[]})},KE=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=bd(),{data:o,loader:s}=Oi("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 Zc(o.organization?.form.name??""),(0,i.jsx)(qE,{eventSegments:o.event?.segments??[],form:o.organization?.form,loader:s,organizationSegments:o.organization?.segments??[]})};function YE(e){return"production"===a.Development&&F.HIGHLIGHT_CUSTOM_COLOURS?{blueGray900:"#ff03ee",primary50:"#ffbbfa",primary100:"#ecbbe9",primary200:"#d8bbd7",primary300:"#c4bbc3",primary400:"#b37eaf",primary500:"#9cff66",primary600:"#61fc0d",primary700:"#b35bad",primary800:"#b32eaa",primary900:"#b30da7"}:{blueGray900:e?.blueGray900??Ia.colors.blueGray900.value,primary50:e?.primary50??Ia.colors.primary50.value,primary100:e?.primary100??Ia.colors.primary100.value,primary200:e?.primary200??Ia.colors.primary200.value,primary300:e?.primary300??Ia.colors.primary300.value,primary400:e?.primary400??Ia.colors.primary400.value,primary500:e?.primary500??Ia.colors.primary500.value,primary600:e?.primary600??Ia.colors.primary600.value,primary700:e?.primary700??Ia.colors.primary700.value,primary800:e?.primary800??Ia.colors.primary800.value,primary900:e?.primary900??Ia.colors.primary900.value,primaryCustom500:e?.primary500??Ia.colors.primary500.value,primaryCustom600:e?.primary600??Ia.colors.primary600.value}}function ZE(e){return"production"===a.Development&&F.HIGHLIGHT_CUSTOM_COLOURS?{grayCustom50:"#fabbf6",grayCustom500:"#fa5aef",grayCustom700:"#ff3df2",grayCustom800:"#fc23ee",grayCustom900:"#ff03ee",primaryCustom500:"#9cff66",primaryCustom600:"#61fc0d"}:{grayCustom50:e?.grayCustom50??Ia.colors.gray50.value,grayCustom500:e?.grayCustom500??Ia.colors.gray500.value,grayCustom700:e?.grayCustom700??Ia.colors.gray700.value,grayCustom800:e?.grayCustom800??Ia.colors.gray800.value,grayCustom900:e?.grayCustom900??Ia.colors.gray900.value,primaryCustom500:e?.primaryCustom500??Ia.colors.primary500.value,primaryCustom600:e?.primaryCustom600??Ia.colors.primary600.value}}let XE=class extends ic{documentInputService;constructor(e,t){super(t),this.documentInputService=e}designInputDefault(e,t){return{banner:t?.banner??e?.banner??this.documentInputService.documentInputDefault(),logo:t?.logo??e?.logo??this.documentInputService.documentInputDefault(),colors:ZE(t?.colors??e?.colors)}}formParametersDesignInputDefault(e){return{banner:e?.banner??this.documentInputService.documentInputDefault(),colors:ZE(e?.colors)}}};XE=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[tj,Si])],XE);const JE=({initialValues:e,showBackground:t=!0})=>{const{translate:n}=bd();return(0,i.jsxs)($x,{heading:n("charte_graphiqu_02725"),children:[t&&(0,i.jsx)(eC,{heading:n("couleur_de_fond_75677"),children:(0,i.jsx)(aj,{initialValue:e?.grayCustom50??Ia.colors.gray50.value,label:n("couleur_de_fond_75677"),name:"design.colors.grayCustom50"})}),(0,i.jsx)(eC,{heading:n("textes_07935"),children:(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(aj,{initialValue:e?.grayCustom800??Ia.colors.gray800.value,label:n("couleur_du_text_32021"),name:"design.colors.grayCustom800"}),(0,i.jsx)(aj,{initialValue:e?.grayCustom900??Ia.colors.gray900.value,label:n("couleur_des_tit_58918"),name:"design.colors.grayCustom900"}),(0,i.jsx)(aj,{initialValue:e?.grayCustom500??Ia.colors.gray500.value,label:n("couleur_des_sou_18968"),name:"design.colors.grayCustom500"}),(0,i.jsx)(aj,{initialValue:e?.grayCustom700??Ia.colors.gray700.value,label:n("couleur_des_lab_38397"),name:"design.colors.grayCustom700"})]})}),(0,i.jsx)(eC,{heading:n("boutons_35604"),children:(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(aj,{initialValue:e?.primaryCustom500??Ia.colors.primary500.value,label:n("couleur_des_bou_24410"),name:"design.colors.primaryCustom500"}),(0,i.jsx)(aj,{initialValue:e?.primaryCustom600??Ia.colors.primary600.value,label:n("couleur_des_bou_16515"),name:"design.colors.primaryCustom600"})]})})]})},QE=e=>{const{params:{organizationId:t},translate:n}=bd();return(0,i.jsxs)($x,{heading:e.heading,hideHeading:e.hideHeading,children:[e.showLogo&&(0,i.jsx)(eC,{heading:n("logo_18191"),children:(0,i.jsx)(fj,{hint:n("nous_recommando_20904"),label:n("s_lectionnez_un_82734"),organizationId:t,prefix:"design.logo."})}),(0,i.jsx)(eC,{heading:n("banni_re_86634"),children:(0,i.jsx)(fj,{hint:n("taille_de_l_ima_84109"),label:n("s_lectionnez_un_82734"),organizationId:t,prefix:"design.banner."})})]})},eT=()=>{const{translate:e}=bd();return(0,i.jsxs)($x,{heading:e("design_du_formu_57145"),subtitle:e("personnalisez_l_27035"),children:[(0,i.jsx)(QE,{heading:e("banni_re_du_for_40749"),hideHeading:!0,showLogo:!1}),(0,i.jsx)(JE,{})]})},tT=e=>{const t=Ti(),{isNotSavedModalOpen:n,onClose:o,onNotSavedClose:s,onSave:r}=WE(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(iE,{button:(0,i.jsx)(kd,{isLoading:e.isMutateLoading,onClick:r,children:t("enregistrer_06519")}),title:e.name,onClose:o,children:(0,i.jsx)(UE,{isNotSavedOpen:n,onNotSavedClose:s,children:e.loader||(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(eT,{})})})})},nT=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=bd(),{data:o,loader:s}=Oi("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 ...DesignColors\n }\n }\n }\n}\n",{organizationId:e,formId:n},[js.DesignColorsFragment]);Zc(o.organization?.form.name??"");const r=Ei(XE),{mutate:a,isLoading:l}=function(e={}){return Di("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=V.useMemo(()=>({design:r.formParametersDesignInputDefault(o.organization?.form.design)}),[o.organization]);return(0,i.jsx)(Vd,{direction:"column",height:1,initialValues:d,render:({handleSubmit:t,values:n})=>(0,i.jsx)(tT,{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 iT=class extends ic{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||"",successTitle:e?.successTitle||"",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,ticketUrl:e?.ticketUrl||""}}formParametersGeneralInputSchema(){return c.Ik().shape({name:c.Yj().required(this.t("le_nom_est_requ_61536")),allowMultiProfiles:c.zM().required(),setAssignmentStateToWaiting:c.zM().required(),setAccreditationStateToWaiting:c.zM().required(),description:c.Yj(),successTitle:c.Yj(),successMessage:c.Yj(),areTeamsAllowed:c.zM().required(),maxTeamMembers:c.ai().nullable(),teamMemberFillFullForm:c.zM().required(),informationTitle:c.Yj(),registerButtonText:c.Yj(),ticketUrl:c.Yj().test("valid-ticket-url",this.t("le_lien_doit_co_30275"),e=>!g(e)||e.startsWith("https://"))})}updateFormParametersGeneralSchema(){return c.Ik().shape({form:this.formParametersGeneralInputSchema()})}};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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],iT);const oT=e=>{const t=Ti(),[n,o]=V.useState(Bs(e.values)),s=V.useCallback(t=>{o(t),t||e.change(e.name,[])},[e.name,e.change,o]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("d_finir_la_vale_27863")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("choisissez_une_24029")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(Zm,{value:n,onChange:s,children:t("je_souhaite_d_f_72912")}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(kj,{...e})]})]})},sT=e=>{const{translate:t,params:{eventId:n}}=bd(),{isNotSavedModalOpen:o,onClose:s,onNotSavedClose:r,onSave:a}=WE(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(iE,{button:(0,i.jsx)(kd,{isLoading:e.isMutateLoading,onClick:a,children:t("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(UE,{isNotSavedOpen:o,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba.Yr,{name:"hasWeezTicketForm",children:t=>{t||e.change("form.ticketUrl","")}}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("initialisation_29288")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("personnaliser_l_27381")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ec,{label:t("nom_du_formulai_14952"),name:"form.name"}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"semiBold",children:t("affectation_des_81808")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Fp,{name:"form.setAssignmentStateToWaiting",children:t("les_membres_ser_52180")}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"semiBold",children:t("accr_ditation_d_48426")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Fp,{name:"form.setAccreditationStateToWaiting",children:t("les_membres_ser_34727")})]}),(0,i.jsx)(Dh,{height:"7"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("param_trage_de_41992")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("donner_la_possi_56694")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{font:"gray800 textSm semiBold",children:t("inscriptions_mu_35073")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Kp,{name:"form.allowMultiProfiles",children:t("autoriser_les_i_26880")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{font:"gray800 textSm semiBold",children:t("remplissages_mu_72343")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Kp,{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)(md,{height:"4"}),(0,i.jsx)(ka,{font:"gray800 textSm semiBold",children:t("inscriptions_en_77739")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Kp,{name:"form.areTeamsAllowed",children:t("permettre_aux_m_56083")}),e.values.form.areTeamsAllowed&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(Kp,{name:"form.teamMemberFillFullForm",children:t("tous_les_membre_59937")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ec,{label:t("nombre_maximum_14615"),name:"form.maxTeamMembers",shouldParseAsInt:!0})]})]}),(0,i.jsx)(Dh,{height:"7"}),(0,i.jsx)(oT,{change:e.change,customFields:e.customFields,name:"form.customFields",values:e.values.form.customFields}),(0,i.jsx)(Dh,{height:"7"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("texte_de_l_tap_00197")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("personnaliser_l_68212")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ec,{name:"form.emailTitle"}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("description_de_80800")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("la_description_13257")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(SI,{name:"form.description"}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("texte_de_l_tap_92536")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("personnaliser_l_66470")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ec,{name:"form.informationTitle"}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("texte_du_bouton_05866")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("personnaliser_l_02611")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ec,{name:"form.registerButtonText"}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("texte_de_l_tap_59788")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("personnaliser_l_10000")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ec,{name:"form.successTitle"}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("message_de_succ_99510")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("personnaliser_l_55334")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(SI,{name:"form.successMessage"}),e.isWeezeventConnected&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Dh,{height:"7"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("int_gration_10662")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsxs)(zd,{alertStyle:"primary",children:[(0,i.jsx)($d,{children:t("comment_l_int_g_52949")}),(0,i.jsx)(Pd,{children:t("le_widget_sera_08013")})]}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(Kp,{name:"hasWeezTicketForm",children:t("ajouter_un_widg_55295")}),e.values.hasWeezTicketForm&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(Hp,{label:t("lien_vers_le_wi_55308"),name:"form.ticketUrl"})]})]}),(0,i.jsx)(Dh,{height:"7"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("_dition_des_inf_90758")}),(0,i.jsx)(ka,{color:"gray500",children:t("donner_la_possi_56683")}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"semiBold",children:t("espace_membre_06532")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Kp,{name:"form.isEditableInMemberSpace",children:t("permettre_aux_m_40630")})]})})})},rT=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=bd(),{data:o,loader:s}=Oi("query FormParametersGeneral($organizationId: OrganizationId!, $eventId: EventId, $formId: FormId!) {\n organization(id: $organizationId) {\n customFields(\n eventId: $eventId\n variety: UserInfo\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n event: eventMaybe(id: $eventId) {\n isWeezeventConnected\n }\n\n form(id: $formId) {\n name\n setAssignmentStateToWaiting\n setAccreditationStateToWaiting\n allowMultiProfiles\n canRefill\n description\n successTitle\n successMessage\n areTeamsAllowed\n maxTeamMembers\n teamMemberFillFullForm\n emailTitle\n informationTitle\n registerButtonText\n isEditableInMemberSpace\n ticketUrl\n\n customFields {\n addValues\n customFieldId\n value\n }\n }\n }\n}\n",{organizationId:e,eventId:t,formId:n},[js.MassEditCustomFieldFragment]);Zc(o.organization?.form.name??"");const r=Ei(ld),a=Ei(iT),{mutate:l,isLoading:d}=function(e={}){return Di("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=V.useMemo(()=>{const e=a.formParametersGeneralInputDefault(o.organization?.form);return{form:e,hasWeezTicketForm:g(e.ticketUrl)}},[o.organization]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Vd,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(sT,{change:e.change,customFields:o.organization?.customFields.nodes??[],handleSubmit:t,initialValues:c,isMutateLoading:d,isWeezeventConnected:o.organization?.event?.isWeezeventConnected??!1,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 aT=class extends ic{constructor(e){super(e)}formParametersStateInputDefault(e){return{state:e?.state||Je.Open,closedTitle:e?.closedTitle||"",closedMessage:e?.closedMessage||"",closedAt:e?.closedAt||null}}formParametersStateInputSchema(){return c.Ik().shape({state:c.Yj().required(this.t("cl_turer_le_for_10541")).oneOf(Bn,this.t("cl_turer_le_for_10541")),closedMessage:c.Yj(),closedAt:Yp.when("state",{is:Je.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 c.Ik().shape({form:this.formParametersStateInputSchema()})}};aT=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],aT);const lT=e=>{const{translate:t,params:{eventId:n}}=bd(),{isNotSavedModalOpen:o,onClose:s,onNotSavedClose:r,onSave:a}=WE(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(iE,{button:(0,i.jsx)(kd,{isLoading:e.isMutateLoading,onClick:a,children:t("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(UE,{isNotSavedOpen:o,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba.Yr,{name:"form.state",children:t=>{t!==Je.ClosedAt&&e.change("form.closedAt",null)}}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("cl_turer_le_for_46483")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("choisir_si_le_f_14519")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(FI,{name:"form.state",value:Je.Open,children:t("ne_pas_cl_turer_46870")}),(0,i.jsx)(md,{height:"3"}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(FI,{name:"form.state",value:Je.CloseWhenEventDone,children:t("cl_turer_le_for_61719")}),(0,i.jsx)(md,{height:"3"})]}),(0,i.jsx)(FI,{name:"form.state",value:Je.Closed,children:t("cl_turer_le_for_10120")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(FI,{name:"form.state",value:Je.ClosedAt,children:t("cl_turer_le_for_19176")}),e.values.form.state===Je.ClosedAt&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(lj,{name:"form.closedAt"})]})]}),e.values.form.state!==Je.Open&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Dh,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ec,{label:t("nom_de_l_tape_85862"),name:"form.closedTitle"}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(SI,{hint:t("ce_message_sera_03472"),label:t("message_de_cl_t_95276"),name:"form.closedMessage"})]})]})})})},dT=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=bd(),{data:o,loader:s}=Oi("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},[]);Zc(o.organization?.form.name??"");const r=Ei(ld),a=Ei(aT),{mutate:l,isLoading:d}=function(e={}){return Di("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=V.useMemo(()=>({form:a.formParametersStateInputDefault(o.organization?.form)}),[o.organization]);return(0,i.jsx)(Vd,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(lT,{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})})},cT={PLURAL:"accreditation-profile-categories",SINGLE:"accreditation-profile-category"},uT={PLURAL:"accreditation-profiles",SINGLE:"accreditation-profile"},mT=e=>Ui([cT.SINGLE,e]),hT=e=>Ui([uT.SINGLE,e]),gT={ACCREDITATIONS_PROFILES_IMPORT:e=>Ui([So.EVENT(e),uT.PLURAL,qi.IMPORT]),ACCREDITATIONS_PROFILE_CREATE:({accreditationProfileCategoryId:e,...t})=>Ui([So.EVENT(t),uT.PLURAL,qi.CREATE,...e?[e]:[]]),ACCREDITATIONS_PROFILES:e=>Ui([So.EVENT(e),uT.PLURAL]),ACCREDITATIONS_PROFILES_SEGMENT:({segmentId:e,...t})=>Ui([gT.ACCREDITATIONS_PROFILES(t),e]),ACCREDITATIONS_PROFILE:({accreditationProfileId:e,...t})=>Ui([So.EVENT(t),hT(e)]),ACCREDITATIONS_PROFILE_DASHBOARD:e=>Ui([gT.ACCREDITATIONS_PROFILE(e),Hi.DASHBOARD]),ACCREDITATIONS_PROFILE_MEMBERS:e=>Ui([gT.ACCREDITATIONS_PROFILE(e),Hi.MEMBERS]),ACCREDITATIONS_PROFILE_CATEGORY:({accreditationProfileCategoryId:e,...t})=>Ui([So.EVENT(t),mT(e)]),ACCREDITATIONS_PROFILE_CATEGORY_DASHBOARD:e=>Ui([gT.ACCREDITATIONS_PROFILE_CATEGORY(e),Hi.DASHBOARD]),ACCREDITATIONS_PROFILE_CATEGORY_MEMBERS:e=>Ui([gT.ACCREDITATIONS_PROFILE_CATEGORY(e),Hi.MEMBERS]),ACCREDITATIONS_PROFILE_EDIT:({accreditationProfileId:e,...t})=>Ui([So.EVENT(t),hT(e),qi.EDIT])};function pT(e,t,n){return(0,hd.A)([n.canMemberEdit?{icon:"user-plus",text:e("cr_er_un_membre_38547"),link:bx.CREATE({organizationId:t})}:null,{icon:"user-group",text:e("voir_les_membre_27923"),link:ro.COMMUNITY_USERS({organizationId:t})},n.canEventEdit?{icon:"cake-candles",text:e("cr_er_un_v_nem_28126"),link:fs.CREATE_EVENT(t)}:null,{icon:"cake-candles",text:e("voir_les_v_nem_52491"),link:`${io.ORGANIZATION({organizationId:t})}/events`},n.canCustomFieldEdit?{icon:"text",text:e("cr_eer_un_champ_08883"),link:tx.CREATE({organizationId:t})}:null,n.canCustomFieldRead?{icon:"text",text:e("voir_les_champs_59185"),link:tx.CUSTOM_FIELDS({organizationId:t})}:null,n.canFormEdit?{icon:"file-lines",text:e("cr_er_un_formul_78352"),link:jo.CREATE({organizationId:t})}:null,n.canFormEdit?{icon:"file-lines",text:e("voir_les_formul_55824"),link:jo.FORMS({organizationId:t})}:null,n.canDelegationEdit?{icon:"users",text:e("cr_er_une_d_l_g_23035"),link:fs.COMMUNITY_CREATE_DELEGATION(t)}:null,n.canDelegationRead?{icon:"users",text:e("voir_les_d_l_ga_71959"),link:qo.DELEGATIONS({organizationId:t})}:null,n.canCampaignSend?{icon:"paper-plane",text:e("cr_er_une_campa_96023"),link:Tx.CREATE({organizationId:t})}:null,n.canCampaignRead?{icon:"paper-plane",text:e("voir_les_campag_02148"),link:Tx.CAMPAIGNS({organizationId:t})}:null,n.canWorkflowEdit?{icon:"hand-sparkles",text:e("cr_er_une_autom_91246"),link:Dx.CREATE({organizationId:t})}:null,n.canWorkflowRead?{icon:"hand-sparkles",text:e("voir_les_automa_58340"),link:Dx.WORKFLOWS({organizationId:t})}:null])}function fT(e,t,n,i){return(0,hd.A)([i.canMemberEdit?{icon:"user-plus",text:e("cr_er_un_membre_38547"),link:bx.CREATE({organizationId:t,eventId:n})}:null,{icon:"user-group",text:e("voir_les_membre_27923"),link:fs.VOLUNTEERS(t,n)},i.canEventEdit?{icon:"cake-candles",text:e("cr_er_un_v_nem_28126"),link:fs.CREATE_EVENT(t)}:null,{icon:"cake-candles",text:e("voir_les_v_nem_52491"),link:`${io.ORGANIZATION({organizationId:t})}/events`},i.canCustomFieldEdit?{icon:"text",text:e("cr_eer_un_champ_08883"),link:tx.CREATE({organizationId:t,eventId:n})}:null,i.canCustomFieldRead?{icon:"text",text:e("voir_les_champs_59185"),link:tx.CUSTOM_FIELDS({organizationId:t,eventId:n})}:null,i.canPositionEdit?{icon:"sitemap",text:e("cr_er_une_missi_66818"),link:fs.CREATE_POSITION(t,n)}:null,i.canPositionRead?{icon:"sitemap",text:e("voir_les_missio_71964"),link:Jo.POSITIONS({organizationId:t,eventId:n})}:null,i.canFormEdit?{icon:"file-lines",text:e("cr_er_un_formul_78352"),link:jo.CREATE({organizationId:t,eventId:n})}:null,i.canFormRead?{icon:"file-lines",text:e("voir_les_formul_55824"),link:jo.FORMS({organizationId:t,eventId:n})}:null,i.canAccreditationEdit?{icon:"badge-check",text:e("cr_er_une_accr_33475"),link:fs.CREATE_ACCREDITATION(t,n)}:null,i.canAccreditationRead?{icon:"badge-check",text:e("voir_les_accr_d_34867"),link:Mo.ACCREDITATIONS({organizationId:t,eventId:n})}:null,i.canAccreditationEdit?{icon:"badge-check",text:e("cr_er_un_profil_01464"),link:gT.ACCREDITATIONS_PROFILE_CREATE({organizationId:t,eventId:n})}:null,i.canAccreditationRead?{icon:"badge-check",text:e("voir_les_profil_55935"),link:gT.ACCREDITATIONS_PROFILES({organizationId:t,eventId:n})}:null,i.canDelegationEdit?{icon:"users",text:e("cr_er_une_d_l_g_23035"),link:fs.CREATE_DELEGATION(t,n)}:null,i.canDelegationRead?{icon:"users",text:e("voir_les_d_l_ga_71959"),link:qo.DELEGATIONS({organizationId:t,eventId:n})}:null,i.canDelegationsSpaceParamEdit?{icon:"brush",text:e("cr_er_un_layout_13164"),link:Vk.DELEGATIONS_SPACE_LAYOUTS_CREATE({organizationId:t,eventId:n})}:null,i.canDelegationsSpaceParamRead?{icon:"brush",text:e("voir_les_layout_36965"),link:Vk.DELEGATIONS_SPACE_LAYOUTS({organizationId:t,eventId:n})}:null,i.canCustomDocumentEdit?{icon:"file",text:e("cr_er_un_docume_92512"),link:fs.CREATE_CUSTOM_DOCUMENT(t,n)}:null,i.canDocumentRead?{icon:"file",text:e("voir_les_docume_33988"),link:fs.DOCUMENTS(t,n)}:null,i.canCampaignSend?{icon:"paper-plane",text:e("cr_er_une_campa_96023"),link:Tx.CREATE({organizationId:t,eventId:n})}:null,i.canCampaignRead?{icon:"paper-plane",text:e("voir_les_campag_02148"),link:Tx.CAMPAIGNS({organizationId:t,eventId:n})}:null,i.canWorkflowEdit?{icon:"hand-sparkles",text:e("cr_er_une_autom_91246"),link:Dx.CREATE({organizationId:t,eventId:n})}:null,i.canWorkflowRead?{icon:"hand-sparkles",text:e("voir_les_automa_58340"),link:Dx.WORKFLOWS({organizationId:t,eventId:n})}:null])}function _T(e){switch(e.segmentType){case Me.Accreditations:return e.eventId?fs.ACCREDITATIONS_SEGMENT(e.organizationId,e.eventId,e.id):"";case Me.AccreditationsProfiles:return e.eventId?gT.ACCREDITATIONS_PROFILES_SEGMENT({organizationId:e.organizationId,eventId:e.eventId,segmentId:e.id}):"";case Me.Campaigns:return Tx.CAMPAIGNS_SEGMENT({organizationId:e.organizationId,segmentId:e.id});case Me.CustomFields:return tx.CUSTOM_FIELDS_SEGMENT({organizationId:e.organizationId,eventId:e.eventId??void 0,segmentId:e.id});case Me.Delegations:return e.eventId?fs.DELEGATIONS_SEGMENT(e.organizationId,e.eventId,e.id):fs.COMMUNITY_DELEGATIONS_SEGMENT(e.organizationId,e.id);case Me.Events:return fs.EVENTS_SEGMENT(e.organizationId,e.id);case Me.Positions:return e.eventId?fs.POSITIONS_SEGMENT(e.organizationId,e.eventId,e.id):"";case Me.Volunteers:return e.eventId?fs.VOLUNTEERS_SEGMENT(e.organizationId,e.eventId,e.id):fs.COMMUNITY_USERS_SEGMENT(e.organizationId,e.id);case Me.Workflows:return Dx.WORKFLOWS_SEGMENT({organizationId:e.organizationId,eventId:e.eventId??void 0,segmentId:e.id});default:return vd(e.segmentType)}}const xT=e=>(0,i.jsx)(bm,{css:{"&:hover":{textDecoration:"none"}},hideIcon:!0,to:e.link,width:1,onClick:()=>{e.onClose()},children:(0,i.jsxs)(rd,{align:"center",css:{cursor:"pointer",px:"$4","&:hover":{background:"$gray100"}},gap:"2",height:40,width:1,children:[e.avatar,e.icon&&(0,i.jsx)(ka,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(Id,{icon:e.icon})}),(0,i.jsx)(ka,{font:"gray800 textSm medium",children:e.children})]})}),IT=e=>(0,i.jsx)(rd,{css:{px:"$4"},children:(0,i.jsx)(ka,{font:"gray500 textSm medium",children:e.children})}),vT=e=>(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(IT,{children:e.title}),e.children]}),bT="h-open-omnibar",jT=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{hasFeature:s}=_v(),r=zv(),a=Dv(),l=(0,V.useMemo)(()=>({...a,canCustomDocumentEdit:s(Ae.CustomDocument)&&a.canDocumentEdit}),[a,s]),d=$v(),[c,u]=(0,V.useState)(!1),[h,p]=(0,V.useState)(!1),[f,_,x]=gm(""),[I,v]=(0,V.useState)([]),[b,j]=(0,V.useState)([]),[C,y]=(0,V.useState)([]),[A,S]=(0,V.useState)([]),[k,w]=(0,V.useState)([]),[E,T]=(0,V.useState)([]),[R,O]=(0,V.useState)([]),[D,z]=(0,V.useState)([]),[$,P]=(0,V.useState)([]),[M,F]=(0,V.useState)([]),[N,L]=(0,V.useState)([]),[B,U]=(0,V.useState)([]),[W,G]=(0,V.useState)([]),[q,H]=(0,V.useState)([]),[K,Y]=(0,V.useState)(o?fT(t,n,o,l):pT(t,n,r)),Z=(0,V.useMemo)(()=>Vs(K)&&Vs(I)&&Vs(b)&&Vs(C)&&Vs(A)&&Vs(k)&&Vs(E)&&Vs(R)&&Vs(D)&&Vs($)&&Vs(M)&&Vs(N)&&Vs(B)&&Vs(W)&&Vs(q),[K,I,b,C,A,k,E,R,D,$,M,N,B,W,q]),J=(0,V.useCallback)(()=>{Y(o?fT(t,n,o,l):pT(t,n,r)),v([]),j([]),y([]),S([]),w([]),T([]),O([]),z([]),P([]),F([]),L([]),U([]),G([]),H([])},[n,o,r,l,Y,v,j,y,S,w,T,O,z,P,F,L,U,G,H]),Q=(0,V.useCallback)(e=>{Gd(e),p(!1),x(""),J(),u(e=>!e)},[u,p,x,J]),ee=(0,V.useCallback)(()=>{u(!1)},[u]);return rp("k",Q),Jc(ee),Xc(ee),(0,V.useEffect)(()=>(document.addEventListener(bT,Q),()=>{document.removeEventListener(bT,Q)}),[Q]),(0,V.useEffect)(()=>{(async()=>{if(g(_)){if(p(!0),o){const{organization:s,event:r}=await(e={organizationId:n,eventId:o,name:_},i=await X(),Js('query EventOmnibar($organizationId: OrganizationId!, $eventId: EventId!, $name: String) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, name: $name, limit: 5) {\n nodes {\n id\n eventId\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 accreditationsProfiles(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 customDocuments {\n id\n name\n }\n\n delegations(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n delegationsSpaceLayouts(name: $name) {\n id\n name\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 segments(name: $name) {\n id\n organizationId\n eventId\n name\n segmentType\n }\n\n teams(name: $name, limit: 5) {\n nodes {\n teamCode\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:e,token:i||void 0,fragments:[]}));Y(fT(t,n,o,l).filter(e=>m(e.text).includes(m(_)))),v(r.volunteersRegistrations.nodes.map(e=>e.userInfo)),j(a.canEventEdit?s.events.nodes:[]),y(s.customFields.nodes.filter(d)),S(a.canPositionRead?r.positions.nodes:[]),w(a.canFormRead?r.forms.nodes:[]),T(a.canDocumentEdit?r.customDocuments.filter(e=>m(e.name).includes(m(_))).slice(0,5):[]),O(a.canAccreditationRead?r.accreditations.nodes:[]),z(a.canAccreditationRead?r.accreditationsProfiles.nodes:[]),P(a.canDelegationRead?r.delegations.nodes:[]),F(a.canDelegationsSpaceParamEdit?r.delegationsSpaceLayouts:[]),L(a.canCampaignRead?r.campaigns.nodes:[]),U(a.canWorkflowRead?r.workflows.nodes:[]),G(r.segments),H(a.canMemberAssign?r.teams.nodes:[])}else{const{organization:e}=await function(e,t){return Js("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 accreditationsProfiles(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 eventId\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 segments(name: $name) {\n id\n organizationId\n eventId\n name\n segmentType\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:_},await X());Y(pT(t,n,r).filter(e=>m(e.text).includes(m(_)))),v(e.usersInfos.nodes),j(e.events.nodes),y(r.canCustomFieldRead?e.customFields.nodes:[]),S(r.canPositionRead?e.positions.nodes:[]),w(r.canFormRead?e.forms.nodes:[]),T([]),O(r.canAccreditationRead?e.accreditations.nodes:[]),z(r.canAccreditationRead?e.accreditationsProfiles.nodes:[]),P(r.canDelegationRead?e.delegations.nodes:[]),F([]),L(r.canCampaignRead?e.campaigns.nodes:[]),U(r.canWorkflowRead?e.workflows.nodes:[]),G(e.segments)}p(!1)}else J();var e,i})()},[n,o,r,a,l,d,_,p,Y,v,j,y,S,w,T,O,z,P,F,L,U,G,H,J]),c&&("organization"===e.level&&!o||"event"===e.level&&o)?(0,pn.createPortal)((0,i.jsx)(rd,{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)(rd,{css:{background:"white",borderRadius:"$3",overflow:"hidden"},direction:"column",width:640,onClick:e=>Gd(e),children:[(0,i.jsx)(ka,{css:{"& .h-styled-input-container":{height:"48px"}},height:48,children:(0,i.jsx)(Qd,{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:f,onChange:x})}),(0,i.jsx)(rd,{css:{overflowY:"auto",py:"$4"},direction:"column",height:350,children:h?(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(ju,{borderRadius:"$1",height:36}),(0,i.jsx)(ju,{borderRadius:"$1",height:36}),(0,i.jsx)(ju,{borderRadius:"$1",height:36})]}):Z?(0,i.jsxs)(rd,{align:"center",direction:"column",gap:"4",height:1,justify:"center",children:[(0,i.jsx)(rd,{align:"center",css:{bd:!0,fontSize:"$textMd"},height:48,justify:"center",width:48,children:(0,i.jsx)(Id,{icon:"magnifying-glass"})}),(0,i.jsx)(ka,{font:"gray900 textSm semiBold",children:t("aucun_r_sultat_73664",_)})]}):(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[Bs(K)&&(0,i.jsx)(vT,{title:t("actions_rapides_42479"),children:K.map((e,t)=>(0,i.jsx)(xT,{icon:e.icon,link:e.link,onClose:ee,children:e.text},t))}),Bs(I)&&(0,i.jsx)(vT,{title:t("membres_11310"),children:I.map(e=>(0,i.jsx)(xT,{avatar:(0,i.jsx)(Gf,{email:e.email,image:e.picture?.url,name:e.name,size:24}),link:bx.MEMBER_INFORMATION({organizationId:n,eventId:o,userInfoId:e.id}),onClose:ee,children:e.name},e.id))}),Bs(b)&&(0,i.jsx)(vT,{title:t("Event"),children:b.map(e=>(0,i.jsx)(xT,{icon:"cake-candles",link:So.EVENT({organizationId:n,eventId:e.id}),onClose:ee,children:e.name},e.id))}),Bs(C)&&(0,i.jsx)(vT,{title:t("champs_de_formu_64126"),children:C.map(e=>(0,i.jsx)(xT,{icon:"text",link:tx.UPDATE({organizationId:n,eventId:e.eventId??void 0,customFieldId:e.id}),onClose:ee,children:e.name},e.id))}),Bs(A)&&(0,i.jsx)(vT,{title:t("missions_63972"),children:A.map(e=>(0,i.jsx)(xT,{icon:"sitemap",link:Jo.POSITION({organizationId:n,eventId:o,positionId:e.id}),onClose:ee,children:e.name},e.id))}),Bs(k)&&(0,i.jsx)(vT,{title:t("Form_plural"),children:k.map(e=>(0,i.jsx)(xT,{icon:"file-lines",link:jo.FORM_ELEMENTS({organizationId:n,eventId:o,formId:e.id}),onClose:ee,children:e.name},e.id))}),Bs(E)&&(0,i.jsx)(vT,{title:t("documents_perso_87374"),children:E.map(e=>(0,i.jsx)(xT,{icon:"file",link:fs.EDIT_CUSTOM_DOCUMENT(n,o,e.id),onClose:ee,children:e.name},e.id))}),Bs(R)&&(0,i.jsx)(vT,{title:t("accr_ditations_39450"),children:R.map(e=>(0,i.jsx)(xT,{icon:"badge-check",link:Mo.ACCREDITATION({organizationId:n,eventId:o,accreditationId:e.id}),onClose:ee,children:e.name},e.id))}),Bs(D)&&(0,i.jsx)(vT,{title:t("profils_d_accr_27825"),children:D.map(e=>(0,i.jsx)(xT,{icon:"badge-check",link:gT.ACCREDITATIONS_PROFILE({organizationId:n,eventId:o,accreditationProfileId:e.id}),onClose:ee,children:e.name},e.id))}),Bs($)&&(0,i.jsx)(vT,{title:t("d_l_gations_78318"),children:$.map(e=>(0,i.jsx)(xT,{icon:"users",link:qo.DELEGATION({organizationId:n,eventId:o,delegationId:e.id}),onClose:ee,children:e.name},e.id))}),Bs(M)&&(0,i.jsx)(vT,{title:t("layouts_27757"),children:M.map(e=>(0,i.jsx)(xT,{icon:"brush",link:Vk.DELEGATIONS_SPACE_LAYOUTS_UPDATE({organizationId:n,eventId:o,delegationsSpaceLayoutId:e.id}),onClose:ee,children:e.name},e.id))}),Bs(N)&&(0,i.jsx)(vT,{title:t("Campaigns"),children:N.map(e=>(0,i.jsx)(xT,{icon:"paper-plane",link:Tx.CAMPAIGN_DASHBOARD({organizationId:n,eventId:o,campaignId:e.id}),onClose:ee,children:e.name},e.id))}),Bs(B)&&(0,i.jsx)(vT,{title:t("automatisations_60045"),children:B.map(e=>(0,i.jsx)(xT,{icon:"hand-sparkles",link:Dx.UPDATE({organizationId:n,eventId:o,workflowId:e.id}),onClose:ee,children:e.name},e.id))}),Bs(W)&&(0,i.jsx)(vT,{title:t("vues_personnali_80652"),children:W.map(e=>(0,i.jsx)(xT,{link:_T(e),onClose:ee,children:e.name},e.id))}),Bs(q)&&(0,i.jsx)(vT,{title:t("_quipes_18817"),children:q.map(e=>(0,i.jsx)(xT,{link:fs.TEAM_ASSIGNMENT(n,o,e.teamCode),onClose:ee,children:e.teamCode},e.teamCode))})]})})]})}),document.body):null},CT=(0,V.memo)(function(){const{translate:e}=bd(),{pathname:t}=Pi(),{organization:n,selectedEventId:o}=_v(),[s,r]=(0,V.useState)(!1),a=t===So.EVENTS({organizationId:n.id})||null!==t.match(/\/events/)||null!==t.match(/\/event\/\d+/),l=(0,cm.A)(n.events.nodes.filter(e=>e.state===oe.Ongoing||e.state===oe.Upcoming),e=>e.name),d=n.events.nodes.find(e=>e.id===o);return(0,i.jsxs)(nu,{onStateChange:r,children:[(0,i.jsx)(du,{children:(0,i.jsxs)(rd,{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)(Id,{icon:"angle-up"}):(0,i.jsx)(Id,{icon:"angle-down"})]})}),(0,i.jsxs)(lu,{"aria-orientation":"vertical",id:"events-menu",maxHeight:300,offset:-10,placement:"bottom-start",children:[(0,i.jsx)(rd,{css:{flex:"1",overflowY:"auto"},direction:"column",children:l.map(e=>(0,i.jsx)(su,{to:So.EVENT({organizationId:n.id,eventId:e.id}),onClick:e=>{eu(e.target),document.getElementById("main")?.focus()},children:e.name},e.id))}),(0,i.jsx)(Oh,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(su,{to:So.EVENTS({organizationId:n.id}),onClick:e=>{eu(e.target),document.getElementById("main")?.focus()},children:e("tous_les_v_nem_16033")})]})]})}),yT=()=>{const{translate:e}=bd(),{canShow:t,show:n}=hv();return(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(rd,{align:"center","aria-label":e("Aide"),css:{borderRadius:"$2",padding:"$2","&:hover":{background:"$gray700"}},justify:"center",role:"button",children:(0,i.jsx)(rd,{align:"center",css:{fontSize:"$textMd"},children:(0,i.jsx)(Id,{icon:"circle-question"})})})}),(0,i.jsxs)(lu,{placement:"bottom-end",width:400,children:[t&&(0,i.jsx)(su,{css:{padding:"$2 $4"},onClick:e=>{eu(e.target),n()},children:(0,i.jsxs)(rd,{align:"center",gap:"2",width:1,children:[(0,i.jsx)(ka,{color:"gray500",css:{paddingTop:"2px"},children:(0,i.jsx)(Id,{icon:"message"})}),(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:e("une_question_61292")}),(0,i.jsx)(ka,{color:"gray500",children:e("on_r_pond_vos_06299")})]})]})}),(0,i.jsx)(su,{css:{padding:"$2 $4"},target:"_blank",to:"https://upmoon.app/weezevent?labels=weezcrew",children:(0,i.jsxs)(rd,{align:"center",gap:"2",width:1,children:[(0,i.jsx)(ka,{color:"gray500",css:{paddingTop:"2px"},children:(0,i.jsx)(Id,{icon:"megaphone"})}),(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:e("nouveaut_s_du_p_40290")}),(0,i.jsx)(ka,{color:"gray500",children:e("retrouver_toute_00568")})]})]})})]})]})};var AT,ST;function kT(){return kT=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{translate:t,params:{eventId:n}}=bd(),{organization:o}=_v(),s=(0,V.useMemo)(()=>{let t=`https://admin.${F.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.${F.WEEZEVENT_DOMAIN}/access/O${e.weezeventOrganizationId}`,a=`https://admin.${F.WEEZEVENT_DOMAIN}/pay/#!/${e.weezeventOrganizationId}`;return(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(rd,{align:"center",css:{borderRadius:"$2",padding:"$2","&:hover":{background:"$gray700"}},justify:"center",children:(0,i.jsx)(rd,{align:"center",css:{fontSize:"$textMd"},children:(0,i.jsx)(Id,{icon:"grid",iconStyle:"solid"})})})}),(0,i.jsx)(lu,{css:{padding:"0"},placement:"bottom-end",children:(0,i.jsxs)(rd,{css:{padding:"$3 $4"},direction:"column",gap:"3",children:[(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:t("passer_75488")}),(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(_d,{to:s,children:(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(ka,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(PT,{})}),(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:"WeezTicket"}),(0,i.jsx)(ka,{color:"gray500",fontWeight:"medium",children:t("billetterie_53780")})]})]})}),(0,i.jsx)(_d,{to:r,children:(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(ka,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(wT,{})}),(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:"WeezAccess"}),(0,i.jsx)(ka,{color:"gray500",fontWeight:"medium",children:t("contr_le_d_acc_03854")})]})]})}),(0,i.jsx)(_d,{to:a,children:(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(ka,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(OT,{})}),(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:"WeezPay"}),(0,i.jsx)(ka,{color:"gray500",fontWeight:"medium",children:"Cashless"})]})]})})]})]})})]})},FT=({to:e,children:t,isActive:n,onClick:o})=>{const{pathname:s}=Pi(),r=n?n(s):e===s;return(0,i.jsx)(rd,{"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)(_d,{height:1,to:e,width:1,onClick:o,children:t})})},NT=(0,V.memo)(function(){const{translate:e,params:{organizationId:t}}=bd(),{organization:n,user:o,updateLocalOrganization:s,hasOrganizationRole:r}=_v(),{canCustomFieldRead:a}=zv(),{data:l}=Cl({}),[d,c]=(0,V.useState)(!1),u=(0,V.useMemo)(()=>{const e=(0,Vu.A)(l.user?.roles??[],e=>e.organizationId);return(0,cm.A)((l.organizations||[]).filter(t=>Bs(e[t.id])),e=>e.name)},[l.organizations,l.user]);return(0,i.jsxs)(rd,{align:"center",css:{background:"$blueGray900",color:"white",cursor:"pointer",position:"relative",px:"$6"},height:1,justify:"between",width:1,children:[(0,i.jsx)(rd,{align:"center","aria-label":e("page_d_accueil_12532"),css:{"& svg":{height:"50%"}},height:1,width:300,children:(0,i.jsx)(_d,{height:1,to:So.EVENTS({organizationId:t}),children:Sx(t)?.logo??(0,i.jsx)(pc,{})})}),(0,i.jsx)(rd,{"aria-label":e("menu_de_l_organ_58508"),as:id.Nav,height:1,children:(0,i.jsxs)(rd,{align:"center",justify:"center",role:"menubar",children:[(0,i.jsx)(CT,{}),a&&(0,i.jsx)(FT,{isActive:e=>e.startsWith(tx.CUSTOM_FIELDS({organizationId:t})),to:tx.CUSTOM_FIELDS({organizationId:t}),onClick:async()=>await s({customFieldsSegmentId:null}),children:e("champs_de_formu_64126")}),r&&(0,i.jsx)(FT,{isActive:e=>e.startsWith(ro.COMMUNITY({organizationId:t})),to:ro.COMMUNITY_USERS({organizationId:t}),children:e("communaut_20896")}),(0,i.jsx)(FT,{isActive:e=>e.startsWith(fs.ORGANIZATION_PARAMETERS(t)),to:fs.ORGANIZATION_PARAMETERS_PROFILE(t),children:e("param_tres_78420")})]})}),(0,i.jsxs)(rd,{align:"center",gap:"6",justify:"end",width:300,children:[(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(yT,{}),"number"==typeof n.weezeventOrganizationId&&(0,i.jsx)(MT,{weezeventOrganizationId:n.weezeventOrganizationId})]}),(0,i.jsxs)(nu,{"aria-label":e("menu_utilisateu_40033"),"aria-orientation":"vertical",isOpen:d,onStateChange:c,children:[(0,i.jsx)(du,{children:(0,i.jsxs)(rd,{align:"center","aria-expanded":d,"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)(Gf,{email:o.email,image:o.userInfo.picture?.url,name:o.userInfo.name,size:32}),(0,i.jsxs)(ka,{css:{maxWidth:"calc(100% - 66px)"},children:[(0,i.jsx)(ka,{css:{ellipsis:!0},fontWeight:"semiBold",children:o.userInfo.firstName||o.email}),(0,i.jsx)(ka,{css:{ellipsis:!0},fontSize:"textXs",children:n.name})]}),(0,i.jsx)("div",{children:d?(0,i.jsx)("i",{className:"far fa-angle-up"}):(0,i.jsx)("i",{className:"far fa-angle-down"})})]})}),(0,i.jsxs)(lu,{"aria-orientation":"vertical",id:"user-menu",maxHeight:500,placement:"bottom-end",width:300,children:[(0,i.jsx)(su,{children:(0,i.jsxs)(rd,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(Gf,{email:o.email,image:o.userInfo.picture?.url,name:o.userInfo.name,size:32}),(0,i.jsxs)(ka,{css:{width:"calc(100% - 44px)"},children:[(0,i.jsx)(ka,{css:{ellipsis:!0},fontWeight:"semiBold",children:o.userInfo.name||o.email}),g(o.userInfo.name)&&(0,i.jsx)(ka,{color:"gray500",css:{ellipsis:!0},children:o.email})]})]})}),(0,i.jsx)(Oh,{color:"gray100",direction:"horizontal"}),(0,i.jsxs)(rd,{as:id.Nav,direction:"column",role:"menubar",children:[u.map(({id:e,name:t})=>(0,i.jsx)(su,{onClick:async()=>{await s({eventsSegmentId:null}),location.href=`${F.HEAVENT_APP_URL.pathname}${So.EVENTS({organizationId:e})}`,document.getElementById("main")?.focus()},children:t},e)),(0,i.jsx)(Oh,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(su,{to:fs.ORGANIZATION_PARAMETERS_PROFILE(t),onClick:()=>{c(!1),document.getElementById("main")?.focus()},children:e("mon_profil_48224")}),(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(su,{to:fs.ORGANIZATION_PARAMETERS_INFOS(t),onClick:()=>{c(!1),document.getElementById("main")?.focus()},children:e("organisation_71863")})}),(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(su,{to:fs.ORGANIZATION_PARAMETERS_TEAM(t),onClick:()=>{c(!1),document.getElementById("main")?.focus()},children:e("utilisateurs_04975")})}),(0,i.jsx)(Oh,{color:"gray100",direction:"horizontal"}),xm(o.email)&&(0,i.jsx)(su,{to:fs.BACKOFFICE,onClick:()=>{document.getElementById("main")?.focus()},children:e("back_office_83072")}),(0,i.jsx)(su,{color:"red",onClick:Q,children:e("se_d_connecter_74151")})]})]})]})]})]})}),LT=[1033,1538,1787,2574,2954,3059,3854,3900].concat([1823,2659]),BT=e=>{const{translate:t,params:{organizationId:n}}=bd(),o=Pi(),{organization:s}=_v(),[r,a]=V.useState(!1),l=function(e){return Math.ceil(e.periodEndAt.diff(As.c9.utc(),"days").days)}(s),d=(c=l)>0&&c<=15;var c;const u=s.invoices.length>0,m=V.useCallback(()=>{a(!0)},[a]);if(V.useEffect(()=>(document.addEventListener(Xs,m),()=>{document.removeEventListener(Xs,m)}),[]),s.isBlocked&&!o.pathname.endsWith(eo))return(0,i.jsx)(Fi,{path:io.IS_BLOCKED(io.ORGANIZATION({organizationId:n}))});if(!s.isBlocked&&o.pathname.endsWith(eo))return(0,i.jsx)(Fi,{path:io.ORGANIZATION({organizationId:n})});if(l<=0&&!o.pathname.endsWith(to))return(0,i.jsx)(Fi,{path:io.IS_EXPIRED(io.ORGANIZATION({organizationId:n}))});if(l>0&&o.pathname.endsWith(to))return(0,i.jsx)(Fi,{path:io.ORGANIZATION({organizationId:n})});{const o=u&&!LT.includes(n),c=64+(r?40:0)+(d||o?64:0);return(0,i.jsxs)(rd,{css:{overflow:"hidden"},direction:"column",height:1,role:"presentation",width:1,children:[r&&(0,i.jsxs)(rd,{align:"center",css:{background:"$primary100",px:"$6"},gap:"1",height:40,justify:"between",role:"alert",width:1,children:[(0,i.jsx)(ka,{}),(0,i.jsxs)(rd,{gap:"1",children:[(0,i.jsx)(ka,{color:"gray800",children:t("une_nouvelle_ve_69718")}),(0,i.jsx)(kd,{color:"invisible",css:{height:"auto",padding:0},type:"button",onClick:()=>{window.location.reload()},children:t("cliquez_pour_re_36838")})]}),(0,i.jsx)(ka,{color:"white",css:{cursor:"pointer"},fontSize:"textMd",onClick:()=>{a(!1)},children:(0,i.jsx)(Id,{icon:"xmark"})})]}),d&&!o&&(0,i.jsx)(rd,{align:"center",css:{background:"$primary500",color:"white"},dangerouslySetInnerHTML:{__html:`${t("trial_remaining_days",l,`${F.EMAIL_FROM} `,$c)}
`},height:64,justify:"center",width:1}),o&&(0,i.jsx)(rd,{align:"center",css:{background:"$primary500",color:"white","& > a":{color:"white",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:t("sauf_erreur_de_03325",s.invoices[0].url,s.invoices[0].invoiceNumber)},height:64,justify:"center",width:1}),(0,i.jsx)(ka,{as:id.Header,height:64,width:1,children:(0,i.jsx)(NT,{})}),(0,i.jsx)(ka,{as:id.Main,css:{height:`calc(100% - ${c}px)`},id:"main",tabIndex:-1,width:1,children:e.children}),(0,i.jsx)(jT,{level:"organization"})]})}};let VT=class extends ic{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)}}updateUserInfoChangedFieldsSchema(e,t,n){return c.Ik().shape({userInfo:c.Ik().shape({fields:this.fieldInputService.changedFieldsSchema(e,t,n)})})}formUserInfoInputSchema(e){return c.Ik().shape({fields:c.Ik().shape(Object.fromEntries(e.map(({isMandatory:e,customField:t})=>[t.slug,this.fieldInputService.fieldSchema(t,e)])))})}userInfoProfileInputDefault(e){const t=this.countriesService.getDefaultCountryValues();return{email:e.email,fields:{firstName:e.userInfo?.fields?.firstName??"",lastName:e.userInfo?.fields?.lastName??"",language:e.language??e.userInfo?.fields?.language??t.user.language??ae.En,picture:e.userInfo.fields.picture?(0,Ta.A)(e.userInfo.fields.picture,ej):this.documentInputService.documentInputDefault(),phone:e.userInfo.fields.phone?(0,Ta.A)(e.userInfo.fields.phone,N_):this.phoneInputService.phoneInputDefault(t)}}}userInfoFields(){return{fields:c.Ik().shape({firstName:c.Yj().nullable(),lastName:c.Yj().nullable(),picture:this.documentInputService.documentInputSchemaNotRequired(),language:c.Yj().required(this.t("les_langues_doi_27712")).oneOf(Rc,this.t("les_langues_doi_27712")),phone:this.phoneInputService.phoneInputSchemaNotRequired()})}}userInfoProfileInputSchema(){return c.Ik().shape({email:c.Yj().email(this.t("l_e_mail_est_re_04856")).required(this.t("l_e_mail_est_re_04856")),...this.userInfoFields()})}updateProfileSchema(){return c.Ik().shape({userInfo:this.userInfoProfileInputSchema()})}userInfoAndTermsInputDefault(e){return{...(0,ma.A)(e.userInfo,["id"]),termsAccepted:!1}}userInfoAndTermsInputSchema(){return c.Ik().shape({firstName:c.Yj().nullable(),lastName:c.Yj().nullable(),phone:this.phoneInputService.phoneInputSchemaNotRequired(),termsAccepted:c.zM().oneOf([!0],this.t("il_est_n_cessai_83896")).required(this.t("il_est_n_cessai_83896"))})}updateUserInfoAndTermsSchema(){return c.Ik().shape({userInfoAndTerms:this.userInfoAndTermsInputSchema()})}};VT=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si,Mm,tj,oj,L_])],VT);let UT=class extends ic{constructor(e){super(e)}volunteersRegistrationsSlotInputDefault(e){return{startDate:e||As.c9.invalid("Invalid"),startTime:"",endDate:e||As.c9.invalid("Invalid"),endTime:""}}volunteersRegistrationsSlotInputSchema(e,t){const n=t.plus({day:1}).endOf("day");return c.Ik().shape({startDate:Yp.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:c.Yj().required(this.t("heure_de_d_but_90785")),endDate:Yp.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)=>As.c9.isDateTime(t.parent.startDate)&&t.parent.startDate.isValid&&As.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:c.Yj().required(this.t("l_heure_de_fin_78626"))})}};UT=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],UT);let WT=class extends ic{translationService;volunteerRegistrationSlotInputService;constructor(e,t){super(e),this.translationService=e,this.volunteerRegistrationSlotInputService=t}slotsFields(e,t,n,i,o){switch(e){case Qe.Display:case Qe.DisplayDays:case Qe.Calendar:case Qe.Custom:return{slots:c.YO().of(this.volunteerRegistrationSlotInputService.volunteersRegistrationsSlotInputSchema(n,i)).min(o?0:t,this.t("vous_devez_ajou_68961",t))};case Qe.Hide:return{};default:return vd()}}volunteersRegistrationsSlotsUpdateInputDefault(e){return Bs(e)?e.map(e=>({startDate:e.startDate,startTime:e.startTime,endDate:e.endDate,endTime:e.endTime})):[]}volunteersRegistrationsWishedPositionsInputDefault(){return{positionsCategoriesIds:[],positionsIds:[],positionsSlotsIds:[]}}volunteersRegistrationsWishedPositionsUpdateInputDefault(e){return e?{positionsCategoriesIds:e?.positionsCategoriesIds,positionsIds:e?.positionsIds,positionsSlotsIds:e?.positionsSlotsIds}:this.volunteersRegistrationsWishedPositionsInputDefault()}wishedPositionsFields(e,t,n){if(e===it.Ranked){if(t===tt.Category)return{positionsCategoriesIds:c.YO().of(c.ai().typeError(this.t("s_lectionner_un_26253"))).min(n?0:1,this.t("vous_devez_s_le_32044")).test("different",this.t("les_missions_so_04441"),e=>{const t=(0,hd.A)((e||[]).filter(e=>-1!==e));return Bs(t)&&(0,bs.A)(t).length===t.length})};if(t===tt.Position)return{positionsIds:c.YO().of(c.ai().typeError(this.t("s_lectionner_un_26253"))).min(n?0:1,this.t("vous_devez_s_le_89603")).test("different",this.t("les_missions_so_04441"),e=>{const t=(0,hd.A)((e||[]).filter(e=>-1!==e));return Bs(t)&&(0,bs.A)(t).length===t.length})};if(t===tt.Slot)return{positionsSlotsIds:c.YO().of(c.ai().typeError(this.t("s_lectionner_un_26253"))).min(n?0:1,this.t("vous_devez_s_le_89603")).test("different",this.t("les_missions_so_04441"),e=>{const t=(0,hd.A)((e||[]).filter(e=>-1!==e));return Bs(t)&&(0,bs.A)(t).length===t.length})};throw new Error("Should not happen")}switch(t){case tt.Category:return{positionsCategoriesIds:c.YO().of(c.ai().typeError(this.t("s_lectionner_un_26253"))).min(n?0:1,this.t("vous_devez_s_le_32044"))};case tt.Position:return{positionsIds:c.YO().of(c.ai().typeError(this.t("s_lectionner_un_26253"))).min(n?0:1,this.t("vous_devez_s_le_89603"))};case tt.Slot:return{positionsSlotsIds:c.YO().of(c.ai()).min(n?0:1,this.t("vous_devez_s_le_89603"))};case tt.None:return{};default:return vd()}}volunteersRegistrationsWishedAccreditationsInputDefault(){return{accreditationsSlotsIds:[]}}volunteersRegistrationsWishedAccreditationsUpdateInputDefault(e){return e?{accreditationProfileId:e.accreditationProfileId,accreditationsSlotsIds:e.accreditationsSlotsIds}:this.volunteersRegistrationsWishedAccreditationsInputDefault()}accreditationProfileFields(e,t){return e&&Bs(t)?{accreditationProfileId:c.ai().required(this.t("vous_devez_s_le_07918"))}:{}}accreditationsFields(e,t,n){if(t)return{};switch(e){case ot.Accreditation:return{accreditationsSlotsIds:c.YO().of(c.ai().typeError(this.t("s_lectionner_un_96571"))).min(n?0:1,this.t("vous_devez_s_le_72138"))};case ot.None:return{};default:return vd()}}userInfoAccreditationsSchema(e){return c.Ik().shape({userInfo:c.Ik().shape({accreditations:c.YO().of(c.Ik().shape({formId:c.ai().required(),...this.accreditationsFields(e,null)}))})})}adminAddSchema(){return c.Ik().shape({usersInfosIds:c.YO().of(c.ai()).min(1,this.t("vous_devez_s_le_83608")),sendVolunteerRegistrationEmail:c.zM().required()})}};WT=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si,UT])],WT);let GT=class extends ic{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??[],accreditationProfileId:null,accreditationsSlotsIds:(i.delegationAccreditationsSlots??[]).filter(e=>e.isDefault).map(e=>e.accreditationSlotId),userInfo:this.userInfoInputService.userInfoUpdateInputDefault(t,n,{countryCode:i.countryCode}),sendNotificationEmail:i.sendNotificationEmail,slots:i.team?.slots??(i.slotDisplay===Qe.Display?[this.volunteerRegistrationSlotInputService.volunteersRegistrationsSlotInputDefault(i.eventStartDate)]:[]),source:e}}formRegisterInformationsSchema(e){return c.Ik().shape({formRegister:c.Ik().shape({userInfo:this.userInfoInputService.formUserInfoInputSchema(e)})})}formRegisterSlotsSchema(e,t,n,i){return c.Ik().shape({formRegister:c.Ik().shape({...this.volunteerRegistrationInputService.slotsFields(e,t,n,i)})})}formRegisterPositionsSchema(e,t){return c.Ik().shape({formRegister:c.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 c.Ik().shape({formRegister:c.Ik().shape({...this.volunteerRegistrationInputService.accreditationsFields(e,i),userInfo:c.Ik().shape({fields:c.Ik().shape(Object.fromEntries(o.map(e=>{const n=e.isMandatory&&Bs((0,Pu.A)(e.accreditationsSlotsIds,t));return[e.customField.slug,this.fieldInputService.fieldSchema(e.customField,n)]})))})})})}formRegisterSchema(e,{accreditationDisplay:t,areSectionsDisabled:n,delegationAccreditationsProfiles:i,delegationId:o,eventEndDate:s,eventStartDate:r,minNumberOfSlots:a,positionDisplay:l,positionRanking:d,slotDisplay:u}){return c.Ik().shape({email:c.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856")),formRegister:c.Ik().shape({userInfo:this.userInfoInputService.formUserInfoInputSchema(e),...this.volunteerRegistrationInputService.slotsFields(u,a,r,s,n?.isWishedAssignmentsDisabled),...this.volunteerRegistrationInputService.wishedPositionsFields(d,l,n?.isWishedAssignmentsDisabled),...this.volunteerRegistrationInputService.accreditationsFields(t,o,n?.isWishedAccreditationsDisabled),...this.volunteerRegistrationInputService.accreditationProfileFields(o,i)})})}};GT=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si,oj,VT,WT,UT])],GT);const qT=[79151,64083,79017,64084,79152,71228];["INTER. COMMISSAIRE TECHNIQUE COURSE D'ACCELERATION DRAGSTER","INTERNATIONALE CHRONOMETREUR A AUTO","INTERNATIONALE CHRONOMETREUR B AUTO","INTERNATIONALE CHRONOMETREUR C CIRCUIT AUTO","INTERNATIONALE CHRONOMETREUR C ROUTE AUTO","INTERNATIONALE CHRONOMETREUR KARTING","INTERNATIONALE COMMISSAIRE A CHEF DE POSTE CIRCUIT","INTERNATIONALE COMMISSAIRE A CHEF DE POSTE ROUTE AUTO","INTERNATIONALE COMMISSAIRE B","INTERNATIONALE COMMISSAIRE SPORTIF AUTO","INTERNATIONALE COMMISSAIRE SPORTIF KARTING","INTERNATIONALE COMMISSAIRE TECHNIQUE A AUTO","INTERNATIONALE COMMISSAIRE TECHNIQUE A KARTING","INTERNATIONALE COMMISSAIRE TECHNIQUE B AUTO","INTERNATIONALE COMMISSAIRE TECHNIQUE B KARTING","INTERNATIONALE COMMISSAIRE TECHNIQUE C AUTO","INTERNATIONALE COMMISSAIRE TECHNIQUE C KARTING","INTERNATIONALE COMMISSAIRE TECHNIQUE D'ACCELERATION DRAGSTER","INTERNATIONALE COMMISSAIRE TECHNIQUE STAGIAIRE AUTO","INTERNATIONALE COMMISSAIRE TECHNIQUE STAGIAIRE KARTING","INTERNATIONALE DIRECTEUR DE COURSE CIRCUIT ASPHALTE","INTERNATIONALE DIRECTEUR DE COURSE CIRCUIT TERRE","INTERNATIONALE DIRECTEUR DE COURSE DRAGSTER","INTERNATIONALE DIRECTEUR DE COURSE KARTING","INTERNATIONALE DIRECTEUR DE COURSE ROUTE AUTO","INTERNATIONALE DIRECTEUR DE COURSE TRIAL 4X4","INTERNATIONALE DIRIGEANT","INTERNATIONALE MEDICALE","INTERNATIONALE PERSONNE SATELLITE","INTERNATIONALE RESPONSABLE DE ZONE TRIAL 4X4","INTERNATIONALE VOLONTAIRE","NATIONALE CHRONOMETREUR STAGIAIRE","NATIONALE COMMISSAIRE C","NATIONALE COMMISSAIRE SPORTIF KARTING GRADE C","NATIONALE COMMISSAIRE SPORTIF KARTING","NATIONALE DIRECTEUR DE COURSE DRIFT","NATIONALE DIRECTEUR DE COURSE KARTING GRADE C","NATIONALE DIRECTEUR DE COURSE KARTING","NATIONALE DIRECTEUR DE COURSE TRIAL 4X4","NATIONALE JUGE DRIFT","NATIONALE MEDIA","NATIONALE MEDICALE","NATIONALE STAGIAIRE OPTION COMMISSAIRE SPORTIF","NATIONALE STAGIAIRE OPTION DIRECTEUR DE COURSE","NATIONALE STAGIAIRE OPTION JUGE DRIFT"].map(e=>function(e){return m(e).replace(/[\u2018\u2019]/g,"'")}(e));const HT=e=>{const t=Ei(Mm);return(0,i.jsx)(Ba.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)}})},KT=e=>{const t=Ei(Mm);return(0,i.jsx)(Ba.Yr,{name:e.name,children:n=>{const i=n.address_components?.find(({types:e})=>e.includes("locality")),o=n.address_components?.find(({types:e})=>e.includes("postal_code")),s=n.address_components?.find(({types:e})=>e.includes("country"))?.short_name;i&&e.change(`${e.prefix}birthCity`,i.long_name),o&&e.change(`${e.prefix}birthPostalCode`,o.long_name),t.countryCodeExists(s)&&e.change(`${e.prefix}birthCountry`,s)}})},YT=e=>{const t=(0,V.useMemo)(()=>e.elements.flatMap(e=>e.elementType===st.Field?(0,hd.A)([e.customField,e.conditionCustomField]):e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]).map(t=>Eg(e.organizationId)&&Tg().includes(t.id)&&Bs(e.asoBannersColors)?{...t,values:t.values.filter(({id:t})=>e.asoBannersColors?.includes(t))}:t),[e.elements]),n=(0,V.useMemo)(()=>Object.fromEntries(t.map(e=>[e.id,e])),[t]);return(0,i.jsx)(ka,{children:e.elements.map((o,s)=>{switch(o.elementType){case st.Field:{const r=n[o.customField.id],a=Qb(r,e.values,t);return(0,i.jsxs)(V.Fragment,{children:[r.fieldProperty===pt.Street&&(0,i.jsx)(HT,{change:e.change,changeCity:!0,changeCountry:!0,changeLatLng:!0,changePostalCode:!0,name:"place",prefix:e.prefix}),r.fieldProperty===pt.BirthCity&&(0,i.jsx)(KT,{change:e.change,name:"birthPlace",prefix:e.prefix}),a&&0!==s&&(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(zj,{change:e.change,countryCode:e.countryCode,disabled:qT.includes(r.id),display:a,field:r,isMandatory:!0===o.isMandatory,organizationId:e.organizationId,prefix:e.prefix},s)]},s)}case st.Section:return Qb(o,e.values,t)?(0,i.jsx)(V.Fragment,{children:"function"==typeof e.renderSection?e.renderSection(o.section,s):(0,i.jsxs)(i.Fragment,{children:[e.featureFlags?.isV4?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(md,{height:"5"})]}):0!==s&&(0,i.jsx)(md,{height:"8"}),(0,i.jsx)(ka,{font:"gray800 textMd semiBold",children:"function"==typeof e.renderText?e.renderText(o.section):o.section})]})},s):null;case st.Text:return Qb(o,e.values,t)?(0,i.jsx)(V.Fragment,{children:(0,i.jsxs)(i.Fragment,{children:[0!==s&&(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(jf,{text:"function"==typeof e.renderText?e.renderText(o.text):o.text})]})},s):null;default:return vd(o.elementType)}})})},ZT=e=>{const t=Ti();return(0,i.jsxs)(Om,{buttons:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(kd,{onClick:e.onClose,children:t("fermer_62479")})}),size:"md",onClose:e.onClose,children:[(0,i.jsx)(rd,{justify:"center",width:1,children:(0,i.jsx)(wj,{color:"primary",icon:"circle-info"})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{font:"gray900 textLg medium",textAlign:"center",width:1,children:t("informations_su_86120",e.name)}),(0,i.jsx)(md,{height:"7"}),g(e.description)&&(0,i.jsxs)(rd,{css:{overflowY:"auto"},direction:"column",gap:"2",children:[(0,i.jsx)(ka,{font:"gray900 textMd semiBold",children:t("description_58935")}),(0,i.jsx)(jf,{text:e.description})]}),(0,i.jsx)(md,{height:"4"})]})},XT=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)(!1),s=(0,V.useMemo)(()=>g(e.profile.description)&&e.showDescription,[e.profile,e.showDescription]),r=(0,V.useMemo)(()=>(e.delegationAccreditationsProfiles||[]).find(({accreditationProfileId:t})=>t===e.profile.id),[e.delegationAccreditationsProfiles,e.profile]),a=(0,V.useCallback)(()=>"number"==typeof r?.maxResources?{assignedResources:r.assignedResources,maxResources:r.maxResources,remaining:r.maxResources-r.assignedResources}:null,[r]),l=(0,V.useMemo)(()=>!!r&&r.isFull&&e.alreadyAssignedProfileId!==e.profile.id,[e.alreadyAssignedProfileId,r,e.profile]),d=(0,V.useMemo)(()=>(0,i.jsx)(rS,{getAssignedMaxRemaining:a,slotId:e.profile.id}),[a,e.profile]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vj,{accreditation:e.profile,badge:d,displayNumberOfSlots:!1,displaySlots:!1,numberOfSlots:0,renderActions:()=>s&&(0,i.jsx)(kd,{color:"white",onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o(!0)},children:t("voir_la_descrip_62304")}),renderCheckbox:()=>(0,i.jsx)(Du,{disabled:l,shouldPreventDefault:!1,state:e.profile.id===e.accreditationProfileId?"checked":"unchecked",onClick:hc.A}),onClick:()=>{l||e.setAccreditationProfileId(e.profile.id===e.accreditationProfileId?null:e.profile.id)}}),n&&(0,i.jsx)(ZT,{description:e.profile.description,name:e.profile.name,onClose:()=>o(!1)})]})},JT=e=>{const{translate:t}=bd(),n=(0,V.useCallback)(t=>{e.change(`${e.prefix}accreditationProfileId`,t)},[e.prefix,e.change]);return(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(ka,{font:"gray800 textMd semiBold",children:t("quel_profil_vou_78626")}),(0,i.jsx)(rd,{css:{background:"$gray50",bd:"gray200 2",padding:"$6"},direction:"column",gap:"3",children:e.accreditationsProfiles.map(t=>(0,i.jsx)(XT,{accreditationProfileId:e.accreditationProfileId,alreadyAssignedProfileId:e.alreadyAssignedProfileId,delegationAccreditationsProfiles:e.delegationAccreditationsProfiles,profile:t,setAccreditationProfileId:n,showDescription:e.options.showAccreditationDescription},t.id))})]})},QT=e=>{const{translate:t}=bd(),n=Ei(Cm);return(0,i.jsx)(i.Fragment,{children:Bs(e.slots)?e.slots.map(t=>(0,i.jsx)(Eu,{disabled:e.getDisabled(t.id),state:e.accreditationsSlotsIds.includes(t.id)?"checked":"unchecked",onClick:n=>{e.onChange(Us(e.accreditationsSlotsIds,t.id,"checked"===n))},children:(0,i.jsxs)(rd,{align:"center",gap:"1",children:[(0,i.jsx)(ka,{css:{textTransform:"capitalize"},children:qg(n,t,e.accreditation.name,{date:{localeFormat:zs.DateOnly.WeekdayLongMonthLong}})}),(0,i.jsx)(rS,{getAssignedMaxRemaining:e.getAssignedMaxRemaining,slotId:t.id})]})},t.id)):(0,i.jsx)(pA,{imageSrc:Ec.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},eR=e=>{const{translate:t}=bd(),n=Ei(Cm),o=(0,V.useMemo)(()=>e.slots.map(e=>e.id),[e.slots]);return(0,i.jsx)(i.Fragment,{children:Bs(e.slots)?e.slots.map(t=>(0,i.jsx)(zu,{disabled:e.getDisabled(t.id),state:e.accreditationsSlotsIds.includes(t.id)?"checked":"unchecked",onClick:n=>{const i=[...e.accreditationsSlotsIds.filter(e=>!o.includes(e)),..."checked"===n?[t.id]:[]];e.onChange(i)},children:(0,i.jsxs)(rd,{align:"center",gap:"1",children:[(0,i.jsx)(ka,{css:{textTransform:"capitalize"},children:qg(n,t,e.accreditation.name,{date:{localeFormat:zs.DateOnly.WeekdayLongMonthLong}})}),(0,i.jsx)(rS,{getAssignedMaxRemaining:e.getAssignedMaxRemaining,slotId:t.id})]})},t.id)):(0,i.jsx)(pA,{imageSrc:Ec.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},tR=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>e.slots.map(e=>e.id),[e.slots]),o=(0,V.useMemo)(()=>e.accreditation.accreditationDisplay===xe.List&&e.slots.every(t=>e.accreditationsSlotsIds.includes(t.id)),[e.accreditation,e.accreditationsSlotsIds,e.slots]),s=(0,V.useCallback)(()=>{o?e.onChange((0,yu.A)(e.accreditationsSlotsIds,n)):e.onChange((0,bs.A)(e.accreditationsSlotsIds.concat(n)))},[o,e.accreditationsSlotsIds,e.onChange,n]);return e.accreditation.accreditationDisplay===xe.List?(0,i.jsx)(rd,{css:{borderTop:"1px solid $gray200",padding:"$4"},children:(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"primary500 textSm medium",onClick:s,children:t(o?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")})}):null},nR=e=>{const{params:{organizationId:t},translate:n}=bd(),[o,s]=(0,V.useState)(!1),r=(0,V.useMemo)(()=>g(e.accreditation.description)&&e.options.showAccreditationDescription,[e.accreditation,e.options]),a=(0,V.useMemo)(()=>{const t=e.accreditation.hasSlots?e.slots.map(e=>e.id):[e.accreditation.hiddenSlotId];return e.displayFormCustomFields&&Bs(e.accreditation.formCustomFields)&&Bs((0,Pu.A)(t,e.accreditationsSlotsIds))},[e.accreditation,e.accreditationsSlotsIds,e.displayFormCustomFields,e.slots]),l=(0,V.useMemo)(()=>Object.fromEntries(e.delegationAccreditationsSlots.map(e=>[e.accreditationSlotId,e])),[e.delegationAccreditationsSlots]),d=(0,V.useCallback)(e=>{const t=l[e];return"number"==typeof t?.maxResources?{assignedResources:t.assignedResources,maxResources:t.maxResources,remaining:t.maxResources-t.assignedResources}:null},[l]),c=(0,V.useCallback)(t=>{const n=l[t];return!!n&&n.isFull&&n.willAutoAccredit&&!e.alreadyAssignedSlotsIds.includes(t)},[e.alreadyAssignedSlotsIds,l]),u=(0,V.useMemo)(()=>e.accreditation.hasSlots?null:(0,i.jsx)(rS,{getAssignedMaxRemaining:d,slotId:e.accreditation.hiddenSlotId}),[d,e.accreditation]),m=(0,V.useCallback)(t=>{e.change(`${e.prefix}accreditationsSlotsIds`,t)},[e.prefix,e.change]),h=e.accreditationsSlotsIds.includes(e.accreditation.hiddenSlotId)?"checked":"unchecked";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vj,{accreditation:e.accreditation,badge:u,displayFormCustomFields:a,displayNumberOfSlots:!1,displaySlots:e.accreditation.hasSlots,numberOfSlots:0,renderActions:()=>r&&(0,i.jsx)(kd,{color:"white",onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),s(!0)},children:n("voir_la_descrip_62304")}),renderCheckbox:()=>!e.accreditation.hasSlots&&(0,i.jsx)(wu,{disabled:c(e.accreditation.hiddenSlotId),shouldPreventDefault:!1,state:h,onClick:hc.A}),onClick:()=>{e.accreditation.hasSlots||c(e.accreditation.hiddenSlotId)||e.change(`${e.prefix}accreditationsSlotsIds`,Us(e.accreditationsSlotsIds,e.accreditation.hiddenSlotId,"unchecked"===h))},children:(0,i.jsxs)(rd,{css:{background:"white",padding:"$4"},direction:"column",gap:"3",children:[e.accreditation.hasSlots?e.accreditation.accreditationDisplay===xe.Calendar?(0,i.jsx)(lS,{accreditationsSlotsIds:e.accreditationsSlotsIds,slotIdToDas:l,slots:e.slots,onChange:m}):(0,i.jsxs)(rd,{css:{background:"white",bd:!0},direction:"column",width:1,children:[(0,i.jsx)(rd,{css:{padding:"$4"},direction:"column",gap:"3",children:e.accreditation.accreditationDisplay===xe.Radio?(0,i.jsx)(eR,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,getAssignedMaxRemaining:d,getDisabled:c,slots:e.slots,onChange:m}):(0,i.jsx)(QT,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,getAssignedMaxRemaining:d,getDisabled:c,slots:e.slots,onChange:m})}),(0,i.jsx)(tR,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,slots:e.slots,onChange:m})]}):null,a&&(0,i.jsx)(rd,{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)(ZT,{description:e.accreditation.description,name:e.accreditation.name,onClose:()=>s(!1)})]})},iR=e=>{const{translate:t}=bd();return(0,i.jsx)(Bj,{category:e.category.name,children:Bs(e.accreditations)?e.accreditations.map(t=>(0,i.jsx)(nR,{accreditation:t,accreditationsSlotsIds:e.accreditationsSlotsIds,alreadyAssignedSlotsIds:e.alreadyAssignedSlotsIds,change:e.change,delegationAccreditationsSlots:e.delegationAccreditationsSlots,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,slots:e.accreditationIdToSelectableSlots[t.id]},t.id)):(0,i.jsx)(pA,{imageSrc:Ec.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},oR=e=>{const{translate:t}=bd();return(0,i.jsx)(Lj,{css:{background:"transparent",padding:"0"},children:Bs(e.categories)?(0,i.jsxs)(i.Fragment,{children:[e.categories.map(t=>(0,i.jsx)(iR,{accreditationIdToSelectableSlots:e.accreditationIdToSelectableSlots,accreditations:e.categoryIdToSelectableAccreditations[t.id],accreditationsSlotsIds:e.accreditationsSlotsIds,alreadyAssignedSlotsIds:e.alreadyAssignedSlotsIds,category:t,change:e.change,delegationAccreditationsSlots:e.delegationAccreditationsSlots,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix},t.id)),e.showAutoAccredit&&(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray900 textSm medium",children:t("attribution_des_59896")}),(0,i.jsx)(Kp,{name:`${e.prefix}autoAccredit`,children:t("attribuer_les_a_75431")})]})]}):Bs(e.delegationAccreditationsProfiles)?null:(0,i.jsx)(pA,{imageSrc:Ec.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},sR=(0,V.memo)(e=>{const{accreditationIdToSelectableSlots:t,categoryIdToSelectableAccreditations:n,selectableCategories:o,selectableProfiles:s}=(0,V.useMemo)(()=>{const t=Hh(e.slots.map(Rs)),n=e.event.accreditationsProfilesCategories.flatMap(t=>t.accreditationsProfiles.filter(t=>function(e,t,n){return t.some(t=>t.accreditationProfileId===e.id&&(n===t.accreditationProfileId||!t.isFull))}(t,e.delegationAccreditationsProfiles,e.alreadyAssignedProfileId))),i=e.event.accreditationsCategories.flatMap(n=>n.accreditations.flatMap(n=>n.slots.filter(n=>function(e,t,n,i,o,s){const r=n.slotDisplay===Qe.Hide||n.accreditationFilter===nt.None||!e.date||t.some(t=>Ds(t,e.date)),a=n.showFullAccreditation||s.includes(e.id),l=n.accreditationDisplay!==ot.None&&!n.hiddenAccreditationsSlotsIds.includes(e.id)&&(0===n.displayedAccreditationsSlotsIds.length||n.displayedAccreditationsSlotsIds.includes(e.id))&&(a||!e.isFull),d=i.some(t=>t.accreditationSlotId===e.id&&(a||!t.isFull&&!e.isFull));return!o.includes(e.id)&&!e.isBlocked&&r&&(l||d)}(n,t,e.options,e.delegationAccreditationsSlots,e.scannedSlotsIds,e.alreadyAssignedSlotsIds)))),o=i.map(e=>e.id),s=(0,Bu.A)((0,Vu.A)(i,e=>e.accreditationId),e=>(0,cm.A)(e,e=>(0,hd.A)([e.date?.toMillis(),m(e.name)]))),r=e.event.accreditationsCategories.flatMap(t=>t.accreditations.filter(t=>function(e,t,n,i,o){return i.accreditationDisplay!==ot.None&&!i.hiddenAccreditationsIds.includes(e.id)&&(0===i.displayedAccreditationsIds.length||i.displayedAccreditationsIds.includes(e.id))&&lg(e,n)&&e.slots.some(e=>t.includes(e.id))||o.some(i=>i.accreditationId===e.id&&lg(e,n)&&e.slots.some(e=>t.includes(e.id)))}(t,o,e.userInfosFields,e.options,e.delegationAccreditationsSlots))),a=r.map(e=>e.id),l=(0,Bu.A)((0,Vu.A)(r,e=>e.accreditationCategoryId),e=>_g(e)),d=(0,cm.A)(e.event.accreditationsCategories.filter(t=>function(e,t,n,i){return n.accreditationDisplay!==ot.None&&!n.hiddenAccreditationsCategoriesIds.includes(e.id)&&(0===n.displayedAccreditationsCategoriesIds.length||n.displayedAccreditationsCategoriesIds.includes(e.id))&&e.accreditations.some(e=>t.includes(e.id))||i.some(n=>n.accreditationCategoryId===e.id&&e.accreditations.some(e=>t.includes(e.id)))}(t,a,e.options,e.delegationAccreditationsSlots)),e=>m(e.name));return{selectableCategories:d,selectableProfiles:n,categoryIdToSelectableAccreditations:l,accreditationIdToSelectableSlots:s}},[e.alreadyAssignedProfileId,e.alreadyAssignedSlotsIds,e.delegationAccreditationsProfiles,e.delegationAccreditationsSlots,e.event.accreditationsCategories,e.event.accreditationsProfilesCategories,e.options,e.scannedSlotsIds,e.slots,e.userInfosFields]);return Bs(s)||Bs(e.delegationAccreditationsSlots)||e.options.accreditationDisplay===ot.Accreditation?(0,i.jsxs)(rd,{direction:"column",gap:"9",children:[Bs(e.delegationAccreditationsProfiles)&&(0,i.jsx)(JT,{accreditationProfileId:e.accreditationProfileId,accreditationsProfiles:s,alreadyAssignedProfileId:e.alreadyAssignedProfileId,change:e.change,delegationAccreditationsProfiles:e.delegationAccreditationsProfiles,options:e.options,prefix:e.prefix}),(0,i.jsx)(oR,{accreditationIdToSelectableSlots:t,accreditationsSlotsIds:e.accreditationsSlotsIds,alreadyAssignedSlotsIds:e.alreadyAssignedSlotsIds,categories:o,categoryIdToSelectableAccreditations:n,change:e.change,delegationAccreditationsProfiles:e.delegationAccreditationsProfiles,delegationAccreditationsSlots:e.delegationAccreditationsSlots,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,showAutoAccredit:e.showAutoAccredit})]}):null}),rR=e=>{const[t,n]=(0,V.useState)(!1),o=g(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Eu,{css:{alignItems:"center"},state:e.positionsCategoriesIds.includes(e.category.id)?"checked":"unchecked",onClick:t=>{e.change(`${e.prefix}positionsCategoriesIds`,Us(e.positionsCategoriesIds,e.category.id,"checked"===t))},children:(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{children:e.category.name}),o&&(0,i.jsx)(ka,{onClick:e=>{Gd(e),n(!0)},children:(0,i.jsx)(Id,{icon:"circle-info"})})]})}),t&&(0,i.jsx)(ZT,{description:e.category.description,name:e.category.name,onClose:()=>{n(!1)}})]})},aR=e=>{const{translate:t}=bd();return(0,i.jsx)(i.Fragment,{children:Bs(e.categories)?e.categories.map((t,n)=>(0,i.jsxs)(V.Fragment,{children:[0!==n&&(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(rR,{category:t,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix})]},t.id)):(0,i.jsx)(pA,{imageSrc:Ec.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},lR=e=>{const[t,n]=(0,V.useState)(!1),o=g(e.position.description)&&e.options.showPositionDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Eu,{css:{alignItems:"center"},state:e.positionsIds.includes(e.position.id)?"checked":"unchecked",onClick:t=>{e.change(`${e.prefix}positionsIds`,Us(e.positionsIds,e.position.id,"checked"===t))},children:(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{children:e.position.name}),o&&(0,i.jsx)(ka,{onClick:e=>{Gd(e),n(!0)},children:(0,i.jsx)(Id,{icon:"circle-info"})})]})}),t&&(0,i.jsx)(ZT,{description:e.position.description,name:e.position.name,onClose:()=>{n(!1)}})]})},dR=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)(!1),s=g(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{color:"gray900",fontWeight:"semiBold",children:e.category.name}),s&&(0,i.jsx)(ka,{color:"gray700",onClick:()=>{o(!0)},children:(0,i.jsx)(Id,{icon:"circle-info"})})]}),(0,i.jsx)(md,{height:"2"}),Bs(e.positions)?e.positions.map((t,n)=>(0,i.jsxs)(V.Fragment,{children:[0!==n&&(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(lR,{change:e.change,options:e.options,position:t,positionsIds:e.positionsIds,prefix:e.prefix})]},t.id)):(0,i.jsx)(pA,{imageSrc:Ec.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),n&&(0,i.jsx)(ZT,{description:e.category.description,name:e.category.name,onClose:()=>{o(!1)}})]})},cR=e=>{const{translate:t}=bd();return(0,i.jsx)(i.Fragment,{children:Bs(e.categories)?e.categories.map((t,n)=>(0,i.jsxs)(V.Fragment,{children:[0!==n&&(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(dR,{category:t,change:e.change,options:e.options,positions:e.categoryIdToSelectablePositions[t.id],positionsIds:e.positionsIds,prefix:e.prefix})]},t.id)):(0,i.jsx)(pA,{imageSrc:Ec.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},uR=e=>{const t=Ti(),n=rk(),o=(0,V.useMemo)(()=>e.categories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[e.categories]);return(0,i.jsxs)(i.Fragment,{children:[Bs(o)?n?(0,i.jsxs)(Uu,{isSearchVisible:!0,label:t("souhait_n_1_47211",e.index+1),values:[e.positionsCategoriesIds?.[e.index]??-1],onChange:t=>{Bs(t)&&e.change(`${e.prefix}positionsCategoriesIds[${e.index}]`,t[0])},children:[(0,i.jsx)("option",{value:-1,children:t("choisir_une_mis_90627")}),o]}):(0,i.jsxs)(hh,{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")}),o]}):(0,i.jsx)(pA,{imageSrc:Ec.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),e.index!==e.options.positionLimit-1&&(0,i.jsx)(md,{height:"4"})]})},mR=e=>{const{translate:t}=bd(),n=rk(),o=(0,V.useMemo)(()=>e.categories.map(t=>{const n=e.categoryIdToSelectablePositions[t.id];return(0,i.jsx)("optgroup",{label:t.name,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},t.id)}),[e.categories]);return(0,i.jsxs)(i.Fragment,{children:[Bs(o)?n?(0,i.jsxs)(Uu,{isSearchVisible:!0,label:t("souhait_n_1_47211",e.index+1),values:[e.positionsIds?.[e.index]??-1],onChange:t=>{Bs(t)&&e.change(`${e.prefix}positionsIds[${e.index}]`,t[0])},children:[(0,i.jsx)("option",{value:-1,children:t("choisir_une_mis_90627")}),o]}):(0,i.jsxs)(hh,{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")}),o]}):(0,i.jsx)(pA,{imageSrc:Ec.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),e.index!==e.options.positionLimit-1&&(0,i.jsx)(md,{height:"4"})]})},hR=e=>{const{translate:t}=bd(),n=Ei(Yh),o=rk(),s=(0,V.useMemo)(()=>{const t=e.categories.map(t=>{const n=e.categoryIdToSelectablePositions[t.id];return{...t,positions:n.map(t=>{const n=e.positionIdToSelectableSlots[t.id];return{...t,slots:n}})}});return Yg(n,t)},[e.categories]);return(0,i.jsxs)(i.Fragment,{children:[Bs(s)?o?(0,i.jsxs)(Uu,{isSearchVisible:!0,label:t("souhait_n_1_47211",e.index+1),values:[e.positionsSlotsIds?.[e.index]??-1],onChange:t=>{Bs(t)&&e.change(`${e.prefix}positionsSlotsIds[${e.index}]`,t[0])},children:[(0,i.jsx)("option",{value:-1,children:t("choisir_une_mis_90627")}),s]}):(0,i.jsxs)(hh,{label:t("souhait_n_1_47211",e.index+1),shouldParseAsInt:!0,value:e.positionsSlotsIds?.[e.index]??-1,onChange:t=>{e.change(`${e.prefix}positionsSlotsIds[${e.index}]`,t)},children:[(0,i.jsx)("option",{value:-1,children:t("choisir_une_mis_90627")}),s]}):(0,i.jsx)(pA,{imageSrc:Ec.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),e.index!==e.options.positionLimit-1&&(0,i.jsx)(md,{height:"4"})]})},gR=e=>{const{translate:t}=bd();return(0,i.jsx)(i.Fragment,{children:Bs(e.categories)?(0,nm.A)(0,e.options.positionLimit).map(t=>e.options.positionDisplay===tt.Category?(0,i.jsx)(uR,{categories:e.categories,change:e.change,index:t,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix},t):e.options.positionDisplay===tt.Position?(0,i.jsx)(mR,{categories:e.categories,categoryIdToSelectablePositions:e.categoryIdToSelectablePositions,change:e.change,index:t,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix},t):e.options.positionDisplay===tt.Slot?(0,i.jsx)(hR,{categories:e.categories,categoryIdToSelectablePositions:e.categoryIdToSelectablePositions,change:e.change,index:t,options:e.options,positionIdToSelectableSlots:e.positionIdToSelectableSlots,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix},t):null):(0,i.jsx)(pA,{imageSrc:Ec.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})};function pR(e){const t=Ei(Yh),n=(0,V.useMemo)(()=>t.toDisplayString(e.range,{formats:{displayWeekday:!0}}),[e]),i=g(e.name);return{isRenamed:i,finalName:i?e.name:n,rangeString:n}}const fR=e=>{const{translate:t}=bd(),{rangeString:n,finalName:o,isRenamed:s}=pR(e.slot),r=(0,V.useMemo)(()=>{if(e.options.willAutoAssign){const t=e.allSlots.filter(t=>e.positionsSlotsIds.includes(t.id));return ig(e.slot,t)}return!1},[e.options.willAutoAssign,e.allSlots,e.positionsSlotsIds]);return(0,i.jsxs)(V.Fragment,{children:[0!==e.index&&(0,i.jsx)(md,{height:"3"}),r?(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(Eu,{disabled:!0,shouldPreventDefault:!1,state:e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked",subtext:s?n:void 0,onClick:hc.A,children:o})})}),(0,i.jsx)(bp,{placement:"top-start",children:t("ce_cr_neau_en_c_55775")})]}):(0,i.jsx)(Eu,{state:e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked",subtext:s?n:void 0,onClick:t=>{e.change(`${e.prefix}positionsSlotsIds`,Us(e.positionsSlotsIds,e.slot.id,"checked"===t))},children:o})]},e.slot.id)},_R=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)(!1),s=g(e.position.description)&&e.options.showPositionDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{color:"gray900",fontWeight:"semiBold",children:e.position.name}),s&&(0,i.jsx)(ka,{color:"gray700",onClick:()=>{o(!0)},children:(0,i.jsx)(Id,{icon:"circle-info"})})]}),(0,i.jsx)(md,{height:"2"}),Bs(e.slots)?e.slots.map((t,n)=>(0,i.jsx)(fR,{allSlots:e.allSlots,change:e.change,index:n,options:e.options,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slot:t},t.id)):(0,i.jsx)(pA,{imageSrc:Ec.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),n&&(0,i.jsx)(ZT,{description:e.position.description,name:e.position.name,onClose:()=>{o(!1)}})]})},xR=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)(!1),s=g(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{color:"gray500",css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"semiBold",children:e.category.name}),s&&(0,i.jsx)(ka,{color:"gray700",onClick:()=>{o(!0)},children:(0,i.jsx)(Id,{icon:"circle-info"})})]}),Bs(e.positions)?e.positions.map(t=>(0,i.jsx)(_R,{allSlots:e.allSlots,change:e.change,options:e.options,position:t,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slots:e.positionIdToSelectableSlots[t.id]},t.id)):(0,i.jsx)(pA,{imageSrc:Ec.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),n&&(0,i.jsx)(ZT,{description:e.category.description,name:e.category.name,onClose:()=>{o(!1)}})]})},IR=e=>{const{translate:t}=bd();return(0,i.jsx)(i.Fragment,{children:Bs(e.categories)?e.categories.map((t,n)=>(0,i.jsxs)(V.Fragment,{children:[0!==n&&(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(xR,{allSlots:e.allSlots,category:t,change:e.change,options:e.options,positionIdToSelectableSlots:e.positionIdToSelectableSlots,positions:e.categoryIdToSelectablePositions[t.id],positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix},t.id)]},t.id)):(0,i.jsx)(pA,{imageSrc:Ec.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},vR=(0,V.memo)(e=>{const{categoryIdToSelectablePositions:t,positionIdToSelectableSlots:n,selectableCategories:o,selectableSlots:s}=(0,V.useMemo)(()=>{const t=Hh(e.slots.map(Rs)),n=e.event.positionsCategories.flatMap(n=>n.positions.flatMap(n=>n.slots.filter(n=>function(e,t,n){return!n.hiddenPositionsSlotsIds.includes(e.id)&&(0===n.displayedPositionsSlotsIds.length||n.displayedPositionsSlotsIds.includes(e.id))&&(n.showFullPosition||!e.isFull)&&(n.slotDisplay===Qe.Hide||n.positionFilter===nt.None||t.some(t=>t.engulfs(e.range)))}(n,t,e.options)))),i=n.map(e=>e.id),o=(0,Bu.A)((0,Vu.A)(n,e=>e.positionId),e=>(0,cm.A)(e,e=>[e.range.start.toMillis(),e.nameOrRange])),s=e.event.positionsCategories.flatMap(t=>t.positions.filter(t=>function(e,t,n,i){return!i.hiddenPositionsIds.includes(e.id)&&(0===i.displayedPositionsIds.length||i.displayedPositionsIds.includes(e.id))&&(0===i.hiddenPositionsTagsIds.length||Vs((0,Pu.A)(i.hiddenPositionsTagsIds,e.tagsIds)))&&(0===i.displayedPositionsTagsIds.length||Bs((0,Pu.A)(i.displayedPositionsTagsIds,e.tagsIds)))&&lg(e,n)&&e.slots.some(e=>t.includes(e.id))}(t,i,e.userInfoFields,e.options))),r=s.map(e=>e.id),a=(0,Bu.A)((0,Vu.A)(s,e=>e.positionCategoryId),e=>(0,cm.A)(e,e=>m(e.name))),l=(0,cm.A)(e.event.positionsCategories.filter(t=>function(e,t,n){return!n.hiddenPositionsCategoriesIds.includes(e.id)&&(0===n.displayedPositionsCategoriesIds.length||n.displayedPositionsCategoriesIds.includes(e.id))&&e.positions.some(e=>t.includes(e.id))}(t,r,e.options)),e=>m(e.name));return{selectableCategories:l,selectableSlots:n,categoryIdToSelectablePositions:a,positionIdToSelectableSlots:o}},[e.event.positionsCategories,e.options,e.slots,e.userInfoFields]);if(e.options.positionRanking===it.Ranked)return(0,i.jsx)(gR,{categories:o,categoryIdToSelectablePositions:t,change:e.change,options:e.options,positionIdToSelectableSlots:n,positionsCategoriesIds:e.positionsCategoriesIds,positionsIds:e.positionsIds,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix});switch(e.options.positionDisplay){case tt.Category:return(0,i.jsx)(aR,{categories:o,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix});case tt.Position:return(0,i.jsx)(cR,{categories:o,categoryIdToSelectablePositions:t,change:e.change,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields});case tt.Slot:return(0,i.jsx)(IR,{allSlots:s,categories:o,categoryIdToSelectablePositions:t,change:e.change,options:e.options,positionIdToSelectableSlots:n,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix});case tt.None:return null;default:return vd(e.options.positionDisplay)}}),bR=e=>{const t=(0,V.useMemo)(()=>tg(e.dayStartTime)?.[0]??0,[e.dayStartTime]),[n,o]=(0,V.useMemo)(()=>Vg(e.startAt,e.endAt,e.ranges,e.daysDisplay,t),[e.startAt,e.endAt,e.ranges,e.daysDisplay,t]),s=(0,V.useMemo)(()=>(0,Lh.A)(n,e=>e.toMillis()),[n]),r=(0,V.useMemo)(()=>(0,Bh.A)(n,e=>e.toMillis()),[n]),a=(0,V.useMemo)(()=>s?.isValid&&r?.isValid?Math.ceil(r.endOf("month").diff(s.startOf("month"),"months").months):0,[s,r]),l=(0,V.useCallback)((t,n)=>{const i=e.currentSlots.filter(e=>e.startDate.year!==t.year||e.startDate.month!==t.month).concat(n.map(e=>Os(As.IX.fromDateTimes(e,e.plus({day:1})))));e.change(`${e.prefix}slots`,i)},[e.currentSlots,e.prefix,e.change]);return s?.isValid&&r?.isValid&&a>0?(0,i.jsx)(rd,{gap:"6",wrap:"wrap",children:(0,nm.A)(0,a).map(n=>{const d=s.plus({month:n}).startOf("month"),c=0===n?s:d,u=n===a-1?r:d.endOf("month"),m=e.currentSlots.flatMap(e=>e.startDate.year===d.year&&e.startDate.month===d.month?[e.startDate.startOf("day").set({hour:t||0})]:[]);return(0,i.jsx)(oS,{disabledDates:o,firstDayOfMonth:d,max:u,min:c,startHour:t,values:m,onChange:e=>{l(d,e)}},n)})}):null},jR=e=>{const{intervals:t,minDate:n,maxDate:o,numberOfMonths:s}=(0,V.useMemo)(()=>{const t=e.intervalsGrouped.flatMap(([e,t])=>t.map(({interval:e})=>e)),n=(0,Lh.A)(t,e=>e.start.toMillis()).start.startOf("day"),i=(0,Bh.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)(rd,{gap:"6",wrap:"wrap",children:(0,nm.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)(oS,{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)})})},CR=e=>{const[t,n]=(0,V.useState)(e.intervals.some(({interval:t})=>e.isSelected(t))?"checked":"unchecked"),o=(0,V.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)(rd,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs"},direction:"column",children:[(0,i.jsxs)(rd,{align:"center",css:{cursor:"pointer",padding:"$4 $5"},gap:"2",onClick:o,children:[(0,i.jsx)(ka,{color:"gray900",fontSize:"textXs",children:(0,i.jsx)(Id,{icon:"checked"===t?"chevron-down":"chevron-right"})}),(0,i.jsx)(ka,{font:"gray800 textSm medium",children:e.day})]}),"checked"===t&&(0,i.jsx)(rd,{css:{borderTop:"1px solid $gray200",padding:"$4 $5"},direction:"column",gap:"3",children:e.intervals.map(({name:t,interval:n},o)=>(0,i.jsx)(Eu,{state:e.isSelected(n)?"checked":"unchecked",onClick:t=>{e.setSelected(n,"checked"===t)},children:Wg(t,n)},o))})]})},yR=e=>(0,i.jsx)(rd,{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)(Eu,{state:e.isSelected(o)?"checked":"unchecked",onClick:t=>{e.setSelected(o,"checked"===t)},children:a},s)})}),AR=({customSlotPeriod:e,daysDisplay:t,event:n,isSelected:o,setSelected:s,setSelectedBatch:r})=>{const a=Ei(Cm),l=(0,V.useMemo)(()=>Ug(e.startDate??n.startAt,e.endDate??n.endAt,e.customSlots,n.ranges,t),[e,n,t]),d=(0,V.useMemo)(()=>(0,cm.A)(Object.entries((0,Vu.A)(l,({interval:e})=>a.toLocaleString(e.start.startOf("day"),zs.DateOnly.WeekdayLongMonthLong))),([e,[{interval:t}]])=>t.start.startOf("day").toMillis()),[l]);return(0,i.jsxs)(rd,{direction:"column",gap:"2",width:1,children:[g(e.name)&&(0,i.jsx)(ka,{font:"gray900 textSm semiBold",children:e.name}),1===e.customSlots.length?0===d.length?null:e.displayAsCalendar?(0,i.jsx)(jR,{intervalsGrouped:d,isSelected:o,setSelectedBatch:r}):(0,i.jsx)(yR,{hideNameDates:e.hideNameDates,intervalsGrouped:d,isSelected:o,setSelected:s}):d.map(([e,t],n)=>(0,i.jsx)(CR,{day:e,intervals:t,isSelected:o,setSelected:s},n))]})},SR=e=>{const t=(0,V.useMemo)(()=>e.customSlotsPeriods.flatMap(t=>Ug(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,V.useState)(Object.fromEntries(t.map(t=>{const n=e.currentSlots.some(e=>Ts(e).equals(t));return[t.toISO(),n]}))),s=(0,V.useCallback)(e=>n[e.toISO()],[n]),r=(0,V.useCallback)((t,n)=>{const i=t.toISO();o(e=>({...e,[i]:n})),e.change(`${e.prefix}slots`,Gg(e.currentSlots,t,n))},[e.currentSlots,o]),a=(0,V.useCallback)(t=>{const n=t.reduce((e,{interval:t,isSelected:n})=>{const i=t.toISO();return o(e=>({...e,[i]:n})),Gg(e,t,n)},e.currentSlots);e.change(`${e.prefix}slots`,n)},[e.currentSlots,o]),l=(0,V.useMemo)(()=>e.elements.flatMap(e=>e.elementType===st.Field?(0,hd.A)([e.customField,e.conditionCustomField]):e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]),[e.elements]);return(0,i.jsx)(rd,{direction:"column",gap:"6",children:e.customSlotsPeriods.map(t=>Qb(t,e.userInfoFields,l)?(0,i.jsx)(AR,{customSlotPeriod:t,daysDisplay:e.daysDisplay,event:e.event,isSelected:s,setSelected:r,setSelectedBatch:a},t.id):null)})},kR=e=>{const{translate:t}=bd(),[n]=(0,V.useMemo)(()=>Vg(e.startAt,e.endAt,e.ranges,e.daysDisplay,tg(e.dayStartTime)?.[0]??0),[e.startAt,e.endAt,e.ranges,e.daysDisplay,e.dayStartTime]),o=(0,V.useMemo)(()=>n.filter(t=>(e.blockedSlots??[]).some(e=>Ds(e,t))),[e.blockedSlots,n]),s=Ei(Cm),[r,a]=(0,V.useState)(Object.fromEntries(n.map((t,n)=>{const i=As.IX.fromDateTimes(t,t.plus({day:1}));return[`day${n}`,void 0!==e.currentSlots.find(e=>Ts(e).equals(i))]})));return(0,i.jsx)(i.Fragment,{children:n.map((n,l)=>{const d=o.includes(n);return(0,i.jsxs)(V.Fragment,{children:[0!==l&&(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Eu,{disabled:d,state:r[`day${l}`]?"checked":"unchecked",onClick:t=>{a({...r,[`day${l}`]:"checked"===t}),e.change(`${e.prefix}slots`,Gg(e.currentSlots,As.IX.fromDateTimes(n,n.plus({day:1})),"checked"===t))},children:d?(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(Od,{children:s.toLocaleString(n,zs.DateOnly.WeekdayLongMonthLong)})}),(0,i.jsx)(bp,{placement:"right",children:t("vous_avez_d_j_92810")})]}):s.toLocaleString(n,zs.DateOnly.WeekdayLongMonthLong)})]},l)})})};var wR=n(3088);const ER=e=>{const t=Ti();return(0,i.jsx)(Ij,{buttons:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})})}),title:t("disponibilit_n_50484",e.index+1),children:(0,i.jsxs)(rd,{direction:{"@initial":"column","@desktop":"row"},gap:"4",children:[(0,i.jsx)(Np,{label:t("date_de_d_but_43380"),max:e.max,min:e.min,name:`${e.prefix}startDate`}),(0,i.jsx)(wI,{label:t("heure_de_d_but_27566"),name:`${e.prefix}startTime`}),(0,i.jsx)(Np,{label:t("date_de_fin_86920"),max:e.max,min:e.min,name:`${e.prefix}endDate`}),(0,i.jsx)(wI,{label:t("heure_de_fin_95071"),name:`${e.prefix}endTime`})]})})},TR=e=>{const t=Ti(),n=Ei(UT),o=(0,V.useMemo)(()=>e.max.endOf("day"),[e.max]);return(0,i.jsx)(wR.ED,{name:`${e.prefix}slots`,children:({fields:s})=>(0,i.jsxs)(i.Fragment,{children:[s.map((t,n)=>(0,i.jsxs)(V.Fragment,{children:[0!==n&&(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ER,{index:n,max:o,min:e.min,prefix:`${t}.`,remove:()=>{s.remove(n)}})]},n)),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",onClick:()=>{s.push(n.volunteersRegistrationsSlotInputDefault(e.min))},children:t("ajouter_une_dis_96540")})]})})},RR=(0,V.memo)(e=>{switch(e.slotDisplay){case Qe.Display:return(0,i.jsx)(TR,{max:e.event.endAt,min:e.event.startAt,prefix:e.prefix});case Qe.DisplayDays:return(0,i.jsx)(kR,{blockedSlots:e.blockedSlots,change:e.change,currentSlots:e.currentSlots,dayStartTime:e.event.dayStartTime,daysDisplay:e.daysDisplay,endAt:e.event.endAt,prefix:e.prefix,ranges:e.event.ranges,startAt:e.event.startAt});case Qe.Calendar:return(0,i.jsx)(bR,{change:e.change,currentSlots:e.currentSlots,dayStartTime:e.event.dayStartTime,daysDisplay:e.daysDisplay,endAt:e.event.endAt,prefix:e.prefix,ranges:e.event.ranges,startAt:e.event.startAt});case Qe.Custom:return(0,i.jsx)(SR,{change:e.change,currentSlots:e.currentSlots,customSlotsPeriods:e.customSlotsPeriods,daysDisplay:e.daysDisplay,elements:e.elements,event:e.event,prefix:e.prefix,userInfoFields:e.userInfoFields});case Qe.Hide:return null;default:return vd(e.slotDisplay)}}),OR=e=>(0,i.jsx)(Wp,{disabled:e.disabled,heading:e.heading,hideHeader:e.hideHeader,children:(0,i.jsx)(rd,{direction:"column",children:e.children})}),DR=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),s=(0,V.useMemo)(()=>o&&e.form.slotDisplay!==Qe.Hide,[e.form,o]),r=(0,V.useMemo)(()=>o&&e.form.positionDisplay!==tt.None,[e.form,o]),a=(0,V.useMemo)(()=>o&&(e.form.accreditationDisplay!==ot.None||Bs(e.delegationAccreditationsSlots)||Bs(e.delegationAccreditationsProfiles)),[e.delegationAccreditationsProfiles,e.delegationAccreditationsSlots,e.form,o]),l=(0,V.useMemo)(()=>e.userInfo?.volunteerRegistration?.accreditationsUsersInfos.flatMap(e=>e.checkInAt?.isValid?[e.accreditationSlotId]:[])??[],[e.userInfo]),d=function(e,t=300){const[n,i]=(0,V.useState)(e),o=hm(i,t);return(0,V.useEffect)(()=>{o(e)},[e]),n}(e.values.formRegister.userInfo.fields);return(0,i.jsxs)(i.Fragment,{children:[e.showEmail&&(0,i.jsxs)(OR,{hideHeader:!0,children:[g(e.form.description)&&(0,i.jsx)(jf,{text:e.form.description}),(0,i.jsx)(ec,{isEmail:!0,label:t("Email"),name:"email"})]}),(0,i.jsx)(OR,{heading:g(e.form.informationTitle)?e.form.informationTitle:t("informations_pe_37892"),children:e.disabled?(0,i.jsx)(sA,{form:e.form,userInfo:e.userInfo}):(0,i.jsx)(YT,{asoBannersColors:e.asoBannersColors,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)(OR,{heading:g(e.form.slotTitle)?e.form.slotTitle:t("disponibilit_s_49923"),children:[g(e.form.slotSubtitle)&&(0,i.jsx)(jf,{text:e.form.slotSubtitle}),e.areSectionsDisabled?.isWishedAssignmentsDisabled?(0,i.jsxs)(zd,{alertStyle:"warning",children:[(0,i.jsx)($d,{children:t("no_longer_modif_99663")}),(0,i.jsx)(Pd,{children:t("you_are_already_assigned_to_missions")})]}):(0,i.jsx)(RR,{blockedSlots:e.blockedSlots,change:e.change,currentSlots:e.values.formRegister.slots,customSlotsPeriods:e.form.customSlotsPeriods,daysDisplay:e.form.daysDisplay,elements:e.form.elements,event:e.event,prefix:"formRegister.",slotDisplay:e.form.slotDisplay,userInfoFields:d})]}),r&&e.event&&(0,i.jsxs)(OR,{heading:g(e.form.positionTitle)?e.form.positionTitle:t("missions_souhai_23225"),children:[g(e.form.positionSubtitle)&&(0,i.jsx)(jf,{text:e.form.positionSubtitle}),e.areSectionsDisabled?.isWishedAssignmentsDisabled?(0,i.jsxs)(zd,{alertStyle:"warning",children:[(0,i.jsx)($d,{children:t("no_longer_modif_99663")}),(0,i.jsx)(Pd,{children:t("you_are_already_assigned_to_missions")})]}):(0,i.jsx)(vR,{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:d})]}),a&&e.event&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(OR,{heading:g(e.form.accreditationTitle)?e.form.accreditationTitle:t("accr_ditations_74375"),children:[g(e.form.accreditationSubtitle)&&(0,i.jsx)(jf,{text:e.form.accreditationSubtitle}),e.areSectionsDisabled?.isWishedAccreditationsDisabled?(0,i.jsxs)(zd,{alertStyle:"warning",children:[(0,i.jsx)($d,{children:t("no_longer_modif_99663")}),(0,i.jsx)(Pd,{children:t("you_are_already_assigned_to_accreditations")})]}):(0,i.jsx)(sR,{accreditationProfileId:e.values.formRegister.accreditationProfileId,accreditationsSlotsIds:e.values.formRegister.accreditationsSlotsIds,alreadyAssignedProfileId:e.alreadyAssignedProfileId,alreadyAssignedSlotsIds:e.alreadyAssignedSlotsIds,change:e.change,delegationAccreditationsProfiles:e.delegationAccreditationsProfiles??Ns,delegationAccreditationsSlots:e.delegationAccreditationsSlots??Ns,displayFormCustomFields:!0,event:e.event,options:e.form,prefix:"formRegister.",scannedSlotsIds:l,showAutoAccredit:e.showAutoAccredit,slots:e.values.formRegister.slots,userInfosFields:d})]})})]})},zR=e=>{const t=Ei(GT),n=(0,V.useMemo)(()=>(e.organization.form.elements??[]).flatMap(e=>e.elementType===st.Field?[e.customField]:[]),[e.organization]);return(0,V.useEffect)(()=>{const i=t.formRegisterInputDefault(Dt.Admin,null,n,{countryCode:e.organization?.event?.country??e.organization?.country,delegationAccreditationsSlots: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,fields:{...i.userInfo.fields,...e.values.formRegister.userInfo.fields}}}})},[e.organization]),(0,i.jsx)($p,{children:(0,i.jsx)(DR,{alreadyAssignedProfileId:null,alreadyAssignedSlotsIds:Ns,change:e.change,delegationAccreditationsProfiles:e.organization.delegation?.accreditationsProfiles??Ns,delegationAccreditationsSlots:e.organization.delegation?.accreditationsSlots??Ns,event:e.organization.event,form:e.organization.form,showAutoAccredit:!0,showEmail:!1,values:e.values})})},$R=e=>{const{translate:t,params:{delegationId:n}}=bd();return(0,i.jsxs)(rd,{direction:"column",gap:"6",width:1,children:[(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(ec,{isEmail:!0,label:t("Email"),name:"email"}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(ec,{label:(0,i.jsx)(fI,{children:t("pr_nom_66988")}),name:"formRegister.userInfo.fields.firstName"}),(0,i.jsx)(ec,{label:(0,i.jsx)(fI,{children:t("last_name")}),name:"formRegister.userInfo.fields.lastName"})]})]}),!n&&(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{font:"gray800 textMd medium",children:t("param_tres_du_m_69378")}),(0,i.jsx)(ka,{color:"gray500",children:t("s_lectionnez_le_16209")})]}),(0,i.jsx)(Gp,{isSearchVisible:!0,label:(0,i.jsx)(fI,{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)(Uu,{isSearchVisible:!0,label:(0,i.jsx)(fI,{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)(Uu,{isSearchVisible:!0,label:(0,i.jsx)(fI,{children:t("Form")}),state:Bs(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))})]})]})},PR=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,delegationId:r}}=bd(),a=Ei(GT),l=Ei(ld),d=(0,V.useRef)(null),{mutate:c,isLoading:u}=Bl(),{mutate:m}=function(e={}){return Di("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)}(),[h,g]=(0,V.useState)(null),p=(0,V.useMemo)(()=>h?.form.elements.filter(e=>e.elementType===st.Field)??[],[h]),[f,_]=(0,V.useState)({email:"",formRegister:a.formRegisterInputDefault(Dt.Admin,null,Ns,{countryCode:e.organization?.event?.country??e.organization?.country,delegationAccreditationsSlots:Ns,eventStartDate:e.organization?.event?.startAt,forOther:!0,sendNotificationEmail:!1,slotDisplay:Qe.Hide,team:null})}),x=(0,V.useMemo)(()=>a.formRegisterSchema(p,{slotDisplay:h?.form.slotDisplay??Qe.Hide,minNumberOfSlots:h?.form.minNumberOfSlots??1,eventStartDate:h?.event?.startAt??As.c9.now(),eventEndDate:h?.event?.endAt??As.c9.now(),positionRanking:h?.form.positionRanking??it.Unranked,positionDisplay:h?.form.positionDisplay??tt.None,accreditationDisplay:h?.form.accreditationDisplay??ot.None,delegationId:h?.delegation?.id,delegationAccreditationsProfiles:h?.delegation?.accreditationsProfiles??[]}),[p,a,h]),I=(0,V.useCallback)(e=>l.validateForForm(x)(e),[x]),v=(0,V.useCallback)(async n=>{h?await m({organizationId:o,eventId:s,delegationId:h.delegation?.id,formId:h.form.id,email:n.email,formRegister:n.formRegister}):await c({organizationId:o,eventId:s,email:n.email,userInfo:n.formRegister.userInfo,sendNotificationEmail:n.formRegister.sendNotificationEmail}),t.push(e.closePath)},[e.closePath,h]),b=e.organization.delegations.nodes,j=e.organization.forms.nodes,[C,y]=(0,V.useState)(!1),[A,S]=(0,V.useState)([]),[k,w]=(0,V.useState)([]),E=(0,V.useCallback)(async e=>{if(w(e),Bs(e)){y(!0);const{organization:t}=await Ll({organizationId:o,eventId:s,formId:e[0]},await X());g(t),y(!1)}else g(null)},[s,o]),T=(0,V.useCallback)(async e=>{if(S(e),Bs(e)){const t=b.find(t=>t.id===e[0]);w([t.formId]),y(!0);const{organization:n}=await Ll({organizationId:o,delegationId:e[0],eventId:s,formId:t.formId},await X());g(n),y(!1)}else g(null)},[b,o,s]);return Zc(n("cr_ation_d_un_m_98624")),(0,V.useEffect)(()=>{r&&T([r])},[r,T]),(0,i.jsx)(Vd,{customErrorRef:d,height:1,hideDefaultErrors:!0,initialValues:f,render:({form:t,handleSubmit:o,values:r})=>(0,i.jsx)(zp,{category:n("cr_ation_d_un_m_98624"),color:"dark",fallbackClosePath:e.closePath,heading:n("nouveau_membre_94535"),children:(0,i.jsx)(Op,{ref:d,children:(0,i.jsxs)(rd,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(Nd,{hideSpacer:!0}),(0,i.jsx)(Wp,{heading:n("informations_su_05921"),children:(0,i.jsx)($R,{delegations:b,delegationsIds:A,forms:j,formsIds:k,population:e.organization.population,setDelegationsIds:T,setFormsIds:E})}),C&&(0,i.jsx)($p,{css:{minHeight:"200px"},children:(0,i.jsx)(Cd,{})}),!C&&h&&(0,i.jsx)(zR,{change:t.change,organization:h,setInitialValues:_,values:r}),(0,i.jsx)($p,{children:(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[s&&(0,i.jsx)(Fp,{name:"formRegister.sendNotificationEmail",children:n("envoyer_l_email_75574")}),(0,i.jsx)(kd,{isLoading:u,textAlign:"center",onClick:o,children:n("ajouter_le_memb_57505")})]})})]})})}),validate:I,width:1,onSubmit:v})},MR=()=>{const{params:{organizationId:e,eventId:t,delegationId:n}}=bd(),{data:o,loader:s}=Oi('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?ke.Event:ke.Organization},[]);return s||(0,i.jsx)(PR,{closePath:n?qo.DELEGATION_MEMBERS({organizationId:e,eventId:t,delegationId:n}):t?fs.VOLUNTEERS(e,t):ro.COMMUNITY_USERS({organizationId:e}),organization:o.organization})};let FR=class extends ic{constructor(e){super(e)}commentInputDefault(){return{content:""}}commentInputSchema(){return c.Ik().shape({content:c.Yj().required(this.t("le_commentaire_33393"))})}createCommentSchema(){return c.Ik().shape({comment:this.commentInputSchema()})}};function NR(e){return e.replace(/\*\*(.+?)\*\*/g,"$1 ").replace(/\+\+(.+?)\+\+/g,"$1 ").replace(/_(.+?)_/g,"$1 ").replace(/~~(.+?)~~/g,"$1 ")}FR=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],FR);const LR=e=>{const t=Ti(),{mutate:n}=function(e={}){return Di("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)(DA,{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()}})},BR=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{mutate:s}=function(e={}){return Di("mutation CommentUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $commentId: CommentId!\n $comment: CommentInput!\n) {\n commentUpdate(\n organizationId: $organizationId\n eventId: $eventId\n commentId: $commentId\n comment: $comment\n ) {\n id\n }\n}\n",e)}(),[r,a]=(0,V.useState)(e.comment.content),[l,d]=(0,V.useState)(!1),c=g(r);return(0,i.jsxs)(Av,{children:[(0,i.jsx)(Sv,{children:(0,i.jsx)(ka,{color:"gray500",css:{cursor:"pointer"},children:(0,i.jsx)(Id,{icon:"pen"})})}),(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"message",children:t("mise_jour_du_59845")}),(0,i.jsx)(jv,{children:(0,i.jsx)(qp,{label:t("commentaire_08754"),value:r,onChange:a})}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{disabled:!c,isLoading:l,onClick:async()=>{d(!0),await s({organizationId:n,eventId:o,commentId:e.comment.id,comment:{content:r}}),e.reload()},children:t("mettre_jour_85141")})})]})]})},VR=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),s=Ei(Cm),{user:r}=Li(),[a,l]=(0,V.useState)(!1),d=e.comment.event,c=e.comment.writtenBy;return(0,i.jsxs)(rd,{gap:"3",children:[(0,i.jsx)(Gf,{email:c.email,image:c.userInfo.picture?.url,name:c.userInfo.name,size:40}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"2",children:[(0,i.jsxs)(rd,{gap:"2",children:[(0,i.jsx)(ka,{color:"gray800",css:{flex:"1"},fontWeight:"medium",children:c.userInfo.nameOrEmail}),(0,i.jsx)(ka,{color:"gray500",children:s.toLocaleString(e.comment.insertedAt.toLocal(),zs.DateTime)}),e.showEvent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{color:"gray500",children:"•"}),(0,i.jsx)(ka,{color:"gray500",children:d?.name??t("communaut_20896")})]}),c.id===r?.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{color:"gray500",children:"•"}),(0,i.jsx)(BR,{comment:e.comment,reload:e.reload})]}),(0,i.jsxs)(Mv,{permissions:Ov.COMMENT_ADD,children:[(0,i.jsx)(ka,{color:"gray500",children:"•"}),(0,i.jsx)(ka,{color:"gray500",css:{cursor:"pointer"},onClick:()=>{l(!0)},children:(0,i.jsx)(Id,{icon:"trash-can"})})]})]}),(0,i.jsx)(ka,{color:"gray800",css:{background:"$gray100",borderRadius:"0 $2 $2 $2",boxShadow:"$sm",padding:"$3",whiteSpace:"pre-line"},dangerouslySetInnerHTML:{__html:NR(e.comment.content)}})]}),a&&(0,i.jsx)(LR,{commentId:e.comment.id,eventId:o,organizationId:n,onClose:()=>{l(!1)},onSuccess:e.reload})]})},UR=e=>{const{params:{organizationId:t,eventId:n,userInfoId:o},translate:s}=bd(),r=Ei(FR),a=Ei(ld),{data:l,loader:d,reload:c}=Wl({organizationId:t,userInfoId:o}),{mutate:u,isLoading:m}=Ul(),[h,g]=(0,V.useState)(1),p=(0,V.useCallback)(()=>{g(h+1),c()},[h,g,c]);return(0,i.jsx)(Vd,{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)(V.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(VR,{comment:t,reload:p,showEvent:e.showEvent})]},n)),(0,i.jsxs)(Mv,{permissions:Ov.COMMENT_ADD,children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Nd,{}),(0,i.jsx)(Hp,{label:s("commentaire_08754"),name:"comment.content"}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(kd,{isLoading:m,onClick:t,children:(0,i.jsx)(ka,{textAlign:"center",width:1,children:s("ajouter_un_nouv_86295")})})]}),(0,i.jsx)(md,{height:"8"})]}),validate:a.validateForForm(r.createCommentSchema()),width:1,onSubmit:async e=>{await u({organizationId:t,eventId:n,userInfoId:o,comment:e.comment}),p()}},h)},WR=({canEdit:e,editPath:t,formsUsersInfos:n,isEditDisabled:o=!1})=>{const{params:{organizationId:s,eventId:r},translate:a}=bd(),l=Ei(Cm),d=(0,V.useMemo)(()=>(0,cm.A)(n.filter(e=>Bs(e.accreditationsSlots)).map(e=>({...e,accreditationsSlots:(0,cm.A)(e.accreditationsSlots,e=>[e.accreditationCategory.name.toLowerCase(),fg(e.accreditation.index),e.accreditation.name.toLowerCase(),e.date?.toMillis()??1,e.name.toLowerCase()])})),e=>e.form.name.toLowerCase()),[n]),c=om();return(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[o&&(0,i.jsx)(fA,{message:a("you_are_already_assigned_to_accreditations"),title:a("wished_accreds_can_no_longer_be_changed")}),(0,i.jsx)(dm,{filters:e&&(0,i.jsx)(kd,{color:"white",disabled:o,size:"sm",to:t,children:a("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:a("AccreditationName")}),!c&&(0,i.jsx)(pm,{children:a("cr_neau_11117")}),!c&&(0,i.jsx)(pm,{children:a("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:Bs(d)?d.flatMap((e,t)=>e.accreditationsSlots.map((n,a)=>(0,i.jsxs)(am,{children:[(0,i.jsxs)(Qu,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(ka,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:n.accreditationCategory.name}),(0,i.jsx)(bm,{css:{overflow:"hidden",width:"100%","& > a":{width:"100%"}},to:Mo.ACCREDITATION({organizationId:s,eventId:r,accreditationId:n.accreditation.id}),children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:n.accreditation.name,width:1,children:n.accreditation.name})})]}),!c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qu,{children:qg(l,n,"")}),(0,i.jsx)(Qu,{children:(0,i.jsx)(xA,{editDisabled:o,eventId:r,form:e.form,organizationId:s})})]})]},`${t}-${a}`))):(0,i.jsx)(am,{css:{height:"200px"},children:(0,i.jsx)(Qu,{children:(0,i.jsx)(pA,{title:a("aucune_accr_dit_56501")})})})}),setOffset:hc.A,title:a("accr_ditations_74375"),totalCount:0})]})},GR=e=>{const t=Ei(Cm),n=V.useMemo(()=>{const t=pu(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)(rd,{css:{...n,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsxs)(rd,{align:"center",css:{fontSize:"10px"},gap:"1",children:[(0,i.jsx)(ka,{children:qg(t,e.aui.accreditationSlot,"")}),e.aui.isAutoAccredit&&(0,i.jsx)(ka,{fontSize:"textXs",children:(0,i.jsx)(Id,{icon:"bolt-auto"})})]}),(0,i.jsx)(ka,{fontSize:"textXs",fontWeight:"medium",children:e.aui.accreditation.name})]}),e.aui.accreditation.id)})},qR=e=>{const t=rk(),n=V.useMemo(()=>(0,cm.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(e=>!e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name.toLowerCase(),fg(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.name.toLowerCase()]),[e.event]),o=V.useMemo(()=>(0,cm.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(e=>e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name.toLowerCase(),fg(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.name.toLowerCase()]),[e.event]);return(0,i.jsxs)(ck,{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)(dk,{children:(0,i.jsx)(GR,{aui:t,renderAccreditation:e.renderAccreditation})},t.id)),o.map(t=>(0,i.jsx)(dk,{endAt:t.accreditationSlot.date,startAt:t.accreditationSlot.date,children:(0,i.jsx)(GR,{aui:t,renderAccreditation:e.renderAccreditation})},t.id))]})},HR=e=>{const{translate:t,params:{organizationId:n,eventId:o,userInfoId:s}}=bd(),r=Ei(Cm),{mutate:a}=hr(),{mutate:l}=function(e={}){return Di("mutation AccreditationsSlotsUsersInfosCheckIn(\n $eventId: EventId!\n $checkIn: AccreditationSlotCheckInInput!\n) {\n accreditationsSlotsUsersInfosCheckIn(eventId: $eventId, checkIn: $checkIn)\n}\n",e)}(),d=(0,V.useMemo)(()=>qg(r,e.aui.accreditationSlot,e.aui.accreditation.name),[e.aui]);return(0,i.jsxs)(am,{children:[(0,i.jsxs)(Qu,{align:"center",gap:"3",children:[(0,i.jsx)(Xv,{color:e.aui.accreditation.color,icon:e.aui.accreditation.icon}),(0,i.jsxs)(rd,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(ka,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:e.aui.accreditationCategory.name}),(0,i.jsx)(bm,{css:{overflow:"hidden",width:"100%","& > a":{width:"100%"}},to:Mo.ACCREDITATION({organizationId:n,eventId:o,accreditationId:e.aui.accreditation.id}),children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.aui.accreditation.name,width:1,children:e.aui.accreditation.name})}),d!==e.aui.accreditation.name&&(0,i.jsx)(ka,{color:"gray500",css:{ellipsis:!0},title:d,width:1,children:d})]})]}),(0,i.jsxs)(Qu,{align:"start",direction:"column",justify:"center",children:[e.aui.state===lt.Waiting&&(0,i.jsxs)(rd,{align:"center",gap:"1",children:[(0,i.jsx)(ka,{color:"warning500",children:(0,i.jsx)(Id,{icon:"hourglass-empty",iconStyle:"solid"})}),(0,i.jsx)(ka,{font:"gray800 textXs medium",children:t("pas_encore_scan_88057")})]}),e.aui.state===lt.CheckedIn&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"center",gap:"1",children:[(0,i.jsx)(ka,{color:"success500",children:(0,i.jsx)(Id,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(ka,{font:"gray800 textXs medium",children:t("scann_e_01567")})]}),(0,i.jsx)(ka,{font:"gray500 textXs regular",children:e.aui.checkInAt?.isValid?r.toLocaleString(e.aui.checkInAt.toLocal(),zs.DateTime):""})]})]}),(0,i.jsx)(Qu,{children:e.aui.isAutoAccredit&&(0,i.jsx)(ka,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(Id,{icon:"check"})})}),(0,i.jsx)(Qu,{children:e.aui.isWorkflow&&(0,i.jsx)(ka,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(Id,{icon:"check"})})}),(0,i.jsx)(Qu,{children:e.aui.accreditationProfile?e.aui.accreditationProfile.name:"-"}),(0,i.jsxs)(Qu,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(ka,{children:e.aui.createdBy?.name??"-"}),(0,i.jsx)(ka,{color:"gray500",children:r.toLocaleString(e.aui.insertedAt.toLocal(),zs.DateTime)})]}),e.canMemberAccredit&&(0,i.jsxs)(jm,{justify:"end",width:200,children:[e.aui.state===lt.Waiting&&(0,i.jsx)(kd,{color:"white",size:"sm",onClick:async()=>{await l({eventId:e.aui.eventId,checkIn:{strategy:At.CheckIn,accreditationsSlotsUsersInfosIds:[e.aui.id]}}),e.reload()},children:"Scanner"}),(0,i.jsx)(vm,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:async()=>{await a({eventId:o,massAccredit:{accreditationsSlotsIds:[e.aui.accreditationSlot.id],selecteds:{ids:[s]},strategy:yt.Delete}}),e.reload()},children:t("d_saffecter_du_47122")})})]})]})},KR=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>(0,cm.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(),fg(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.date?.toMillis()??1,e.accreditationSlot.name.toLowerCase()]),[e.event,e.selectedDay]);return(0,i.jsxs)(Hu,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(Wu,{children:[(0,i.jsx)(pm,{children:t("Accreditation")}),(0,i.jsx)(pm,{children:t("scann_e_le_27812")}),(0,i.jsx)(pm,{children:t("affect_e_automa_74071")}),(0,i.jsx)(pm,{children:t("ajout_via_une_69544")}),(0,i.jsx)(pm,{children:t("ajout_via_un_p_85925")}),(0,i.jsx)(pm,{children:t("ajout_e_par_71330")}),e.canMemberAccredit&&(0,i.jsx)(pm,{width:200})]}),n.map(t=>(0,i.jsx)(HR,{aui:t,canMemberAccredit:e.canMemberAccredit,reload:e.reload},t.id))]})},YR=e=>{const{translate:t}=bd(),[n,o]=V.useState(w_(e.event.startAt,e.event.endAt)),[s,r]=V.useState(null);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(rd,{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)(rd,{align:"center",as:"header",css:{padding:e.featureFlags?.isV4?void 0:"$5 $6"},gap:"4",children:[(0,i.jsxs)(ka,{as:"hgroup",css:{flex:"1"},children:[(0,i.jsx)(Dd,{children:e.title}),e.subtitle&&(0,i.jsx)(Od,{textStyle:"subtitle",children:e.subtitle})]}),(0,i.jsxs)(rd,{as:"nav",gap:"3",children:["calendar"===e.accreditationsDisplay&&(0,i.jsx)(ak,{max:e.event.endAt,min:e.event.startAt,value:n,onChange:o}),"list"===e.accreditationsDisplay&&!e.hideListView&&(0,i.jsx)(ka,{width:160,children:(0,i.jsx)(Ih,{rightIcon:"xmark",value:s,onChange:r,onRightIconClick:()=>r(null)})}),!e.hideListView&&e.setAccreditationsDisplay&&(0,i.jsx)(ka,{width:200,children:(0,i.jsxs)(hh,{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)(qR,{event:e.event,featureFlags:e.featureFlags,renderAccreditation:e.renderAccreditation,selectedDay:n}):(0,i.jsx)(KR,{canMemberAccredit:e.canMemberAccredit,event:e.event,reload:e.reload,selectedDay:s})]})})};function ZR(e,t,n={}){const{localEvent:i,updateLocalEvent:o}=dv(),[s,r]=V.useState("function"==typeof n.deserialize?n.deserialize(i?.[e])||t:i?.[e]??t);return[s,V.useCallback(async t=>{r(t),await o({[e]:"function"==typeof n.serialize?n.serialize(t):t})},[e,r,o])]}const XR=e=>{const{params:{organizationId:t,eventId:n,userInfoId:o},translate:s}=bd(),[r,a]=ZR("user.accreditations.display","calendar");return(0,i.jsx)(YR,{...e,accreditationsDisplay:r,actions:(0,i.jsx)(Mv,{permissions:Ov.MEMBER_ACCREDIT,children:(0,i.jsx)(kd,{to:fs.EDIT_ACCREDIT(t,n,o),children:s("_diter_les_accr_86042")})}),canMemberAccredit:e.canMemberAccredit,setAccreditationsDisplay:a})},JR=e=>{const{params:{organizationId:t,eventId:n,userInfoId:o},translate:s}=bd(),{canMemberAccredit:r}=Dv(),a=(0,V.useMemo)(()=>Bs(e.organization.userInfo.formsUsersInfos.filter(e=>Bs(e.accreditationsSlots)))||(e.event?.hasFormWithAccreditationDisplay??!1),[e.organization,e.event]);return(0,i.jsxs)(rd,{direction:"column",gap:"6",width:1,children:[Bs(e.event.volunteerRegistration.accreditationsUsersInfos)&&(0,i.jsx)(XR,{canMemberAccredit:r,event:e.event,reload:e.reload,renderAccreditation:(e,o)=>(0,i.jsx)(_d,{style:{width:"100%"},to:Mo.ACCREDITATION({organizationId:t,eventId:n,accreditationId:o}),children:e}),subtitle:s("visualisez_tout_53227"),title:s("accr_ditations_33155")}),a&&(0,i.jsx)(WR,{canEdit:r,editPath:fs.EDIT_USER_ACCREDITATIONS(t,n,o),formsUsersInfos:e.organization.userInfo.formsUsersInfos}),(0,i.jsx)(md,{height:"8"})]})},QR=()=>{const{organizationId:e,eventId:t,userInfoId:n}=zi(),{data:o,loader:s,reload:r}=Oi("query UserProfileAccreditations(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $excludeAccreditations: [AccreditationId!]\n) {\n organization(id: $organizationId) {\n hideAccreditationsUntilConfirmationEmailSent\n\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 isAccreditationsEmailSent\n\n accreditationsUsersInfos(excludeAccreditations: $excludeAccreditations) {\n ...UserPanelAccreditationSlotUserInfo\n }\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:n},[js.UserPanelAccreditationSlotUserInfoFragment]);return s||(0,i.jsx)(JR,{event:o.event,organization:o.organization,reload:r})},eO=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=bd(),{organization:r,hasFeature:a}=_v(),{event:l,hasEventRole:d}=dv(),{canDocumentRead:c,canMemberAccredit:u,canMemberAssignmentStateEdit:m,canMemberEdit:h,canMemberDelete:g}=Dv(),{mutate:p,isLoading:f}=Yr(),{mutate:_,isLoading:x}=ta(),{mutate:I,isLoading:v}=ta(),{mutate:b,isLoading:j}=ta(),{mutate:C}=Rr(),{mutate:y}=Mr(),{mutate:A,isLoading:S}=Jr(),{mutate:k,isLoading:w}=Jr(),[E,T]=(0,V.useState)(!1),[R,O]=(0,V.useState)(!1),D=(0,V.useMemo)(()=>(0,cm.A)(e.customDocuments.filter(t=>zg(t.populationsIds,e.userInfo.fields.population)),e=>e.name),[e.customDocuments,e.userInfo]),{permissions:[z]}=Ry(((...e)=>({name:"canUserInfoAssignFn",args:e}))(e.userInfo.id)),$=c&&(e.links&&(e.state===ve.Assigned||Bs(r.customBadges))||Bs(D)),P=d&&h&&l.useDelegations&&a(Ae.Delegation)&&e.delegation,M={lang:e.userInfo.language};return(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[(z||m)&&(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:s("affectation")}),m&&(e.state===ve.Assigned||e.state===ve.Refused||e.state===ve.NotApplicable||e.state===ve.PreAssigned)&&(0,i.jsx)(kd,{color:"white",isLoading:x,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await _({eventId:o,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:ve.WaitingAssignment}}),e.reload()},children:s("changer_le_stat_90266")}),m&&(e.state===ve.Assigned||e.state===ve.WaitingAssignment||e.state===ve.NotApplicable||e.state===ve.PreAssigned)&&(0,i.jsx)(kd,{color:"white",isLoading:v,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await I({eventId:o,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:ve.Refused}}),e.reload()},children:s("changer_le_stat_68392")}),m&&(e.state===ve.WaitingAssignment||e.state===ve.Assigned)&&(0,i.jsx)(kd,{color:"white",isLoading:j,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await b({eventId:o,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:ve.NotApplicable}}),e.reload()},children:s("changer_le_stat_62507")}),z&&e.state===ve.Assigned&&(0,i.jsx)(kd,{color:"white",leftIcon:"pen",rightIcon:"arrow-right",to:fs.EDIT_ASSIGNMENT(n,o,e.userInfo.id),children:s("_diter_les_affe_42283")}),z&&(e.state===ve.WaitingAssignment||e.state===ve.PreAssigned)&&(0,i.jsx)(kd,{color:"white",leftIcon:"wand-magic-sparkles",rightIcon:"arrow-right",to:fs.ASSIGNMENT(n,o,e.userInfo.id),children:s("affecter_94255")}),z&&e.teams.map(e=>e.state===ve.WaitingAssignment?(0,i.jsx)(kd,{color:"white",leftIcon:"wand-magic-sparkles",rightIcon:"arrow-right",to:fs.TEAM_ASSIGNMENT(n,o,e.teamCode),children:s("affecter_l_qui_12468",e.teamCode)},e.teamCode):null),z&&e.state===ve.Assigned&&(0,i.jsx)(kd,{color:"white",isLoading:f,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await p({organizationId:n,eventId:o,userInfoId:e.userInfo.id,emailType:ze.Assignments})},children:s("r_envoyer_l_e_65315")}),z&&e.state===ve.Refused&&(0,i.jsx)(kd,{color:"white",isLoading:f,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await p({organizationId:n,eventId:o,userInfoId:e.userInfo.id,emailType:ze.Refused})},children:s("r_envoyer_l_e_06733")})]}),u&&(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:s("Accreditation")}),(e.accreditationState===We.NotApplicable||e.accreditationState===We.Refused||e.accreditationState===We.Accredited||e.accreditationState===We.AutoAccredited)&&(0,i.jsx)(kd,{color:"white",isLoading:w,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await k({eventId:o,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:We.WaitingAccreditation}}),e.reload()},children:s("changer_le_stat_20528")}),(e.accreditationState===We.Accredited||e.accreditationState===We.AutoAccredited||e.accreditationState===We.WaitingAccreditation||e.accreditationState===We.NotApplicable)&&(0,i.jsx)(kd,{color:"white",isLoading:w,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await k({eventId:o,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:We.Refused}}),e.reload()},children:s("changer_le_stat_68392")}),(e.accreditationState===We.WaitingAccreditation||e.accreditationState===We.Accredited||e.accreditationState===We.AutoAccredited)&&(0,i.jsx)(kd,{color:"white",isLoading:S,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await A({eventId:o,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:We.NotApplicable}}),e.reload()},children:s("changer_le_stat_62507")}),e.accreditationState===We.Accredited&&(0,i.jsx)(kd,{color:"white",leftIcon:"pen",rightIcon:"arrow-right",to:fs.EDIT_ACCREDIT(n,o,e.userInfo.id),children:s("_diter_les_accr_86042")}),(e.accreditationState===We.AutoAccredited||e.accreditationState===We.WaitingAccreditation)&&(0,i.jsx)(kd,{color:"white",leftIcon:"badge-check",rightIcon:"arrow-right",to:fs.ACCREDIT(n,o,e.userInfo.id),children:s("accr_diter_70543")}),(e.accreditationState===We.Accredited||e.accreditationState===We.AutoAccredited)&&(0,i.jsx)(kd,{color:"white",isLoading:f,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await p({organizationId:n,eventId:o,userInfoId:e.userInfo.id,emailType:ze.Accreditations})},children:s("r_envoyer_l_e_24677")})]}),$&&(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:s("Documents")}),$&&e.state===ve.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kd,{color:"white",download:`${e.userInfo.nameOrEmail}-assignments`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:gf(e.links.userAssignmentsLink,"pdf",M),children:s("t_l_charger_la_82882")}),(0,i.jsx)(kd,{color:"white",download:`${e.userInfo.nameOrEmail}-planning`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:gf(e.links.userPlanningLink,"pdf",M),children:s("t_l_charger_le_74660")}),(0,i.jsx)(kd,{color:"white",download:`${e.userInfo.nameOrEmail}-planning-days`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:gf(e.links.userPlanningDaysLink,"pdf",M),children:s("t_l_charger_le_43587")}),(0,i.jsx)(kd,{color:"white",download:`${e.userInfo.nameOrEmail}-planning-list`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:gf(e.links.userPlanningListLink,"pdf",M),children:s("t_l_charger_le_58518")}),(0,i.jsx)(kd,{color:"white",download:`${e.userInfo.nameOrEmail}-user-hours`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:gf(e.links.userHoursLink,"pdf",M),children:s("t_l_charger_les_98537")}),a(Ae.Documents)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kd,{color:"white",download:`${e.userInfo.nameOrEmail}-badge`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:gf(e.links.userBadgeLink,"pdf",M),children:s("t_l_charger_le_53240")}),(0,i.jsx)(kd,{color:"white",download:`${e.userInfo.nameOrEmail}-certificate`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:gf(e.links.userCertificateLink,"pdf",M),children:s("t_l_charger_l_a_02386")})]})]}),r.customBadges.map(t=>(0,i.jsx)(kd,{color:"white",download:`${e.userInfo.nameOrEmail}-custom-badge`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:gf(e.links.userCustomBadgeLinks[t],"pdf",M),children:s("t_l_charger_1_80752",y_(t))},t)),D.map((t,n)=>(0,i.jsx)(kd,{color:"white",download:`${e.userInfo.name}-custom-document`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:gf(e.links.userCustomDocumentLinks[t.slug],"pdf",M),children:s("t_l_charger_1_80752",t.name)},n))]}),g&&(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:s("g_n_ral_64953")}),P&&(0,i.jsx)(kd,{color:"white",leftIcon:"minus",rightIcon:"arrow-right",onClick:()=>T(!0),children:s("retirer_de_la_d_64963")}),(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",rightIcon:"arrow-right",onClick:()=>O(!0),children:s("d_sinscrire_de_06416")})]}),P&&E&&(0,i.jsx)(DA,{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:()=>T(!1),onDelete:async()=>{await C({organizationId:r.id,eventId:o,delegationId:e.delegation.id,selecteds:{ids:[e.userInfo.id]}}),t.push(fs.VOLUNTEERS(n,o))}}),R&&(0,i.jsx)(DA,{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:()=>O(!1),onDelete:async()=>{await y({eventId:o,selecteds:{ids:[e.userInfo.id]}}),t.push(fs.VOLUNTEERS(n,o))}}),(0,i.jsx)(md,{height:"8"})]})},tO=()=>{const{params:{eventId:e,userInfoId:t}}=bd(),{data:n,loader:o,reload:s}=Oi("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 teams {\n teamCode\n state\n }\n\n userInfo {\n ...UserInfoOverlay\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n }\n }\n }\n}\n",{eventId:e,userInfoId:t},[js.CustomDocumentPopulationFragment,js.UserInfoOverlayFragment,js.UserInfoLinksFragment]);if(o)return o;{const e=n.event.volunteerRegistration;return(0,i.jsx)(eO,{accreditationState:e.accreditationState,customDocuments:n.event.customDocuments,delegation:e.delegation,links:e.userInfo.links,reload:s,state:e.state,teams:e.teams,userInfo:e.userInfo})}},nO=e=>{const{history:t,params:{organizationId:n},translate:o}=bd(),{mutate:s}=function(e={}){return Di("mutation UserInfoAdminDelete($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n userInfoAdminDelete(organizationId: $organizationId, userInfoId: $userInfoId) {\n id\n }\n}\n",e)}(),[r,a]=(0,V.useState)(!1);return(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("g_n_ral_64953")}),(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",rightIcon:"arrow-right",onClick:()=>a(!0),children:o("supprimer_43083")}),r&&(0,i.jsx)(DA,{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(ro.COMMUNITY_USERS({organizationId:n}))}})]})},iO=()=>{const{params:{organizationId:e,userInfoId:t}}=bd(),{data:n,loader:o}=Oi("query UserOverlayActionsOrganization($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...UserInfoOverlay\n }\n }\n}\n",{organizationId:e,userInfoId:t},[js.UserInfoOverlayFragment]);return o||(0,i.jsx)(nO,{userInfo:n.organization.userInfo})},oO=e=>{const{translate:t,params:{organizationId:n,eventId:o,userInfoId:s}}=bd(),r=Ei(ZI),a=Ei(Cm),{mutate:l}=gr(),{data:d}=fr({organizationId:n,eventId:o,userInfoId:s}),c=(0,V.useMemo)(()=>{const n=r.createUpdateCampaignValuesDefault(!1,d.organization?.event?.emailSender?.id??d.organization?.emailSenderId,null,null),i=d.organization?.userInfo?.name||"",o=a.toLocaleString(As.c9.now(),zs.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:me.InProgress,sendToEveryone:!1,usersInfosIds:[s]}}},[e.campaignType,d.organization]);return(0,i.jsx)(Vd,{initialValues:c,render:n=>(0,i.jsxs)(Jm,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(yb,{children:e.campaignType===ue.Sms?t("envoi_d_un_sms_22148"):t("envoi_d_un_emai_99336")}),(0,i.jsx)(Qm,{css:{padding:"$6"},children:e.campaignType===ue.Email?(0,i.jsx)(DI,{canCustomDocuments:e.canCustomDocuments,customDocuments:d.organization?.event?.customDocuments??[],customFields:[],emailSenderId:d.organization?.event?.emailSender?.id??d.organization?.emailSenderId,emailsSenders:d.organization?.emailsSenders??[],form:n.form,hasDuplicatedMembers:!1,values:n.values}):(0,i.jsx)(NI,{formRenderProps:n})}),(0,i.jsx)(eh,{children:(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")}),(0,i.jsx)(kd,{isLoading:n.submitting,onClick:n.handleSubmit,children:t("envoyer_26609")})]})})]}),onSubmit:async t=>{await l({organizationId:n,eventId:o,campaign:t.campaign}),e.onClose()}})},sO=e=>{const t=Ti(),n=Ei(lc),{mutate:o}=Ur();return(0,i.jsx)(Ej,{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)(ec,{label:t("adresse_e_mail_60930"),name:"email"})})},rO=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{hasFeature:s}=_v(),{event:r}=dv(),[a,l]=(0,V.useState)(!1),[d,c]=(0,V.useState)(!1),[u,m]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"center",gap:"4",width:1,children:[(0,i.jsx)(Gf,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:88}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"3",children:[(0,i.jsx)(ka,{font:"gray800 textXl medium",children:e.userInfo.name}),(0,i.jsxs)(rd,{gap:"7",children:[(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("Email")}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(vu,{color:"white",cursor:"pointer",leftIcon:"at",rightIcon:"chevron-down",size:"md",children:e.userInfo.email})}),(0,i.jsxs)(lu,{placement:"bottom-start",children:[(0,i.jsx)(ru,{icon:"copy",onClick:()=>{TI(e.userInfo.email)},children:t("copier_1_59210",e.userInfo.email)}),e.canEmailEdit&&(0,i.jsx)(ru,{icon:"pen",onClick:()=>{l(!0)},children:t("modifier_1_38587",e.userInfo.email)}),(0,i.jsx)(ru,{icon:"at",onClick:()=>c(!0),children:t("_crire_1_90053",e.userInfo.email)})]})]})]}),(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("t_l_phone_31755")}),g(e.userInfo.phone?.internationalFormat)?(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(vu,{color:"white",cursor:"pointer",leftIcon:"phone",rightIcon:"chevron-down",size:"md",children:e.userInfo.phone?.internationalFormat??"-"})}),(0,i.jsxs)(lu,{placement:"bottom-start",children:[(0,i.jsx)(ru,{color:"default",icon:"copy",onClick:()=>TI(e.userInfo.phone.internationalFormat),children:t("copier_1_59210",e.userInfo.phone?.internationalFormat??"-")}),(0,i.jsx)(_d,{to:{pathname:`tel:${e.userInfo.phone.internationalFormat.replaceAll(" ","")}`},children:(0,i.jsx)(ru,{color:"default",icon:"phone",children:t("appeler_1_57163",e.userInfo.phone?.internationalFormat??"-")})}),s(Ae.Sms)&&(0,i.jsx)(ru,{icon:"phone",onClick:()=>m(!0),children:t("_crire_1_90053",e.userInfo.phone?.internationalFormat??"-")})]})]}):(0,i.jsx)(ka,{color:"gray500",children:"-"})]}),(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:e.populationFieldName}),(0,i.jsx)(ka,{color:"gray500",children:g(e.userInfo.population)?e.userInfo.population:"-"})]}),e.showPositions&&e.assignmentState&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("status_d_affect_75769")}),(0,i.jsx)(rd,{children:(0,i.jsx)(vu,{...fb(e.assignmentState),children:t(e.assignmentState)})})]})}),e.showAccreditations&&e.accreditationState&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("statut_d_accr_d_75527")}),(0,i.jsx)(rd,{children:(0,i.jsx)(vu,{..._b(e.accreditationState),children:t(e.accreditationState)})})]})})]})]})]}),a&&(0,i.jsx)(sO,{email:e.userInfo.email,eventId:o,organizationId:n,userInfoId:e.userInfo.id,onClose:()=>{l(!1)},onSuccess:e.reload}),d&&(0,i.jsx)(oO,{campaignType:ue.Email,canCustomDocuments:!!o&&r?.useDocuments,onClose:()=>c(!1)}),u&&(0,i.jsx)(oO,{campaignType:ue.Sms,canCustomDocuments:!1,onClose:()=>m(!1)})]})},aO=()=>(0,i.jsxs)(rd,{gap:"4",width:1,children:[(0,i.jsx)(ju,{size:88,variant:"circular"}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"3",children:[(0,i.jsx)(ju,{borderRadius:"$1",height:28,width:200}),(0,i.jsx)(ju,{borderRadius:"$1",height:48,width:1})]})]}),lO=e=>{const{translate:t,params:{organizationId:n,eventId:o,userInfoId:s}}=bd(),{canCampaignSend:r}=Dv(),a=Ei(Cm),{mutate:l}=la(),d=e.campaign.sentAt?.setZone(As.c9.local().zone),c=(0,V.useMemo)(()=>e.campaign.campaignType===ue.Email&&e.campaign.email?e.campaign.email.state:null,[e.campaign]),u=(0,V.useMemo)(()=>e.campaign.campaignType===ue.Sms&&e.campaign.textMessage?e.campaign.textMessage.state:null,[e.campaign]);return(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:(0,i.jsxs)(rd,{direction:"column",width:1,children:[(0,i.jsx)(bm,{to:Tx.CAMPAIGN({organizationId:e.campaign.organizationId,eventId:e.campaign.eventId||void 0,campaignId:e.campaign.id}),children:e.campaign.name}),d&&(0,i.jsx)(ka,{color:"gray500",children:t("envoy_e_le_1_31494",a.toLocaleString(d,zs.DateOnly.MonthLong),a.toLocaleString(d,zs.TimeOnly))})]})}),(0,i.jsxs)(Qu,{width:150,children:[(0,i.jsx)(ka,{width:22,children:e.campaign.campaignType===ue.Email?(0,i.jsx)(Id,{icon:"at"}):(0,i.jsx)(Id,{icon:"message"})}),e.campaign.campaignType]}),(0,i.jsxs)(Qu,{width:200,children:[c&&(0,i.jsx)(vu,{...mb(c),children:t(c)}),u&&(0,i.jsx)(vu,{...Cb(u),children:t(u)})]}),(0,i.jsx)(Qu,{children:(0,i.jsx)(ka,{css:{ellipsis:!0},children:e.campaign.event?.name??t("communaut_20896")})}),r&&(0,i.jsx)(jm,{justify:"end",children:(0,i.jsx)(vm,{children:(0,i.jsx)(ru,{icon:"paper-plane",onClick:async()=>{await l({organizationId:n,eventId:o,campaignId:e.campaign.id,selecteds:{ids:[s]}})},children:t("r_envoyer_90741")})})})]})},dO=()=>{const{translate:e,params:{organizationId:t,userInfoId:n}}=bd(),{canCampaignSend:o}=Dv(),{data:s,isLoading:r,reload:a}=Oi("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)(Hu,{hideBorder:!0,children:[(0,i.jsxs)(Wu,{children:[(0,i.jsx)(pm,{children:e("nom_de_la_campa_45063")}),(0,i.jsx)(pm,{width:150,children:e("type_35427")}),(0,i.jsx)(pm,{width:200,children:e("State")}),(0,i.jsx)(pm,{children:e("_v_nement_22345")}),o&&(0,i.jsx)(pm,{width:100})]}),r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):s.organization.userInfo.campaigns.nodes.map(e=>(0,i.jsx)(lO,{campaign:e,reload:a},e.id))]})},cO=e=>{const{translate:t,params:{organizationId:n}}=bd(),o=Ei(Cm),s=(0,V.useMemo)(()=>Object.values((0,Vu.A)(e.vr.positionsSlotsUsersInfos,e=>e.position.id)).map(e=>{const t=e[0].position;return{id:t.id,text:g(t.acronym)?t.acronym:t.name,color:t.color,count:e.length,icon:t.icon}}),[e.vr]),r=(0,V.useMemo)(()=>Object.values((0,Vu.A)(e.vr.accreditationsUsersInfos,e=>e.accreditation.id)).map(e=>{const t=e[0].accreditation;return{id:t.id,text:g(t.acronym)?t.acronym:t.name,color:t.color,count:e.length,icon:t.icon}}),[e.vr]);return(0,i.jsxs)(am,{children:[(0,i.jsxs)(Qu,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(bm,{to:So.EVENT({organizationId:n,eventId:e.vr.event.id}),children:e.vr.event.name}),(0,i.jsx)(ka,{color:"gray500",children:t("inscrit_le_1_12018",o.toLocaleString(e.vr.insertedAt.toLocal(),zs.DateTime))})]}),(0,i.jsx)(Qu,{children:(0,i.jsx)(UC,{badges:s})}),(0,i.jsx)(Qu,{children:(0,i.jsx)(UC,{badges:r})}),(0,i.jsx)(Qu,{children:e.vr.delegation&&(0,i.jsx)(vu,{ellipsis:!0,children:e.vr.delegation.name})})]})},uO=()=>{const{translate:e,params:{organizationId:t,userInfoId:n}}=bd(),{data:o,isLoading:s}=Oi("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)(Hu,{hideBorder:!0,children:[(0,i.jsxs)(Wu,{children:[(0,i.jsx)(pm,{children:e("nom_de_l_v_nem_08711")}),(0,i.jsx)(pm,{children:e("missions_63972")}),(0,i.jsx)(pm,{children:e("accr_ditations_39450")}),(0,i.jsx)(pm,{children:e("Delegation")})]}),s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):o.organization.userInfo.volunteersRegistrations.map(e=>(0,i.jsx)(cO,{vr:e},e.id))]})},mO=e=>{const{translate:t,params:{organizationId:n}}=bd(),o=Ei(Cm);return(0,i.jsxs)(am,{children:[(0,i.jsxs)(Qu,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(bm,{to:jo.FORM_PARAMETERS_GENERAL({organizationId:n,eventId:e.fui.event?.id,formId:e.fui.form.id}),children:e.fui.form.name}),(0,i.jsx)(ka,{color:"gray500",children:t("rempli_le_1_29292",o.toLocaleString(e.fui.insertedAt.toLocal(),zs.DateTime))})]}),(0,i.jsx)(Qu,{children:(0,i.jsx)(ka,{css:{ellipsis:!0},children:e.fui.event?.name??t("communaut_20896")})})]})},hO=()=>{const{translate:e,params:{organizationId:t,userInfoId:n}}=bd(),{data:o,isLoading:s}=Oi("query UserHistoryForms($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n formsUsersInfos {\n id\n insertedAt\n\n form {\n id\n name\n }\n\n event {\n id\n name\n }\n }\n }\n }\n}\n",{organizationId:t,userInfoId:n},[]);return(0,i.jsxs)(Hu,{hideBorder:!0,children:[(0,i.jsxs)(Wu,{children:[(0,i.jsx)(pm,{children:e("nom_du_formulai_14952")}),(0,i.jsx)(pm,{children:e("_v_nement_22345")})]}),s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):o.organization.userInfo.formsUsersInfos.map(e=>(0,i.jsx)(mO,{fui:e},e.id))]})},gO=e=>{const t=Ei(Cm),{organization:n}=_v(),o=(0,V.useMemo)(()=>As.c9.fromISO(e.weezeventWebhook.data?.values?.validated)?.isValid?As.c9.fromISO(e.weezeventWebhook.data?.values?.validated):e.weezeventWebhook.insertedAt,[e.weezeventWebhook]),s=e.weezeventWebhook.checklist?pf(n.weezeventOrganizationId,e.weezeventWebhook.checklist.id):"";return(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(bm,{to:s,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.weezeventWebhook.checklist?.name??"-",width:1,children:e.weezeventWebhook.checklist?.name??"-"})})}),(0,i.jsx)(Qu,{children:t.toLocaleString(o,{...zs.DateTime,weekday:"long"})}),(0,i.jsx)(Qu,{children:e.weezeventWebhook.data?.values?.partner_name??"-"})]})},pO=()=>{const{translate:e,params:{eventId:t,userInfoId:n}}=bd(),{data:o,isLoading:s}=Oi('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)(Hu,{hideBorder:!0,children:[(0,i.jsxs)(Wu,{children:[(0,i.jsx)(pm,{children:e("liste_de_contr_79815")}),(0,i.jsx)(pm,{children:e("Date")}),(0,i.jsx)(pm,{children:e("op_rateur_30804")})]}),s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):o.event.volunteerRegistration.weezeventWebhooks.nodes.map(e=>(0,i.jsx)(gO,{weezeventWebhook:e},e.id))]})},fO=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o}}=bd(),{data:s,isLoading:r}=Oi("query UserHistorySegments(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n segmentsFolders(segmentType: Volunteers, eventId: $eventId, level: $level) {\n id\n name\n\n segments {\n id\n name\n isIn(userInfoId: $userInfoId)\n }\n }\n }\n}\n",{organizationId:t,level:n?ke.Event:ke.Organization,eventId:n,userInfoId:o},[]);return(0,i.jsxs)(Hu,{hideBorder:!0,children:[(0,i.jsxs)(Wu,{children:[(0,i.jsx)(pm,{children:e("dossier_00726")}),(0,i.jsx)(pm,{children:e("vue_97139")}),(0,i.jsx)(pm,{width:100,children:e("fait_parti_67171")})]}),r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):s.organization.segmentsFolders.flatMap(e=>e.segments.map(o=>(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:e.name}),(0,i.jsx)(Qu,{children:(0,i.jsx)(bm,{to:n?fs.VOLUNTEERS_SEGMENT(t,n,o.id):fs.COMMUNITY_USERS_SEGMENT(t,o.id),children:o.name})}),(0,i.jsx)(Qu,{width:100,children:o.isIn&&(0,i.jsx)(Id,{icon:"check"})})]},o.id)))]})},_O=e=>{const{translate:t,params:n}=bd(),{hasOrganizationRole:o}=_v(),{hasEventRole:s}=dv(),{canAccreditationRead:r,canCampaignRead:a,canDelegationRead:l,canFormRead:d}=Dv(),c={organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,userInfoId:":userInfoId"},u=e.isEvent&&e.isWeezeventConnected&&(r||l);return(0,i.jsxs)(rd,{css:{background:"white",bd:!0,overflow:"hidden",paddingTop:"$5"},direction:"column",gap:"5",children:[(0,i.jsx)(ka,{css:{px:"$6"},font:"gray900 textMd semiBold",children:t("historique_06296")}),(0,i.jsxs)(rb,{css:{flex:"1"},children:[(0,i.jsxs)(ob,{css:{px:"$6"},children:[(o||s)&&(0,i.jsx)(ib,{path:bx.MEMBER_HISTORY_EVENTS(n),children:t("Event")}),a&&(0,i.jsx)(ib,{path:bx.MEMBER_HISTORY_CAMPAIGNS(n),children:t("Campaigns")}),d&&(0,i.jsx)(ib,{path:bx.MEMBER_HISTORY_FORMS(n),children:t("Form_plural")}),u&&(0,i.jsx)(ib,{path:bx.MEMBER_HISTORY_SCANS(n),children:"Scans"}),(o||s)&&(0,i.jsx)(ib,{path:bx.MEMBER_HISTORY_SEGMENTS(n),children:t("vues_50543")})]}),(o||s)&&(0,i.jsx)(sb,{path:bx.MEMBER_HISTORY_EVENTS(c),children:(0,i.jsx)(uO,{})}),a&&(0,i.jsx)(sb,{path:bx.MEMBER_HISTORY_CAMPAIGNS(c),children:(0,i.jsx)(dO,{})}),d&&(0,i.jsx)(sb,{path:bx.MEMBER_HISTORY_FORMS(c),children:(0,i.jsx)(hO,{})}),u&&(0,i.jsx)(sb,{path:bx.MEMBER_HISTORY_SCANS(c),children:(0,i.jsx)(pO,{})}),(o||s)&&(0,i.jsx)(sb,{path:bx.MEMBER_HISTORY_SEGMENTS(c),children:(0,i.jsx)(fO,{})})]})]})},xO=e=>{const{translate:t}=bd(),n=Ei(Cm),[o,s]=(0,V.useState)(!0),r=(0,V.useCallback)(async()=>{const t=!o;s(t),await sv.forms.put({id:e.form.id,isOpenInUserOverlay:t})},[o,s]),a=e.canEdit&&!1!==e.form.isEditableInMemberSpace;return(0,V.useEffect)(()=>{(async()=>{s((await sv.forms.get(e.form.id))?.isOpenInUserOverlay??!0)})()},[]),(0,i.jsxs)(rd,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$xs"},direction:"column",width:1,children:[(0,i.jsxs)(rd,{align:"center",css:{cursor:"pointer",padding:"$5 $6",userSelect:"none"},gap:"4",onClick:r,children:[(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:o?"chevron-up":"chevron-down"})}),(0,i.jsxs)(rd,{align:"start",css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{children:e.form.name}),e.showIsFilled?e.filledAt?(0,i.jsx)(vu,{color:"success",size:"sm",children:t("rempli_le_1_29292",n.toLocaleString(e.filledAt.toLocal(),zs.DateTime))}):(0,i.jsx)(vu,{color:"error",size:"sm",children:t("non_rempli_80877")}):null]}),a&&(0,i.jsx)(kd,{color:"white",size:"sm",to:e.getEditUserFormPath(e.form.id),children:t("_diter_62574")})]}),o&&(0,i.jsx)(sA,{css:{borderTop:"1px solid $gray200",padding:"$6"},form:e.form,userInfo:e.userInfo})]})},IO=e=>(0,i.jsxs)(rd,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"3",children:[(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(Id,{icon:e.icon}),(0,i.jsx)(ka,{font:"gray900 textMd medium",children:e.title})]}),e.children]}),vO=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=bd();return(0,i.jsx)(IO,{icon:"people-group",title:n("d_l_gations_78318"),children:(0,i.jsx)(rd,{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)(vu,{color:"white",cursor:"pointer",ellipsis:!0,size:"md",onClick:()=>{t.push(e.event?qo.DELEGATION({organizationId:o,eventId:e.event.id,delegationId:e.id}):fs.COMMUNITY_DELEGATION(o,e.id))},children:n},e.id)})})})},bO=e=>{const{history:t,translate:n}=bd(),o=Ei(Cm),[s,r]=(0,V.useState)(!1),a=(0,V.useMemo)(()=>e.customFields.filter(e=>e.isPrivate),[e.customFields]),l=(0,V.useMemo)(()=>Bs(e.profilePrivateFields)?e.profilePrivateFields:a.map(e=>e.slug),[a,e.profilePrivateFields]),d=(0,V.useMemo)(()=>(0,cm.A)(a.filter(t=>l.includes(t.slug)&&Qb(t,e.userInfo.fields,e.customFields)),({slug:e})=>l.indexOf(e)),[e.customFields,a,l]),c=(0,V.useCallback)(async t=>{await e.profilePrivateFieldsUpdate(t),e.reload()},[e.profilePrivateFieldsUpdate,e.reload]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(IO,{icon:"lock-keyhole",title:n("informations_pr_15873"),children:[d.map(t=>(0,i.jsx)(oA,{field:t,fields:e.userInfo.fields},t.slug)),(0,i.jsx)(ka,{css:{textTransform:"uppercase"},font:"gray500 textXs regular",children:n("inscrit_le_1_12018",o.toLocaleString(e.insertedAt.toLocal(),zs.DateTime))}),(0,i.jsx)(Mv,{permissions:Ov.MEMBER_EDIT,children:(0,i.jsx)(dE,{color:"white",menu:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(ru,{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)(sh,{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})]})},jO=e=>{const{translate:t}=bd();return(0,i.jsxs)(rd,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"3",children:[(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(Id,{icon:"users-viewfinder"}),(0,i.jsx)(ka,{font:"gray900 textMd medium",children:t("profils_li_s_03417")})]}),e.usersInfos.map(e=>(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ub,{size:32,userInfo:e}),Bs(e.delegations)&&(0,i.jsx)(rd,{css:{paddingLeft:"44px"},gap:"2",wrap:"wrap",children:e.delegations.map(e=>(0,i.jsx)(vu,{color:"white",size:"md",children:e.name},e.id))})]},e.id))]})},CO=({team:{organizationId:e,eventId:t,formId:n,teamCode:o,teamMembers:s}})=>{const{history:r,translate:a}=bd(),l=cf({organizationId:e,eventId:t,formId:n,teamCode:o}),{isLoading:d,copy:c}=RI(),u=(0,V.useCallback)(()=>{c(cf({organizationId:e,eventId:t,formId:n,teamCode:o}))},[e,t,n,o]);return(0,i.jsxs)(IO,{icon:"user-group",title:a("_quipe_76857"),children:[g(o)&&(0,i.jsx)(rd,{gap:"2",children:(0,i.jsx)(vu,{color:"white",cursor:"pointer",ellipsis:!0,size:"md",onClick:()=>{r.push(fs.TEAM_ASSIGNMENT(e,t,o))},children:o})}),s.map(e=>(0,i.jsx)(ub,{size:32,userInfo:e},e.id)),(0,i.jsxs)(rd,{align:"center",gap:"3",justify:"end",children:[(0,i.jsx)(_d,{to:l,children:a("lien_d_invitati_45319")}),(0,i.jsx)(kd,{color:"white",isLoading:d,rightIcon:"copy",size:"sm",onClick:u})]})]})};function yO(e,{locale:t}={}){const n=e.amount/100;return new Intl.NumberFormat(t,{style:"currency",currency:"USD",minimumFractionDigits:e.currencyDecimalPlaces,maximumFractionDigits:e.currencyDecimalPlaces}).formatToParts(n).map(t=>"currency"===t.type?e.currencySymbol:t.value).join("")}const AO=e=>{const{translate:t,params:{eventId:n,userInfoId:o}}=bd(),{canTicketIdRegenerate:s}=Dv(),r=Ei(Cm),{mutate:a}=Vl(),[l,d]=(0,V.useState)(!1),c=(0,V.useMemo)(()=>g(e.volunteerRegistration.weezevent.lastSynchronizedAt)&&As.c9.fromISO(e.volunteerRegistration.weezevent.lastSynchronizedAt)?.isValid?r.toLocaleString(As.c9.fromISO(e.volunteerRegistration.weezevent.lastSynchronizedAt).toLocal(),zs.DateTime):"-",[e.volunteerRegistration]),u=(0,V.useMemo)(()=>e.volunteerRegistration.pairedAt?.isValid?r.toLocaleString(e.volunteerRegistration.pairedAt.toLocal(),zs.DateTime):"-",[e.volunteerRegistration]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{css:{background:"white",bd:!0},direction:"column",width:1,children:[(0,i.jsxs)(rd,{css:{padding:"$5 $6"},direction:"column",gap:"4",children:[(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(Id,{icon:"memo-circle-info"}),(0,i.jsx)(ka,{font:"gray900 textMd medium",children:t("informations_22954")})]}),(0,i.jsxs)(rd,{align:e.isWeezeventConnected?"center":"start",direction:e.isWeezeventConnected?"row":"column",gap:"5",children:[(0,i.jsx)(ay,{nameOrEmail:e.nameOrEmail,size:64,ticketId:e.volunteerRegistration.ticketId}),(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{color:"gray500",children:t("TicketId")}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(vu,{color:"white",cursor:"pointer",leftIcon:"ticket",rightIcon:"chevron-down",size:"md",children:e.volunteerRegistration.ticketId})}),(0,i.jsxs)(lu,{placement:"bottom-start",children:[(0,i.jsx)(ru,{icon:"copy",onClick:()=>{TI(e.volunteerRegistration.ticketId)},children:t("copier_75889")}),e.isWeezeventConnected&&g(e.volunteerRegistration.weezeventTicketUrl)&&(0,i.jsx)(_d,{to:e.volunteerRegistration.weezeventTicketUrl,children:(0,i.jsx)(ru,{icon:"arrow-up-right-from-square",children:t("ouvrir_dans_wee_97529")})}),e.isWeezeventConnected&&g(e.volunteerRegistration.weezeventAccessUrl)&&(0,i.jsx)(_d,{to:e.volunteerRegistration.weezeventAccessUrl,children:(0,i.jsx)(ru,{icon:"arrow-up-right-from-square",children:t("ouvrir_dans_wee_22181")})}),e.isWeezeventConnected&&g(e.volunteerRegistration.weezeventPayUrl)&&(0,i.jsx)(_d,{to:e.volunteerRegistration.weezeventPayUrl,children:(0,i.jsx)(ru,{icon:"arrow-up-right-from-square",children:t("ouvrir_dans_wee_14636")})}),s&&(0,i.jsx)(ru,{icon:"repeat",onClick:()=>d(!0),children:t("r_g_n_rer_le_co_81294")})]})]})]}),e.isWeezeventConnected&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{color:"gray500",children:t("num_ro_de_puce_50039")}),(0,i.jsx)(ka,{font:"gray800 textSm medium",children:g(e.volunteerRegistration.shortTag)?e.volunteerRegistration.shortTag:"-"})]}),(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{color:"gray500",children:t("derni_re_synchr_59823")}),(0,i.jsx)(ka,{font:"gray800 textSm medium",children:c})]}),(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{color:"gray500",children:t("appair_le_70213")}),(0,i.jsx)(ka,{font:"gray800 textSm medium",children:u})]})]})]})]}),e.isWeezeventConnected&&Bs(e.volunteerRegistration.weezeventPayBalances)&&(0,i.jsxs)(rd,{css:{borderTop:"1px solid $gray200",padding:"$5 $6"},direction:"column",gap:"4",children:[(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(Id,{icon:"money-bill"}),(0,i.jsx)(ka,{font:"gray900 textMd medium",children:t("solde_cashless_67316")})]}),(0,i.jsx)(rd,{gap:"9",children:e.volunteerRegistration.weezeventPayBalances.map((e,t)=>(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{color:"gray500",children:e.currencyName}),(0,i.jsx)(ka,{color:"gray800",children:yO(e)})]},t))})]})]}),l&&(0,i.jsx)(DA,{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:()=>d(!1),onDelete:async()=>{await a({eventId:n,selecteds:{ids:[o]}}),e.reload()}})]})},SO=e=>{const{translate:t,params:{eventId:n,userInfoId:o}}=bd(),{organization:s}=_v(),{event:r}=dv(),{canMemberEdit:a}=Dv(),[l,d]=(0,V.useState)(""),[c,u]=(0,V.useState)(e.initialShowNotFilled),m=(0,V.useCallback)(t=>{u(t),e.setShowNotFilled(t)},[e.setShowNotFilled,u]),h=(0,V.useMemo)(()=>Object.fromEntries(e.formsUsersInfos.map(e=>[e.formId,e.insertedAt])),[e.formsUsersInfos]),p=(0,V.useMemo)(()=>(0,cm.A)(e.forms.filter(e=>!(!c&&void 0===h[e.id])&&(!g(l)||e.name.toLowerCase().includes(l.toLowerCase().trim()))),[e=>void 0!==h[e.id]?1:2,e=>e.name]),[e.forms,h,l,c]),f=(0,V.useMemo)(()=>Bs(e.delegations)&&(!n||r?.useDelegations),[r,n,e.delegations]),_=(0,V.useMemo)(()=>e.formsUsersInfos.filter(e=>g(e.teamCode)),[e.formsUsersInfos]),x=(0,V.useMemo)(()=>!Bs(_)||!n||r?.useForms,[_,n,r]),I=(0,V.useMemo)(()=>e.usersInfos.filter(e=>e.id!==o),[e.usersInfos,o]),v=(0,V.useMemo)(()=>XC(e.userPermissions,t),[e.userPermissions,s]);return(0,i.jsxs)(rd,{gap:"6",width:1,children:[(0,i.jsxs)(rd,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"4",children:[e.isWeezeventConnected&&e.volunteerRegistration&&(0,i.jsx)(AO,{isWeezeventConnected:e.isWeezeventConnected,nameOrEmail:e.userInfo.nameOrEmail,reload:e.reload,volunteerRegistration:e.volunteerRegistration}),(0,i.jsxs)(rd,{align:"center",css:{background:"white",bd:!0,padding:"$4"},gap:"2",children:[(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_un_f_28561"),value:l,onChange:d})}),(0,i.jsx)(Eu,{state:c?"checked":"unchecked",onClick:e=>{m("checked"===e)},children:t("afficher_les_fo_84832")})]}),(0,i.jsx)(rd,{direction:"column",gap:"3",children:0===p.length?(0,i.jsx)(rd,{css:{background:"white",bd:!0},height:400,children:(0,i.jsx)(pA,{button:(0,i.jsx)(Mv,{permissions:Ov.MEMBER_EDIT,children:(0,i.jsx)(kd,{to:e.getEditUserFormPath("all"),children:t("_diter_les_cham_66020")})}),title:t("aucun_formulair_41857")})}):p.map(t=>(0,i.jsx)(xO,{canEdit:a,filledAt:h[t.id],form:t,getEditUserFormPath:e.getEditUserFormPath,showIsFilled:"all"!==t.id,userInfo:e.userInfo},t.id))})]}),(0,i.jsxs)(rd,{direction:"column",gap:"4",width:348,children:[!e.isWeezeventConnected&&e.volunteerRegistration&&(0,i.jsx)(AO,{isWeezeventConnected:e.isWeezeventConnected,nameOrEmail:e.userInfo.nameOrEmail,reload:e.reload,volunteerRegistration:e.volunteerRegistration}),Bs(v)&&(0,i.jsx)(IO,{icon:"shield",title:t("r_les_61679"),children:(0,i.jsx)(rd,{gap:"2",wrap:"wrap",children:v.map(e=>(0,i.jsx)(BC,{badge:e},e.id))})}),Bs(I)&&(0,i.jsx)(jO,{usersInfos:I}),f&&(0,i.jsx)(vO,{delegations:e.delegations}),x&&_.map((e,t)=>(0,i.jsx)(CO,{team:e},t)),(0,i.jsx)(bO,{customFields:e.customFields,getEditUserFormPath:e.getEditUserFormPath,insertedAt:e.insertedAt,profilePrivateFields:e.profilePrivateFields,profilePrivateFieldsUpdate:e.profilePrivateFieldsUpdate,reload:e.reload,userInfo:e.userInfo})]})]})},kO=()=>{const{organizationId:e,eventId:t,userInfoId:n}=zi(),{localEvent:o,updateLocalEvent:s}=dv(),{mutate:r}=function(e={}){return Di("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}=Oi("query UserInformationsEvent(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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 pairedAt\n weezeventAccessUrl\n weezeventPayUrl\n weezeventTicketUrl\n\n delegation {\n ...DelegationUserProfile\n }\n\n weezeventPayBalances {\n amount\n currencyDecimalPlaces\n currencyName\n currencySymbol\n }\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:n},[js.CustomFieldWithConditionFragment,js.UserInfoOverlayFragment,js.UserAllPermissionsFragment,js.FormUserInfoUserProfileFragment,js.FormUserOverlayFragment,js.DelegationUserProfileFragment]),c=(0,V.useMemo)(()=>(0,cm.A)(a.event?.forms.nodes??[],e=>e.name),[a.event]),u=(0,V.useMemo)(()=>(0,hd.A)([a.event?.volunteerRegistration.delegation]),[a.event]);return l||(0,i.jsx)(SO,{customFields:a.organization.customFields.nodes,delegations:u,forms:c,formsUsersInfos:a.organization?.userInfo.formsUsersInfos??[],getEditUserFormPath:i=>fs.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})},wO=()=>{const{params:{organizationId:e,userInfoId:t},translate:n}=bd(),{localOrganization:o,updateLocalOrganization:s}=_v(),{mutate:r}=function(e={}){return Di("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}=Oi("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},[js.CustomFieldWithConditionFragment,js.FormUserOverlayFragment,js.UserInfoOverlayFragment,js.UserAllPermissionsFragment,js.DelegationUserProfileFragment,js.FormUserInfoUserProfileFragment]),c=(0,V.useMemo)(()=>{if(a.organization){const e=Cj(a.organization.customFields.nodes),t={id:"all",name:n("tous_les_champs_57939"),elements:e};return(0,cm.A)(a.organization.forms.nodes,e=>e.name).concat([t])}return[]},[a.organization,n]);return l||(0,i.jsx)(SO,{customFields:a.organization.customFields.nodes,delegations:a.organization.userInfo.delegations,forms:c,formsUsersInfos:a.organization?.userInfo.formsUsersInfos??[],getEditUserFormPath:n=>fs.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})},EO=e=>{const{translate:t,params:{eventId:n}}=bd(),o=Ei(Yh),{mutate:s}=Dr(),r=(0,V.useMemo)(()=>Ps(),[]),[a,l]=(0,V.useState)(e.assignments.map(e=>({...e,checkInAt:e.checkInAt?.toLocal(),checkOutAt:e.checkOutAt?.toLocal()}))),d=(0,V.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,V.useCallback)((e,t,n)=>{l((0,Wm.jM)(i=>{i.forEach(i=>{i.id===e&&(i[t]=n||void 0)})}))},[a,l]);return(0,i.jsx)(Av,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"sliders",children:t("mettre_jour_d_54198")}),(0,i.jsx)(jv,{gap:"4",children:a.map(e=>(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsxs)(ka,{font:"gray800 textSm medium",children:[e.position.name," -"," ",(0,i.jsx)(Jp,{fontWeight:"regular",children:ng(o,e.positionSlot,"",{slot:{includeRange:!0}})})]}),(0,i.jsxs)(rd,{gap:"6",children:[(0,i.jsx)(Ch,{rightIcon:"xmark",value:e.checkInAt,zone:r,onChange:t=>{c(e.id,"checkInAt",t)},onRightIconClick:()=>{c(e.id,"checkInAt",null)}}),(0,i.jsx)(Ch,{rightIcon:"xmark",value:e.checkOutAt,zone:r,onChange:t=>{c(e.id,"checkOutAt",t)},onRightIconClick:()=>{c(e.id,"checkOutAt",null)}}),(0,i.jsx)(Qd,{shouldParseAsInt:!0,value:e.breakTime,onChange:t=>{c(e.id,"breakTime",t)}})]})]},e.id))}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{disabled:!d,onClick:async()=>{await Promise.all(a.map(e=>s({eventId:n,checkIn:{strategy:At.CheckInOut,breakTime:e.breakTime,checkInAt:e.checkInAt,checkOutAt:e.checkOutAt,positionsSlotsUsersInfosIds:[e.id]}}))),e.onClose(),e.onSuccess()},children:t("mettre_jour_85141")})})]})})},TO=e=>{const{translate:t}=bd(),n=Ei(Yh),o=(0,V.useMemo)(()=>{const t=pu(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)(rd,{css:{...o,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsxs)(rd,{align:"center",css:{fontSize:"10px"},gap:"1",children:[(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[e.psui.positionSlot.name&&(0,i.jsx)(ka,{children:e.psui.positionSlot.name}),(0,i.jsx)(ka,{children:n.toDisplayString(e.psui.positionSlot.range,{hideDate:!0})})]}),e.psui.state===lt.CheckedOut&&(0,i.jsx)(Id,{icon:"stopwatch",title:t("d_pointer_25328")}),e.psui.state===lt.CheckedIn&&(0,i.jsx)(Id,{icon:"timer",title:t("pointer_80927")})]}),(0,i.jsx)(ka,{fontSize:"textXs",fontWeight:"medium",children:e.psui.position.name})]}),e.psui.position.id)})},RO=e=>{const t=rk(),[n]=tg(e.dayStartTime),o=(0,V.useMemo)(()=>qh(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)(ck,{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)(dk,{endAt:t.range.start,startAt:t.range.start,startHour:n,children:(0,i.jsx)(TO,{psui:t,renderPosition:e.renderPosition,startHour:n})},o))})},OO=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{hasPermission:s}=nv(),r=Ei(Cm),a=Ei(CC),l=Ei(Yh),{mutate:d}=Dr(),c=(0,V.useMemo)(()=>ng(l,e.psui.positionSlot,"",{slot:{includeRange:!0}}),[e.psui]),u=s(Ov.MEMBER_ASSIGN),m=s(Ov.POSITION_READ,{positionCategoryId:e.psui.positionCategoryId,positionId:e.psui.position.id});return(0,i.jsxs)(am,{children:[(0,i.jsxs)(Qu,{align:"center",gap:"3",children:[(0,i.jsx)(Xv,{color:e.psui.position.color,icon:e.psui.position.icon}),(0,i.jsxs)(rd,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(ka,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:e.psui.positionCategory.name}),(0,i.jsx)(bm,{css:{overflow:"hidden",width:"100%","& > a":{width:"100%"}},to:Jo.POSITION({organizationId:n,eventId:o,positionId:e.psui.position.id}),children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.psui.position.name,width:1,children:e.psui.position.name})}),(0,i.jsx)(ka,{color:"gray500",css:{ellipsis:!0},title:c,width:1,children:c})]})]}),(0,i.jsx)(Qu,{children:e.psui.state===lt.CheckedOut?(0,i.jsx)(vu,{leftIcon:"clock",children:t("temps_total_79448",a.minutesToHoursMinutesString(e.psui.timeDifferenceMinutes))}):e.psui.state===lt.CheckedIn?(0,i.jsx)(vu,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:t("point_le_1_63576",r.toLocaleString(e.psui.checkInAt.toLocal(),zs.DateTime))}):(0,i.jsx)(vu,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:t("non_point_42145")})}),(0,i.jsx)(Qu,{children:e.psui.isAutoAssign&&(0,i.jsx)(ka,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(Id,{icon:"check"})})}),(0,i.jsxs)(Qu,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(ka,{children:e.psui.createdBy?.name??"-"}),(0,i.jsx)(ka,{color:"gray500",children:r.toLocaleString(e.psui.insertedAt.toLocal(),zs.DateTime)})]}),(0,i.jsxs)(jm,{justify:"end",width:200,children:[m&&(e.psui.state===lt.Waiting?(0,i.jsx)(kd,{color:"white",size:"sm",onClick:async()=>{await d({eventId:e.psui.eventId,checkIn:{strategy:At.CheckIn,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reload()},children:t("pointer_80927")}):e.psui.state===lt.CheckedIn?(0,i.jsx)(kd,{color:"white",size:"sm",onClick:async()=>{await d({eventId:e.psui.eventId,checkIn:{strategy:At.CheckOut,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reload()},children:t("d_pointer_25328")}):null),(0,i.jsx)(dA,{canCheckIn:m,canDelete:u,psui:e.psui,reloadCheckIn:e.reload,onDelete:e.reload})]})]})},DO=e=>{const{translate:t}=bd(),{hasPermission:n}=nv(),o=n(Ov.POSITION_READ),s=(0,V.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)(Hu,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(Wu,{children:[(0,i.jsx)(pm,{children:t("Position")}),(0,i.jsx)(pm,{children:t("statut_du_point_52451")}),(0,i.jsx)(pm,{children:t("affect_e_automa_74071")}),(0,i.jsx)(pm,{children:t("ajout_e_par_71330")}),o&&(0,i.jsx)(pm,{width:200})]}),s.map(t=>(0,i.jsx)(OO,{psui:t,reload:e.reload},t.id))]})},zO=e=>{const{params:{organizationId:t,eventId:n,userInfoId:o},translate:s}=bd(),[r,a]=(0,V.useState)(w_(e.event.startAt,e.event.endAt)),[l,d]=(0,V.useState)(null),[c,u]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{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)(rd,{align:"center",as:"header",css:{padding:e.featureFlags?.isV4?void 0:"$5 $6"},gap:"4",children:[(0,i.jsxs)(ka,{as:"hgroup",css:{flex:"1"},children:[(0,i.jsx)(Dd,{children:e.title}),e.subtitle&&(0,i.jsx)(Od,{textStyle:"subtitle",children:e.subtitle})]}),(0,i.jsxs)(rd,{as:"nav",gap:"3",children:["calendar"===e.positionsDisplay&&(0,i.jsx)(ak,{max:e.event.endAt,min:e.event.startAt,value:r,onChange:a}),"list"===e.positionsDisplay&&!e.hideListView&&(0,i.jsx)(ka,{width:160,children:(0,i.jsx)(Ih,{rightIcon:"xmark",value:l,onChange:d,onRightIconClick:()=>d(null)})}),!e.hideListView&&e.setPositionsDisplay&&(0,i.jsx)(ka,{width:200,children:(0,i.jsxs)(hh,{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")})]})}),e.canMemberAssign&&(0,i.jsx)(kd,{to:fs.EDIT_ASSIGNMENT(t,n,o),children:s("_diter_les_affe_42283")}),e.canMemberAssign&&(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(lu,{placement:"bottom-end",children:(0,i.jsx)(ru,{icon:"circle-check",onClick:()=>u(!0),children:s("mettre_jour_d_54198")})})]})]})]}),"calendar"===e.positionsDisplay?(0,i.jsx)(RO,{assignments:e.assignments,dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,featureFlags:e.featureFlags,renderPosition:e.renderPosition,selectedDay:r,startAt:e.event.startAt}):!e.hideListView&&(0,i.jsx)(DO,{assignments:e.assignments,reload:e.reload,selectedDay:l})]}),EO&&(0,i.jsx)(EO,{assignments:e.assignments,isOpen:c,onClose:()=>u(!1),onSuccess:()=>e.reload()})]})},$O=e=>{const[t,n]=ZR("user.positions.display","calendar");return(0,i.jsx)(zO,{...e,positionsDisplay:t,setPositionsDisplay:n})},PO=e=>{const t=Ti(),n=Ei(Yh),{mutate:o,isLoading:s}=Qr(),r=g(e.slot.name)?`${e.slot.name} - ${n.toDisplayString(e.slot.range)}`:n.toDisplayString(e.slot.range);return(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:e.slot.position.name}),(0,i.jsx)(Qu,{children:r}),(0,i.jsx)(Qu,{justify:"end",width:200,children:(0,i.jsx)(kd,{color:"white",isLoading:s,size:"sm",onClick:async()=>{await o({eventId:e.eventId,massAssign:{strategy:yt.Add,selecteds:{ids:[e.userInfoId]},positionsSlotsIds:[e.slot.id]}}),e.reload()},children:t("affecter_94255")})})]})},MO=e=>{const{params:{eventId:t,userInfoId:n},translate:o}=bd(),[s,r,a]=gm(""),[l,d]=(0,V.useState)(0),[c,u]=(0,V.useState)(null),m=(0,V.useCallback)(e=>{u(e),d(0)},[u,d]),{data:h,isLoading:p}=Oi("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:g(r)?r:void 0,offset:l,sort:c},[]);const{numberOfPages:f,totalCount:_}=ah(h.event?.volunteerRegistration.availablePositionsSlots),x=h.event?.volunteerRegistration.availablePositionsSlots.nodes??[];return(0,i.jsx)(dm,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:o("rechercher_une_69998"),value:s,onChange:a})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fp,{attribute:en.Position,setSort:m,sort:c,children:o("nom_de_la_missi_64605")}),(0,i.jsx)(fp,{attribute:en.Range,setSort:m,sort:c,children:o("cr_neau_11117")}),(0,i.jsx)(pm,{width:200})]}),numberOfPages:f,offset:l,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):Bs(x)?x.map(n=>(0,i.jsx)(PO,{eventId:t,reload:e.reload,slot:n,userInfoId:e.userInfoId},n.id)):(0,i.jsx)(am,{css:{height:"200px"},children:(0,i.jsx)(pA,{title:o("aucune_mission_03533")})}),setOffset:d,title:o("missions_dispon_68881"),totalCount:_})},FO=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=bd(),r=Ei(Yh),a=(0,V.useMemo)(()=>{const t=e.volunteerRegistration.preassignPositions.map(e=>({name:e.name,range:e.range?r.toDisplayString(e.range):"-",path:Jo.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:Jo.POSITION_CATEGORY({organizationId:n,eventId:o,positionCategoryId:e.id})}));return t.concat(i)},[e.volunteerRegistration]);return Bs(a)?(0,i.jsx)(dm,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:s("nom_de_la_missi_64605")}),(0,i.jsx)(pm,{children:s("Date")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:a.map((e,n)=>(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(ka,{color:"gray900",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{t.push(e.path)},children:e.name})}),(0,i.jsx)(Qu,{children:e.range})]},n))}),setOffset:hc.A,title:s("pr_affectation_68999"),totalCount:0}):null},NO=e=>{const{translate:t}=bd(),n=Ei(CC);return(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsxs)(rd,{css:{background:"white",bd:!0,padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(ka,{font:"gray500 textSm medium",children:t("nombre_d_heures_46954")}),(0,i.jsx)(ka,{font:"gray900 displaySm semiBold",children:n.minutesToHoursMinutesString(e.volunteerRegistration.volunteerMinutes)})]}),(0,i.jsxs)(rd,{css:{background:"white",bd:!0,padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(ka,{font:"gray500 textSm medium",children:t("nombre_de_missi_80367")}),(0,i.jsx)(ka,{font:"gray900 displaySm semiBold",children:e.numberOfAssignments})]})]})},LO=e=>{const{params:{organizationId:t,eventId:n,userInfoId:o},translate:s}=bd(),{canMemberAssign:r}=Dv(),a=(0,V.useMemo)(()=>(0,cm.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.event]);return(0,i.jsxs)(rd,{direction:"column",gap:"6",width:1,children:[Bs(a)&&(0,i.jsx)($O,{assignments:a,canMemberAssign:r,event:e.event,reload:()=>{e.reload(),a.length<=1&&e.reloadHeader()},renderPosition:(e,o)=>(0,i.jsx)(_d,{style:{width:"100%"},to:Jo.POSITION({organizationId:t,eventId:n,positionId:o}),children:e}),subtitle:s("visualisez_tout_59046"),title:s("missions_affect_97811")}),(0,i.jsx)(FO,{volunteerRegistration:e.event.volunteerRegistration}),e.event.hasFormWithPositionDisplay&&(0,i.jsx)(IA,{canMemberAssign:r,editPath:fs.EDIT_USER_MISSIONS(t,n,o),formsUsersInfos:e.organization.userInfo.formsUsersInfos}),(0,i.jsx)(Mv,{permissions:Ov.MEMBER_ASSIGN,children:(0,i.jsx)(MO,{reload:e.reload,userInfoId:o})}),Bs(a)&&(0,i.jsx)(NO,{numberOfAssignments:a.length,volunteerRegistration:e.event.volunteerRegistration})]})},BO=e=>{const{params:{organizationId:t,eventId:n,userInfoId:o}}=bd(),{data:s,loader:r,reload:a}=zr({organizationId:t,eventId:n,userInfoId:o});return r||(0,i.jsx)(LO,{event:s.event,organization:s.organization,reload:a,reloadHeader:e.reload})},VO=()=>{const{params:{organizationId:e,eventId:t,userInfoId:n}}=bd(),{data:o,loader:s}=Zr({organizationId:e,eventId:t,userInfoId:n}),{permissions:[r],isLoading:a}=Ry(Sy({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)(TA,{editPath:fs.EDIT_USER_SLOTS(e,t,n),eventId:t,formsUsersInfos:o.organization.userInfo.formsUsersInfos,organizationId:e,showEditButton:r})})})},UO=e=>{const{params:t,translate:n}=bd(),{data:o,isLoading:s,reload:r}=Oi('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,[js.UserInfoOverlayFragment]),a=(0,V.useMemo)(()=>o.organization?.userInfo.numberOfComments??0,[o.organization]),l={organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,userInfoId:":userInfoId"};Zc(o.organization?.userInfo?.nameOrEmail||"");const{params:{eventId:d,delegationId:c,organizationId:u,userInfoId:m}}=bd(),{permissions:[h,g],isLoading:p}=Ry(yy({eventId:d,organizationId:u,userInfoId:m}),((...e)=>({name:"canEmailUpdateFn",args:e}))({delegationId:c,eventId:d,organizationId:u,userInfoId:m})),f=s||p;return(0,i.jsxs)(nb,{children:[(0,i.jsx)(tb,{hideBorder:!0,children:f?(0,i.jsx)(aO,{}):(0,i.jsx)(rO,{accreditationState:o.organization?.userInfo.volunteerRegistration?.accreditationState,assignmentState:o.organization?.userInfo.volunteerRegistration?.state,canEmailEdit:g,populationFieldName:o.organization?.populationField.name||"",reload:r,showAccreditations:e.showAccreditations,showPositions:e.showPositions,userInfo:o.organization.userInfo})}),(0,i.jsxs)(rb,{css:{flex:"1"},children:[(0,i.jsxs)(ob,{css:{px:"$7"},children:[(0,i.jsx)(ib,{path:bx.MEMBER_INFORMATION(t),children:n("informations_22954")}),e.showAvailabilities&&(0,i.jsx)(ib,{path:bx.MEMBER_AVAILABILITIES(t),children:n("disponibilit_s_49923")}),e.showPositions&&(0,i.jsx)(ib,{path:bx.MEMBER_POSITIONS(t),children:n("missions_63972")}),e.showAccreditations&&(0,i.jsx)(ib,{path:bx.MEMBER_ACCREDITATIONS(t),children:n("accr_ditations_39450")}),e.showActions&&(0,i.jsx)(ib,{path:bx.MEMBER_ACTIONS(t),children:n("actions_21689")}),h&&(0,i.jsx)(ib,{path:bx.MEMBER_COMMENTS(t),children:n("commentaires_97857",a)}),(0,i.jsx)(ib,{basePath:bx.MEMBER_HISTORY(t),path:bx.MEMBER_HISTORY_EVENTS(t),children:n("historique_06296")})]}),(0,i.jsx)(sb,{path:bx.MEMBER_INFORMATION(l),children:e.isEvent?(0,i.jsx)(Qv,{children:(0,i.jsx)(kO,{})}):(0,i.jsx)(Qv,{children:(0,i.jsx)(wO,{})})}),e.showAvailabilities&&(0,i.jsx)(sb,{path:bx.MEMBER_AVAILABILITIES(l),children:(0,i.jsx)(Qv,{children:(0,i.jsx)(VO,{})})}),e.showPositions&&(0,i.jsx)(sb,{path:bx.MEMBER_POSITIONS(l),children:(0,i.jsx)(Qv,{children:(0,i.jsx)(BO,{reload:r})})}),e.showAccreditations&&(0,i.jsx)(sb,{path:bx.MEMBER_ACCREDITATIONS(l),children:(0,i.jsx)(Qv,{children:(0,i.jsx)(QR,{})})}),e.showActions&&(0,i.jsx)(sb,{path:bx.MEMBER_ACTIONS(l),children:e.isEvent?(0,i.jsx)(Qv,{children:(0,i.jsx)(tO,{})}):(0,i.jsx)(Qv,{children:(0,i.jsx)(iO,{})})}),h&&(0,i.jsx)(sb,{path:bx.MEMBER_COMMENTS(l),children:(0,i.jsx)(Qv,{children:(0,i.jsx)(UR,{showEvent:!0})})}),(0,i.jsx)(sb,{path:bx.MEMBER_HISTORY(l),children:(0,i.jsx)(Qv,{children:(0,i.jsx)(_O,{isEvent:e.isEvent,isWeezeventConnected:o.organization?.event?.isWeezeventConnected??!1})})})]})]})},WO=()=>{const{canAccreditationRead:e,canDocumentRead:t,canMemberAccredit:n,canMemberAssign:o,canMemberAssignmentStateEdit:s,canMemberAvailabilitiesEdit:r,canMemberDelete:a,canPositionRead:l}=Dv(),d=t||n||o||s||a,c=e||l||r;return(0,i.jsx)(UO,{isEvent:!0,showAccreditations:e,showActions:d,showAvailabilities:c,showPositions:l})},GO=()=>(0,i.jsx)(UO,{isEvent:!1,showAccreditations:!1,showActions:!0,showAvailabilities:!1,showPositions:!1});var qO=n(6301);function HO(e=[]){const t=String.fromCharCode(65+(0,qO.A)(25));return!1===e.includes(t)?t:HO(e)}function KO(e=[]){const t=(0,qO.A)(9);return!1===e.includes(t)?t:KO(e)}const YO=["Q","O","I","L"],ZO=[0,1];function XO(e=10){const t=(0,nm.A)(0,e-1).map(()=>{return e=YO,t=ZO,0===(0,qO.A)(1)?HO(e):KO(t).toString();var e,t}).join("");return`${HO(YO)}${t}`}const JO=e=>{const t=Ti(),n=`formKeyToTeamCode.f${e.form.id}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{font:"gray900 textLg medium",children:"Équipe"}),(0,i.jsx)(Dh,{height:"4"}),(0,i.jsx)(ec,{hint:t("d_finissez_votr_19710"),label:t("code_quipe_14296"),name:n,rightIcon:"arrows-rotate",onRightIconClick:()=>{e.change(n,XO())}}),(0,i.jsx)(md,{height:"9"})]})},QO=e=>{const{history:t,params:{eventId:n},translate:o}=bd(),s=V.useMemo(()=>(0,cm.A)(e.forms,e=>e.name.toLowerCase()),[e.forms]);return(0,i.jsxs)(rd,{css:{overflow:"hidden"},direction:"column",height:1,width:1,children:[(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsxs)(rd,{align:"center",css:{margin:"auto",overflowY:"auto"},direction:"column",height:1,width:1,children:[e.banner,(0,i.jsxs)(rd,{css:{padding:"$6 $4",width:"100%","@tablet":{padding:"$6 $8"},"@desktop":{padding:"$7",width:n?"100%":"$container"}},direction:"column",children:[(0,i.jsx)(ka,{font:"gray900 displayXs semiBold",children:e.title}),(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rb,{children:[(0,i.jsxs)(ob,{children:[s.map(t=>(0,i.jsx)(ib,{path:e.getTabPath(t.id),children:t.name},t.id)),e.extraTabs]}),e.children]})]})]})}),(0,i.jsx)(rd,{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)(rd,{align:"center",css:{width:"100%","@desktop":{width:n?"100%":"$container"}},gap:"4",children:[(0,i.jsx)(kd,{isLoading:e.isLoading,onClick:e.handleSubmit,children:o("mettre_jour_85141")}),(0,i.jsx)(ka,{color:"gray700",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>t.goBack(e.returnPathFallback),children:o("annuler_48254")})]})})]})},eD=({banner:e,change:t,customFields:n,formIdToInsertedAt:o,forms:s,getEditUserFormPath:r,handleSubmit:a,isLoading:l,returnPathFallback:d,showAllAndPrivate:c,showIsFilled:u,userInfo:m,values:h})=>{const{translate:g,params:{organizationId:p}}=bd(),f=Ei(Cm),_=V.useMemo(()=>n.filter(e=>e.isPrivate).map(e=>({id:W(),elementType:st.Field,customField:e,hasCondition:!1,conditionValue:!1})),[n]),x=V.useMemo(()=>Cj(n),[n]),I=V.useCallback((e,t)=>(0,i.jsxs)(i.Fragment,{children:[0!==t&&(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(ka,{font:"gray900 textLg medium",children:e}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(Oh,{direction:"horizontal"})]}),[]);return(0,i.jsxs)(QO,{banner:e,extraTabs:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ib,{path:r("all"),children:g("tous_les_champs_57939")}),(0,i.jsx)(ib,{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",m.nameOrEmail),children:[s.map(e=>{const n=o[e.id];return(0,i.jsxs)(sb,{path:r(e.id),children:[(0,i.jsx)(md,{height:"7"}),u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"center",css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"4",children:[(0,i.jsx)(ka,{css:{flex:"1"},font:"gray800 textMd semiBold",children:g("statut_du_formu_08195")}),(0,i.jsx)(ka,{width:320,children:(0,i.jsxs)(hh,{shouldParseAsBoolean:!0,state:n?"disabled":"active",value:h.filledFormsIds.includes(e.id),onChange:n=>{t("filledFormsIds",Us(h.filledFormsIds,e.id,n))},children:[(0,i.jsx)("option",{value:"true",children:n?g("rempli_le_1_29292",f.toLocaleString(n,zs.DateTime)):g("rempli_78674")}),(0,i.jsx)("option",{value:"false",children:g("non_rempli_80877")})]})})]}),(0,i.jsx)(md,{height:"6"}),e.areTeamsAllowed&&(0,i.jsx)(JO,{change:t,form:e})]}),(0,i.jsx)(YT,{change:t,elements:e.elements,organizationId:p,prefix:"userInfo.fields.",renderSection:I,values:h.userInfo.fields})]},e.id)}),c&&(0,i.jsxs)(sb,{path:r("all"),children:[(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(YT,{change:t,elements:x,organizationId:p,prefix:"userInfo.fields.",renderSection:I,values:h.userInfo.fields})]}),c&&(0,i.jsxs)(sb,{path:r("private"),children:[(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(YT,{change:t,elements:_,organizationId:p,prefix:"userInfo.fields.",renderSection:I,values:h.userInfo.fields})]})]})},tD=[Oe.Address,Oe.Text,Oe.Textarea,Oe.Time],nD=({banner:e,customFields:t,country:n,formIdToInsertedAt:o,formIdToTeamCode:s,forms:r,from:a,getEditUserFormPath:l,showAllAndPrivate:d,showIsFilled:c,userInfo:u})=>{const{organizationId:m,eventId:h,delegationId:g}=zi(),p=$i(),f=Ei(VT),_=Ei(ld),{mutate:x,isLoading:I}=function(e={}){return Di("mutation UserInfoUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n $userId: UserId!\n $userInfo: UsersInfoInput!\n $filledFormsIds: [FormId!]\n $memberSpaceFormId: 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 memberSpaceFormId: $memberSpaceFormId\n ) {\n id\n }\n}\n",e)}(),v=(0,V.useMemo)(()=>Object.keys(o).map(e=>parseInt(e,10)),[o]),b=(0,V.useMemo)(()=>Object.fromEntries(Object.entries(s).map(([e,t])=>[`f${e}`,t])),[s]),j=(0,V.useMemo)(()=>({filledFormsIds:v,formKeyToTeamCode:b,userInfo:f.userInfoUpdateInputDefault(u,t,{checkboxDefaultEmpty:!0,countryCode:n})}),[v,b,u,t,n]),C=(0,V.useCallback)(e=>_.validateForForm(f.updateUserInfoChangedFieldsSchema(t,j.userInfo.fields,e.userInfo.fields))(e),[t,j]);return(0,i.jsx)(Vd,{direction:"column",height:1,hideDefaultErrors:!0,initialValues:j,render:({form:n,handleSubmit:s,values:p})=>(0,i.jsx)(eD,{banner:e,change:n.change,customFields:t,formIdToInsertedAt:o,forms:r,getEditUserFormPath:l,handleSubmit:s,isLoading:I,returnPathFallback:"app"===a?h?fs.VOLUNTEERS(m,h):ro.COMMUNITY_USERS({organizationId:m}):g?qo.DELEGATION_MEMBERS({organizationId:m,eventId:h,delegationId:g}):bx.MEMBER({organizationId:m,eventId:h,userInfoId:u.id}),showAllAndPrivate:d,showIsFilled:c,userInfo:u,values:p}),validate:C,width:1,onSubmit:async e=>{const n=e.userInfo.fields;t.forEach(e=>{tD.includes(e.fieldType)&&!n[e.slug]?n[e.slug]="":e.fieldType!==Oe.File||n[e.slug]||(n[e.slug]=null)}),await x({organizationId:m,eventId:h,userId:u.userId,userInfo:{id:u.id,fields:e.userInfo.fields},filledFormsIds:c?e.filledFormsIds:void 0,formKeyToTeamCode:e.formKeyToTeamCode}),p.goBack("app"===a?fs.VOLUNTEERS(m,h):bx.MEMBER({organizationId:m,eventId:h,userInfoId:u.id}))}})},iD=({country:e,data:t,forms:n,getEditFormPath:o})=>{const{params:{organizationId:s,eventId:r,userInfoId:a}}=bd(),l=(0,V.useMemo)(()=>t.organization?.userInfo.formsUsersInfos??[],[t.organization]),d=(0,V.useMemo)(()=>l.map(e=>e.formId),[l]),c=(0,V.useMemo)(()=>Object.fromEntries(l.map(e=>[e.formId,e.insertedAt])),[l]),u=(0,V.useMemo)(()=>r?Object.fromEntries(l.map(e=>[e.formId,e.teamCode])):{},[r,l]);return(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:[fs.EDIT_USER_FORM(":organizationId",":eventId",":userInfoId",":formId"),fs.COMMUNITY_EDIT_USER_FORM(":organizationId",":userInfoId",":formId")],children:(0,i.jsx)(nD,{country:e,customFields:t.organization.customFields.nodes,formIdToInsertedAt:c,formIdToTeamCode:u,forms:n,from:"app",getEditUserFormPath:o,showAllAndPrivate:!0,showIsFilled:!0,userInfo:t.organization.userInfo})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:r?fs.EDIT_USER_FORM(s,r,a,d?.[0]??"all"):fs.COMMUNITY_EDIT_USER_FORM(s,a,d?.[0]??"all"),replace:!0})})]})},oD=()=>{const{params:{organizationId:e,eventId:t,delegationId:n,userInfoId:o}}=bd(),s=$i(),{data:r,loader:a}=Oi("query UpdateUserInfosEvent(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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},[js.CustomFieldWithConditionFragment,js.UpdateUserFormFragment]);return a||(r.organization.userInfo.isEditable??1)||s.push(fs.DASHBOARD(e,t)),a||(0,i.jsx)(iD,{country:r.event.country,data:r,forms:n?r.event.forms.nodes.filter(e=>Bs(e.delegationsIds)&&e.delegationsIds.includes(n)):r.event.forms.nodes,getEditFormPath:n=>fs.EDIT_USER_FORM(e,t,o,n)})},sD=()=>{const{organizationId:e,delegationId:t,userInfoId:n}=zi(),{data:o,loader:s}=Oi("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},[js.CustomFieldWithConditionFragment,js.UpdateUserFormFragment]);return s||(0,i.jsx)(iD,{country:o.organization.country,data:o,forms:t?o.organization.forms.nodes.filter(e=>Bs(e.delegationsIds)&&e.delegationsIds.includes(t)):o.organization.forms.nodes,getEditFormPath:t=>fs.COMMUNITY_EDIT_USER_FORM(e,n,t)})},rD=(0,V.createContext)({}),aD=({children:e,...t})=>(0,i.jsx)(rD.Provider,{value:{shouldShowModeSelection:Boolean(t.createCard||t.upsertCard||t.updateCard),...t},children:e});function lD(){return(0,V.useContext)(rD)}var dD=n(4809);let cD=class extends ic{constructor(e){super(e)}csvDocumentInputDefault(e){return{key:"",name:"",acl:"",formats:{timeFormat:"HH:mm",dateFormat:Ss,datetimeFormat:"yyyy-MM-dd HH:mm",...e}}}schema(){const e=this.t("le_document_est_86403");return c.Ik().shape({acl:c.Yj().required(e),delimiter:c.Yj().optional().test("is-valid-value",this.t("delimiter_value_52108"),e=>!e||!dD.BAD_DELIMITERS.includes(e)),key:c.Yj().required(e).test("is-a-csv",this.t("le_fichier_n_es_33134"),e=>Hx(Lx(e).extension)===Ux.Csv),name:c.Yj().required(e),newline:c.Yj().optional().test("is-valid-value",this.t("newline_charact_88066"),e=>!e||["\r","\n","\r\n"].includes(e)),quoteChar:c.Yj().optional(),formats:c.Ik().shape({timeFormat:c.Yj().optional(),dateFormat:c.Yj().optional(),datetimeFormat:c.Yj().optional()}),file:c.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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],cD);var uD;let mD=class extends ic{static{uD=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={Id:"id"};static IMPORT_COLUMNS_REQUIRED=e=>e===jt.Update?[uD.IMPORT_COLUMNS_DEFAULT.Id]:[];constructor(e,t){super(t),this.csvInputService=e}default(e){return{input:{csv:this.csvInputService.csvDocumentInputDefault(e),mode:jt.Upsert}}}schema(){return c.Ik().shape({input:c.Ik().shape({csv:this.csvInputService.schema(),mode:c.Yj().oneOf(Un,this.t("le_mode_d_impor_75706"))})})}};mD=uD=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[cD,Si])],mD);let hD=class extends mD{csvInputService;default(e){return{input:{csv:this.csvInputService.csvDocumentInputDefault(e),mappings:[],presets:[],mode:jt.Upsert,tag:""}}}schema(){return c.Ik().shape({input:c.Ik().shape({csv:this.csvInputService.schema(),mappings:c.YO().of(c.Yj().nullable()),presets:c.YO().of(c.Ik().shape({customFieldId:c.ai().positive(this.t("le_choix_du_typ_07079")),value:c.gl().when("customFieldId",{is:e=>e>-1,then:e=>e.required(this.t("la_valeur_du_ch_65599"))})})),mode:c.Yj().oneOf(Un,this.t("le_mode_d_impor_75706")),tag:c.Yj().required("a_tag_must_be_s_23274")})})}settingsStepSchema(){return c.Ik().shape({input:c.Ik().shape({csv:this.csvInputService.schema()})})}mappingStepSchema(){return c.Ik().shape({input:c.Ik().shape({mappings:c.YO().of(c.Yj().nullable()),presets:c.YO().of(c.Ik().shape({customFieldId:c.ai().positive(this.t("le_choix_du_typ_07079")),value:c.gl().when("customFieldId",{is:e=>e>-1,then:e=>e.required(this.t("la_valeur_du_ch_65599"))})})),mode:c.Yj().oneOf(Un,this.t("le_mode_d_impor_75706")),tag:c.Yj().required("a_tag_must_be_s_23274")})})}constructor(e,t){super(e,t),this.csvInputService=e}};hD=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[cD,Si])],hD);var gD=n(6632);const pD=e=>{const{params:{organizationId:t},translate:n}=bd(),{data:o,loader:s}=Or({organizationId:t}),r=Hd(),a=(0,V.useMemo)(()=>e.formRenderProps.values.input.csv.file,[e.formRenderProps.values.input.csv]),l=(0,V.useMemo)(()=>{const t=localStorage.getItem(tc[`${e.localStorageKeyPrefix}_FORMATS`]);return t?JSON.parse(t):t},[e.localStorageKeyPrefix]),d=(0,V.useMemo)(()=>{const t=t=>e.formRenderProps.values.input.csv.formats?.[t]===o.organization?.[t]?(0,i.jsx)(vu,{css:{textTransform:"uppercase"},children:n("from_organisati_25675")}):l?.[t]===e.formRenderProps.values.input.csv.formats?.[t]&&(0,i.jsx)(vu,{css:{textTransform:"uppercase"},children:n("from_saved_22150")});return{datetime:t("datetimeFormat"),date:t("dateFormat"),timeBadge:t("timeFormat")}},[o.organization,l,e.formRenderProps.values.input.csv.formats]),c=Ri(),u=Object.values(e.ImportInputService.IMPORT_COLUMNS_DEFAULT).filter(t=>t!==e.ImportInputService.IMPORT_COLUMNS_DEFAULT.Id),m="data:text/csv;charset=utf-8,"+[[...u,...e.customFields.map(e=>e.slug)],new Array(u.length+e.customFields.length)].map(e=>e.join(",")).join("\n");return s||(0,i.jsxs)(rd,{direction:"column",gap:"8",children:[(0,i.jsx)($x,{css:{"& header":{borderBlockEnd:"unset",paddingBlockEnd:"unset"}},heading:n("choix_du_fichie_30517"),subtitle:[...c(n("s_lectionnez_vo_53506","{1}"),(0,i.jsx)(bm,{css:{color:"$primary600"},download:"export-sample-file.csv",to:encodeURI(m),children:n("t_l_charger_un_46976")}))],children:(0,i.jsx)(dj,{...r,accept:Vx.Csv,acl:"private",organizationId:t,prefix:"input.csv.",withFileField:!0,onChange:t=>e.onChange(t,e.formRenderProps)})}),(0,i.jsxs)($x,{heading:n("param_tres_du_f_01675"),isOpenToggleLabel:n("afficher_les_pa_96893"),subtitle:n("personnaliser_s_29361"),children:[(0,i.jsxs)(eC,{heading:n("type_de_carat_r_62356"),children:[(0,i.jsx)(ec,{hint:n("laissez_ce_cham_07837"),label:n("d_limitateur_77701"),name:"input.csv.delimiter",state:a?"disabled":void 0}),(0,i.jsx)(ec,{hint:n("leave_blank_if_02058"),label:n("caract_re_d_ch_56847"),name:"input.csv.quoteChar",state:a?"disabled":void 0}),(0,i.jsxs)(Ev,{hint:n("leave_blank_if_02058"),label:n("caract_re_de_re_71491"),name:"input.csv.newline",state:a?"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)(eC,{heading:n("type_de_format_68432"),children:[(0,i.jsx)(ec,{label:(0,i.jsxs)(rd,{align:"center",gap:"2",children:[n("format_d_heure_46798"),d.timeBadge]}),name:"input.csv.formats.timeFormat",state:a?"disabled":void 0}),(0,i.jsx)(ec,{label:(0,i.jsxs)(rd,{align:"center",gap:"2",children:[n("format_de_date_82059"),d.date]}),name:"input.csv.formats.dateFormat",state:a?"disabled":void 0}),(0,i.jsx)(ec,{label:(0,i.jsxs)(rd,{align:"center",gap:"2",children:[n("format_de_date_24474"),d.datetime]}),name:"input.csv.formats.datetimeFormat",state:a?"disabled":void 0})]})]})]})},fD=xa("input",{blockSize:"fit-content",inlineSize:"fit-content"}),_D=(0,V.forwardRef)((e,t)=>(0,i.jsx)(fD,{ref:t,type:"radio",...e}));_D.displayName="Radio";const xD=({children:e,css:t,icon:n,subtext:o,...s})=>{const{inputId:r,descId:a,labelId:l}=Hd(),d=(0,V.useRef)(null);return(0,i.jsx)(rd,{css:{bd:!0,flexGrow:"1",margin:"-1px",cursor:"pointer",'&:has( input[type="radio"]:checked)':{border:"2px solid $primary500"},...t},onClick:()=>d.current?.click(),children:(0,i.jsx)(rd,{css:{border:"1px solid transparent",padding:"$4",'&:has( input[type="radio"]:checked)':{border:"none"}},children:(0,i.jsxs)(rd,{gap:"1",children:[(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(rd,{css:{bd:!0,border:"1px solid $gray200",inlineSize:"fit-content"},justify:"start",children:(0,i.jsx)(Xv,{css:{color:"$gray800",background:"unset"},icon:n})}),(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(Zd,{htmlFor:r,id:l,children:(0,i.jsx)(Od,{css:{fontSize:"$textSm",fontWeight:"$medium"},children:e})}),o&&(0,i.jsx)(Od,{id:a,children:o})]}),(0,i.jsx)(rd,{css:{flex:"1"}})]}),(0,i.jsx)(_D,{ref:d,"aria-describedby":a,"aria-labelledby":l,id:r,...s})]})})})},ID=({name:e,value:t,...n})=>(0,i.jsx)(cd.D0,{name:e,render:({input:e})=>(0,i.jsx)(xD,{checked:e.checked,name:e.name,value:t,onChange:e.onChange,...n,children:n.children}),type:"radio",value:t}),vD=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>[{id:-1,name:t("default_fields_04920"),fields:Object.entries(e.defaultFields).map(([e,n])=>({name:g(t(e))?t(e):e,slug:n,id:parseInt((0,qd.A)())}))},...e.categories].map(t=>({...t,fields:(0,cm.A)(t.fields,t=>{const n=t.name.toLowerCase(),i=t.slug.toLowerCase(),o=e.column.name.toLowerCase(),s=Math.min(v(n,o),v(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)(Qd,{state:"disabled",value:e.column.name,onChange:()=>{}}),(0,i.jsx)(Id,{icon:"arrow-right"}),(0,i.jsx)(Gp,{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))})]})},bD=xa("div",{display:"grid",gridTemplateColumns:"[column] 1fr auto [field] 1fr",gap:"$4 $5",alignItems:"center"}),jD=xa("div",{color:"$gray800",gridColumn:"column",fontWeight:"$medium"}),CD=xa("div",{color:"$gray800",gridColumn:"field",fontWeight:"$medium"}),yD=e=>{const{translate:t}=bd();return(0,i.jsxs)(bD,{children:[(0,i.jsx)(jD,{children:t("titres_de_vos_c_31388")}),(0,i.jsx)(CD,{children:t("champs_de_formu_64126")}),e.columns.map((t,n)=>(0,i.jsx)(vD,{categories:e.categories,column:{name:t,index:n},defaultFields:e.defaultFields,requiredFieldSlugs:e.requiredFieldSlugs,values:e.values},n))]})},AD=e=>{const{translate:t}=bd(),{alertDescriptionKey:n}=lD(),{formRenderProps:{values:{input:{mappings:o}}}}=(0,V.useContext)(ud),s=(0,V.useMemo)(()=>Object.entries(e.defaultFields).filter(([t,n])=>e.requiredFieldSlugs.includes(n)&&!o.includes(n)).map(([e,n])=>g(t(e))?t(e):e),[e.defaultFields,e.requiredFieldSlugs,o]),r=Ri();return(0,i.jsxs)($x,{css:{"& > header":{borderBlockEnd:"unset",paddingBlockEnd:"unset"}},gap:"5",heading:t("donn_es_de_mapp_98874"),subtitle:t("s_lectionnez_le_13978"),children:[Bs(s)&&(0,i.jsxs)(zd,{alertStyle:"warning",children:[(0,i.jsx)($d,{children:t("required_field_46113",s.length)}),(0,i.jsx)(Pd,{children:[...r(t(n,"{1}"),(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:s.map(e=>(0,i.jsx)("li",{children:e},e))}))]})]}),(0,i.jsx)(yD,{...e})]})},SD=({file:e,onToggle:t,...n})=>{const o=Ti();return(0,i.jsx)($x,{heading:o("attribution_d_u_50979"),isOpen:Bs(n.values)??!1,isOpenToggleLabel:o("attribuer_autom_74319"),subtitle:o("d_finissez_dire_31742"),children:(0,i.jsx)(eC,{heading:o("liste_des_champ_94862"),children:(0,i.jsx)(kj,{name:"input.presets",...n})})})},kD=(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 wD(e){const{translate:t}=bd(),{isLoading:n,columns:o,errors:s}=((e,t)=>{const[n,i]=(0,V.useReducer)(kD,{isLoading:!0,columns:void 0,errors:void 0});return(0,V.useEffect)(()=>{i({type:"LOADING"}),(0,dD.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})(e.file,{delimiter:e.values.input.csv.delimiter??void 0,quoteChar:e.values.input.csv.quoteChar??void 0,newline:e.values.input.csv.newline??void 0}),r=(0,V.useMemo)(()=>{const t=bj(e.customFields).map(({category:e,items:t})=>({id:e.id,name:e.name,fields:t.map(e=>e.fieldType===Oe.File?{...e,name:`${e.name} (URL)`}:e)}));return e.additionalCategories?t.concat(e.additionalCategories):t},[e.additionalCategories,e.customFields]);return n||s?null:(0,i.jsxs)(i.Fragment,{children:[e.additionalOptions&&(0,i.jsx)($x,{heading:t("param_tres_d_im_18876"),children:e.additionalOptions}),(0,i.jsx)(AD,{categories:r,columns:o,defaultFields:e.defaultFields,modeSelection:e.modeSelection,requiredFieldSlugs:e.requiredFieldSlugs,values:e.values.input.mappings}),Bs(e.customFields)&&(0,i.jsx)(SD,{change:e.form.change,customFields:e.customFields,file:e.file,values:e.values.input.presets,onToggle:e.onToggle})]})}const ED=e=>{const{params:{organizationId:t},translate:n}=bd(),{createCard:o,upsertCard:s,updateCard:r,shouldShowModeSelection:a}=lD();return(0,i.jsxs)(rd,{direction:"column",gap:"8",children:[a&&(0,i.jsx)($x,{heading:n("type_d_action_d_35533"),name:"input.mode",role:"radiogroup",subtitle:n("s_lectionnez_la_32551"),children:(0,i.jsxs)(rd,{gap:"4",justify:"evenly",children:[o&&(0,i.jsx)(rd,{css:{flex:"1"},direction:"column",children:(0,i.jsx)(ID,{icon:"user-plus",name:"input.mode",subtext:o.description,value:jt.Create,children:o.heading})}),s&&(0,i.jsx)(rd,{css:{flex:"1"},direction:"column",children:(0,i.jsx)(ID,{icon:"user-pen",name:"input.mode",subtext:s.description,value:jt.Upsert,children:s.heading})}),r&&(0,i.jsx)(rd,{css:{flex:"1"},direction:"column",children:(0,i.jsx)(ID,{icon:"arrows-rotate",name:"input.mode",subtext:r.description,value:jt.Update,children:r.heading})})]})}),e.formRenderProps.values.input.csv?.file&&RD(e.formRenderProps.form)&&(0,i.jsx)(wD,{additionalCategories:e.additionalCategories,additionalOptions:e.additionalOptions,customFields:e.customFields,defaultFields:e.ImportInputService.IMPORT_COLUMNS_DEFAULT,file:e.formRenderProps.values.input.csv.file,form:e.formRenderProps.form,requiredFieldSlugs:e.ImportInputService.IMPORT_COLUMNS_REQUIRED(e.formRenderProps.values.input.mode),values:e.formRenderProps.values,onToggle:n=>{if(!e.formRenderProps.values.input.csv.file)throw new Error("No file in input!");try{n?e.formRenderProps.form.change("input.presets",JSON.parse(localStorage.getItem(tc[`${e.localStorageKeyPrefix}_PRESETS`](t))??"[]")):e.formRenderProps.form.change("input.presets",[])}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}}}),(0,i.jsxs)($x,{heading:n("identify_your_i_87636"),subtitle:n("by_default_you_75833"),children:[(0,i.jsx)(ec,{label:n("your_import_tag_41852"),name:"input.tag",state:"disabled"}),!e.isTagInputDisabled&&(0,i.jsx)(Qd,{label:n("specify_an_impo_41868"),onChange:t=>{g(t)?e.formRenderProps.form.change("input.tag",`${e.importTagPrefix}-csv-${t}`):e.formRenderProps.form.change("input.tag",`${e.importTagPrefix}-csv-${As.c9.now().toFormat(ws)}`)}})]})]})},TD=e=>{const{translate:t}=bd();return(0,i.jsxs)(rd,{align:"center",css:{alignSelf:"center",maxInlineSize:"640px"},direction:"column",gap:"8",children:[(0,i.jsxs)(rd,{align:"center",direction:"column",gap:"4",children:[(0,i.jsx)(rd,{css:{bd:!0,border:"1px solid $gray200",inlineSize:"fit-content"},justify:"start",children:(0,i.jsx)(Xv,{css:{color:"$gray800",background:"unset"},icon:"party-horn"})}),(0,i.jsxs)(rd,{css:{textAlign:"center"},direction:"column",gap:"1",children:[(0,i.jsx)(Dd,{children:t("l_importation_e_12369")}),(0,i.jsx)(Od,{textStyle:"subtitle",children:t("_la_fin_du_pro_00757")})]})]}),(0,i.jsxs)(rd,{gap:"3",children:[(0,i.jsx)(kd,{onClick:()=>window.location.reload(),children:t("nouvel_import_48306")}),e.returnLink]})]})},RD=e=>!!e.getFieldState("input.csv.key")?.valid&&!!e.getFieldState("input.csv.file")?.valid,OD=(0,gD.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)),DD=(e,t,n)=>t.formatListValues(e.IMPORT_COLUMNS_REQUIRED(n.mode).filter(e=>!n.mappings.includes(e)),"conjunction"),zD=e=>{const{params:{organizationId:t,eventId:n,delegationId:o},translate:s}=bd(),{shouldShowModeSelection:r}=lD();Zc(e.heading);const a=Ei(Si),{data:l}=Or({organizationId:t}),d=Mi(),c=Ei(e.ImportInputService),u=(0,V.useRef)(null),[m,h]=(0,V.useState)(!1),p=(0,V.useMemo)(()=>{try{const t={dateFormat:l.organization.dateFormat,datetimeFormat:l.organization.datetimeFormat,timeFormat:l.organization.timeFormat},n=JSON.parse(d.getItem(tc[`${e.localStorageKeyPrefix}_FORMATS`])??"{}");return{...t,...n}}catch{return null}},[l.organization]),f=(0,V.useMemo)(()=>{const t=d.getItem(tc[`${e.localStorageKeyPrefix}_FORMATS`]);return t?JSON.parse(t):t},[e.localStorageKeyPrefix]),_=Ei(hD),x=(0,V.useCallback)((n,i)=>{i.form.change("input.tag",`${e.importTagPrefix}-csv-${As.c9.now().toFormat(ws)}`),(0,dD.parse)(n,{delimiter:i.values.input.csv.delimiter,preview:1,newline:i.values.input.csv.newline,quoteChar:i.values.input.csv.quoteChar,complete:({data:t,errors:n})=>{let o;if(!n.length||1===n.length&&"UndetectableDelimiter"===n[0].code){const n=t[0],s=OD({ImportInputService:e.ImportInputService,columns:n,customFields:e.customFields});try{o=JSON.parse(d.getItem(tc[`${e.localStorageKeyPrefix}_MAPPINGS`])??"{}")}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}i.form.change("input.mappings",n.map((e,t)=>void 0!==o[e]?o[e]:s[t])),e.skipMappingIfAllColumnsMatch&&n.every(e=>s.includes(e))&&h(!0)}}});try{i.form.change("input.presets",JSON.parse(d.getItem(tc[`${e.localStorageKeyPrefix}_PRESETS`](t))??"[]")),r&&i.form.change("input.mode",d.getItem(tc[`${e.localStorageKeyPrefix}_MODE`])??jt.Upsert)}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}},[e.customFields]);return(0,i.jsx)(Zu.Provider,{value:{designSystem:Yu},children:(0,i.jsx)(zp,{category:s("nouvel_import_48306"),color:"dark",fallbackClosePath:e.closePath,heading:e.heading,children:(0,i.jsx)(Op,{ref:u,children:(0,i.jsxs)(VI,{containerRef:u,initialValues:{input:c.default(p).input},isEdit:!1,summaryStep:(0,i.jsx)(TD,{returnLink:e.returnLink}),onSubmit:async({input:i})=>{if(!((e,t)=>e.IMPORT_COLUMNS_REQUIRED(t.mode).every(e=>t.mappings.includes(e)))(e.ImportInputService,i))return{[ad.Ym]:s("you_have_not_ma_46806",DD(e.ImportInputService,a,i))};(n=>{const i=n.csv.file;if(!i)throw new Error("No file in input!");(0,dD.parse)(i,{delimiter:n.csv.delimiter,preview:1,newline:n.csv.newline,quoteChar:n.csv.quoteChar,complete:({data:t,errors:i})=>{if(!i.length)try{const i=t[0],o=OD({ImportInputService:e.ImportInputService,columns:i,customFields:e.customFields}),s=JSON.parse(d.getItem(tc[`${e.localStorageKeyPrefix}_MAPPINGS`])??"{}"),r={};for(const[e,t]of n.mappings.entries()){const n=i[e];t?r[n]=t:delete s[n],g(o[e])&&!r[n]&&(r[n]=null)}d.setItem(tc[`${e.localStorageKeyPrefix}_MAPPINGS`],JSON.stringify({...s,...r}))}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}}});try{const i=JSON.parse(d.getItem(tc[`${e.localStorageKeyPrefix}_PRESETS`](t))??"[]");d.setItem(tc[`${e.localStorageKeyPrefix}_PRESETS`](t),JSON.stringify([...new Map([...i,...n.presets].map(e=>[e.customFieldId,e])).values()])),d.setItem(tc[`${e.localStorageKeyPrefix}_FORMATS`],JSON.stringify(n.csv.formats?Object.fromEntries(Object.entries(n.csv.formats).filter(([e,t])=>g(t))):{})),r&&d.setItem(tc[`${e.localStorageKeyPrefix}_MODE`],n.mode)}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}})(i);const l=(e=>{const t={...e.csv};return delete t.file,{...e,csv:t}})(i);try{const{jobId:i}=await e.mutate({organizationId:t,eventId:n,delegationId:o,input:l});e.checkImport(i,t,n)}catch{}},children:[(0,i.jsx)(BI,{actions:t=>(0,i.jsxs)(rd,{gap:"3",children:[(0,i.jsx)(kd,{disabled:!RD(t.form),onClick:t.handleSubmit,children:s("suivant_donn_08625")}),f&&(0,i.jsx)(kd,{color:"invisible-gray",onClick:()=>{d.removeItem(tc[`${e.localStorageKeyPrefix}_FORMATS`]),window.location.reload()},children:s("clear_saved_set_61259")})]}),heading:s("choix_du_fichie_30517"),render:t=>(0,i.jsx)(pD,{ImportInputService:e.ImportInputService,customFields:e.customFields,formRenderProps:t,localStorageKeyPrefix:e.localStorageKeyPrefix,onChange:x}),schema:_.settingsStepSchema()}),!m&&(0,i.jsx)(BI,{actions:e=>(0,i.jsx)(kd,{type:"submit",onClick:e.handleSubmit,children:s("importer_90688")}),heading:s("donn_es_impor_12371"),render:t=>(0,i.jsx)(ED,{ImportInputService:e.ImportInputService,additionalCategories:e.additionalCategories,additionalOptions:e.additionalOptions,customFields:e.customFields,formRenderProps:t,importTagPrefix:e.importTagPrefix,isTagInputDisabled:e.isTagInputDisabled,localStorageKeyPrefix:e.localStorageKeyPrefix}),schema:c.mappingStepSchema()})]})})})})};var $D;let PD=class extends hD{static{$D=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...hD.IMPORT_COLUMNS_DEFAULT,Email:"email",TicketId:"ticketId"};static IMPORT_COLUMNS_REQUIRED=e=>e===jt.Update?[$D.IMPORT_COLUMNS_DEFAULT.Id]:[$D.IMPORT_COLUMNS_DEFAULT.Email];constructor(e,t){super(e,t),this.csvInputService=e}};PD=$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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[cD,Si])],PD);const MD=({accreditations:e,accreditationsProfiles:t,closePath:n,customFields:o})=>{const{params:{organizationId:s,eventId:r},translate:a}=bd(),l=Ei(Cm),{mutate:d}=function(e={}){return Di("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:c}=HI(),u=(0,V.useMemo)(()=>{const n=e.map(e=>({...e,fields:e.slots.map(t=>({id:t.id,slug:`accreditation_slot_${t.id}`,name:qg(l,t,e.name,{accreditation:{includeNameAtEnd:!0}})}))})),i=Object.values((0,Vu.A)(t,e=>e.accreditationProfileCategory.id)).map(e=>({id:e[0].accreditationProfileCategory.id,name:e[0].accreditationProfileCategory.name,fields:e.map(e=>({id:e.id,slug:`accreditation_profile_${e.id}`,name:e.name}))}));return n.concat(i)},[e,t]);return(0,i.jsx)(aD,{alertDescriptionKey:"to_add_a_member_56912",createCard:{heading:a("ajouter_un_memb_78965"),description:a("cr_e_un_nouveau_57873")},updateCard:{heading:a("mettre_jour_d_10088"),description:a("aucun_membre_se_13414")},upsertCard:{heading:a("ajouter_et_mett_05009"),description:a("si_plusieurs_me_88818")},children:(0,i.jsx)(zD,{ImportInputService:PD,additionalCategories:u,checkImport:c,closePath:n,customFields:o,heading:a("import_de_membr_48618"),importTagPrefix:"volunteers",localStorageKeyPrefix:"VOLUNTEERS_IMPORT",mutate:d,returnLink:(0,i.jsx)(bm,{to:r?fs.VOLUNTEERS(s,r):ro.COMMUNITY_USERS({organizationId:s}),children:a("revenir_aux_mem_33379")})})})},FD=()=>{const{params:{organizationId:e}}=bd(),{data:t,loader:n}=sl({organizationId:e,variety:Te.UserInfo});return n||(0,i.jsx)(MD,{accreditations:[],accreditationsProfiles:[],closePath:ro.COMMUNITY_USERS({organizationId:e}),customFields:t.organization.customFields.nodes})},ND=()=>{const{params:{organizationId:e,eventId:t}}=bd(),{data:n,loader:o}=sl({organizationId:e,variety:Te.UserInfo,eventId:t});return o||(0,i.jsx)(MD,{accreditations:n.organization.event?.accreditations.nodes??[],accreditationsProfiles:n.organization.event?.accreditationsProfiles.nodes??[],closePath:fs.VOLUNTEERS(e,t),customFields:n.organization.customFields.nodes})};function LD(e){switch(e){case Ge.Active:return{color:"success",leftIcon:"play"};case Ge.Error:return{color:"error",leftIcon:"triangle-exclamation"};case Ge.Paused:return{color:"warning",leftIcon:"pause"};default:return vd()}}const BD=[Ke.CanLeadersAddMembers,Ke.CanLeadersDeleteMembers,Ke.CanLeadersDuplicateMembers,Ke.CanLeadersEditColumns,Ke.CanLeadersEditCustomFields,Ke.CanLeadersEditMembers,Ke.CanLeadersImportMembers,Ke.CanLeadersSeeHiddenAccreditationsSlots];let VD=class extends ic{constructor(e){super(e)}workflowInputDefault(e){return{name:e?.name??"",state:e?.state??Ge.Active,frequency:e?.frequency??Ze.Every10Minutes,trigger:e?.trigger??qe.VolunteersSegment,action:e?.action??He.SetCustomField,data:(0,rv.A)({recipients:Ye.View},e?.data??{}),onExit:e?.onExit??Xe.Revert}}workflowInputSchema(){return c.Ik().shape({name:c.Yj().required(this.t("le_nom_est_requ_61536")),state:c.Yj().required(this.t("le_statut_est_r_13164")).oneOf(vi,this.t("le_statut_est_r_13164")),action:c.Yj().required(this.t("l_action_est_re_08934")).oneOf(pi,this.t("l_action_est_re_08934")),trigger:c.Yj().required(this.t("le_d_clencheur_32555")).oneOf(bi,this.t("le_d_clencheur_32555")),data:c.gl().required().test("positions-valid",this.t("les_missions_so_67594"),function(){return this.parent.trigger!==qe.Assigned||Bs(this.parent.data.positionsCategoriesIds)||Bs(this.parent.data.positionsIds)||Bs(this.parent.data.positionsSlotsIds)||Bs(this.parent.data.positionsSegmentsIds)}).test("volunteers-segment-id-valid",this.t("la_vue_est_requ_65480"),function(){return this.parent.trigger!==qe.VolunteersSegment||Number.isInteger(this.parent.data.volunteersSegmentId)}).test("delegations-segment-id-valid",this.t("la_vue_est_requ_65480"),function(){return this.parent.trigger!==qe.DelegationsSegment||Number.isInteger(this.parent.data.delegationsSegmentId)}).test("form-id-valid",this.t("le_formulaire_e_77404"),function(){return this.parent.trigger!==qe.FormSubmit||Number.isInteger(this.parent.data.formId)}).test("campaign-id-valid",this.t("la_campagne_est_06708"),function(){return this.parent.trigger!==qe.VolunteersSegment||this.parent.action!==He.SendCampaign||Number.isInteger(this.parent.data.campaignId)}).test("campaign-recipients-valid",this.t(this.t("les_destinatair_82420")),function(){return this.parent.trigger!==qe.VolunteersSegment||this.parent.action!==He.SendCampaign||Ii.includes(this.parent.data.recipients)}).test("campaign-recipients-users-infos",this.t("la_liste_des_me_55886"),function(){return this.parent.trigger!==qe.VolunteersSegment||this.parent.action!==He.SendCampaign||this.parent.data.recipients!==Ye.UsersInfosIds||Bs(this.parent.data.usersInfosIds)}).test("custom-field-id-valid",this.t("le_champ_person_80074"),function(){return(this.parent.trigger!==qe.VolunteersSegment&&this.parent.trigger!==qe.DelegationsSegment||this.parent.action!==He.SetCustomField)&&(this.parent.trigger!==qe.FormSubmit||this.parent.action!==He.CreateDelegation)||Number.isInteger(this.parent.data.customFieldId)}).test("duplicate-member-custom-fields-valid",this.t("le_champ_lier_69891"),function(){return this.parent.action!==He.DuplicateMember||(this.parent.data.customFields||[]).every(e=>!0!==e.fromField||g(e.value))}).test("accreditations-valid",this.t("les_accr_ditati_27943"),function(){return this.parent.trigger!==qe.Assigned&&(this.parent.trigger!==qe.VolunteersSegment||this.parent.action!==He.AddAccreditations&&this.parent.action!==He.DeleteAccreditations)||Bs(this.parent.data.accreditationsSlotsIds)}).test("delegation-id-valid",this.t("la_d_l_gation_c_71684"),function(){return this.parent.trigger!==qe.FormSubmit||this.parent.action!==He.CreateDelegation||Number.isInteger(this.parent.data.delegationId)}).test("event-id-valid",this.t("l_v_nement_est_88155"),function(){return this.parent.trigger!==qe.VolunteersSegment||this.parent.action!==He.AddEvent||Number.isInteger(this.parent.data.eventId)}).test("permissions-valid",this.t("les_permissions_82998"),function(){return this.parent.trigger!==qe.DelegationsSegment||this.parent.action!==He.AddDelegationPermissions&&this.parent.action!==He.DeleteDelegationPermissions||Bs(this.parent.data.permissions)&&this.parent.data.permissions.every(e=>BD.includes(e))}),onExit:c.Yj().required(this.t("l_action_de_fin_64764")).oneOf(_i,this.t("l_action_de_fin_64764"))})}};VD=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],VD);const UD=e=>(0,i.jsxs)(rd,{css:{background:"white",bd:!0,padding:"$4",width:"min($container, 100%)"},direction:"column",gap:"5",children:[(0,i.jsxs)(rd,{css:{borderBottom:"1px solid $gray200",paddingBottom:"$3"},gap:"3",width:1,children:[(0,i.jsx)(Xv,{color:"gray",icon:e.icon}),(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{font:"gray500 textXs regular",children:e.category}),(0,i.jsx)(ka,{font:"gray800 textSm medium",children:e.title})]})]}),(0,i.jsx)(rd,{direction:"column",gap:"4",width:1,children:e.children})]}),WD=e=>{const{translate:t,params:{eventId:n}}=bd(),{hasFeature:o}=_v(),{event:s}=dv(),r=(!s||s.useCampaigns)&&e.workflow.trigger===qe.VolunteersSegment,a=e.workflow.trigger===qe.VolunteersSegment||e.workflow.trigger===qe.DelegationsSegment,l=e.workflow.trigger===qe.DelegationsSegment,d=!!n&&o(Ae.Accreditation)&&(s?.useAccreditations??!1)&&(e.workflow.trigger===qe.Assigned||e.workflow.trigger===qe.VolunteersSegment),c=!!n&&o(Ae.Accreditation)&&(s?.useAccreditations??!1)&&e.workflow.trigger===qe.VolunteersSegment,u=o(Ae.Delegation)&&e.workflow.trigger===qe.FormSubmit,m=!n&&e.workflow.trigger===qe.VolunteersSegment,h=!!n&&e.workflow.trigger===qe.VolunteersSegment;return(0,i.jsx)(UD,{category:t("action_s_lectio_18617"),icon:"lasso-sparkles",title:t("alors_automatiq_16268"),children:(0,i.jsxs)(Gp,{isSearchVisible:!0,name:"workflow.action",placeholder:t("choisir_une_act_51814"),state:e.isEdit?"disabled":"active",children:[r&&(0,i.jsx)("option",{value:He.SendCampaign,children:t("SendCampaign")}),a&&(0,i.jsx)("option",{value:He.SetCustomField,children:t("SetCustomField")}),d&&(0,i.jsx)("option",{value:He.AddAccreditations,children:t("AddAccreditations")}),c&&(0,i.jsx)("option",{value:He.DeleteAccreditations,children:t("DeleteAccreditations")}),u&&(0,i.jsx)("option",{value:He.CreateDelegation,children:t("cr_er_une_d_l_g_23035")}),m&&(0,i.jsx)("option",{value:He.AddEvent,children:t("AddEvent")}),h&&(0,i.jsx)("option",{value:He.DuplicateMember,children:t("DuplicateMember")}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("option",{value:He.LockDelegation,children:t("LockDelegation")}),(0,i.jsx)("option",{value:He.UnlockDelegation,children:t("UnlockDelegation")}),(0,i.jsx)("option",{value:He.AddDelegationPermissions,children:t("AddDelegationPermissions")}),(0,i.jsx)("option",{value:He.DeleteDelegationPermissions,children:t("DeleteDelegationPermissions")})]})]})})},GD=()=>{const{translate:e,params:{eventId:t}}=bd(),n=Ei(Cm),{data:o}=Gr({eventId:t,loadIsBlocked:!1}),s=(0,V.useMemo)(()=>Kg(n,o.event?.accreditationsCategories??[]),[o.event,n]);return(0,i.jsx)(UD,{category:e("liste_des_accr_02647"),icon:"badge-check",title:e("les_accr_ditati_19289"),children:(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"workflow.data.accreditationsSlotsIds",children:s})})},qD=()=>{const{translate:e,params:{organizationId:t}}=bd(),{data:n}=Oi("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)(UD,{category:e("liste_des_v_ne_29929"),icon:"plus",title:e("l_v_nement_sui_45117"),children:(0,i.jsx)(Gp,{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))})})},HD=e=>{const{translate:t,params:{organizationId:n}}=bd(),[o,s,r]=gm(""),{usersInfosOptions:a,isLoading:l}=Lv({organizationId:n,eventId:null,hasSelected:Bs(e.workflow.data.usersInfosIds),nameDebounced:s,userInfoIds:e.workflow.data.usersInfosIds||[]});return(0,i.jsxs)(UD,{category:t("destinataires_19592"),icon:"users",title:t("aux_membres_sui_99877"),children:[(0,i.jsxs)(Gp,{name:"workflow.data.recipients",children:[(0,i.jsx)("option",{value:Ye.View,children:t("aux_membres_de_71046")}),(0,i.jsx)("option",{value:Ye.DelegationsLeaders,children:t("aux_responsable_38147")}),(0,i.jsx)("option",{value:Ye.PositionsLeaders,children:t("aux_responsable_85620")}),(0,i.jsx)("option",{value:Ye.UsersInfosIds,children:t("_certains_memb_91094")})]}),e.workflow.data.recipients===Ye.UsersInfosIds&&(0,i.jsx)(Gp,{isSearchLoading:l,isSearchVisible:!0,label:t("liste_des_membr_89037"),multiple:!0,name:"workflow.data.usersInfosIds",searchElement:(0,i.jsx)(Qd,{icon:"magnifying-glass",name:o,placeholder:t("rechercher_un_m_05904"),state:"search",onChange:r}),children:a})]})},KD=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{data:s}=Oi("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?ke.Event:ke.Organization,formId:e.workflow.data.formId},[]);const r=(0,V.useMemo)(()=>s.organization?.delegations.nodes??[],[s.organization]),a=(0,V.useMemo)(()=>(s.organization?.form.elements??[]).flatMap(e=>e.customField?.fieldType===Oe.Text?[e.customField]:[]),[s.organization]);return(0,i.jsxs)(UD,{category:t("liste_des_d_l_g_86270"),icon:"users",title:t("la_d_l_gation_s_46776"),children:[(0,i.jsx)(Gp,{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)(Gp,{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))})]})},YD=e=>{const{translate:t}=bd();return(0,i.jsx)(UD,{category:t("liste_des_droit_83212"),icon:"user-shield",title:(e.workflow.action,He.AddDelegationPermissions,t("les_droits_suiv_96404")),children:(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"workflow.data.permissions",placeholder:t("choisir_des_dro_64167"),children:BD.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))})})},ZD=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{data:s}=Oi("query WorkflowDelegationsSegments(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n segmentsFolders(level: $level, segmentType: Delegations, eventId: $eventId) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{organizationId:n,eventId:o,level:o?ke.Event:ke.Organization},[]);return(0,i.jsx)(UD,{category:t("liste_des_d_l_g_86270"),icon:"people-group",title:t("une_vue_parmi_l_98342"),children:(0,i.jsx)(Gp,{isSearchVisible:!0,name:"workflow.data.delegationsSegmentId",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))})})},XD=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{data:s}=Jl({organizationId:n,eventId:o,variety:Te.UserInfo});return(0,i.jsx)(UD,{category:t("param_tres_du_n_85818"),icon:"user",title:t("on_duplique_le_59761"),children:(0,i.jsx)(rd,{direction:"column",children:(0,i.jsx)(kj,{canLinkToField:!0,change:e.change,customFields:s.organization?.customFields.nodes??[],name:"workflow.data.customFields",values:e.workflow.data.customFields||[]})})})},JD=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{data:s}=Oi("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?ke.Event:ke.Organization},[]);return(0,i.jsx)(UD,{category:t("liste_des_formu_69259"),icon:"file-lines",title:t("un_formulaire_p_61128"),children:(0,i.jsx)(Gp,{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))})})},QD=e=>{const{translate:t}=bd();return(0,i.jsx)(UD,{category:t("finalisation_94065"),icon:"hand-sparkles",title:e.workflow.trigger===qe.DelegationsSegment?t("quand_la_d_l_ga_62267"):t("quand_le_membre_90818"),children:(0,i.jsxs)(Gp,{name:"workflow.onExit",placeholder:t("choisir_une_act_51814"),children:[(0,i.jsx)("option",{value:Xe.Revert,children:e.workflow.action===He.SetCustomField?t("remettre_l_anci_37071"):e.workflow.action===He.AddAccreditations?t("supprimer_les_a_39948"):e.workflow.action===He.DeleteAccreditations?t("ajouter_les_acc_34000"):e.workflow.action===He.LockDelegation?t("UnlockDelegation"):e.workflow.action===He.UnlockDelegation?t("LockDelegation"):e.workflow.action===He.AddDelegationPermissions?t("retirer_les_dro_34459"):e.workflow.action===He.DeleteDelegationPermissions?t("remettre_les_dr_74368"):""}),(0,i.jsx)("option",{value:Xe.Keep,children:t("ne_rien_faire_76456")})]})})},ez=e=>{const{translate:t,params:{eventId:n}}=bd(),o=Ei(Yh),{data:s}=Oi("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,V.useMemo)(()=>(0,cm.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,V.useMemo)(()=>(0,cm.A)(s.event?.positionsCategories??[],e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,cm.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,V.useMemo)(()=>(s.event?.positionsCategories??[]).flatMap(e=>(0,cm.A)(e.positions,e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,cm.A)(e.slots,e=>e.range.start.toMillis()).map(t=>{const n=ng(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,V.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)(UD,{category:t("liste_des_missi_82050"),icon:"sitemap",title:t("une_mission_par_94044"),children:[(0,i.jsx)(Gp,{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)(Gp,{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)(Gp,{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)(Gp,{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})]})},tz=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=bd(),{data:o}=Oi("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?ke.Event:ke.Organization},[]);return(0,i.jsx)(UD,{category:e("liste_des_campa_60034"),icon:"paper-plane",title:e("la_campagne_sui_83193"),children:(0,i.jsx)(Gp,{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))})})},nz=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{data:s}=Jl({organizationId:n,eventId:o,variety:e.workflow.trigger===qe.DelegationsSegment?Te.Delegation:Te.UserInfo}),r=(0,V.useMemo)(()=>s.organization?.customFields.nodes??[],[s.organization]),a=(0,V.useMemo)(()=>yj(r),[r]),l=r.find(t=>t.id===e.workflow.data.customFieldId);return(0,i.jsxs)(UD,{category:t("liste_des_champ_94862"),icon:"text",title:t("le_champ_suivan_27303"),children:[(0,i.jsx)(Gp,{isSearchVisible:!0,label:t("CustomField"),name:"workflow.data.customFieldId",placeholder:t("choisir_un_cham_67587"),children:a}),l&&(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray700 textSm medium",children:t("nouvelle_valeur_39039",l.name)}),(0,i.jsx)(xj,{campaigns:[],categories:[],change:e.change,customDocuments:[],customField:l,delegationsSpaceLayouts:[],forms:[],name:"workflow.data.customFieldValue",slug:l.slug,tags:[],traces:[],value:e.workflow.data?.customFieldValue}),Gb(l)&&(0,i.jsx)(Fp,{name:"workflow.data.addValues",children:t("ajouter_les_val_22996")})]})]})},iz=e=>{const{translate:t,params:{eventId:n}}=bd(),{hasFeature:o}=_v(),{event:s}=dv(),r=!!n&&(s?.usePositions??!1)&&(s?.useAccreditations??!1)&&o(Ae.Accreditation),a=(s?.useForms??!0)&&(s?.useDelegations??!0)&&o(Ae.Delegation),l=(s?.useDelegations??!0)&&o(Ae.Delegation);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba.Yr,{name:"workflow.trigger",children:t=>{t===qe.Assigned?e.change("workflow.action",He.AddAccreditations):t===qe.FormSubmit?e.change("workflow.action",He.CreateDelegation):e.change("workflow.action",He.SetCustomField),e.change("workflow.data.customFieldId",void 0),e.change("workflow.data.customFieldValue",void 0)}}),(0,i.jsx)(UD,{category:t("initialisation_38640"),icon:"hand-sparkles",title:t("quand_18117"),children:(0,i.jsxs)(Gp,{isSearchVisible:!0,name:"workflow.trigger",placeholder:t("choisir_un_d_cl_85012"),state:e.isEdit?"disabled":"active",children:[r&&(0,i.jsx)("option",{value:qe.Assigned,children:t("un_membre_est_a_48435")}),a&&(0,i.jsx)("option",{value:qe.FormSubmit,children:t("FormSubmit")}),(0,i.jsx)("option",{value:qe.VolunteersSegment,children:t("VolunteersSegment")}),l&&(0,i.jsx)("option",{value:qe.DelegationsSegment,children:t("DelegationsSegment")})]})})]})},oz=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{data:s}=Oi("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?ke.Event:ke.Organization},[]);return(0,i.jsx)(UD,{category:t("liste_des_membr_89037"),icon:"user-group",title:t("une_vue_parmi_l_98342"),children:(0,i.jsx)(Gp,{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))})})},sz=()=>(0,i.jsx)(rd,{height:32,justify:"center",width:1,children:(0,i.jsx)(ka,{css:{borderRight:"1px solid $gray200"},height:1})}),rz=e=>{const{translate:t}=bd(),n=e.workflow.data,o=e.workflow.trigger===qe.VolunteersSegment,s=e.workflow.trigger===qe.DelegationsSegment,r=e.workflow.trigger===qe.Assigned,a=e.workflow.trigger===qe.FormSubmit,l=e.workflow.trigger===qe.VolunteersSegment&&"number"==typeof n.volunteersSegmentId||e.workflow.trigger===qe.Assigned&&(Bs(n.positionsCategoriesIds)||Bs(n.positionsIds)||Bs(n.positionsSlotsIds)||Bs(n.positionsSegmentsIds))||e.workflow.trigger===qe.FormSubmit&&"number"==typeof n.formId||e.workflow.trigger===qe.DelegationsSegment&&"number"==typeof n.delegationsSegmentId,d=l&&e.workflow.trigger===qe.VolunteersSegment&&e.workflow.action===He.SendCampaign,c=d&&"number"==typeof e.workflow.data.campaignId,u=l&&(e.workflow.trigger===qe.VolunteersSegment||e.workflow.trigger===qe.DelegationsSegment)&&e.workflow.action===He.SetCustomField,m=l&&e.workflow.action===He.AddAccreditations,h=l&&e.workflow.action===He.DeleteAccreditations,g=l&&e.workflow.action===He.CreateDelegation,p=l&&e.workflow.action===He.AddEvent,f=l&&e.workflow.action===He.DuplicateMember,_=l&&(e.workflow.action===He.LockDelegation||e.workflow.action===He.UnlockDelegation),x=l&&(e.workflow.action===He.AddDelegationPermissions||e.workflow.action===He.DeleteDelegationPermissions),I=e.workflow.trigger===qe.VolunteersSegment&&(u||m||h)||e.workflow.trigger===qe.DelegationsSegment&&(u||_||x),v=_||x||d||u||m||g||p;return(0,i.jsxs)(rd,{align:"center",direction:"column",children:[(0,i.jsx)(Nd,{}),e.workflow.state===Ge.Error&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(zd,{alertStyle:"warning",width:"min($container, 100%)",children:[(0,i.jsx)($d,{children:t("une_erreur_est_38715")}),(0,i.jsx)(Pd,{children:e.workflow.data.errorMessage})]}),(0,i.jsx)(md,{height:"6"})]}),(0,i.jsx)(rd,{css:{background:"white",bd:!0,borderRadius:"50px",padding:"$2 $4"},children:(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("d_but_41840")})}),(0,i.jsx)(sz,{}),(0,i.jsx)(iz,{change:e.change,isEdit:e.isEdit,workflow:e.workflow}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sz,{}),(0,i.jsx)(oz,{hasBeenExecuted:e.hasBeenExecuted,isEdit:e.isEdit})]}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sz,{}),(0,i.jsx)(ZD,{isEdit:e.isEdit})]}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sz,{}),(0,i.jsx)(ez,{isEdit:e.isEdit})]}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sz,{}),(0,i.jsx)(JD,{isEdit:e.isEdit})]}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sz,{}),(0,i.jsx)(WD,{isEdit:e.isEdit,workflow:e.workflow})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sz,{}),(0,i.jsx)(tz,{})]}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sz,{}),(0,i.jsx)(HD,{workflow:e.workflow})]}),u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sz,{}),(0,i.jsx)(nz,{change:e.change,workflow:e.workflow})]}),(m||h)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sz,{}),(0,i.jsx)(GD,{})]}),g&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sz,{}),(0,i.jsx)(KD,{workflow:e.workflow})]}),p&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sz,{}),(0,i.jsx)(qD,{})]}),f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sz,{}),(0,i.jsx)(XD,{change:e.change,workflow:e.workflow})]}),x&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sz,{}),(0,i.jsx)(YD,{workflow:e.workflow})]}),I&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sz,{}),(0,i.jsx)(QD,{workflow:e.workflow})]}),v&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sz,{}),(0,i.jsx)(rd,{css:{background:"white",bd:!0,borderRadius:"50px",padding:"$2 $4"},children:(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("fin_60104")})})]})]})},az=V.forwardRef((e,t)=>{const{history:n,translate:o,params:{organizationId:s,eventId:r}}=bd(),{user:a}=Li(),l=um(),[d,c]=V.useState(!1),u=V.useCallback(()=>{JSON.stringify(e.workflow)===e.initialValuesString?n.goBack(Dx.WORKFLOWS({organizationId:s,eventId:r})):c(!0)},[e.workflow,e.initialValuesString,c]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zp,{button:(0,i.jsx)(Mv,{permissions:Ov.WORKFLOW_EDIT,children:(0,i.jsx)(kd,{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",heading:e.isEdit?e.name:o("nouvelle_automa_77863"),onClose:u,children:(0,i.jsxs)(rd,{height:1,children:[(0,i.jsxs)(rd,{css:{background:"white",padding:"$6"},direction:"column",gap:"7",width:420,children:[(0,i.jsx)(ka,{font:"gray800 textMd medium",children:o("param_tres_de_l_25166")}),(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(ec,{label:o("nom_de_l_automa_04883"),name:"workflow.name"}),(0,i.jsx)(Ev,{label:o("State"),name:"workflow.state",children:l(vi.filter(e=>e!==Ge.Error))}),(0,i.jsxs)(Ev,{label:o("Frequency"),name:"workflow.frequency",state:xm(a.email)?void 0:"disabled",children:[(0,i.jsx)("option",{value:Ze.Every10Minutes,children:o(Ze.Every10Minutes)}),(0,i.jsx)("option",{value:Ze.Every5Minutes,children:o(Ze.Every5Minutes)}),(0,i.jsx)("option",{value:Ze.Every2Minutes,children:o(Ze.Every2Minutes)}),(0,i.jsx)("option",{value:Ze.EveryMinute,children:o(Ze.EveryMinute)})]})]})]}),(0,i.jsx)(rd,{ref:t,css:{background:"$gray50",flex:"1",overflowY:"auto",padding:"$8"},direction:"column",height:1,children:(0,i.jsx)(rz,{change:e.change,hasBeenExecuted:e.hasBeenExecuted,isEdit:e.isEdit,workflow:e.workflow})})]})}),(0,i.jsx)(rE,{fallbackPath:Dx.WORKFLOWS({organizationId:s,eventId:r}),isOpen:d,onClose:()=>c(!1)})]})});az.displayName="UpdateWorkflowForm";const lz=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=bd(),{showNotification:r}=HI(),a=(0,V.useRef)(null),l=Ei(ld),d=Ei(VD),[c,u]=(0,V.useState)(""),m=(0,V.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.name??""):n("cr_ation_d_une_01202"),[e.initialValues]);return Zc(m),(0,V.useEffect)(()=>{u(JSON.stringify(e.initialValues))},[e.initialValues]),(0,i.jsx)(Vd,{customErrorRef:a,height:1,initialValues:{workflow:e.initialValues},render:({form:t,handleSubmit:n,submitting:o,values:s})=>(0,i.jsx)(az,{ref:a,category:m,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(Dx.WORKFLOWS({organizationId:o,eventId:s}))}})},dz=()=>{const{params:{organizationId:e,eventId:t}}=bd(),n=Ei(VD),{mutate:o}=function(e={}){return Di("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,V.useMemo)(()=>n.workflowInputDefault(),[]);return(0,i.jsx)(lz,{hasBeenExecuted:!1,initialValues:s,isEdit:!1,mutate:n=>o({organizationId:e,eventId:t,workflow:n})})},cz=()=>{const{params:{organizationId:e,eventId:t,workflowId:n}}=bd(),o=Ei(VD),{mutate:s}=function(e={}){return Di("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}=Oi("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 onExit\n\n data {\n accreditationsSlotsIds\n addValues\n campaignId\n customFieldId\n customFieldValue\n customFields\n delegationId\n delegationsSegmentId\n errorMessage\n eventId\n formId\n permissions\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,V.useMemo)(()=>o.workflowInputDefault(r.organization?.workflow),[r.organization]);return a||(0,i.jsx)(lz,{hasBeenExecuted:r.organization?.workflow.hasBeenExecuted,initialValues:l,isEdit:!0,mutate:i=>s({organizationId:e,eventId:t,workflowId:n,workflow:i})})};let uz=class extends ic{translationService;constructor(e){super(e),this.translationService=e}segmentFolderInputDefault(e,t){return{name:t?.name??"",segmentType:e}}};uz=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],uz);const mz=e=>{const t=Ti(),{eventId:n,organizationId:o,segmentType:s,reload:r}=SC(),{mutate:a}=function(e={}){return Di("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 Di("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=Ei(uz);return(0,i.jsx)(Ej,{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)(ec,{label:t("nom_du_dossier_95781"),name:"segmentFolder.name"})})},hz=e=>{const t={type:"segment",segmentId:e.segment.id},{setNodeRef:n,style:o,handleProps:s}=Hm(`s-${e.segment.id}`,t),[r,a]=V.useState(!1),l=V.useCallback(t=>{e.setSegmentsFolders((0,Wm.jM)(n=>{n[e.segmentFolderIndex].segments[e.index].name=t}))},[e.segmentFolderIndex,e.index,e.setSegmentsFolders]),d=V.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.jsxs)(rd,{ref:n,css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",padding:"$3"},gap:"3",align:"center",style:o,children:[(0,i.jsx)(ka,{color:"gray300",css:{cursor:"pointer"},...s,children:(0,i.jsx)(Id,{icon:"grip-vertical",iconStyle:"solid"})}),r?(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(Qd,{value:e.segment.name,onChange:l})}):(0,i.jsx)(ka,{css:{flex:"1"},font:"gray900 textSm medium",children:e.segment.name}),(0,i.jsx)(kd,{color:"white",leftIcon:r?"check":"pen",size:"sm",onClick:()=>a(!r)}),(0,i.jsx)(kd,{color:"white",disabled:!e.canDelete,leftIcon:"trash-can",size:"sm",onClick:d})]})},gz=e=>{const[t,n]=V.useState(!1),o={type:"segmentFolder",segmentFolderId:e.segmentFolder.id},{setNodeRef:s,style:r,handleProps:a}=Hm(`sf-${e.segmentFolder.id}`,o),l={type:"segmentFolderSegments",segmentFolderId:e.segmentFolder.id},{setNodeRef:d}=(0,th.zM)({id:`drop-sf-${e.segmentFolder.id}`,data:l}),c=V.useCallback(t=>{e.setSegmentsFolders((0,Wm.jM)(n=>{n[e.index].name=t}))},[e.index,e.setSegmentsFolders]);return(0,i.jsxs)(rd,{ref:s,css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$sm"},direction:"column",style:r,children:[(0,i.jsxs)(rd,{align:"center",css:{padding:"$4"},gap:"3",children:[(0,i.jsx)(ka,{color:"gray300",css:{cursor:"pointer"},fontSize:"textMd",...a,children:(0,i.jsx)(Id,{icon:"grip-vertical",iconStyle:"solid"})}),t?(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(Qd,{value:e.segmentFolder.name,onChange:c})}):(0,i.jsx)(ka,{css:{flex:"1"},font:"gray800 textMd medium",children:e.segmentFolder.name}),(0,i.jsx)(kd,{color:"white",leftIcon:t?"check":"pen",size:"sm",onClick:()=>n(!t)}),(0,i.jsx)(kd,{color:"white",disabled:!e.canDelete,leftIcon:"trash-can",size:"sm",onClick:()=>{e.setSegmentsFolders(t=>t.filter(t=>t!==e.segmentFolder))}})]}),(0,i.jsx)(Gm.gB,{items:e.segmentFolder.segments.map(e=>`s-${e.id}`),strategy:Gm._G,children:(0,i.jsx)(rd,{ref:d,css:{background:"$gray100",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",padding:"$4"},direction:"column",gap:"2",children:e.segmentFolder.segments.map((t,n)=>(0,i.jsx)(hz,{canDelete:e.segmentFolder.segments.length>1,index:n,segment:t,segmentFolderIndex:e.index,setSegmentsFolders:e.setSegmentsFolders},t.id))})})]})},pz=[nh.FN,nh.Mk];function fz(e){return e?.data.current}function _z(e,t){return"segment"===t.type?e.findIndex(e=>e.segments.some(e=>e.id===t.segmentId)):e.findIndex(e=>e.id===t.segmentFolderId)}const xz=e=>{const t=Ti(),{segmentsFolders:n}=SC(),{mutate:o,isLoading:s}=function(e={}){return Di("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,V.useState)(n.map(e=>({id:e.id,name:e.name,segments:e.segments.map(e=>({id:e.id,name:e.name}))}))),l=(0,V.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=function(e,t){const n=(0,th.FR)((0,th.MS)(th.AN,{activationConstraint:{distance:4}}),(0,th.MS)(th.uN,{coordinateGetter:Gm.JR})),i=(0,V.useRef)(null),o=(0,V.useCallback)(t=>{const n=fz(t.active);if("segmentFolder"===n?.type)return(0,th.fp)({...t,droppableContainers:t.droppableContainers.filter(e=>"segmentFolder"===fz(e)?.type)});const i=t.droppableContainers.filter(e=>"segment"===fz(e)?.type),[o]=(0,th.TT)({...t,droppableContainers:t.droppableContainers.filter(e=>"segmentFolderSegments"===fz(e)?.type)});if(o){const n=_z(e,fz(t.droppableContainers.find(e=>e.id===o.id))),s=i.filter(t=>e[n].segments.some(e=>e.id===fz(t).segmentId));return s.length>0?(0,th.fp)({...t,droppableContainers:s}):[o]}return(0,th.fp)({...t,droppableContainers:i})},[e]),s=(0,V.useCallback)(()=>{i.current=e},[e]),r=(0,V.useCallback)(({active:e,over:n})=>{const i=fz(e),o=fz(n);"segment"===i?.type&&o&&"segmentFolder"!==o.type&&t((0,Wm.jM)(e=>{const t=_z(e,i),n=_z(e,o);if(-1!==t&&-1!==n&&t!==n){const s=e[t],r=e[n],[a]=s.segments.splice(s.segments.findIndex(e=>e.id===i.segmentId),1),l="segment"===o.type?r.segments.findIndex(e=>e.id===o.segmentId):-1;r.segments.splice(-1===l?r.segments.length:l,0,a)}}))},[t]),a=(0,V.useCallback)(({active:e,over:n})=>{i.current=null;const o=fz(e),s=fz(n);o&&s&&e.id!==n.id&&("segmentFolder"===o.type&&"segmentFolder"===s.type?t(e=>Gs(e,_z(e,o),_z(e,s))):"segment"===o.type&&"segment"===s.type&&t((0,Wm.jM)(e=>{const t=e[_z(e,o)],n=t.segments.findIndex(e=>e.id===o.segmentId),i=t.segments.findIndex(e=>e.id===s.segmentId);-1!==i&&(t.segments=Gs(t.segments,n,i))})))},[t]),l=(0,V.useCallback)(()=>{i.current&&(t(i.current),i.current=null)},[t]);return{collisionDetection:o,modifiers:pz,sensors:n,onDragCancel:l,onDragEnd:a,onDragOver:r,onDragStart:s}}(r,a);return(0,i.jsx)(zp,{button:(0,i.jsx)(kd,{isLoading:s,onClick:l,children:t("enregistrer_06519")}),category:t("vues_personnali_80652"),heading:t("param_tres_de_v_66378"),onClose:e.onClose,children:(0,i.jsxs)(Op,{css:{background:"white"},children:[(0,i.jsxs)(rd,{align:"center",gap:"6",justify:"between",children:[(0,i.jsx)(ka,{font:"gray900 textLg semiBold",children:t("organisation_de_95776")}),(0,i.jsx)(kd,{color:"white",leftIcon:"folder-plus",onClick:()=>{const e=Math.min((0,Lh.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)(Dh,{height:"5"}),(0,i.jsx)(th.Mp,{...d,children:(0,i.jsx)(Gm.gB,{items:r.map(e=>`sf-${e.id}`),strategy:Gm._G,children:(0,i.jsx)(rd,{direction:"column",gap:"6",width:1,children:r.map((e,t)=>(0,i.jsx)(gz,{canDelete:r.length>1,index:t,segmentFolder:e,setSegmentsFolders:a},e.id))})})})]})})},Iz=e=>{const t=Ti(),{eventId:n,organizationId:o,segmentsFolders:s,reload:r}=SC(),{mutate:a}=function(e={}){return Di("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)(Ej,{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)(ka,{color:"gray900",fontWeight:"medium",children:t("vers_quel_dossi_86452")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(rd,{css:{overflowY:"auto"},direction:"column",gap:"3",children:s.map(e=>(0,i.jsx)(fE,{label:e.name,name:"segmentFolderId",value:e.id},e.id))})]})},vz=e=>{const{translate:t}=bd(),{eventId:n,organizationId:o,segmentsFolders:s,reload:r}=SC(),{mutate:a,isLoading:l}=function(e={}){return Di("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,V.useState)(e.segment.name),[u,m]=(0,V.useState)(e.segment.segmentFolderId),[h,p]=(0,V.useState)(e.segment.description||void 0),f=g(d);return(0,i.jsx)(Av,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"gear",subtitle:t("mettez_jour_l_55467"),children:t("mise_jour_de_80873")}),(0,i.jsxs)(jv,{gap:"4",children:[(0,i.jsx)(Qd,{label:t("nom_de_la_vue_66415"),value:d,onChange:c}),(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("dossier_00726"),shouldParseAsInt:!0,values:[u],onChange:e=>{Bs(e)&&m(e[0])},children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(qp,{label:t("Description"),value:h,onChange:p})]}),(0,i.jsx)(bv,{children:()=>(0,i.jsx)(kd,{disabled:!f,isLoading:l,onClick:async()=>{await a({organizationId:o,eventId:n,description:h,name:d,segmentFolderId:u,segmentId:e.segment.id}),r()},children:t("mettre_jour_85141")})})]})})},bz=xa("div",{alignItems:"center",color:"$gray700",cursor:"pointer",display:"flex",height:"32px",gap:"$space$2",px:"$3",width:"100%","&:hover":{"& .count":{background:"$primary500",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:"$primary50",borderRadius:"$1",color:"$primary500","& .count":{background:"$primary500",color:"white"},"& .count, & .count-admin":{background:"$primary500",color:"white"}},false:{"&:hover":{background:"$gray100",borderRadius:"$1",color:"$gray800"},"& .count, & .count-admin":{background:"$primary50",color:"$primary500"}}}}}),jz=(0,V.memo)(function(e){const{history:t,translate:n}=bd(),{canSegmentEdit:o,eventId:s,organizationId:r,segmentId:a,getSegmentPath:l,onSegmentClick:d,reload:c}=SC(),{mutate:u}=function(e={}){return Di("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:m}=function(e={}){return Di("mutation SegmentDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentId: SegmentId!\n) {\n segmentDuplicate(organizationId: $organizationId, eventId: $eventId, segmentId: $segmentId) {\n id\n }\n}\n",e)}(),{mutate:h}=function(e={}){return Di("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:g}=function(e={}){return Di("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)}(),[p,f]=(0,V.useState)(!1),[_,x]=(0,V.useState)(!1),[I,v]=(0,V.useState)(!1);return(0,i.jsxs)(bz,{selected:e.segment.id===a,onClick:()=>{d(e.segment.id),t.push(l(e.segment.id))},onMouseLeave:e=>{eu(e.target)},children:[(0,i.jsx)("div",{className:"name",title:e.segment.name,children:e.segment.name}),(0,i.jsx)("div",{className:o?"count-admin":"count",children:e.segment.count}),o&&(0,i.jsx)("div",{className:"ellipsis",onClick:Gd,children:(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)("div",{className:"trigger",children:(0,i.jsx)("i",{className:"fa-regular fa-ellipsis-vertical"})})}),(0,i.jsxs)(lu,{offset:0,placement:"bottom-end",children:[(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"pen",onClick:()=>f(!0),children:n("mettre_jour_85141")}),e.canMoveUpDown&&(0,i.jsx)(ru,{color:e.isFirst?"disabled":"default",icon:"arrow-up",onClick:async()=>{await g({organizationId:r,eventId:s,segmentId:e.segment.id}),c()},children:n("d_placer_vers_l_49863")}),e.canMoveUpDown&&(0,i.jsx)(ru,{color:e.isLast?"disabled":"default",icon:"arrow-down",onClick:async()=>{await h({organizationId:r,eventId:s,segmentId:e.segment.id}),c()},children:n("d_placer_vers_l_52432")}),e.canMoveFolder&&(0,i.jsx)(ru,{icon:"folder",onClick:()=>x(!0),children:n("d_placer_de_dos_65513")}),e.canDelete&&(0,i.jsx)(ru,{icon:"clone",onClick:async()=>{await m({organizationId:r,eventId:s,segmentId:e.segment.id}),c()},children:n("dupliquer_28256")})]}),(0,i.jsx)(MA,{children:e.canDelete&&(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>v(!0),children:n("supprimer_43083")})})]})]})}),p&&(0,i.jsx)(vz,{segment:e.segment,onClose:()=>{f(!1)}}),_&&(0,i.jsx)(Iz,{segment:e.segment,onClose:()=>{x(!1)}}),I&&(0,i.jsx)(DA,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_38950"),text:n("suppression_de_73669",e.segment.name),onClose:()=>{v(!1)},onDelete:async()=>{await u({organizationId:r,eventId:s,segmentId:e.segment.id}),c(),await e.onDelete()},children:e.segment.isUsedInWorkflow&&(0,i.jsx)(zd,{alertStyle:"warning",children:(0,i.jsx)(Pd,{children:n("cette_vue_est_u_58409")})})})]})}),Cz=e=>{const t=Ti(),{canSegmentEdit:n,eventId:o,organizationId:s,reload:r,segmentType:a}=SC(),{mutate:l}=function(e={}){return Di("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 Di("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 Di("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)}(),{mutate:u}=function(e={}){return Di("mutation SegmentFolderDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $segmentFolderId: SegmentsFolderId!\n $newEventId: EventId!\n) {\n segmentFolderDuplicate(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n newEventId: $newEventId\n )\n}\n",e)}(),[m,h]=(0,V.useState)(!1),[p,f]=(0,V.useState)(!1),[_,x]=(0,V.useState)(!1),[I,v]=(0,V.useState)(!1),[b,j]=(0,V.useState)(!1),C=(0,V.useCallback)(async()=>{const t=!_;x(t),await sv.segmentsFolders.put({id:e.segmentFolder.id,isOpen:t})},[_,e.segmentFolder.id]),y=(0,V.useCallback)(t=>u({organizationId:s,eventId:o,segmentFolderId:e.segmentFolder.id,newEventId:t}),[s,o,e.segmentFolder,u]),A=(0,V.useMemo)(()=>g(e.search)?e.segmentFolder.segments.filter(t=>Vm(t,e.search)):e.segmentFolder.segments,[e.segmentFolder.segments,e.search]);return(0,V.useEffect)(()=>{(async()=>{x((await sv.segmentsFolders.get(e.segmentFolder.id))?.isOpen??!0)})()},[]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsxs)(rd,{align:"center",css:{cursor:"pointer",userSelect:"none","& .ellipsis":{display:"none"},"&:hover .ellipsis":{display:"block"}},gap:"2",onClick:C,children:[(0,i.jsx)(ka,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(Id,{icon:_?"chevron-down":"chevron-right"})}),(0,i.jsx)(ka,{css:{flex:"1"},font:"gray900 textXs semiBold",children:e.segmentFolder.name}),n&&(0,i.jsx)(ka,{className:"ellipsis",onClick:Gd,children:(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(rd,{align:"center",css:{color:"$gray500",px:"$2"},justify:"end",width:24,children:(0,i.jsx)(Id,{icon:"ellipsis-vertical"})})}),(0,i.jsxs)(lu,{offset:0,placement:"bottom-end",children:[(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"pen",onClick:()=>h(!0),children:t("renommer_42135")}),(0,i.jsx)(ru,{icon:"gear",onClick:()=>v(!0),children:t("r_ordonner_41823")}),e.canDeleteSegmentFolder&&(0,i.jsx)(ru,{color:e.isLast?"disabled":"default",icon:"arrow-down",onClick:async()=>{await d({organizationId:s,eventId:o,segmentFolderId:e.segmentFolder.id}),r()},children:t("d_placer_vers_l_52432")}),e.canDeleteSegmentFolder&&(0,i.jsx)(ru,{color:e.isFirst?"disabled":"default",icon:"arrow-up",onClick:async()=>{await c({organizationId:s,eventId:o,segmentFolderId:e.segmentFolder.id}),r()},children:t("d_placer_vers_l_49863")}),!!o&&e.canDeleteSegmentFolder&&(0,i.jsx)(ru,{icon:"clone",onClick:()=>j(!0),children:"Dupliquer sur un autre événement"})]}),(0,i.jsx)(MA,{children:e.canDeleteSegmentFolder&&(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>f(!0),children:t("supprimer_43083")})})]})]})})]}),A.length>0&&_&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(rd,{direction:"column",gap:"1",children:A.map((t,n)=>(0,i.jsx)(jz,{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)(md,{height:"5"})]}),m&&(0,i.jsx)(mz,{isEdit:!0,segmentFolder:e.segmentFolder,onClose:()=>{h(!1)}}),p&&(0,i.jsx)(DA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_13885"),text:t("suppression_de_73669",e.segmentFolder.name),onClose:()=>{f(!1)},onDelete:async()=>{await l({organizationId:s,eventId:o,segmentFolderId:e.segmentFolder.id}),r()}}),I&&(0,pn.createPortal)((0,i.jsx)(ka,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"200"},height:1,width:1,children:(0,i.jsx)(xz,{eventId:o,organizationId:s,segmentType:a,onClose:()=>{v(!1)},onSuccess:()=>(r(),e.onSegmentDelete())})}),document.body),b&&(0,i.jsx)(Vw,{eventId:o,organizationId:s,onClose:()=>j(!1),onSuccess:y})]})},yz=e=>{const t=Ti(),{canSegmentEdit:n,segmentsFolders:o}=SC(),[s,r]=(0,V.useState)(!1),a=(0,V.useMemo)(()=>o.flatMap(e=>e.segments).length>1,[o]),[l,d]=(0,V.useState)(""),c=(0,V.useMemo)(()=>g(l)?o.filter(e=>e.segments.some(e=>Vm(e,l))):o,[o,l]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(yc,{css:{background:"white",borderRight:"1px solid $gray200",overflow:"hidden"},gridtemplaterows:"1fr 48px",height:1,width:1,children:[(0,i.jsxs)(rd,{css:{overflowY:"auto",padding:"$7 $4"},direction:"column",width:1,children:[(0,i.jsx)(rd,{align:"center",children:(0,i.jsx)(ka,{color:"gray900",css:{flex:"1"},fontSize:"textMd",fontWeight:"semiBold",children:t("vues_personnali_80652")})}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{width:1,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:l,onChange:d})}),(0,i.jsx)(md,{height:"4"}),c.map((t,n)=>(0,i.jsx)(Cz,{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)(rd,{align:"center",css:{borderTop:"1px solid $gray200",cursor:"pointer",padding:"$3 $6"},gap:"4",width:1,onClick:()=>{r(!0)},children:[(0,i.jsx)(Id,{icon:"plus"}),(0,i.jsx)(ka,{color:"gray700",fontWeight:"medium",children:t("nouveau_dossier_94479")})]})]}),s&&(0,i.jsx)(mz,{isEdit:!1,onClose:()=>{r(!1)}})]})},Az=()=>{const{history:e,translate:t}=bd(),{columns:n,columnsExport:o,columnsSearch:s,eventId:r,getSegmentPath:a,infos:l,organizationId:d,predicates:c,reload:u,rendering:m,segment:h,segmentId:p,segmentType:f,segmentsFolders:_,sort:x,setIsSaveSegmentVisible:I}=SC(),v=(0,V.useCallback)(()=>{I(!1)},[I]),{mutate:b,isLoading:j}=function(e={}){return Di("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 Di("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)}(),[A,S]=(0,V.useState)(!1),[k,w]=(0,V.useState)(""),[E,T]=(0,V.useState)(_.find(e=>e.segments.find(e=>e.id===p))?.id??_[0].id),[R,O]=(0,V.useState)(h.description||void 0),D=!A||g(k);return(0,i.jsx)(Av,{isOpen:!0,onClose:v,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"floppy-disk",subtitle:t("sauvegarder_vos_15289"),children:t("enregistrer_une_52986")}),(0,i.jsxs)(jv,{children:[(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:t("que_souhaitez_v_33936")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(zu,{css:{"& label > div > div":{fontWeight:"$regular"}},state:A?"unchecked":"checked",onClick:()=>{S(!1)},children:t("enregistrer_les_31603").split("{1}").map((e,t)=>1===t?(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(Jp,{fontWeight:"medium",children:h.name}),e]},t):(0,i.jsx)(V.Fragment,{children:e},t))}),(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(zu,{css:{"& label > div > div":{fontWeight:"$regular"}},state:A?"checked":"unchecked",onClick:()=>{S(!0)},children:t("cr_er_une_nouve_37002")}),A&&(0,i.jsx)(ka,{css:{marginLeft:"$6"},children:(0,i.jsx)(Qd,{hint:t("cette_vue_sera_83858"),placeholder:t("nom_de_votre_no_21748"),value:k,onChange:w})})]})]}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("dans_quel_dossi_07643"),renderOnPortal:!0,shouldParseAsInt:!0,values:[E],onChange:e=>{Bs(e)&&T(e[0])},children:_.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(qp,{label:t("Description"),placeholder:t("entrer_une_desc_74340"),value:R,onChange:O})]}),(0,i.jsx)(bv,{children:()=>(0,i.jsx)(kd,{disabled:!D,isLoading:y||j,onClick:async()=>{const t={segmentType:f,name:k,description:R,predicates:c,columns:n,columnsExport:o,columnsSearch:s,sort:x,rendering:m,infos:l};if(A){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")})})]})})},Sz=e=>{const t=Ti(),{areColumnsOpen:n,areSegmentsOpen:o,clearNameCursors:s,columns:r,filters:a,hideSegments:l,isFilterOpen:d,isSaveSegmentVisible:c,possibleColumns:u,predicates:m,selectedFilterPredicate:h,setAreColumnsOpen:g,setColumns:p,setIsFilterOpen:f,setPredicates:_}=SC();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{height:1,width:1,children:[!0!==l&&o&&(0,i.jsx)(ka,{css:{overflow:"hidden"},height:1,width:260,children:(0,i.jsx)(yz,{onSegmentDelete:e.onSegmentDelete})}),(0,i.jsx)(rd,{css:{flex:"1",overflowY:"auto"},direction:"column",height:1,children:e.children})]}),d&&(0,i.jsx)(tp,{buttonText:e.filtersButtonText,possibleFilters:a,predicates:m,selectedFilterPredicate:h,subtitle:e.filtersSubtitle,onClose:()=>{f(!1)},onFilter:e=>{s(),_(e)}}),n&&(0,i.jsx)(sh,{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)(Az,{})]})},kz=e=>{const[t,n]=V.useState(e.segmentsFolders),o=V.useMemo(()=>t.flatMap(e=>e.segments),[t]),s=V.useMemo(()=>o.find(t=>t.id===e.segmentId),[e.segmentId,o]),[r,a]=V.useState(s.predicates),[l,d]=V.useState(s.columns),[c,u]=V.useState(s.columnsExport),[m,h]=V.useState(s.columnsSearch),[g,p]=V.useState(s.rendering),[f,_]=V.useState(s.sort),[x,I]=V.useState(s.infos),v=V.useMemo(()=>JSON.stringify(s.predicates),[s]),b=V.useMemo(()=>JSON.stringify(s.columns),[s]),j=V.useMemo(()=>JSON.stringify(s.columnsExport),[s]),C=V.useMemo(()=>JSON.stringify(s.columnsSearch),[s]),y=V.useMemo(()=>JSON.stringify(s.rendering),[s]),A=V.useMemo(()=>JSON.stringify(s.sort),[s]),S=V.useMemo(()=>JSON.stringify(s.infos),[s]),[k]=V.useMemo(()=>Lm(r,e.filters),[r,e.filters]),[w,E]=V.useState(!1),[T,R]=V.useState(!1),[O,D]=V.useState(!1),[z,$]=V.useState(null),[P,M]=V.useState(!1),[F,N]=V.useState(e.initialSegmentsOpen??!0),L=V.useCallback(t=>{e.onSegmentsToggle?.(t),N(t)},[N]),B=V.useMemo(()=>JSON.stringify(r)!==v||JSON.stringify(l)!==b||JSON.stringify(g)!==y||JSON.stringify(c)!==j||JSON.stringify(m)!==C||JSON.stringify(f)!==A||JSON.stringify(x)!==S,[v,r,b,l,y,g,j,c,C,m,A,f,x,S]),[U,W]=V.useState(""),[G,q]=V.useState(""),[H,K]=V.useState(e.initialLimit),[Y,Z]=V.useState(0),X=hm(e=>{q(e),ee()}),[J,Q]=V.useState(1),ee=V.useCallback(()=>{Z(0)},[Z]),te=V.useCallback(t=>{K(t),e.setLimit(t),ee()},[K,ee]),ne=V.useCallback(()=>{W(""),q(""),ee()},[W,q,ee]),ie=rh({}),oe=V.useCallback(()=>{ie.toggleSelectAll("unchecked"),Q(J+1)},[ie,J]),se=V.useMemo(()=>ie.isAllSelected?s.id:null,[ie,s]),re=V.useCallback(e=>{_(e),Z(0)},[_,Z]),ae=V.useCallback((e,i)=>{n((0,Wm.jM)(t,t=>{t.forEach(t=>{t.segments.forEach(t=>{t.id===e&&(t.count=i)})})}))},[t,n]);return V.useEffect(()=>{a(s.predicates),d(s.columns),u(s.columnsExport),h(s.columnsSearch),p(s.rendering),_(s.sort),I(s.infos),W(""),q(""),ee(),Q(1)},[s]),V.useEffect(()=>{n(e.segmentsFolders)},[e.segmentsFolders]),(0,i.jsx)(AC.Provider,{value:{areColumnsOpen:O,areSegmentsOpen:F,canSegmentEdit:e.canSegmentEdit,clearNameCursors:ne,columns:l,columnsExport:c,columnsSearch:m,eventId:e.eventId,filters:e.filters,filtersPredicates:k,getSegmentPath:e.getSegmentPath,hideSegments:e.hideSegments,infos:x,isEditMode:w,isFilterOpen:T,isSaveSegmentVisible:P,isSaveVisible:B,limit:H,massActions:ie,massEditSegmentId:se,name:U,nameDebounced:G,offset:Y,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:z,setAreColumnsOpen:D,setAreSegmentsOpen:L,setColumns:d,setColumnsExport:u,setColumnsSearch:h,setInfos:I,setIsEditMode:E,setIsFilterOpen:R,setIsSaveSegmentVisible:M,setLimit:te,setName:W,setNameDebounced:X,setOffset:Z,setPredicates:a,setReloadKey:Q,setRendering:p,setSegmentCount:ae,setSelectedFilterPredicate:$,setSort:re,sort:f},children:(0,i.jsx)(Sz,{filtersButtonText:e.filtersButtonText,filtersSubtitle:e.filtersSubtitle,onSegmentDelete:e.onSegmentDelete,children:e.children})})},wz=e=>{const t=Ti(),{massActions:n,segment:o}=SC(),s=(0,V.useCallback)(()=>{n.toggleSelectAll("unchecked"),n.setIsAllSelected(!1)},[n]),r=(0,V.useCallback)(()=>{n.setIsAllSelected(!0)},[n]);return(0,i.jsxs)(rd,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$3 $4"},gap:"3",children:[(0,i.jsx)(ka,{fontSize:"textMd",fontWeight:"medium",children:(0,i.jsx)(Id,{icon:"circle-exclamation"})}),n.isAllSelected?(0,i.jsx)(ka,{color:"gray700",css:{flex:"1"},fontWeight:"medium",children:e.segmentSelectedText}):(0,i.jsx)(ka,{color:"gray700",css:{flex:"1"},fontWeight:"medium",children:e.pageSelectedText}),n.isAllSelected?(0,i.jsx)(ka,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",onClick:s,children:t("effacer_la_s_le_85095")}):(0,i.jsx)(ka,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",onClick:r,children:t("s_lectionner_le_71777",o.count,o.name)})]})},Ez=e=>{const{translate:t}=bd(),{columnsSearch:n,setColumnsSearch:o}=SC(),[s,r]=(0,V.useState)(""),a=(0,V.useMemo)(()=>g(s)?e.searchableColumns.filter(e=>m(e.name).includes(m(s))):e.searchableColumns,[e.searchableColumns,s]);return(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",css:{borderLeft:"none",borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"bars-filter"})}),(0,i.jsx)(lu,{css:{padding:"0"},maxHeight:350,placement:"bottom-end",width:320,children:(0,i.jsxs)(rd,{css:{padding:"$4 $6"},direction:"column",gap:"3",children:[(0,i.jsx)(ka,{font:"gray800 textMd medium",children:t("rechercher_sur_85243")}),(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("filtrer_78031"),state:"search",value:s,onChange:r}),(0,i.jsx)(rd,{direction:"column",gap:"3",children:a.map(({slug:e,name:t})=>(0,i.jsx)(Eu,{state:n.includes(e)?"checked":"unchecked",onClick:t=>{o(Us(n,e,"checked"===t))},children:t},e))})]})})]})},Tz=e=>{const t=Ti(),{canSegmentEdit:n,isEditMode:o,isSaveVisible:s,massActions:r,name:a,possibleColumns:l,possibleRenderings:d,rendering:c,setAreColumnsOpen:u,setIsEditMode:m,setIsFilterOpen:h,setIsSaveSegmentVisible:g,setName:p,setNameDebounced:f,setRendering:_,setSelectedFilterPredicate:x}=SC(),I=sp(),v=e.showActions&&e.actions&&r.numberOfSelected>0,b=V.useMemo(()=>(0,cm.A)(l.filter(e=>e.isSearchable),e=>e.name),[l]),j=V.useMemo(()=>e.showSearchColumns?{"& .h-styled-input-container":{borderBottomRightRadius:"0",borderTopRightRadius:"0"}}:{},[e.showSearchColumns]);return rp("e",V.useCallback(()=>{m(!o)},[o,m])),(0,i.jsxs)(rd,{align:"center",gap:"4",children:[(0,i.jsxs)(rd,{width:320,children:[(0,i.jsx)(Qd,{autoFocus:!0,css:j,icon:"magnifying-glass",placeholder:e.searchPlaceholder,value:a,onChange:e=>{p(e),f(e)}}),e.showSearchColumns&&(0,i.jsx)(Ez,{searchableColumns:b})]}),n&&(0,i.jsx)(kd,{color:"gray",leftIcon:"bars-filter",onClick:()=>{x(null),h(!0)},children:t("filtres_64574")}),(0,i.jsx)(ka,{css:{flex:"1"},children:n&&s&&(0,i.jsx)(kd,{color:"invisible",onClick:()=>{g(!0)},children:t("enregistrer_la_22884")})}),!v&&e.controls,!v&&e.showEditColumns&&(0,i.jsx)(kd,{color:"invisible",css:{color:"$gray800","&:hover":{color:"$gray800"}},leftIcon:"gear",onClick:()=>{u(!0)},children:t("_diter_les_colo_39630")}),!v&&e.showEditMode&&(0,i.jsx)(Zm,{"aria-keyshortcuts":(I?"Meta":"Control")+"+E",value:o,onChange:m,children:t("mode_dition_93778")}),!v&&Bs(d)&&(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:yg(c),children:Ag(t,c)})}),(0,i.jsx)(lu,{placement:"bottom-end",children:d.map(e=>(0,i.jsx)(ru,{icon:yg(e),onClick:()=>_(e),children:Ag(t,e)},e))})]}),v&&e.actions]})},Rz=()=>{const e=Ti(),t=Ei(Um),{canSegmentEdit:n,filtersPredicates:o,clearNameCursors:s,setPredicates:r,setIsFilterOpen:a,setSelectedFilterPredicate:l,predicates:d}=SC(),c=(0,V.useCallback)(()=>{s(),r([])},[s,r]),u=(0,V.useCallback)(e=>{l(e),a(!0)},[a,l]),m=(0,V.useCallback)(e=>{s(),r((0,Cu.A)(d,e.predicate))},[d,s,r]);return Xg(o),Bs(o)?(0,i.jsxs)(rd,{align:"center",gap:"3",width:1,wrap:"wrap",children:[o.map((e,o)=>e.filter.needLoading?(0,i.jsx)(vu,{leftIcon:"loader"},o):(0,i.jsx)(vu,{cursor:n?"pointer":"default",ellipsis:!0,rightIcon:n?"xmark":void 0,onContentClick:n?()=>u(e):void 0,onRightIconClick:n?()=>m(e):void 0,children:t.filterPredicateToText(e)},o)),n&&(0,i.jsx)(ka,{color:"gray700",css:{cursor:"pointer"},fontWeight:"medium",onClick:c,children:e("r_initialiser_l_66835")})]}):null},Oz=e=>{const{canSegmentEdit:t,limit:n,massActions:o}=SC(),s=t&&o.numberOfSelected===n;return(0,i.jsxs)(rd,{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)(Rz,{}),s&&e.selectSegment]})},Dz=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=bd(),{massActions:o,onMassEditSuccess:s,predicates:r,segment:a}=SC(),{showNotification:l}=HI(),{user:d}=Li(),{mutate:c}=Ql(),{mutate:u}=kr(),{mutate:m}=ed(),[h,g]=(0,V.useState)(!1),[p,f]=(0,V.useState)(!1),_=o.getSelectedsInput(r,null),x=o.isAllSelected?a.count:o.numberOfSelected;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kd,{onClick:()=>g(!0),children:e("_diter_une_prop_26724")}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{icon:"play",onClick:async()=>{const{numberOfExecuted:i}=await m({organizationId:t,eventId:n,selecteds:_});l(e("_1_automatisat_96943",i)),s()},children:e("ex_cuter_54158")})}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>f(!0),children:e("supprimer_43083")})})]})]}),h&&(0,i.jsx)(YA,{canAccessBackoffice:xm(d.email),mutate:e=>u({organizationId:t,eventId:n,massEdit:e}),selecteds:_,onClose:()=>g(!1),onSuccess:t=>{l(e("_1_automatisat_35589",t)),s()}}),p&&(0,i.jsx)(DA,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_04998")],text:e("suppression_de_41301",x),onClose:()=>f(!1),onDelete:async()=>{await c({organizationId:t,eventId:n,selecteds:_}),l(e("_1_automatisat_45105",x)),s()}})]})},zz=e=>{const{translate:t,params:{organizationId:n,segmentId:o}}=bd(),{areSegmentsOpen:s,hideSegments:r,segment:a,setAreSegmentsOpen:l,setSegmentCount:d}=SC(),{data:c}=Oi("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 V.useEffect(()=>{a.id===o&&d(a.id,c.organization?.segment.count??a.count)},[o,a,c.organization,d]),(0,i.jsx)(tb,{children:(0,i.jsxs)(rd,{align:"center",gap:"4",width:1,children:[!r&&(0,i.jsx)(rd,{css:{cursor:"pointer",padding:"$2"},onClick:()=>l(!s),children:(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"sidebar"})})}),(0,i.jsx)(bp,{placement:"top",children:t(s?"masquer_la_list_94215":"afficher_la_lis_48771")})]})}),e.name||(0,i.jsxs)(ka,{css:{flex:"1"},font:"gray900 displayXs medium",children:[(0,i.jsxs)(rd,{align:"center",gap:"4",children:[(0,i.jsx)(ka,{children:a.name}),a.isUsedInWorkflow&&(0,i.jsx)(vu,{color:"white",leftIcon:"bolt-auto",children:t("utilis_e_dans_u_46582")})]}),a.description&&(0,i.jsx)(ka,{css:{whiteSpace:"pre-wrap"},font:"gray500 textXs medium",children:a.description})]}),e.children]})})},$z=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o}}=bd();return(0,i.jsx)(zz,{children:(0,i.jsx)(Mv,{permissions:Ov.WORKFLOW_EDIT,children:(0,i.jsx)(kd,{onClick:()=>{e.push(Dx.CREATE({organizationId:n,eventId:o}))},children:t("cr_er_une_autom_91246")})})})},Pz=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{showNotification:s}=HI(),{mutate:r}=Ql();return(0,i.jsx)(DA,{buttonText:t("supprimer_43083"),subtext:(0,hd.A)([t("_tes_vous_s_r_d_94890"),e.workflow.trigger===qe.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()}})},Mz=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=bd(),{mutate:r}=function(e={}){return Di("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}=ed(),[l,d]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{children:[(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"play",isDisabled:e.workflow.state===Ge.Paused,onClick:async()=>{await a({organizationId:o,eventId:s,selecteds:{ids:[e.workflow.id]}}),e.reload()},children:n("ex_cuter_54158")}),(0,i.jsx)(ru,{icon:"pen",to:Dx.UPDATE({organizationId:o,eventId:s,workflowId:e.workflow.id}),children:n("_diter_62574")}),(0,i.jsx)(ru,{icon:"clone",onClick:async()=>{const{workflowDuplicate:{id:n}}=await r({organizationId:o,eventId:s,workflowId:e.workflow.id});t.push(Dx.UPDATE({organizationId:o,eventId:s,workflowId:n}))},children:n("dupliquer_28256")})]}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:e=>{d(!0),eu(e.target)},children:n("supprimer_43083")})})]}),l&&(0,i.jsx)(Pz,{workflow:e.workflow,onClose:()=>d(!1),onSuccess:e.reload})]})},Fz=e=>{const t=Ei(Cm);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:t.toLocaleString(e.insertedAt.toLocal(),zs.DateTime)})},Nz=e=>{const t=g(e.createdBy?.name),n=(t?e.createdBy?.name:e.createdBy?.email)||"";return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(rd,{direction:"column",width:1,children:[(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray900 textSm medium",title:n,width:1,children:n}),t&&(0,i.jsx)(ka,{color:"gray500",css:{ellipsis:!0},title:e.createdBy?.email||"",width:1,children:e.createdBy?.email||""})]})})},Lz=e=>{const{params:{organizationId:t,eventId:n}}=bd(),{mutate:o}=kr(),s=V.useCallback(async i=>(await o({organizationId:t,eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.workflowId]},slug:e.property,strategy:yt.Replace,value:i}}),!0),[t,n,e.workflowId,e.property,o]);return(0,i.jsx)(OC,{column:e.column,initialValue:e.initialValue,mutate:s,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:e.updatable??!0})},Bz=e=>{const{translate:t}=bd(),{user:n}=Li();return(0,i.jsx)(Lz,{column:e.column,initialValue:e.workflow.frequency,property:an.Frequency,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(hh,{label:t("Frequency"),value:e,onChange:n,children:fi.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))}),renderValue:t(e.workflow.frequency),updatable:xm(n.email),workflowId:e.workflow.id})},Vz=({children:e,isEditMode:t,title:n,updatable:o})=>t&&o?(0,i.jsx)(ka,{css:{clamp:2},font:"gray900 textSm medium",title:n,width:1,children:n}):(0,i.jsx)(i.Fragment,{children:e}),Uz=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{isEditMode:s}=SC(),r=e.workflow.name;return(0,i.jsx)(Lz,{column:e.column,initialValue:r,property:an.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Qd,{label:t("nom_de_l_automa_04883"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Vz,{isEditMode:s,title:r,updatable:!0,children:(0,i.jsx)(bm,{to:Dx.UPDATE({organizationId:n,eventId:o,workflowId:e.workflow.id}),children:(0,i.jsx)(ka,{css:{clamp:2},title:r,children:r})})}),workflowId:e.workflow.id})},Wz=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>vi.filter(e=>e!==Ge.Error),[]),o=e.workflow.data.errorMessage||"";return(0,i.jsx)(Lz,{column:e.column,initialValue:e.workflow.state,property:an.State,reload:e.reload,renderInput:(e,o)=>(0,i.jsx)(hh,{label:t("State"),value:e,onChange:o,children:n.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))}),renderValue:()=>(0,i.jsxs)(rd,{align:"start",direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsx)(vu,{...LD(e.workflow.state),children:t(e.workflow.state)}),e.workflow.state===Ge.Error&&(0,i.jsx)(ka,{css:{ellipsis:!0},title:o,width:1,children:o})]}),workflowId:e.workflow.id})},Gz=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),s=Ei(Cm),r=(0,V.useMemo)(()=>Bs(e.row.accreditationsSlots)?pg(e.row.accreditationsSlots):[],[e.column]);return e.column.slug===Ng.Id?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===Ng.Name?(0,i.jsx)(Uz,{column:e.column,reload:e.reload,workflow:e.row}):e.column.slug===Ng.State?(0,i.jsx)(Wz,{column:e.column,reload:e.reload,workflow:e.row}):e.column.slug===Ng.Trigger?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:t(e.row.trigger)}):e.column.slug===Ng.Action?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:t(e.row.action)}):e.column.slug===Ng.CreatedBy?(0,i.jsx)(Nz,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===Ng.CreatedAt?(0,i.jsx)(Fz,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===Ng.VolunteersSegment?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.segment?(0,i.jsx)(bm,{to:e.row.segment.segmentType===Me.Delegations?fs.DELEGATIONS_SEGMENT(n,o,e.row.segment.id):fs.VOLUNTEERS_SEGMENT(n,o,e.row.segment.id),children:e.row.segment.name}):"-"}):e.column.slug===Ng.ExecutedAt?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.executedAt?.isValid?s.toLocaleString(e.row.executedAt.toLocal(),zs.DateTime):"-"}):e.column.slug===Ng.Accreditations?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:r,doNotSort:!0})}):e.column.slug===Ng.Campaign?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.campaign?(0,i.jsx)(bm,{to:Tx.CAMPAIGN({organizationId:n,eventId:o,campaignId:e.row.campaign.id}),children:e.row.campaign.name}):"-"}):e.column.slug===Ng.Frequency?(0,i.jsx)(Bz,{column:e.column,reload:e.reload,workflow:e.row}):e.column.slug===Ng.CustomField?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.customField?e.row.customField.name:"-"}):null},qz=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd();return(0,i.jsxs)(am,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},onMouseLeave:e=>{eu(e.target)},children:[e.canWorkflowEdit&&(0,i.jsx)(Qu,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:e.state,onClick:(t,n)=>{Gd(n),e.toggleRow(`w${e.workflow.id}`,t,n.shiftKey)}})}),e.columns.map(t=>(0,i.jsx)(Gz,{column:t,reload:e.reload,row:e.workflow},t.slug)),e.canWorkflowEdit&&(0,i.jsxs)(jm,{justify:"center",children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"pen",to:Dx.UPDATE({organizationId:n,eventId:o,workflowId:e.workflow.id})})})}),(0,i.jsx)(bp,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsx)(Mz,{reload:e.reload,workflow:e.workflow})]})]})},Hz=e=>{const{params:{organizationId:t,eventId:n}}=bd(),{columns:o,limit:s,massActions:r,nameDebounced:a,offset:l,possibleColumns:d,predicates:c,reloadKey:u,setLimit:m,setOffset:h,setSort:p,sort:f}=SC(),_=(0,V.useMemo)(()=>function(e){return{includeAccreditations:e.includes(Ng.Accreditations),includeCampaign:e.includes(Ng.Campaign),includeCustomField:e.includes(Ng.CustomField)}}(o),[o]),{data:x,isLoading:I,reload:v}=Oi("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",{..._,organizationId:t,eventId:n,level:n?ke.Event:ke.Organization,name:g(a)?a:void 0,predicates:c,limit:s,offset:l,sort:f},[js.WorkflowsWorkflowFragment]);const{numberOfPages:b,totalCount:j}=ah(x.data?.rows),C=(0,V.useMemo)(()=>o.flatMap(e=>(0,hd.A)([d.find(t=>t.slug===e)])),[d,o]),y=(0,V.useMemo)(()=>x.data?.rows.nodes??[],[x.data]);return(0,V.useEffect)(()=>{u>1&&v()},[u]),(0,V.useEffect)(()=>{r.setStates(Object.fromEntries(y.map(e=>[`w${e.id}`,{id:e.id,state:"unchecked"}])))},[y,r.setStates]),(0,i.jsx)(rd,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(_p,{"aria-busy":I,headerRow:(0,i.jsxs)(Wu,{children:[e.canWorkflowEdit&&(0,i.jsx)(pm,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:r.selectAllState,onClick:r.toggleSelectAll})}),C.map(e=>e.isSortable?(0,i.jsx)(fp,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:p,sort:f,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(pm,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),e.canWorkflowEdit&&(0,i.jsx)(pm,{width:100})]}),paginationRow:(0,i.jsx)(lm,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(rm,{limit:s,numberOfPages:b,offset:l,setLimit:m,setOffset:h,showLimits:!0,totalCount:j})}),children:I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):y.map(t=>(0,i.jsx)(qz,{canWorkflowEdit:e.canWorkflowEdit,columns:C,reload:v,state:r.states[`w${t.id}`]?.state??"unchecked",toggleRow:r.toggleRow,workflow:t},t.id))})})},Kz=e=>{const{translate:t}=bd(),{limit:n,segment:o}=SC();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($z,{}),(0,i.jsxs)(Qv,{children:[(0,i.jsx)(Oz,{searchRow:(0,i.jsx)(Tz,{actions:(0,i.jsx)(Dz,{}),searchPlaceholder:t("rechercher_une_30575"),showActions:e.canWorkflowEdit,showEditColumns:e.canSegmentEdit,showEditMode:e.canWorkflowEdit,showSearchColumns:!1}),selectSegment:(0,i.jsx)(wz,{pageSelectedText:t("les_1_automat_30472",n),segmentSelectedText:t("les_1_automat_58612",o.count,o.name)})}),(0,i.jsx)(Hz,{canWorkflowEdit:e.canWorkflowEdit})]})]})},Yz=e=>{const{translate:t,params:{organizationId:n,eventId:o,segmentId:s}}=bd(),r=Ei(Lg),a=(0,V.useMemo)(()=>r.getWorkflowsFilters(n,o),[r,n,o]),l=(0,V.useMemo)(()=>r.getWorkflowsPossibleColumns(),[r]);return(0,i.jsx)(kz,{canSegmentEdit:e.canSegmentEdit,eventId:o,filters:a,filtersButtonText:t("filtrer_les_aut_25902"),filtersSubtitle:t("appliquer_des_f_55705"),getSegmentPath:e=>Dx.WORKFLOWS_SEGMENT({organizationId:n,eventId:o,segmentId:e}),initialLimit:e.initialLimit??em,initialSegmentsOpen:e.initialSegmentsOpen??!0,organizationId:n,possibleColumns:l,possibleRenderings:[],reload:e.reload,segmentId:s,segmentType:Me.Workflows,segmentsFolders:e.segmentsFolders,setLimit:e.setLimit,onSegmentClick:e.onSegmentClick,onSegmentDelete:e.onSegmentDelete,onSegmentsToggle:e.onSegmentsToggle,children:(0,i.jsx)(Kz,{canSegmentEdit:e.canSegmentEdit,canWorkflowEdit:e.canWorkflowEdit})})};function Zz(e){return(0,V.useMemo)(()=>e.flatMap(e=>e.segments).map(e=>e.id),[e])}const Xz=()=>{const{history:e,params:{organizationId:t,eventId:n},translate:o}=bd(),{event:{name:s},localEvent:r,updateLocalEvent:a}=dv(),{canSegmentEdit:l,canWorkflowEdit:d}=Dv();Zc(`${s} ${o("automatisations_60045")}`);const{data:c,loader:u,reload:m}=td({organizationId:t,eventId:n,level:ke.Event}),h=(0,V.useMemo)(()=>c.organization?.segmentsFolders??[],[c.organization]),g=Zz(h);return u||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:Dx.WORKFLOWS_SEGMENT({organizationId:":organizationId",eventId:":eventId",segmentId:":segmentId"}),children:(0,i.jsx)(Yz,{canSegmentEdit:l,canWorkflowEdit:d,initialLimit:r?.workflowsLimit,initialSegmentsOpen:r?.areWorkflowsSegmentsOpen,reload:m,segmentsFolders:h,setLimit:e=>{a({workflowsLimit:e})},onSegmentClick:e=>{a({workflowsSegmentId:e})},onSegmentDelete:async()=>{await a({workflowsSegmentId:null}),e.replace(Dx.WORKFLOWS({organizationId:t,eventId:n}))},onSegmentsToggle:async e=>{await a({areWorkflowsSegmentsOpen:e})}})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:Dx.WORKFLOWS_SEGMENT({organizationId:t,eventId:n,segmentId:r?.workflowsSegmentId&&g.includes(r.workflowsSegmentId)?r.workflowsSegmentId:g[0]}),replace:!0})})]})},Jz=()=>{const{history:e,params:{organizationId:t},translate:n}=bd(),{organization:o,localOrganization:s,updateLocalOrganization:r}=_v(),{canSegmentEdit:a,canWorkflowEdit:l}=zv();Zc(`${o.name} ${n("automatisations_60045")}`);const{data:d,loader:c,reload:u}=td({organizationId:t,level:ke.Organization}),m=(0,V.useMemo)(()=>d.organization?.segmentsFolders??[],[d.organization]),h=Zz(m);return c||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:Dx.WORKFLOWS_SEGMENT({organizationId:":organizationId",segmentId:":segmentId"}),children:(0,i.jsx)(Yz,{canSegmentEdit:a,canWorkflowEdit:l,initialLimit:s?.workflowsLimit,initialSegmentsOpen:s?.areWorkflowsSegmentsOpen,reload:u,segmentsFolders:m,setLimit:e=>{r({workflowsLimit:e})},onSegmentClick:e=>{r({workflowsSegmentId:e})},onSegmentDelete:async()=>{await r({workflowsSegmentId:null}),e.replace(Dx.WORKFLOWS({organizationId:t}))},onSegmentsToggle:async e=>{await r({areWorkflowsSegmentsOpen:e})}})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:Dx.WORKFLOWS_SEGMENT({organizationId:t,segmentId:s?.workflowsSegmentId&&h.includes(s.workflowsSegmentId)?s.workflowsSegmentId:h[0]}),replace:!0})})]})};let Qz=class extends Um{constructor(e,t,n){super(e,t,n)}getCampaignsFilters(e){return[{slug:"state",name:this.t("State"),category:this.t("Campaigns"),fieldType:Zt.Select,values:yn.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"campaign_type",name:this.t("type_35427"),category:this.t("Campaigns"),fieldType:Zt.Select,values:An.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"created_by",name:this.t("cr_e_par_30622"),category:this.t("Campaigns"),fieldType:Zt.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:Zt.Date,hideEmpty:!0}]}};Qz=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mm,Cm,Si])],Qz);const e$=()=>{const{translate:e,history:t,params:{organizationId:n}}=bd();return(0,i.jsx)(zz,{children:(0,i.jsx)(Mv,{permissions:Ov.CAMPAIGN_SEND,children:(0,i.jsx)(dE,{menu:(0,i.jsx)(ru,{icon:"paper-plane",onClick:()=>{t.push(Tx.CREATE_TEMPLATE({organizationId:n}))},children:e("cr_er_un_mod_le_20298")}),onClick:()=>{t.push(Tx.CREATE({organizationId:n}))},children:e("cr_er_une_campa_96023")})})})};function t$(e){switch(e){case me.Draft:return{color:"gray",leftIcon:"pen-ruler"};case me.Done:return{color:"success",leftIcon:"check"};case me.InProgress:return{color:"warning",leftIcon:"hourglass-empty"};case me.Scheduled:return{color:"primary",leftIcon:"calendar"};case me.Template:return{color:"purple",leftIcon:"paper-plane"};default:return vd()}}const n$=e=>{const{history:t,translate:n}=bd(),{showNotification:o}=HI(),{mutate:s}=function(e={}){return Di("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 Di("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 Di("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,V.useState)(!1),c=e.campaign.state===me.Draft||e.campaign.state===me.Scheduled;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{children:[(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"pen",onClick:()=>{t.push(Tx.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id}))},children:n("_diter_62574")}),c&&(0,i.jsx)(ru,{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)(ru,{icon:"clone",onClick:async()=>{const{campaignDuplicate:{id:n}}=await s({organizationId:e.organizationId,eventId:e.eventId,campaignId:e.campaign.id});t.push(Tx.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:n}))},children:n("dupliquer_28256")})]}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:e=>{eu(e.target),d(!0)},children:n("supprimer_43083")})})]}),l&&(0,i.jsx)(DA,{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()}})]})},i$=e=>{const{translate:t}=bd(),n=Ei(Cm),o=e.campaign.sentAt?.setZone(As.c9.local().zone);return(0,i.jsxs)(am,{css:{"&:hover":{background:"$gray100"}},onMouseLeave:e=>{eu(e.target)},children:[(0,i.jsx)(Qu,{children:(0,i.jsxs)(rd,{direction:"column",width:1,children:[(0,i.jsx)(bm,{to:Tx.CAMPAIGN_DASHBOARD({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id}),children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.campaign.name,children:e.campaign.name})}),e.campaign.state===me.Done&&o&&(0,i.jsx)(ka,{color:"gray500",children:t("envoy_e_le_1_90336",n.toLocaleString(o,zs.DateTime),e.campaign.createdBy?.nameOrEmail??"")}),e.campaign.state===me.Scheduled&&e.campaign.scheduledAt?.isValid&&(0,i.jsx)(ka,{color:"gray500",children:t("programm_e_le_58279",n.toLocaleString(e.campaign.scheduledAt,zs.DateOnly.MonthLong),n.toLocaleString(e.campaign.scheduledAt,zs.TimeOnly))})]})}),(0,i.jsxs)(Qu,{css:{flex:"0 150px"},children:[(0,i.jsx)(ka,{width:22,children:e.campaign.campaignType===ue.Email?(0,i.jsx)(Id,{icon:"at"}):(0,i.jsx)(Id,{icon:"message"})}),e.campaign.campaignType]}),(0,i.jsx)(Qu,{css:{flex:"0 200px",justifyContent:"flex-end"},children:e.campaign.numberOfRecipients}),(0,i.jsx)(Qu,{css:{flex:"0 150px",justifyContent:"flex-end"},children:e.campaign.campaignType===ue.Email?t("gratuit_13712"):`${e.campaign.cost} €`}),(0,i.jsx)(Qu,{css:{flex:"0 150px"},children:(0,i.jsx)(vu,{...t$(e.campaign.state),children:t(e.campaign.state)})}),(0,i.jsx)(jm,{justify:"end",children:e.canCampaignSend&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"pen",to:Tx.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id})})})}),(0,i.jsx)(bp,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsx)(n$,{campaign:e.campaign,eventId:e.eventId,organizationId:e.organizationId,reload:e.reload})]})})]})};function o$(e,t){(0,V.useEffect)(()=>{let n=null;return e.some(e=>e.state===me.InProgress)&&(n=window.setInterval(t,3e4)),()=>{n&&clearInterval(n)}},[e])}const s$=()=>{const{translate:e,params:{organizationId:t}}=bd(),{canCampaignSend:n}=zv(),{limit:o,nameDebounced:s,offset:r,predicates:a,reloadKey:l,setLimit:d,setOffset:c,setSort:u,sort:m}=SC(),{data:h,isLoading:p,reload:f}=Oi("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:g(s)?s:null,limit:o,offset:r,sort:m},[js.CampaignListFragment]);const{numberOfPages:_,totalCount:x}=ah(h.organization?.rows);return(0,V.useEffect)(()=>{l>1&&f()},[l]),o$(h.organization?.rows.nodes??[],f),(0,i.jsx)(rd,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(_p,{"aria-busy":p,headerRow:(0,i.jsxs)(Wu,{children:[(0,i.jsx)(fp,{attribute:Ee.Name,setSort:u,sort:m,children:e("nom_de_la_campa_45063")}),(0,i.jsx)(fp,{attribute:Ee.Type,setSort:u,sort:m,width:150,children:e("type_35427")}),(0,i.jsx)(pm,{width:200,children:e("nombre_de_desti_21374")}),(0,i.jsx)(pm,{width:150,children:e("co_t_68998")}),(0,i.jsx)(fp,{attribute:Ee.State,css:{flex:"0 150px"},setSort:u,sort:m,children:e("State")}),(0,i.jsx)(pm,{width:100})]}),paginationRow:(0,i.jsx)(lm,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(rm,{limit:o,numberOfPages:_,offset:r,setLimit:d,setOffset:c,showLimits:!0,totalCount:x})}),children:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):h.organization.rows.nodes.map(e=>(0,i.jsx)(i$,{campaign:e,canCampaignSend:n,eventId:null,organizationId:t,reload:f},e.id))})})},r$=()=>{const e=Ti();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e$,{}),(0,i.jsxs)(Qv,{children:[(0,i.jsx)(Oz,{searchRow:(0,i.jsx)(Tz,{searchPlaceholder:e("rechercher_une_69554"),showActions:!1,showEditColumns:!1,showEditMode:!1,showSearchColumns:!1})}),(0,i.jsx)(s$,{})]})]})},a$=e=>{const{history:t,translate:n,params:{organizationId:o,segmentId:s}}=bd(),{localOrganization:r,updateLocalOrganization:a}=_v(),{canSegmentEdit:l}=zv(),d=Ei(Qz);return(0,i.jsx)(kz,{canSegmentEdit:l,filters:d.getCampaignsFilters(e.organization.admins.nodes),filtersButtonText:n("filtrer_les_cam_97457"),filtersSubtitle:n("appliquer_des_f_57442"),getSegmentPath:e=>Tx.CAMPAIGNS_SEGMENT({organizationId:o,segmentId:e}),initialLimit:r?.campaignsLimit??em,initialSegmentsOpen:r?.areCampaignsSegmentsOpen??!0,organizationId:o,possibleColumns:[],possibleRenderings:[],reload:e.reload,segmentId:s,segmentType:Me.Campaigns,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{a({campaignsLimit:e})},onSegmentClick:e=>{a({campaignsSegmentId:e})},onSegmentDelete:async()=>{await a({campaignsSegmentId:null}),t.replace(Tx.CAMPAIGNS({organizationId:o}))},onSegmentsToggle:async e=>{await a({areCampaignsSegmentsOpen:e})},children:(0,i.jsx)(r$,{})})},l$=()=>{const{params:{organizationId:e},translate:t}=bd();Zc(`${t("communaut_20896")} ${t("Campaigns")}`);const{localOrganization:n}=_v(),{data:o,loader:s,reload:r}=Oi("query CampaignsSegments($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n admins: usersInfos(isResourceCreator: true) {\n nodes {\n userId\n nameOrEmail\n }\n }\n\n segmentsFolders(level: Organization, segmentType: Campaigns) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e},[js.SegmentsFoldersSegmentsFragment]),a=(0,V.useMemo)(()=>(o.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[o.organization]);return s||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:Tx.CAMPAIGNS_SEGMENT({organizationId:":organizationId",segmentId:":segmentId"}),children:(0,i.jsx)(a$,{organization:o.organization,reload:r})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:Tx.CAMPAIGNS_SEGMENT({organizationId:e,segmentId:n?.campaignsSegmentId&&a.includes(n.campaignsSegmentId)?n?.campaignsSegmentId:a[0]}),replace:!0})})]})},d$=()=>{const{translate:e,params:{organizationId:t}}=bd(),{updateLocalOrganization:n}=_v(),{canCampaignRead:o,canFormRead:s,canDelegationRead:r,canWorkflowRead:a}=zv();return(0,i.jsxs)(tE,{"aria-label":e("menu_communauta_47274"),children:[(0,i.jsx)(eE,{replace:!1,to:ro.COMMUNITY_DASHBOARD({organizationId:t}),children:e("tableau_de_bord_24627")}),(0,i.jsx)(eE,{isActive:e=>e.endsWith("/users")||null!==e.match(/\/users\/\d+/)||null!==e.match(/\/member\/\d+/),replace:!1,to:ro.COMMUNITY_USERS({organizationId:t}),onClick:()=>n({usersSegmentId:null}),children:e("vos_membres_38104")}),o&&(0,i.jsx)(eE,{isActive:e=>e.endsWith("/campaigns")&&!e.endsWith("/history/campaigns")||null!==e.match(/\/community\/campaigns\/\d+/)||null!==e.match(/\/community\/campaign\/\d+/),replace:!1,to:Tx.CAMPAIGNS({organizationId:t}),onClick:()=>n({campaignsSegmentId:null}),children:e("Campaigns")}),s&&(0,i.jsx)(eE,{isActive:e=>e.endsWith("/forms")||e.endsWith("/forms/create"),replace:!1,to:jo.FORMS({organizationId:t}),children:e("Form_plural")}),r&&(0,i.jsx)(eE,{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:fs.COMMUNITY_DELEGATIONS(t),children:e("d_l_gations_78318")}),a&&(0,i.jsx)(eE,{replace:!1,to:Dx.WORKFLOWS({organizationId:t}),children:e("automatisations_60045")})]})},c$=e=>(0,i.jsx)(BT,{children:(0,i.jsxs)(yc,{gridtemplatecolumns:"auto",gridtemplaterows:"55px 1fr",height:1,width:1,children:[(0,i.jsx)(d$,{}),(0,i.jsx)(ka,{css:{overflowY:"auto"},children:e.children})]})}),u$=({percent:e,prospectivePercent:t})=>(0,i.jsxs)(ka,{css:{background:"$gray100",borderRadius:"$1",position:"relative"},height:8,width:1,children:[(0,i.jsx)(ka,{css:{background:xu(e),borderRadius:"$1",left:0,maxWidth:"100%",position:"absolute",top:0,width:100*e+"%"},height:1}),void 0!==t&&(0,i.jsx)(ka,{css:{background:xu(t),borderRadius:"$1",left:0,opacity:.4,maxWidth:"100%",position:"absolute",top:0,width:100*t+"%"},height:1})]}),m$=()=>{const e=Ti(),{organizationId:t}=zi(),n=$i(),{data:o,loader:s}=Oi("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=Ei(Yh);return s||(0,i.jsxs)(rd,{css:{margin:"auto"},direction:"column",height:1,width:"$container",children:[(0,i.jsx)(md,{height:"9"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("tableau_de_bord_24627")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:e("en_un_coup_d_oe_57288")}),(0,i.jsx)(md,{height:"9"}),(0,i.jsxs)(rd,{gap:"6",width:1,children:[(0,i.jsx)(Iw,{icon:"megaphone",iconColor:"primary",text:e("nombre_d_v_nem_14214"),value:o.organization.events.nodes.length}),(0,i.jsx)(Iw,{icon:"user-group",iconColor:"purple",text:e("nombre_de_membr_08851"),value:o.organization.numberOfUsersInfos})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(dm,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:e("nom_de_l_v_nem_08711")}),(0,i.jsx)(pm,{children:e("date_de_l_v_ne_69973")}),(0,i.jsx)(pm,{width:200,children:e("nombre_de_missi_67304_plural")}),(0,i.jsx)(pm,{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,xf.A)(e.assignedResources/e.resources*100);return(0,i.jsxs)(am,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},onClick:()=>{n.push(So.EVENT({organizationId:t,eventId:e.id}))},children:[(0,i.jsx)(Qu,{children:e.name}),(0,i.jsx)(Qu,{children:e.range?r.toDisplayString(e.range):"-"}),(0,i.jsx)(Qu,{width:200,children:e.numberOfPositions}),(0,i.jsx)(Qu,{children:e.resources>0?(0,i.jsxs)(rd,{align:"center",gap:"3",height:1,width:1,children:[(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(u$,{percent:e.assignedResources/e.resources})}),(0,i.jsxs)(ka,{color:"gray700",width:40,children:[o," %"]})]}):"-"})]},e.id)})}),setOffset:hc.A,title:e("liste_des_v_ne_29929"),totalCount:0}),(0,i.jsx)(md,{height:"9"})]})};function h$(e,t,n){const[i,o]=(0,V.useState)(null);return(0,V.useCallback)(async()=>{if(i)return i;{const i=await e(t,await X()),s=n(i);return o(s),s}},[i,e,t])}const g$=V.createContext({}),p$=e=>{const t=h$(Cr,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?ke.Event:ke.Organization},e=>e.organization.campaigns.nodes),n=h$(Cr,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?ke.Event:ke.Organization},e=>e.organization.event?.customDocuments??[]),o=h$(Cr,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?ke.Event:ke.Organization},e=>e.organization.delegationsCategories.nodes),s=h$(Cr,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?ke.Event:ke.Organization},e=>e.organization.event?.delegationsSpaceLayouts??[]),r=h$(Cr,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?ke.Event:ke.Organization},e=>e.organization.forms.nodes),a=h$(_l,{organizationId:e.organizationId},e=>e.organization.delegations.nodes),l=h$(Cr,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?ke.Event:ke.Organization},e=>e.organization.tags.nodes);return(0,i.jsx)(g$.Provider,{value:{getCampaigns:t,getCustomDocuments:n,getDelegationsCategories:o,getEditPath:e.getEditPath,getShowPath:e.getShowPath,getDelegationsSpaceLayouts:s,getForms:r,getParentDelegations:a,getTags:l},children:e.children})};function f$(){return V.useContext(g$)}const _$=e=>{const{translate:t,params:{organizationId:n}}=bd(),[o,s]=(0,V.useState)(!1),[r,a]=(0,V.useState)(yt.Add),[l,d]=(0,V.useState)([]),[c,u]=(0,V.useState)(e.roles[0]?.id??null),[m,h,g]=gm(""),{usersInfosOptions:p,isLoading:f}=Lv({organizationId:n,eventId:null,hasSelected:Bs(l),nameDebounced:h,userInfoIds:l}),_=Bs(l);return(0,i.jsx)(Av,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"user-gear",children:t("_diter_les_resp_29588")}),(0,i.jsxs)(jv,{gap:"6",children:[(0,i.jsxs)(hh,{label:t("que_souhaitez_v_87607"),value:r,onChange:a,children:[(0,i.jsx)("option",{value:yt.Add,children:t("ajouter_des_res_84773")}),(0,i.jsx)("option",{value:yt.Replace,children:t("remplacer_les_r_60774")}),(0,i.jsx)("option",{value:yt.Delete,children:t("supprimer_des_r_69379")})]}),(0,i.jsx)(Uu,{isSearchLoading:f,isSearchVisible:!0,label:t("reponsable_82458_plural"),multiple:!0,renderOnPortal:!0,searchElement:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),state:"search",value:m,onChange:g}),values:l,onChange:d,children:p}),e.showRoleSelect&&r!==yt.Delete&&(0,i.jsx)(hh,{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)(bv,{children:(0,i.jsx)(kd,{disabled:!_,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")})})]})})};let x$=class extends ZA{translationService;inputName="massAccreditationsProfiles";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField()}}step2Fields(){return{accreditationsProfiles:c.YO().of(c.Ik().shape({accreditationProfileId:c.ai().required(),maxResources:c.gl().nullable(),willAutoAccredit:c.zM().required()})).required(this.t("vous_devez_s_le_98277")).min(1,this.t("vous_devez_s_le_98277"))}}};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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],x$);const I$=e=>{const t=Ti();return(0,i.jsx)(QA,{handleSubmit:e.handleSubmit,nextText:t("suivant_accr_25709"),prefix:"massAccreditationsProfiles.",strategies:[{label:t("ajouter_des_pro_03108"),value:yt.Add},{label:t("remplacer_les_p_03034"),value:yt.Replace},{label:t("supprimer_des_p_90440"),value:yt.Delete}]})},v$=e=>{const t=Ti(),{data:n,loader:o}=Wr({eventId:e.eventId}),{accreditationsProfiles:s,strategy:r}=e.values.massAccreditationsProfiles,a=(0,V.useMemo)(()=>n.event?.accreditationsProfilesCategories??[],[n.event]),l=(0,V.useMemo)(()=>Nj(a),[a]),d=(0,V.useMemo)(()=>s.map(e=>e.accreditationProfileId),[s]),c=(0,V.useCallback)(t=>{const n=t.filter(e=>!s.some(t=>t.accreditationProfileId===e)),i=s.filter(e=>t.includes(e.accreditationProfileId)).concat(n.map(e=>({accreditationProfileId:e,willAutoAccredit:!0})));e.change("massAccreditationsProfiles.accreditationsProfiles",i)},[s,e.change]);return o||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Jj,{accreditationsProfiles:s,accreditationsProfilesCategories:a,change:e.change,hideActions:r===yt.Delete,prefix:"massAccreditationsProfiles."}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Uu,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,triggerElem:(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",children:t("ajouter_des_pro_61834")}),values:d,onChange:c,children:l}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{isLoading:e.submitting,onClick:e.handleSubmit,children:t(r===yt.Add?"ajouter_les_pro_81094":r===yt.Replace?"remplacer_les_p_72074":"supprimer_les_p_65703",e.numberOfSelected)})})]})},b$=e=>{const t=Ti(),n=Ei(x$),{mutate:o}=function(e={}){return Di("mutation DelegationsMassAccreditationsProfilesEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $massAccreditationsProfiles: MassDelegationsAccreditationsProfilesInput!\n) {\n numberOfDelegations: delegationsMassAccreditationsProfilesEdit(\n organizationId: $organizationId\n eventId: $eventId\n massAccreditationsProfiles: $massAccreditationsProfiles\n )\n}\n",e)}();return(0,i.jsx)(JA,{children:(0,i.jsx)(zp,{category:t("d_l_gations_78318"),heading:t("_diter_les_prof_19479"),onClose:e.onClose,children:(0,i.jsx)(Op,{children:(0,i.jsxs)(VI,{initialValues:{massAccreditationsProfiles:{accreditationsProfiles:[],selecteds:e.selecteds,strategy:yt.Add}},isEdit:!1,onSubmit:async n=>{const i=(await o({organizationId:e.organizationId,eventId:e.eventId,massAccreditationsProfiles:n.massAccreditationsProfiles})).numberOfDelegations;e.onSuccess(t("les_profils_d_a_85146",i)),e.onClose()},children:[(0,i.jsx)(BI,{heading:t("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(I$,{handleSubmit:e}),schema:n.step1Schema()}),(0,i.jsx)(BI,{heading:t("profils_d_accr_27825"),render:({form:t,handleSubmit:n,submitting:o,values:s})=>(0,i.jsx)(v$,{change:t.change,eventId:e.eventId,handleSubmit:n,numberOfSelected:e.numberOfSelected,submitting:o,values:s}),schema:n.step2Schema()})]})})})})};let j$=class extends ZA{translationService;inputName="massAccreditationsSlots";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField()}}step2Fields(){return{accreditationsSlots:c.YO().of(c.Ik().shape({accreditationCategoryId:c.ai().required(),accreditationId:c.ai().required(),accreditationSlotId:c.ai().required(),isDefault:c.zM().required(),isVisible:c.zM().required(),maxResources:c.gl().nullable()})).required(this.t("vous_devez_s_le_72138")).min(1,this.t("vous_devez_s_le_72138"))}}};j$=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],j$);const C$=e=>{const t=Ti();return(0,i.jsx)(QA,{handleSubmit:e.handleSubmit,nextText:t("suivant_accr_25709"),prefix:"massAccreditationsSlots.",strategies:[{label:t("ajouter_des_acc_17744"),value:yt.Add},{label:t("remplacer_les_a_92733"),value:yt.Replace},{label:t("supprimer_des_a_04246"),value:yt.Delete}]})},y$="massAccreditationsSlots.",A$=e=>{const t=Ti(),n=Ei(Cm),{data:o,loader:s}=Oi("query DelegationsMassAccreditationsSlotsEvent($eventId: EventId!) {\n event(id: $eventId) {\n ...EventAccreditations\n }\n}\n",{eventId:e.eventId},[js.EventAccreditationsFragment]);const{massAccreditationsSlots:r}=e.values,{strategy:a}=r,l=(0,V.useMemo)(()=>o.event?.accreditationsCategories??[],[o.event]),d=(0,V.useMemo)(()=>Kg(n,l),[n,l]),c=(0,V.useMemo)(()=>new Map(l.flatMap(e=>e.accreditations.flatMap(t=>t.slots.map(n=>[n.id,{accreditationCategoryId:e.id,accreditationId:t.id}])))),[l]),u=(0,V.useMemo)(()=>r.accreditationsSlots.map(e=>e.accreditationSlotId),[r.accreditationsSlots]),m=(0,V.useCallback)(t=>{const{accreditationsSlots:n}=r,i=t.filter(e=>!n.some(t=>t.accreditationSlotId===e)),o=n.filter(e=>t.includes(e.accreditationSlotId)).concat(i.flatMap(e=>{const t=c.get(e);return t?[{...t,accreditationSlotId:e,isDefault:!1,isVisible:!0}]:[]}));Wj(r,o,y$,e.change)},[r,e.change,c]);return s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yj,{accreditationCategories:l,change:e.change,delegationAccreditations:r,prefix:y$,selectedAccreditationsSlotsIds:e.values.selectedAccreditationsSlotsIds}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Uu,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,triggerElem:(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",children:t("AddAccreditations")}),values:u,onChange:m,children:d}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{isLoading:e.submitting,onClick:e.handleSubmit,children:t(a===yt.Add?"ajouter_les_acc_92457":a===yt.Replace?"remplacer_les_a_11676":"supprimer_les_a_19773",e.numberOfSelected)})})]})},S$=e=>{const t=Ti(),n=Ei(j$),{mutate:o}=function(e={}){return Di("mutation DelegationsMassAccreditationsSlotsEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $massAccreditationsSlots: MassDelegationsAccreditationsSlotsInput!\n) {\n numberOfDelegations: delegationsMassAccreditationsSlotsEdit(\n organizationId: $organizationId\n eventId: $eventId\n massAccreditationsSlots: $massAccreditationsSlots\n )\n}\n",e)}();return(0,i.jsx)(JA,{children:(0,i.jsx)(zp,{category:t("d_l_gations_78318"),heading:t("_diter_les_accr_86042"),onClose:e.onClose,children:(0,i.jsx)(Op,{children:(0,i.jsxs)(VI,{initialValues:{massAccreditationsSlots:{accreditationsCategories:[],accreditations:[],accreditationsSlots:[],selecteds:e.selecteds,strategy:yt.Add},selectedAccreditationsSlotsIds:[]},isEdit:!1,onSubmit:async n=>{const i=(await o({organizationId:e.organizationId,eventId:e.eventId,massAccreditationsSlots:n.massAccreditationsSlots})).numberOfDelegations;e.onSuccess(t("les_accr_ditati_58186",i)),e.onClose()},children:[(0,i.jsx)(BI,{heading:t("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(C$,{handleSubmit:e}),schema:n.step1Schema()}),(0,i.jsx)(BI,{heading:t("accr_ditations_39450"),render:({form:t,handleSubmit:n,submitting:o,values:s})=>(0,i.jsx)(A$,{change:t.change,eventId:e.eventId,handleSubmit:n,numberOfSelected:e.numberOfSelected,submitting:o,values:s}),schema:n.step2Schema()})]})})})})},k$=e=>{const{setNodeRef:t,style:n,handleProps:o}=Hm(e.column.slug);return(0,i.jsxs)(rd,{ref:t,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,style:n,children:[(0,i.jsx)(ka,{color:"gray300",css:{cursor:"grab"},...o,children:(0,i.jsx)(Id,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(ka,{color:"gray800",children:e.column.name})]})},w$=e=>(0,i.jsx)(oh,{ids:e.selectedColumns.map(e=>e.slug),onReorder:(t,n)=>{e.setSelectedColumns(Gs(e.selectedColumns,t,n))},children:(0,i.jsx)(rd,{css:{background:"$gray50",bd:"gray200 1",padding:"$4"},direction:"column",children:e.selectedColumns.map(e=>(0,i.jsx)(k$,{column:e},e.slug))})}),E$=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),s=Ei(Fg),{data:r}=Oi("query MassColumnsCustomFields($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n ...OrganizationCustomFields\n }\n}\n",{organizationId:n,eventId:o},[js.OrganizationCustomFieldsFragment]),{mutate:a,isLoading:l}=jr(),d=(0,V.useMemo)(()=>s.getDelegationMembersPossibleColumns(n,r.organization?.customFields.nodes??[],{forDelegationsSpace:!1,isWeezeventConnected:!0,positionDisplay:tt.Position,slotDisplay:Qe.Custom}),[n,s,r.organization]),[c,u]=(0,V.useState)(""),m=(0,V.useMemo)(()=>d.filter(e=>!g(c)||e.name.trim().toLowerCase().includes(c.trim().toLowerCase())),[d,c]),[h,p]=(0,V.useState)([]);return(0,i.jsx)(Av,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"line-columns",children:t("_diter_les_colo_38837")}),(0,i.jsxs)(jv,{gap:"2",children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("quelles_colonne_05047")}),Bs(h)&&(0,i.jsx)(w$,{selectedColumns:h,setSelectedColumns:p}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",children:t("ajouter_des_col_04043")})}),(0,i.jsx)(lu,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:400,children:(0,i.jsxs)(rd,{css:{py:"$3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(ka,{css:{px:"$3"},children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_un_c_86475"),state:"search",value:c,onChange:u})}),(0,i.jsx)(ka,{css:{maxHeight:"300px",overflowY:"auto",px:"$3"},children:m.map(e=>(0,i.jsx)($u,{isCheckbox:!0,isRadio:!1,isSelected:h.includes(e),value:e.slug,onClick:()=>{p(t=>Us(t,e,!t.includes(e)))},children:e.name},e.slug))})]})})]})]}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{isLoading:l,onClick:async()=>{const i=(await a({organizationId:n,eventId:o,massEdit:{reset:!1,selecteds:e.selecteds,slug:Ke.Columns,strategy:yt.Replace,value:h.map(e=>e.slug)}})).numberOfEdited;e.onSuccess(t("les_colonnes_de_83023",i)),e.onClose()},children:t("mettre_jour_85141")})})]})})},T$=e=>{const{translate:t}=bd(),{mutate:n,isLoading:o}=function(e={}){return Di("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,V.useState)([]),[a,l]=(0,V.useState)([]),{data:d}=Oi("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?ke.Organization:ke.Event,eventId:s[0]},[]);const c=(!!e.eventId||Bs(s))&&Bs(a);return(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(wj,{color:"primary",icon:"clone"})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{font:"gray900 textLg medium",textAlign:"center",children:t("copier_les_d_l_43406")}),e.eventId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:t("cela_liera_vos_60643")})]}),(0,i.jsx)(md,{height:"7"}),!e.eventId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uu,{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)(md,{height:"4"})]}),(e.eventId||Bs(s))&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Uu,{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)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{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)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},R$=()=>{const e=Ti(),{canDelegationEdit:t}=Dv(),{eventId:n,massActions:o,onMassEditSuccess:s,organizationId:r,predicates:a,segment:l}=SC(),{showNotification:d}=HI(),{mutate:c}=jr(),{mutate:u}=function(e={}){return Di("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:m}=fl(),{mutate:h}=pl(),[p,f]=(0,V.useState)(!1),[_,x]=(0,V.useState)(!1),[I,v]=(0,V.useState)(!1),[b,j]=(0,V.useState)(!1),[C,y]=(0,V.useState)(!1),[A,S]=(0,V.useState)(!1),[k,w]=(0,V.useState)(!1),E=o.getSelectedsInput(a,null),T=o.isAllSelected?l.count:o.numberOfSelected,R=(0,V.useCallback)(e=>{g(e)&&d(e),s()},[s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kd,{onClick:()=>{f(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsxs)(MA,{children:[t&&(0,i.jsx)(ru,{icon:"clone",onClick:()=>x(!0),children:e(n?"copier_dans_la_91936":"copier_dans_un_20230")}),t&&(0,i.jsx)(ru,{icon:"user-gear",onClick:()=>v(!0),children:e("_diter_les_resp_29588")}),t&&(0,i.jsx)(ru,{icon:"paper-plane",onClick:()=>(async()=>{const t=(await m({organizationId:r,eventId:n,selecteds:E})).numberOfDelegations;R(e("l_e_mail_d_invi_63545",t))})(),children:e("envoyer_l_e_mai_17491")}),t&&(0,i.jsx)(ru,{icon:"line-columns",onClick:()=>j(!0),children:e("_diter_les_colo_38837")}),t&&n&&(0,i.jsx)(ru,{icon:"badge-check",onClick:()=>S(!0),children:e("_diter_les_accr_86042")}),t&&n&&(0,i.jsx)(ru,{icon:"badge-check",onClick:()=>y(!0),children:e("_diter_les_prof_19479")})]}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>w(!0),children:e("supprimer_43083")})})]})]}),p&&(0,i.jsx)(qA,{eventId:n,mutate:e=>c({organizationId:r,eventId:n,massEdit:e}),organizationId:r,selecteds:E,onClose:()=>{f(!1)},onSuccess:t=>{R(e("_1_d_l_gations_08105",t))}}),_&&(0,i.jsx)(T$,{eventId:n,organizationId:r,selecteds:E,onClose:()=>{x(!1)},onSuccess:s}),I&&(0,i.jsx)(_$,{roles:[],showRoleSelect:!1,onClose:()=>v(!1),onSuccess:async(t,i)=>{const o=(await u({organizationId:r,eventId:n,massLeaders:{leaders:i,strategy:t,selecteds:E}})).numberOfDelegations;R(e("les_responsable_32087",o))}}),A&&n&&(0,i.jsx)(S$,{eventId:n,numberOfSelected:T,organizationId:r,selecteds:E,onClose:()=>S(!1),onSuccess:R}),C&&n&&(0,i.jsx)(b$,{eventId:n,numberOfSelected:T,organizationId:r,selecteds:E,onClose:()=>y(!1),onSuccess:R}),b&&(0,i.jsx)(E$,{selecteds:E,onClose:()=>j(!1),onSuccess:R}),k&&(0,i.jsx)(DA,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_34990")],text:e("suppression_de_99024",T),onClose:()=>{w(!1)},onDelete:async()=>{const t=(await h({organizationId:r,eventId:n,selecteds:E})).numberOfDelegations;R(e("_1_d_l_gations_40887",t))}})]})},O$=e=>{const t=Ti(),n=Ei(lI);return(0,i.jsxs)(rd,{align:"center",css:{"& > div":{width:"100%"}},gap:"2",width:1,children:[(0,i.jsx)(ka,{children:t("_1_2_membres_04485",e.assignedResources,n.toNumberOrInfinity(e.resources))}),(0,i.jsx)(u$,{percent:e.assignedResources/(e.resources||e.assignedResources)})]})},D$=e=>{const t=(0,V.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)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:t})})},z$=(0,i.jsx)(Cd,{});function $$(e){const[t,n]=(0,V.useState)(!0),[i,o]=(0,V.useState)(null);return(0,V.useEffect)(()=>{e().then(e=>{o(e),n(!1)},()=>{n(!1)})},[]),{isLoading:t,loader:t?z$:null,result:i}}const P$=e=>{const t=Ti(),{getDelegationsSpaceLayouts:n}=f$(),{result:o,isLoading:s}=$$(n);return s?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zd,{children:t("DelegationsSpaceLayout")}),(0,i.jsx)(ju,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Uu,{label:t("DelegationsSpaceLayout"),renderOnPortal:!0,shouldParseAsInt:!0,values:"number"==typeof e.value?[e.value]:[],onChange:t=>{Bs(t)?e.setValue(t[0]):e.setValue(null)},children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},M$=e=>{const{eventId:t,organizationId:n}=SC(),{mutate:o}=jr();return(0,i.jsx)(OC,{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:yt.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},F$=e=>(0,i.jsx)(M$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.delegationsSpaceLayout?.id,property:Ke.DelegationsSpaceLayout,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(P$,{setValue:t,value:e}),renderValue:e.delegation.delegationsSpaceLayout?e.delegation.delegationsSpaceLayout.name:"-"}),N$=e=>{const t=Ti(),{getParentDelegations:n}=f$(),{result:o,isLoading:s}=$$(n);return s?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zd,{children:t("d_l_gation_de_l_86100")}),(0,i.jsx)(ju,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("d_l_gation_de_l_86100"),renderOnPortal:!0,shouldParseAsInt:!0,values:"number"==typeof e.value?[e.value]:[],onChange:t=>{Bs(t)?e.setValue(t[0]):e.setValue(null)},children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},L$=e=>{const{params:{organizationId:t}}=bd(),{isEditMode:n}=SC();return(0,i.jsx)(M$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.parent?.id,property:Ke.Parent,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(N$,{setValue:t,value:e}),renderValue:()=>e.delegation.parent?(0,i.jsx)(Vz,{isEditMode:n,title:e.delegation.parent.name,updatable:!0,children:(0,i.jsx)(bm,{to:qo.DELEGATION({organizationId:t,delegationId:e.delegation.parent.id}),children:e.delegation.parent.name})}):""})},B$=e=>{const t=(0,V.useMemo)(()=>(e.delegation.accreditationsSlots??[]).map(e=>e.accreditationSlot),[e.delegation]),n=(0,V.useMemo)(()=>pg(t),[t]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:n,doNotSort:!0})})},V$=e=>{const t=(0,V.useMemo)(()=>QC((e.delegation.accreditationsProfiles||[]).map(e=>e.accreditationProfile)),[e.delegation]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:t,doNotSort:!0})})},U$=e=>{const{translate:t}=bd(),{getCampaigns:n}=f$(),{result:o,isLoading:s}=$$(n);return s?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zd,{children:t("tags_79499")}),(0,i.jsx)(ju,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Uu,{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))})},W$=e=>{const t=(0,V.useMemo)(()=>e.delegation.campaigns||[],[e.delegation]),n=(0,V.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(M$,{column:e.column,delegation:e.delegation,initialValue:t.map(e=>e.id),property:Ke.Campaigns,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(U$,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(UC,{badges:n})})},G$=e=>{const{translate:t}=bd(),{getDelegationsCategories:n}=f$(),{result:o,isLoading:s}=$$(n);return s?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zd,{children:t("Category")}),(0,i.jsx)(ju,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(hh,{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))})},q$=e=>{const{params:{organizationId:t,eventId:n}}=bd(),{isEditMode:o}=SC();return(0,i.jsx)(M$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.delegationCategory.id,property:Ke.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(G$,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(Vz,{isEditMode:o,title:e.delegation.delegationCategory.name,updatable:!0,children:(0,i.jsx)(bm,{to:qo.DELEGATION_CATEGORY({organizationId:t,eventId:n,delegationCategoryId:e.delegation.delegationCategory.id}),children:e.delegation.delegationCategory.name})})})},H$=e=>{const t=(0,V.useMemo)(()=>(0,cm.A)(e.delegation.delegationCategory.leaders,e=>m(e.userInfo.nameOrEmail)).map(e=>({id:e.userInfo.id,color:"gray",icon:null,text:e.userInfo.nameOrEmail})),[e.delegation]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:t})})},K$=e=>{const t=Ti(),n=Ei(Cm);return(0,i.jsx)(M$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.deadlineDate,property:Ke.DeadlineDate,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Ih,{label:t("date_limite_d_i_79779"),value:e,onChange:n}),renderValue:e.delegation.deadlineDate?n.toLocaleString(e.delegation.deadlineDate,zs.DateOnly.MonthLong):"-"})},Y$=e=>{const t=Ti();return(0,i.jsx)(Om,{buttons:(0,i.jsx)(kd,{color:"white",onClick:e.onClose,children:t("fermer_62479")}),size:"md",onClose:e.onClose,children:(0,i.jsx)(rd,{css:{overflowY:"auto"},direction:"column",gap:"2",children:(0,i.jsx)(jf,{text:e.text})})})},Z$={clamp:"2",wordBreak:"break-word"},X$=e=>{const{isEditMode:t}=SC(),{isEditMode:n}=ip(),o=t||n,[s,r]=(0,V.useState)(!1),a=(0,V.useMemo)(()=>(e.text||"").replace(/<\/(p|div|li|ul|ol|h[1-6]|blockquote|tr)\s*>/gi," ").replace(/<(br|hr)\s*\/?>/gi," ").replace(/<[^>]*>/g,"").replace(/&(#\d+|#x[0-9a-f]+|[a-z]+);/gi,(e,t)=>t.startsWith("#x")||t.startsWith("#X")?String.fromCodePoint(parseInt(t.slice(2),16)):t.startsWith("#")?String.fromCodePoint(parseInt(t.slice(1),10)):f[t.toLowerCase()]??e).replace(/\s+/g," ").trim(),[e.text]),l=!g(a),d=(0,V.useCallback)(async t=>{await e.mutate(t),e.reload()},[e.mutate,e.reload]),c=(0,V.useCallback)(()=>l?"-":(0,i.jsx)(ka,{css:Z$,children:a}),[l,a]);return o&&e.updatable?(0,i.jsx)(RC,{column:e.column,initialValue:e.text||"",renderInput:(t,n)=>(0,i.jsx)(ka,{css:{overflow:"hidden auto"},width:1,onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},children:(0,i.jsx)(AI,{initialValue:t,label:e.column.name,onChange:n})}),renderValue:c,onSave:d}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qu,{css:{border:"2px solid transparent",cursor:l?"default":"pointer"},minWidth:e.column.minWidth,width:e.column.width,onClick:e=>{l||(Gd(e),r(!0))},children:c()}),s&&(0,i.jsx)(Y$,{text:e.text,onClose:()=>{r(!1)}})]})},J$=e=>{const{eventId:t,organizationId:n}=SC(),{mutate:o}=jr(),s=(0,V.useCallback)(i=>o({organizationId:n,eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.delegation.id]},slug:Ke.Description,strategy:yt.Replace,value:i}}),[n,t,e.delegation.id,o]);return(0,i.jsx)(X$,{column:e.column,mutate:s,reload:e.reload,text:e.delegation.description,updatable:!0})},Q$=e=>{const{translate:t}=bd(),{getCustomDocuments:n}=f$(),{result:o,isLoading:s}=$$(n);return s?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zd,{children:t("tags_79499")}),(0,i.jsx)(ju,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Uu,{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))})},eP=e=>{const t=(0,V.useMemo)(()=>e.delegation.customDocuments||[],[e.delegation]),n=(0,V.useMemo)(()=>t.map(e=>({id:e.slug,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(M$,{column:e.column,delegation:e.delegation,initialValue:t.map(e=>e.slug),property:Ke.Documents,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(Q$,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(UC,{badges:n})})},tP=e=>{const t=Ti(),{getForms:n}=f$(),{result:o,isLoading:s}=$$(n);return s?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zd,{children:t("Form")}),(0,i.jsx)(ju,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(hh,{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))})},nP=e=>(0,i.jsx)(M$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.form.id,property:Ke.Form,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(tP,{setValue:t,value:e}),renderValue:e.delegation.form.name}),iP=e=>{const t=Ti();return(0,i.jsx)(M$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.lockedAt?.isValid??!1,property:Ke.IsLocked,reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(hh,{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")})},oP=e=>{const t=(0,V.useMemo)(()=>(0,cm.A)(e.delegation.leaders,e=>m(e.nameOrEmail)).map(e=>({id:e.id,color:"gray",icon:null,text:e.nameOrEmail})),[e.delegation]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:t})})},sP=e=>{const t=Ti(),n=Ei(lI);return(0,i.jsx)(M$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.maxResources||"",property:Ke.MaxResources,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Qd,{label:t("MaxResources"),shouldParseAsInt:!0,value:e,onChange:n}),renderValue:n.toNumberOrInfinity(e.delegation.maxResources)})},rP=e=>{const{translate:t}=bd(),{isEditMode:n}=SC(),{getShowPath:o}=f$();return(0,i.jsx)(M$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.name,property:Ke.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Qd,{label:t("nom_de_la_d_l_g_28087"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Vz,{isEditMode:n,title:e.delegation.name,updatable:!0,children:(0,i.jsx)(bm,{to:o(e.delegation.id),children:(0,i.jsx)(ka,{css:{clamp:2},title:e.delegation.name,children:e.delegation.name})})})})},aP=e=>{const t=Ti();return(0,i.jsx)(M$,{column:e.column,delegation:e.delegation,initialValue:e.value,property:e.property,reload:e.reload,renderInput:(n,o)=>(0,i.jsxs)(hh,{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")})},lP=e=>{const{translate:t}=bd(),{getTags:n}=f$(),{result:o,isLoading:s}=$$(n);return s?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zd,{children:t("tags_79499")}),(0,i.jsx)(ju,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Uu,{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))})},dP=e=>{const t=(0,V.useMemo)(()=>e.delegation.tags||[],[e.delegation]),n=(0,V.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(M$,{column:e.column,delegation:e.delegation,initialValue:t.map(e=>e.id),property:Ke.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(lP,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(UC,{badges:n})})},cP=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{mutate:s}=jr(),r=(0,V.useCallback)((t,n)=>s({organizationId:e.organizationId,eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:n,strategy:yt.Replace,value:t}}),[e.row,s]),a=(0,V.useMemo)(()=>cf({organizationId:n,eventId:o,delegationId:e.row.id,formId:e.row.form.id}),[e.row]),l=(0,V.useMemo)(()=>df(n,qo.DELEGATION({organizationId:n,eventId:o,delegationId:e.row.id})),[e.row]);return e.column.slug===Sg.Id?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===Sg.Name?(0,i.jsx)(rP,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===Sg.Description?(0,i.jsx)(J$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===Sg.DelegationCategory?(0,i.jsx)(q$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===Sg.State?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(vu,{...zb(e.row.state),children:t(e.row.state)})}):e.column.slug===Sg.Leaders?(0,i.jsx)(oP,{column:e.column,delegation:e.row}):e.column.slug===Sg.CategoryLeaders?(0,i.jsx)(H$,{column:e.column,delegation:e.row}):e.column.slug===Sg.Form?(0,i.jsx)(nP,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===Sg.FormLink?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(bm,{to:a,children:a})}):e.column.slug===Sg.DelegationSpaceLink?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(bm,{to:l,children:l})}):e.column.slug===Sg.DeadlineDate?(0,i.jsx)(K$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===Sg.MaxResources?(0,i.jsx)(sP,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===Sg.AssignedResources?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(O$,{assignedResources:e.row.numberOfResources,resources:e.row.maxResources})}):e.column.slug===Sg.Tags?(0,i.jsx)(dP,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===Sg.FillingRate?(0,i.jsxs)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===Sg.CreatedBy?(0,i.jsx)(Nz,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===Sg.ShowInDelegation?(0,i.jsx)(aP,{column:e.column,delegation:e.row,label:t("ShowInDelegationSpace"),property:Ke.ShowInDelegationSpace,reload:e.reloadRow,value:e.row.showInDelegationSpace}):e.column.slug===Sg.CanLeadersAddMembers?(0,i.jsx)(aP,{column:e.column,delegation:e.row,label:t("CanLeadersAddMembers"),property:Ke.CanLeadersAddMembers,reload:e.reloadRow,value:e.row.canLeadersAddMembers}):e.column.slug===Sg.CanLeadersDeleteMembers?(0,i.jsx)(aP,{column:e.column,delegation:e.row,label:t("CanLeadersDeleteMembers"),property:Ke.CanLeadersDeleteMembers,reload:e.reloadRow,value:e.row.canLeadersDeleteMembers}):e.column.slug===Sg.CanLeadersDuplicateMembers?(0,i.jsx)(aP,{column:e.column,delegation:e.row,label:t("CanLeadersDuplicateMembers"),property:Ke.CanLeadersDuplicateMembers,reload:e.reloadRow,value:e.row.canLeadersDuplicateMembers}):e.column.slug===Sg.CanLeadersEditColumns?(0,i.jsx)(aP,{column:e.column,delegation:e.row,label:t("CanLeadersEditColumns"),property:Ke.CanLeadersEditColumns,reload:e.reloadRow,value:e.row.canLeadersEditColumns}):e.column.slug===Sg.CanLeadersEditMembers?(0,i.jsx)(aP,{column:e.column,delegation:e.row,label:t("CanLeadersEditMembers"),property:Ke.CanLeadersEditMembers,reload:e.reloadRow,value:e.row.canLeadersEditMembers}):e.column.slug===Sg.CanLeadersEditCustomFields?(0,i.jsx)(aP,{column:e.column,delegation:e.row,label:t("CanLeadersEditCustomFields"),property:Ke.CanLeadersEditCustomFields,reload:e.reloadRow,value:e.row.canLeadersEditCustomFields}):e.column.slug===Sg.CanLeadersImportMembers?(0,i.jsx)(aP,{column:e.column,delegation:e.row,label:t("CanLeadersImportMembers"),property:Ke.CanLeadersImportMembers,reload:e.reloadRow,value:e.row.canLeadersImportMembers}):e.column.slug===Sg.CanLeadersSeeHiddenAccreditationsSlots?(0,i.jsx)(aP,{column:e.column,delegation:e.row,label:t("CanLeadersSeeHiddenAccreditationsSlots"),property:Ke.CanLeadersSeeHiddenAccreditationsSlots,reload:e.reloadRow,value:e.row.canLeadersSeeHiddenAccreditationsSlots}):e.column.slug===Sg.ShowFormLinkInDelegationSpace?(0,i.jsx)(aP,{column:e.column,delegation:e.row,label:t("afficher_le_lie_05841"),property:Ke.ShowFormLinkInDelegationSpace,reload:e.reloadRow,value:e.row.showFormLinkInDelegationSpace}):e.column.slug===Sg.DelegationsSpaceLayout?(0,i.jsx)(F$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===Sg.ShowAllAccreditations?(0,i.jsx)(aP,{column:e.column,delegation:e.row,label:t("ShowAllAccreditations"),property:Ke.ShowAllAccreditations,reload:e.reloadRow,value:e.row.showAllAccreditations}):e.column.slug===Sg.IsLocked?(0,i.jsx)(iP,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===Sg.CreatedAt?(0,i.jsx)(Fz,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===Sg.Accreditations?(0,i.jsx)(B$,{column:e.column,delegation:e.row}):e.column.slug===Sg.AccreditationsProfiles?(0,i.jsx)(V$,{column:e.column,delegation:e.row}):e.column.slug===Sg.Campaigns?(0,i.jsx)(W$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===Sg.Documents?(0,i.jsx)(eP,{column:e.column,delegation:e.row,reload:e.reloadRow}):"events"===e.column.slug?(0,i.jsx)(D$,{column:e.column,delegation:e.row}):e.column.slug===Sg.Parent?(0,i.jsx)(L$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===Sg.UsedCustomFieldsFilled?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:t(e.row.usedCustomFieldsFilled?.toString()||"-")}):(0,i.jsx)(KC,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:r,reload:e.reloadRow,updatable:!0})},uP=e=>{const{history:t,translate:n}=bd(),{getEditPath:o}=f$(),{mutate:s}=hl(),[r,a]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{children:[(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"pen",to:o(e.delegation.id),children:n("_diter_62574")}),(0,i.jsx)(ru,{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)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:async()=>{a(!0)},children:n("supprimer_43083")})})]}),r&&(0,i.jsx)(rw,{delegation:e.delegation,onClose:()=>{a(!1)},onSuccess:e.reload})]})},mP=({columns:e,customFields:t,delegation:n,eventId:o,organizationId:s,state:r,reload:a,reloadDelegation:l,toggleRow:d})=>{const{canDelegationEdit:c}=Dv(),{getEditPath:u}=f$(),m=jC(t),h=(0,V.useCallback)(()=>{l(n.id)},[n,l]);return(0,i.jsxs)(am,{css:{background:"checked"===r?"$primary100":"white","&:hover":{background:"checked"===r?"$primary100":"$gray100"}},onMouseLeave:e=>{eu(e.target)},children:[c&&(0,i.jsx)(Qu,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:r,onClick:(e,t)=>{Gd(t),d(`d${n.id}`,e,t.shiftKey)}})}),e.map(e=>{const t=m.get(e.slug);return(0,i.jsx)(cP,{column:e,customField:t,eventId:o,organizationId:s,reloadRow:h,row:n},e.slug)}),c&&(0,i.jsxs)(jm,{justify:"center",children:[(0,i.jsx)(Ip,{children:(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"pen",to:u(n.id)})})})}),(0,i.jsx)(uP,{delegation:n,eventId:o,organizationId:s,reload:a})]})]})},hP=e=>{const{canDelegationEdit:t}=Dv(),{columns:n,columnsSearch:o,limit:s,massActions:r,nameDebounced:a,offset:l,possibleColumns:d,predicates:c,reloadKey:u,rendering:m,setLimit:h,setOffset:p,setSort:f,sort:_}=SC(),x=(0,V.useMemo)(()=>kg(n,m),[n,m]),{data:I,isLoading:v,reload:b}=gl({...x,organizationId:e.organizationId,level:e.level,eventId:e.eventId,name:g(a)?a:null,columnsSearch:Bs(o)?o:null,predicates:c,limit:s,offset:l,sort:_}),j=(0,V.useMemo)(()=>n.flatMap(e=>(0,hd.A)([d.find(t=>t.slug===e)])),[d,n]),{numberOfPages:C,totalCount:y}=ah(I.data?.rows),[A,S]=(0,V.useState)([]),[k,w]=(0,V.useState)({}),E=(0,V.useCallback)(async t=>{w(e=>({...e,[t]:!0}));const{data:{row:n}}=await(i={...x,organizationId:e.organizationId,id:t},o=await X(),Js("query DelegationsDelegation(\n $organizationId: OrganizationId!\n $id: DelegationId!\n $includeAccreditations: Boolean!\n $includeAccreditationsProfiles: Boolean!\n $includeAccreditationsSlots: Boolean!\n $includeCampaigns: Boolean!\n $includeChildren: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeDocuments: Boolean!\n $includeLayout: Boolean!\n $includeLeaders: Boolean!\n $includeParent: 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:[js.DelegationsDelegationFragment]}));var i,o;S(e=>e.map(e=>e.id===t?n:e)),w(e=>({...e,[t]:!1}))},[x,w,S]);return(0,V.useEffect)(()=>{S(I.data?.rows.nodes??[])},[I.data]),(0,V.useEffect)(()=>{u>1&&b()},[u]),(0,V.useEffect)(()=>{r.setStates(Object.fromEntries((I.data?.rows.nodes??[]).map(e=>[`d${e.id}`,{id:e.id,state:"unchecked"}])))},[I.data,r.setStates]),(0,i.jsx)(rd,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(_p,{"aria-busy":v,headerRow:(0,i.jsxs)(Wu,{children:[t&&(0,i.jsx)(pm,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:r.selectAllState,onClick:r.toggleSelectAll})}),j.map(e=>e.isSortable?(0,i.jsx)(fp,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:f,sort:_,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(pm,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),t&&(0,i.jsx)(pm,{width:100})]}),paginationRow:(0,i.jsx)(lm,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(rm,{limit:s,numberOfPages:C,offset:l,setLimit:h,setOffset:p,showLimits:!0,totalCount:y})}),children:v?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):A.map(t=>k[t.id]?(0,i.jsx)(fm,{},t.id):(0,i.jsx)(mP,{columns:j,customFields:e.customFields,delegation:t,eventId:e.eventId,organizationId:e.organizationId,reload:b,reloadDelegation:E,state:r.states[`d${t.id}`]?.state??"unchecked",toggleRow:r.toggleRow},t.id))})})},gP=()=>{const{history:e,translate:t,params:{organizationId:n}}=bd();return(0,i.jsx)(zz,{children:(0,i.jsx)(Mv,{permissions:Ov.DELEGATION_EDIT,children:(0,i.jsx)(kd,{onClick:()=>{e.push(fs.COMMUNITY_CREATE_DELEGATION(n))},children:t("cr_er_une_d_l_g_23035")})})})},pP=e=>{const{translate:t,params:{organizationId:n}}=bd(),{canDelegationEdit:o,canSegmentEdit:s}=zv(),{limit:r,segment:a}=SC();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(gP,{}),0===e.numberOfDelegations?(0,i.jsx)(Qv,{css:{overflow:"hidden"},children:(0,i.jsx)(rd,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(pA,{title:t("vous_n_avez_pas_32103")})})}):(0,i.jsxs)(Qv,{children:[(0,i.jsx)(Oz,{searchRow:(0,i.jsx)(Tz,{actions:(0,i.jsx)(R$,{}),searchPlaceholder:t("rechercher_une_31213"),showActions:o,showEditColumns:s,showEditMode:o,showSearchColumns:s}),selectSegment:(0,i.jsx)(wz,{pageSelectedText:t("les_1_d_l_gat_27248",r),segmentSelectedText:t("les_1_d_l_gat_04594",a.count,a.name)})}),(0,i.jsx)(hP,{customFields:e.customFields,eventId:null,level:ke.Organization,organizationId:n})]})]})},fP=e=>{const{history:t,params:{organizationId:n,segmentId:o},translate:s}=bd();Zc(`${s("communaut_20896")} ${s("d_l_gations_78318")}`);const{localOrganization:r,updateLocalOrganization:a}=_v(),{canSegmentEdit:l}=zv(),d=Ei(wg),c=(0,V.useMemo)(()=>d.getDelegationsFilters(n,null,e.organization.customFields.nodes,e.organization.delegationsCategories.nodes),[e.organization,n]),u=(0,V.useMemo)(()=>d.getDelegationsPossibleColumns(null,e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(p$,{eventId:null,getEditPath:e=>Zi(qo.DELEGATION({organizationId:n,delegationId:e})),getShowPath:e=>qo.DELEGATION({organizationId:n,delegationId:e}),organizationId:n,children:(0,i.jsx)(kz,{canSegmentEdit:l,filters:c,filtersButtonText:s("filtrer_les_d_l_04628"),filtersSubtitle:s("appliquer_des_f_65318"),getSegmentPath:e=>fs.COMMUNITY_DELEGATIONS_SEGMENT(n,e),hideSegments:0===e.organization.numberOfDelegations,initialLimit:r?.delegationsLimit??em,initialSegmentsOpen:r?.areDelegationsSegmentsOpen??!0,organizationId:n,possibleColumns:u,possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:Me.Delegations,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{a({delegationsLimit:e})},onSegmentClick:e=>{a({delegationsSegmentId:e})},onSegmentDelete:async()=>{await a({delegationsSegmentId:null}),t.replace(fs.COMMUNITY_DELEGATIONS(n))},onSegmentsToggle:async e=>{await a({areDelegationsSegmentsOpen:e})},children:(0,i.jsx)(pP,{customFields:e.organization.customFields.nodes,numberOfDelegations:e.organization.numberOfDelegations})})})},_P=()=>{const{history:e,params:{organizationId:t}}=bd(),{localOrganization:n}=_v(),{data:o,loader:s,reload:r}=Oi("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},[js.SegmentCustomFieldFragment,js.SegmentsFoldersSegmentsFragment]),a=(0,V.useMemo)(()=>(o.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[o.organization]);return s||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:fs.COMMUNITY_DELEGATIONS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(fP,{organization:o.organization,reload:r})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{onLoad:()=>{const i=n?.delegationsSegmentId&&a.includes(n.delegationsSegmentId)?n?.delegationsSegmentId:a[0];e.replace(fs.COMMUNITY_DELEGATIONS_SEGMENT(t,i))}})})]})},xP=()=>{const{hasFeature:e}=_v();return e(Ae.Delegation)?(0,i.jsx)(_P,{}):(0,i.jsx)(rd,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(kx,{icon:"people-group"})})},IP=e=>{const t=Ti(),{isLoading:n,copy:o}=RI();return(0,i.jsxs)(ka,{children:[(0,i.jsx)(ka,{color:"gray700",css:e.css,children:e.title}),(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{gap:"2",children:[(0,i.jsx)(Qd,{css:{"& .h-styled-input-container":{background:"white"}},hint:e.hint,state:"disabled",value:e.link,onChange:hc.A}),(0,i.jsx)(kd,{color:e.buttonColor,isLoading:n,leftIcon:"copy",onClick:()=>o(e.link),children:t("copier_75889")})]})]})},vP=xa("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"}}),bP=({isOpen:e,onClose:t,link:n})=>{const o=Ti(),s=Ri();return(0,i.jsx)(Av,{isOpen:e,onClose:t,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"plug-circle-bolt",subtitle:o("exporter_votre_81734"),onClose:t,children:o("export_de_votre_02014")}),(0,i.jsx)(jv,{children:(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(ka,{css:{marginBottom:"$5"},children:(0,i.jsxs)(zd,{alertStyle:"warning",children:[(0,i.jsx)($d,{children:o("limites_des_exp_03687")}),(0,i.jsx)(Pd,{children:(0,i.jsxs)(vP,{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)(IP,{buttonColor:"primary",css:{fontWeight:500},link:n,title:o("lien_d_api_pour_98778")}),(0,i.jsx)(IP,{buttonColor:"primary",css:{fontWeight:500},link:`=IMPORTDATA("${n}")`,title:o("import_de_la_vu_17175")})]})})]})})},jP=e=>{const t=Ti(),[n,o]=(0,V.useState)(bt.Excel),[s,r]=(0,V.useState)("unchecked");return(0,i.jsx)(Av,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"file-xls",subtitle:t("exporter_votre_28801"),children:t("exporter_vos_me_10045")}),(0,i.jsxs)(jv,{gap:"3",children:[(0,i.jsx)(ka,{font:"gray800 textMd medium",children:t("parameters_de_votre_export")}),(0,i.jsxs)(rd,{direction:"column",gap:"5",children:[(0,i.jsxs)(hh,{label:t("format_de_lexport"),value:n,onChange:o,children:[(0,i.jsx)("option",{value:bt.Excel,children:"Excel (.xslx)"}),(0,i.jsx)("option",{value:bt.Csv,children:"CSV (.csv)"})]}),e.showIncludeFiles&&(0,i.jsx)(Eu,{state:s,onClick:r,children:t("inclure_dans_l_65554")})]})]}),(0,i.jsx)(bv,{children:()=>(0,i.jsx)(kd,{onClick:()=>{e.requestExport(n,"checked"===s),e.onClose()},children:t("recevoir_l_expo_53392")})})]})})},CP=({organizationKey:e})=>{const{history:t,translate:n,params:{organizationId:o,segmentId:s}}=bd(),{user:r}=Li(),{segment:a,columns:l}=SC(),{mutate:d}=function(e={}){return Di("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)}(),[c,u]=(0,V.useState)(!1),[m,h]=(0,V.useState)(!1),{checkExport:g}=HI();return(0,i.jsxs)(zz,{children:[(0,i.jsx)(Mv,{permissions:Ov.MEMBER_CREATE,children:(0,i.jsx)(dE,{menu:(0,i.jsx)(ru,{icon:"file-import",onClick:()=>{t.push(fs.COMMUNITY_VOLUNTEERS_IMPORT(o))},children:n("importer_via_un_61623")}),path:bx.CREATE({organizationId:o}),children:n("ajouter_un_memb_33261")})}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsx)(Mv,{permissions:Ov.MEMBER_CREATE,children:(0,i.jsx)(ru,{icon:"merge",onClick:()=>{t.push(fs.COMMUNITY_USERS_DUPLICATES(o))},children:n("g_rer_les_doubl_39469")})}),(0,i.jsx)(ru,{icon:"plug-circle-bolt",onClick:e=>{eu(e.target),u(!0)},children:n("exporter_via_l_09843")}),(0,i.jsx)(ru,{icon:"file-xls",onClick:e=>{eu(e.target),h(!0)},children:n("exporter_en_exc_51862")}),(0,i.jsx)(Mv,{permissions:Ov.MEMBER_CREATE,children:(0,i.jsx)(ru,{icon:"file-import",onClick:()=>{t.push(fs.COMMUNITY_FILES_IMPORT(o))},children:n("importer_des_do_55420")})})]})]}),(0,i.jsx)(bP,{isOpen:c,link:hf({organizationId:o,eventId:void 0,lang:r?.language,pathComponent:`members/${s}`,key:e}),onClose:()=>{u(!1)}}),(0,i.jsx)(jP,{isOpen:m,requestExport:async(e,t)=>{const{jobId:n}=await d({organizationId:o,segmentId:a.id,format:e,includeFiles:t,columns:l});g(n,o)},showIncludeFiles:!0,onClose:()=>{h(!1)}})]})},yP=e=>{const{translate:t,params:{organizationId:n}}=bd(),{canMemberEdit:o}=zv(),s=jC(e.customFields),r=(0,V.useCallback)(()=>{e.reloadUserInfo(e.userInfo.id)},[e.userInfo,e.reloadUserInfo]);return(0,i.jsxs)(am,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},children:[o&&(0,i.jsx)(Qu,{css:{paddingRight:0},width:48,children:(0,i.jsx)(wu,{state:e.state,onClick:(t,n)=>{Gd(n),e.toggleRow(`ui${e.userInfo.id}`,t,n.shiftKey)}})}),e.columns.map(t=>{const n=s.get(t.slug);return(0,i.jsx)(HS,{column:t,customField:n,reloadRow:r,row:e.userInfo,updatable:!0},t.slug)}),o&&(0,i.jsx)(jm,{justify:"center",children:(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"pen",to:fs.COMMUNITY_EDIT_USER(n,e.userInfo.id)})})}),(0,i.jsx)(bp,{placement:"top",children:t("_diter_62574")})]})})]})},AP=e=>{const{organizationId:t}=zi(),{canMemberEdit:n}=zv(),{columns:o,columnsSearch:s,massActions:r,nameDebounced:a,limit:l,offset:d,possibleColumns:c,predicates:u,reloadKey:m,setLimit:h,setOffset:p,setSort:f,sort:_}=SC(),x=(0,V.useMemo)(()=>WS(o),[o]),{data:I,isLoading:v,reload:b}=(j={...x,organizationId:t,predicates:u,name:g(a)?a:null,columnsSearch:Bs(s)?s:null,limit:l,offset:d,sort:_},Oi(sr,j,[js.UserInfoCommunityFragment]));var j;const{numberOfPages:C,totalCount:y}=ah(I.data?.rows);(0,V.useEffect)(()=>{m>1&&b()},[m]);const A=(0,V.useMemo)(()=>o.flatMap(e=>(0,hd.A)([c.find(t=>t.slug===e)])),[c,o]),[S,k]=(0,V.useState)([]),[w,E]=(0,V.useState)({}),T=(0,V.useCallback)(async e=>{E(t=>({...t,[e]:!0}));const{data:{row:n}}=await Fr({...x,organizationId:t,id:e},await X());k(t=>t.map(t=>t.id===e?n:t)),E(t=>({...t,[e]:!1}))},[x,E,k]);return(0,V.useEffect)(()=>{k(I.data?.rows.nodes??[])},[I.data]),(0,V.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)(rd,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(_p,{"aria-busy":v,headerRow:(0,i.jsxs)(Wu,{children:[n&&(0,i.jsx)(pm,{css:{paddingRight:0},width:48,children:(0,i.jsx)(wu,{state:r.selectAllState,onClick:r.toggleSelectAll})}),A.map(e=>e.isSortable?(0,i.jsx)(fp,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:f,sort:_,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(pm,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),n&&(0,i.jsx)(pm,{width:100})]}),paginationRow:(0,i.jsx)(lm,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(rm,{limit:l,numberOfPages:C,offset:d,setLimit:h,setOffset:p,showLimits:!0,totalCount:y})}),children:v?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):S.map(t=>w[t.id]?(0,i.jsx)(fm,{},t.id):(0,i.jsx)(yP,{columns:A,customFields:e.customFields,reloadUserInfo:T,state:r.states[`ui${t.id}`]?.state??"unchecked",toggleRow:r.toggleRow,userInfo:t},t.id))})})};var SP;!function(e){e[e.Delegations=0]="Delegations",e[e.DelegationsCategories=1]="DelegationsCategories",e[e.Positions=2]="Positions",e[e.PositionsCategories=3]="PositionsCategories"}(SP||(SP={}));const kP=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>e.level??(e.eventId?ke.Event:ke.Both),[e.eventId,e.level]),[o,s]=(0,V.useState)(!1),[r,a]=(0,V.useState)(null),[l,d,c]=gm("");(0,V.useEffect)(()=>{(async()=>{if(s(!0),e.resource===SP.Delegations){const{organization:o}=await(t={organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,level:n,name:g(d)?d:void 0,ids:e.ids},i=await X(),Js(nr,{variables:t,token:i||void 0,fragments:[]}));a(o)}else if(e.resource===SP.DelegationsCategories){const{organization:t}=await function(e,t){return Js('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:g(d)?d:void 0,ids:e.ids},await X());a(t)}else if(e.resource===SP.Positions){const{organization:t}=await function(e,t){return Js(ir,{variables:e,token:t||void 0,fragments:[]})}({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,name:g(d)?d:void 0,ids:e.ids},await X());a(t)}else if(e.resource===SP.PositionsCategories){const{organization:t}=await function(e,t){return Js('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:g(d)?d:void 0,ids:e.ids},await X());a(t)}var t,i;s(!1)})()},[n,d,e.eventId,e.hasSelected,e.organizationId,e.resource]);const u=(0,V.useMemo)(()=>{if(r){const t=(0,cm.A)((0,Xh.A)(r.list.nodes.concat(r.selected.nodes),e=>e.id),e=>e.name.toLowerCase());return n!==ke.Both&&e.eventId?t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)):Object.values((0,Vu.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)(Uu,{isSearchLoading:o,isSearchVisible:!0,menuWidth:e.menuWidth,renderOnPortal:!0,searchElement:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:l,onChange:c}),values:e.ids,onChange:e.onChange,children:u})},wP=e=>{const{translate:t,params:{organizationId:n}}=bd();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:e.accessScope===Ft.DelegationCategory?"checked":"unchecked",onClick:()=>e.setAccessScope(Ft.DelegationCategory),children:t("r_le_sur_une_ca_31475")}),e.accessScope===Ft.DelegationCategory&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(kP,{hasSelected:!0,ids:[e.resourceId],level:ke.Event,menuWidth:600,organizationId:n,resource:SP.DelegationsCategories,onChange:t=>{Bs(t)&&e.setResourceId(t[0])}})}),(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(hh,{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))})})]})]})]})},EP=e=>{const{translate:t,params:{organizationId:n}}=bd();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:e.accessScope===Ft.Delegation?"checked":"unchecked",onClick:()=>e.setAccessScope(Ft.Delegation),children:t("r_le_sur_une_d_10967")}),e.accessScope===Ft.Delegation&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(rd,{css:{paddingLeft:"$6"},gap:"4",children:(0,i.jsx)(kP,{hasSelected:!0,ids:[e.resourceId],level:ke.Both,organizationId:n,resource:SP.Delegations,onChange:t=>{Bs(t)&&e.setResourceId(t[0])}})})]})]})},TP=e=>{const{translate:t}=bd(),{organization:n}=_v(),o=(0,V.useMemo)(()=>(0,cm.A)(n.events.nodes,e=>m(e.name)).map(e=>{const t=3444===n.id?`${e.name} (${e.fields.cf61867})`:e.name;return(0,i.jsx)("option",{value:e.id,children:t},e.id)}),[n.events]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:e.accessScope===Ft.Event?"checked":"unchecked",onClick:()=>e.setAccessScope(Ft.Event),children:t("r_le_sur_un_v_89523")}),e.accessScope===Ft.Event&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Uu,{isSearchVisible:!0,menuWidth:600,renderOnPortal:!0,shouldParseAsInt:!0,values:[e.resourceId],onChange:t=>{Bs(t)&&e.setResourceId(t[0])},children:o})}),(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(hh,{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))})})]})]})]})},RP=e=>{const{translate:t,params:{organizationId:n}}=bd();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:e.accessScope===Ft.PositionCategory?"checked":"unchecked",onClick:()=>e.setAccessScope(Ft.PositionCategory),children:t("r_le_sur_une_ca_13181")}),e.accessScope===Ft.PositionCategory&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(kP,{hasSelected:!0,ids:[e.resourceId],menuWidth:600,organizationId:n,resource:SP.PositionsCategories,onChange:t=>{Bs(t)&&e.setResourceId(t[0])}})}),(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(hh,{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))})})]})]})]})},OP=e=>{const{translate:t,params:{organizationId:n}}=bd();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:e.accessScope===Ft.Position?"checked":"unchecked",onClick:()=>e.setAccessScope(Ft.Position),children:t("r_le_sur_une_mi_92313")}),e.accessScope===Ft.Position&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(kP,{hasSelected:!0,ids:[e.resourceId],menuWidth:600,organizationId:n,resource:SP.Positions,onChange:t=>{Bs(t)&&e.setResourceId(t[0])}})}),(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(hh,{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))})})]})]})]})},DP=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1})]}),zP=e=>{const{translate:t,params:{organizationId:n}}=bd(),{organization:o,roles:s}=_v(),{mutate:r,isLoading:a}=function(e={}){return Di("mutation UserAccessMassCreate(\n $organizationId: OrganizationId!\n $massAccessCreate: MassAccessCreateInput!\n) {\n numberOfEdited: userAccessMassCreate(\n organizationId: $organizationId\n massAccessCreate: $massAccessCreate\n )\n}\n",e)}(),{data:l,isLoading:d}=Oi('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},[]),[c,u]=(0,V.useState)(Ft.Organization),[m,h]=(0,V.useState)(s.organizationRoles[0].id),[g,p]=(0,V.useState)(-1),f=e=>{e===Ft.Organization?h(s.organizationRoles[0].id):e===Ft.Event?(h(s.eventRoles[0].id),p(o.events.nodes[0].id)):e===Ft.Delegation?(h(-1),p(l.organization.delegations.nodes[0].id)):e===Ft.DelegationCategory?(h(s.delegationCategoryRoles[0].id),p(l.organization.delegationsCategories.nodes[0].id)):e===Ft.Position?(h(s.positionRoles[0].id),p(l.organization.positions.nodes[0].id)):e===Ft.PositionCategory&&(h(s.positionRoles[0].id),p(l.organization.positionsCategories.nodes[0].id)),u(e)};return(0,i.jsxs)(Av,{isOpen:e.isOpen,onClose:e.onClose,children:[!e.hideTrigger&&(0,i.jsx)(Sv,{children:(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",children:t("ajouter_un_r_le_19073")})}),(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"user-lock",children:t("ajouter_un_r_le_19073")}),(0,i.jsx)(jv,{children:d?(0,i.jsx)(DP,{}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zu,{state:c===Ft.Organization?"checked":"unchecked",onClick:()=>f(Ft.Organization),children:t("r_le_sur_l_orga_15663")}),c===Ft.Organization&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(rd,{css:{paddingLeft:"$6"},children:(0,i.jsx)(hh,{shouldParseAsInt:!0,value:m,onChange:h,children:s.organizationRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),Bs(o.events.nodes)&&(0,i.jsx)(TP,{accessScope:c,eventRoles:s.eventRoles,resourceId:g,roleId:m,setAccessScope:f,setResourceId:p,setRoleId:h}),Bs(l.organization?.delegations.nodes)&&(0,i.jsx)(EP,{accessScope:c,resourceId:g,setAccessScope:f,setResourceId:p}),Bs(l.organization?.delegationsCategories.nodes)&&(0,i.jsx)(wP,{accessScope:c,delegationCategoryRoles:s.delegationCategoryRoles,resourceId:g,roleId:m,setAccessScope:f,setResourceId:p,setRoleId:h}),Bs(l.organization?.positions.nodes)&&(0,i.jsx)(OP,{accessScope:c,positionRoles:s.positionRoles,resourceId:g,roleId:m,setAccessScope:f,setResourceId:p,setRoleId:h}),Bs(l.organization?.positionsCategories.nodes)&&(0,i.jsx)(RP,{accessScope:c,positionCategoryRoles:s.positionRoles,resourceId:g,roleId:m,setAccessScope:f,setResourceId:p,setRoleId:h})]})}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{isLoading:a,onClick:async()=>{const t=(await r({organizationId:n,massAccessCreate:{resourceId:c===Ft.Organization?n:g,roleId:c===Ft.Delegation?void 0:m,scope:c,selecteds:{ids:e.usersInfosIds}}})).numberOfEdited;e.onSuccess?.(t),e.onClose()},children:t("ajouter_97327")})})]})]})},$P=e=>{const t=Ti(),{mutate:n,isLoading:o}=ea(),{mutate:s,isLoading:r}=Zl(),[a,l]=(0,V.useState)([]),[d,c]=(0,V.useState)([]);return(0,V.useEffect)(()=>{(async()=>{if(e.eventId){const t=await ia({eventId:e.eventId},await X());l(t.event.delegations.nodes)}else{const i=await(t={organizationId:e.organizationId},n=await X(),Js("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)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(wj,{color:"primary",icon:"people-group"})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{font:"gray900 textLg medium",textAlign:"center",children:t("ajouter_des_mem_60880")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(Uu,{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)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{isLoading:o||r,onClick:async()=>{if(Bs(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)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},PP=e=>{const{translate:t}=bd(),{mutate:n,isLoading:o}=function(e={}){return Di("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 Di("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}=vl({organizationId:e.organizationId,level:e.eventId?ke.Event:ke.Organization,eventId:e.eventId}),l=(0,V.useMemo)(()=>a.organization?.forms.nodes??[],[a.organization]),[d,c]=(0,V.useState)([]),u=Bs(d);return(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(wj,{color:"primary",icon:"people-group"})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{font:"gray900 textLg medium",textAlign:"center",children:t("ajouter_des_mem_81812")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(Uu,{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)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{disabled:!u,isLoading:o||r,onClick:async()=>{if(Bs(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)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},MP=e=>{const t=Ti(),{mutate:n,isLoading:o}=function(e={}){return Di("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 Di("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}=vl({organizationId:e.organizationId,level:e.eventId?ke.Event:ke.Organization,eventId:e.eventId}),l=(0,V.useMemo)(()=>a.organization?.forms.nodes??[],[a.organization]),[d,c]=(0,V.useState)([]),u=Bs(d);return(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(wj,{color:"primary",icon:"file-lines"})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{font:"gray900 textLg medium",textAlign:"center",children:t("marquer_un_form_10633")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(Uu,{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)(md,{height:"4"}),(0,i.jsx)(zd,{alertStyle:"error",children:(0,i.jsx)(Pd,{children:e.eventId?t("cette_action_su_82938"):t("cette_action_su_88097")})}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{color:"error",disabled:!u,isLoading:o||r,onClick:async()=>{if(Bs(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)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})};let FP=class extends ic{constructor(e){super(e)}massAddEventInputSchema(){return c.Ik().shape({massAddEvent:c.Ik().shape({eventId:c.ai().required(this.t("l_v_nement_est_88155")).typeError(this.t("l_v_nement_est_88155"))})})}massAddEventSchema(){return c.Ik().shape({eventId:c.ai().required(this.t("l_v_nement_est_88155")).typeError(this.t("l_v_nement_est_88155"))})}};FP=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],FP);const NP=e=>{const t=Ti(),n=Ei(FP),{mutate:o}=function(e={}){return Di("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}=Er({organizationId:e.organizationId}),[a,l]=(0,V.useState)(""),d=(0,V.useMemo)(()=>g(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)(Ej,{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)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_un_40024"),value:a,onChange:l}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray900",fontWeight:"medium",children:t("sur_quel_v_nem_31606")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(rd,{css:{overflowY:"auto"},direction:"column",gap:"3",children:r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ju,{borderRadius:"$2",height:54}),(0,i.jsx)(ju,{borderRadius:"$2",height:54})]}):d.map(e=>(0,i.jsx)(fE,{label:e.name,name:"massAddEvent.eventId",value:e.id},e.id))})]})},LP=e=>{const t=Ti(),{data:n,loader:o}=Oi("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}=al(),[r,a]=(0,V.useState)(null);return(0,i.jsxs)(Ej,{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,eventId:e.eventId,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)(zd,{alertStyle:"gray",children:(0,i.jsx)(Pd,{children:t("toutes_les_info_39932",e.numbersOfSelected)})}),"number"==typeof n.organization?.weezeventOrganizationId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(zd,{alertStyle:"warning",children:(0,i.jsx)(Pd,{children:t("if_you_merge_me_62641")})})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{font:"gray700 textSm medium",children:t("quel_membre_sou_80665")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(rd,{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)(V.Fragment,{children:[0!==n&&(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsxs)(rd,{align:"center",css:{cursor:"pointer"},gap:"3",onClick:()=>{a(e.id)},children:[(0,i.jsx)(Du,{shouldPreventDefault:!1,state:r===e.id?"checked":"unchecked",onClick:hc.A}),(0,i.jsx)(Gf,{email:e.email,image:e.picture?.url,name:e.name,size:48}),(0,i.jsxs)(rd,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:g(e.name)?e.name:"-"}),(0,i.jsx)(ka,{color:"gray500",children:e.email}),(0,i.jsx)(rd,{gap:"2",wrap:"wrap",children:o.map(e=>(0,i.jsxs)(V.Fragment,{children:[e.numberOfAccreditations>0&&(0,i.jsx)(vu,{css:{height:"fit-content"},leftIcon:"badge-check",children:t("_1_2_accred_26410",e.eventName,e.numberOfAccreditations)}),e.numberOfAssignments>0&&(0,i.jsx)(vu,{css:{height:"fit-content"},leftIcon:"location-dot",children:t("_1_2_assign_03225",e.eventName,e.numberOfAssignments)})]},e.eventId))})]})]})]},e.id)})})]})},BP=e=>{const{translate:t,params:{organizationId:n}}=bd(),{showNotification:o}=HI(),{canOrganizationUserEdit:s}=zv(),{mutate:r}=Sr(),{mutate:a}=function(e={}){return Di("mutation UsersInfosMassDelete(\n $organizationId: OrganizationId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: usersInfosMassDelete(organizationId: $organizationId, selecteds: $selecteds)\n}\n",e)}(),{hasFeature:l}=_v(),{data:d}=Oi("query UsersActions($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n hasDelegations\n hasEvents\n hasForms\n }\n}\n",{organizationId:n},[]),[c,u]=(0,V.useState)(!1),[m,h]=(0,V.useState)(!1),[p,f]=(0,V.useState)(!1),[_,x]=(0,V.useState)(!1),[I,v]=(0,V.useState)(!1),[b,j]=(0,V.useState)(!1),[C,y]=(0,V.useState)(!1),[A,S]=(0,V.useState)(!1),[k,w]=(0,V.useState)(!1),E=e.massActions.getSelectedsInput(e.predicates,null),T=e.massActions.isAllSelected?e.totalNumberOfMembers:e.massActions.numberOfSelected,R=(0,V.useCallback)(t=>{g(t)&&o(t),e.onMassEditSuccess()},[e.onMassEditSuccess]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kd,{onClick:()=>{u(!0)},children:t("_diter_un_champ_64621")}),!e.showOnlyMassEdit&&(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{maxHeight:400,placement:"bottom-end",children:[(0,i.jsxs)(MA,{title:t("gestion_des_mem_51660"),children:[(0,i.jsx)(ru,{icon:"plus",isDisabled:!d.organization?.hasEvents,onClick:()=>h(!0),children:t("ajouter_1_membr_25541",T)}),(0,i.jsx)(ru,{icon:"merge",onClick:()=>f(!0),children:t("fusionner_les_m_37150")}),s&&(0,i.jsx)(ru,{icon:"shield",onClick:()=>x(!0),children:t("ajouter_un_r_le_82872",T)})]}),(0,i.jsx)(MA,{title:t("accr_ditations_39450"),children:l(Ae.Delegation)&&(0,i.jsx)(ru,{icon:"people-group",isDisabled:!d.organization?.hasDelegations,onClick:()=>j(!0),children:d.organization?.hasDelegations?t("ajouter_1_mem_86218",T):t("cette_organisat_48937")})}),(0,i.jsxs)(MA,{title:t("communication_05277"),children:[(0,i.jsx)(ru,{icon:"file-lines",isDisabled:!d.organization?.hasForms,onClick:()=>y(!0),children:t("ajouter_1_mem_52947",T)}),(0,i.jsx)(ru,{icon:"file-lines",isDisabled:!d.organization?.hasForms,onClick:()=>S(!0),children:t("marquer_un_form_10633")}),(0,i.jsx)(ru,{icon:"paper-plane",onClick:()=>w(!0),children:t("SendCampaign")})]}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>v(!0),children:t("supprimer_43083")})})]})]}),c&&(0,i.jsx)(HA,{mutate:e=>r({organizationId:n,massEdit:e}),organizationId:n,selecteds:E,onClose:()=>{u(!1)},onSuccess:e=>{R(t("_1_membres_ont_07596",e))}}),m&&(0,i.jsx)(NP,{numberOfSelected:T,organizationId:n,selecteds:E,onClose:()=>{h(!1)},onSuccess:R}),p&&(0,i.jsx)(LP,{eventId:null,numbersOfSelected:T,organizationId:n,usersInfosIds:e.massActions.selectedsIds,onClose:()=>f(!1),onSuccess:R}),_&&(0,i.jsx)(zP,{isOpen:!0,usersInfosIds:e.massActions.selectedsIds,onClose:()=>x(!1),onSuccess:e=>{R(t("le_r_le_a_t_a_95295",e))}}),I&&(0,i.jsx)(DA,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_65177"),t("cette_action_es_45424")],text:t("suppression_de_57689",T),onClose:()=>v(!1),onDelete:async()=>{const e=(await a({organizationId:n,selecteds:E})).numberOfMembers;R(t("_1_membres_ont_13170",e))}}),C&&(0,i.jsx)(PP,{eventId:null,organizationId:n,selecteds:E,onClose:()=>y(!1),onSuccess:R}),A&&(0,i.jsx)(MP,{eventId:null,organizationId:n,selecteds:E,onClose:()=>S(!1),onSuccess:R}),b&&(0,i.jsx)($P,{eventId:null,organizationId:n,selecteds:E,onClose:()=>j(!1),onSuccess:R}),k&&(0,i.jsx)(xS,{eventId:null,organizationId:n,selecteds:E,onClose:()=>w(!1),onSuccess:R})]})},VP=({customFields:e,organizationKey:t})=>{const n=Ti(),{canMemberEdit:o,canSegmentEdit:s}=zv(),{limit:r,massActions:a,onMassEditSuccess:l,predicates:d,reloadKey:c,segment:u,setReloadKey:m}=SC();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(CP,{organizationKey:t,reload:()=>{m(c+1)}}),(0,i.jsxs)(Qv,{children:[(0,i.jsx)(Oz,{searchRow:(0,i.jsx)(Tz,{actions:(0,i.jsx)(BP,{massActions:a,predicates:d,showOnlyMassEdit:!1,totalNumberOfMembers:u.count,onMassEditSuccess:l}),searchPlaceholder:n("rechercher_un_m_05904"),showActions:o,showEditColumns:s,showEditMode:o,showSearchColumns:s}),selectSegment:(0,i.jsx)(wz,{pageSelectedText:n("les_1_membres_00895",r),segmentSelectedText:n("les_1_membres_56748",u.count,u.name)})}),(0,i.jsx)(AP,{customFields:e})]})]})},UP=e=>{const{history:t,translate:n,params:{organizationId:o,segmentId:s}}=bd(),{localOrganization:r,updateLocalOrganization:a}=_v(),{canSegmentEdit:l}=zv(),d=Ei(GS),c=(0,V.useMemo)(()=>d.getOrganizationUsersFilters(o,s,e.organization),[e.organization]),u=(0,V.useMemo)(()=>d.getOrganizationUsersPossibleColumns(e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(kz,{canSegmentEdit:l,filters:c,filtersButtonText:n("filtrer_les_mem_49255"),filtersSubtitle:n("appliquer_des_f_48814"),getSegmentPath:e=>fs.COMMUNITY_USERS_SEGMENT(o,e),initialLimit:r?.usersLimit??em,initialSegmentsOpen:r?.areUsersSegmentsOpen??!0,organizationId:o,possibleColumns:u,possibleRenderings:[],reload:e.reload,segmentId:s,segmentType:Me.Volunteers,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{a({usersLimit:e})},onSegmentClick:e=>{a({usersSegmentId:e})},onSegmentDelete:async()=>{await a({usersSegmentId:null}),t.replace(ro.COMMUNITY_USERS({organizationId:o}))},onSegmentsToggle:async e=>{await a({areUsersSegmentsOpen:e})},children:(0,i.jsx)(VP,{customFields:e.organization.customFields.nodes,organizationKey:e.organization.key})})},WP=()=>{const{params:{organizationId:e},translate:t}=bd();Zc(`${t("communaut_20896")} ${t("membres_11310")}`);const{localOrganization:n}=_v(),{data:o,loader:s,reload:r}=Oi("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:Re.All},[js.SegmentCustomFieldFragment,js.SegmentsFoldersSegmentsFragment]);const a=(0,V.useMemo)(()=>(o.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[o.organization]);return s||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:fs.COMMUNITY_USERS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(UP,{organization:o.organization,reload:r})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:fs.COMMUNITY_USERS_SEGMENT(e,n?.usersSegmentId&&a.includes(n.usersSegmentId)?n?.usersSegmentId:a[0]),replace:!0})})]})},GP=e=>{const{translate:t,params:{organizationId:n}}=bd(),o=Ei(Xb),{mutate:s,isLoading:r}=al(),a=(0,V.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)(dm,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(kd,{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)(pm,{children:t("nom_du_membre_69353")}),e.displayColumns.map(e=>{const n=a[e];return"delegations"===e?(0,i.jsx)(pm,{children:t("d_l_gations_78318")},e):n?(0,i.jsx)(pm,{children:n.name},e):null}),(0,i.jsx)(pm,{children:t("membre_principa_09597")})]}),numberOfPages:0,offset:0,rows:e.usersInfos.map(t=>(0,i.jsxs)(am,{css:{cursor:"pointer"},onClick:()=>{e.onSelect(t.id)},children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(ub,{userInfo:t})}),e.displayColumns.map(e=>{const n=a[e];return"delegations"===e?(0,i.jsx)(Qu,{gap:"2",wrap:"wrap",children:t.delegations.map(e=>{const t=e.event?`${e.event.name}`:e.name;return(0,i.jsx)(vu,{children:t},e.id)})},e):n?(0,i.jsx)(Qu,{children:o.getValueString(n,t.fields,{fileReturnValue:"name"})},e):null}),(0,i.jsx)(Qu,{children:(0,i.jsx)(Du,{shouldPreventDefault:!1,state:e.selectedId===t.id?"checked":"unchecked",onClick:hc.A})})]},t.id)),setOffset:hc.A,title:e.usersInfos[0].name,totalCount:0})},qP=e=>{const{translate:t,params:{organizationId:n}}=bd(),{localOrganization:o,updateLocalOrganization:s}=_v(),r=e.organization.customFields.nodes,[a,l]=(0,V.useState)(e.organization.possibleDuplicates),[d,c]=(0,V.useState)(Object.fromEntries(a.map(({id:e,usersInfos:t})=>[e,t[0].id]))),[u,m]=(0,V.useState)(!1),h=a.length??0,[p,f]=(0,V.useState)(o?.duplicatesColumns||[]),_=(0,V.useMemo)(()=>(0,cm.A)([...r.map(e=>({name:e.name,slug:e.slug})),{name:t("d_l_gations_78318"),slug:"delegations"}],e=>e.name),[r]),x=(0,V.useCallback)(async e=>{f(e),await s({duplicatesColumns:e})},[f]),[I,v]=(0,V.useState)(""),b=(0,V.useMemo)(()=>g(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)(zp,{fallbackClosePath:ro.COMMUNITY_USERS({organizationId:n}),heading:t("gestion_des_mem_14016"),children:(0,i.jsxs)(Op,{children:[(0,i.jsx)(rd,{align:"center",justify:"between",children:(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{font:"gray900 textMd medium",children:t("liste_des_membr_20115")}),h>0&&(0,i.jsx)(vu,{color:"warning",size:"sm",children:t("_1_doublon_pot_74382",h)})]}),(0,i.jsx)(ka,{color:"gray500",children:t("s_lectionner_le_91896")})]})}),(0,i.jsx)(md,{height:"6"}),0===h?(0,i.jsxs)(Hu,{children:[(0,i.jsxs)(Wu,{children:[(0,i.jsx)(pm,{children:t("nom_du_membre_69353")}),(0,i.jsx)(pm,{children:t("membre_principa_09597")})]}),(0,i.jsx)(am,{css:{height:"400px"},children:(0,i.jsx)(Qu,{css:{height:"100%"},children:(0,i.jsx)(pA,{subtitle:"",title:t("il_n_y_a_pas_de_78722")})})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"center",justify:"between",children:[(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{placeholder:t("rechercher_un_m_05904"),value:I,onChange:v})}),(0,i.jsx)(kd,{color:"white",leftIcon:"gear",onClick:()=>{m(!0)},children:t("_diter_les_colo_39630")})]}),(0,i.jsx)(md,{height:"6"}),b.map(({id:e,usersInfos:t})=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(GP,{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)(md,{height:"4"})]},e))]})]})}),u&&(0,i.jsx)(sh,{columns:_,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:x})]})},HP=()=>{const{params:{organizationId:e}}=bd(),{data:t,loader:n}=Oi("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},[js.CustomFieldWithConditionFragment]);return n||(0,i.jsx)(qP,{organization:t.organization})},KP=()=>{const{translate:e,params:{organizationId:t}}=bd();Zc(e("communaut_20896"));const{hasFeature:n}=_v(),{canDelegationEdit:o,canDelegationRead:s,canFormRead:r,canWorkflowEdit:a,canWorkflowRead:l}=zv();return n(Ae.Community)?(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:ro.COMMUNITY_DASHBOARD({organizationId:":organizationId"}),children:(0,i.jsx)(c$,{children:(0,i.jsx)(m$,{})})}),(0,i.jsx)(Ea.qh,{path:fs.COMMUNITY_USERS_DUPLICATES(":organizationId"),children:(0,i.jsx)(HP,{})}),(0,i.jsx)(Ea.qh,{path:[bx.CREATE({organizationId:":organizationId",delegationId:":delegationId"}),bx.CREATE({organizationId:":organizationId"})],children:(0,i.jsx)(MR,{})}),(0,i.jsx)(Ea.qh,{path:ro.COMMUNITY_USERS({organizationId:":organizationId"}),children:(0,i.jsx)(c$,{children:(0,i.jsx)(WP,{})})}),(0,i.jsx)(Ea.qh,{path:fs.COMMUNITY_EDIT_USER(":organizationId",":userInfoId"),children:(0,i.jsx)(BT,{children:(0,i.jsx)(sD,{})})}),(0,i.jsx)(Ea.qh,{exact:!0,path:Tx.CREATE_TEMPLATE({organizationId:":organizationId"}),children:(0,i.jsx)(qv,{isTemplate:!0})}),(0,i.jsx)(Ea.qh,{exact:!0,path:Tx.CREATE({organizationId:":organizationId",options:":options?"}),children:(0,i.jsx)(qv,{isTemplate:!1})}),(0,i.jsx)(Ea.qh,{path:Tx.UPDATE({organizationId:":organizationId",campaignId:":campaignId"}),children:(0,i.jsx)(Kv,{})}),(0,i.jsx)(Ea.qh,{path:Tx.CAMPAIGNS({organizationId:":organizationId"}),children:(0,i.jsx)(c$,{children:(0,i.jsx)(l$,{})})}),(0,i.jsx)(Ea.qh,{path:Tx.CAMPAIGN({organizationId:":organizationId",campaignId:":campaignId"}),children:(0,i.jsx)(c$,{children:(0,i.jsx)(Db,{})})}),r&&(0,i.jsx)(Ea.qh,{path:jo.CREATE({organizationId:":organizationId"}),children:(0,i.jsx)(c$,{children:(0,i.jsx)(Zw,{isCreateOpen:!0})})}),r&&(0,i.jsx)(Ea.qh,{path:jo.FORMS({organizationId:":organizationId"}),children:(0,i.jsx)(c$,{children:(0,i.jsx)(Zw,{isCreateOpen:!1})})}),r&&(0,i.jsx)(Ea.qh,{path:jo.FORM_ELEMENTS({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)($E,{})}),r&&(0,i.jsx)(Ea.qh,{path:jo.FORM_PARAMETERS_GENERAL({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(rT,{})}),r&&(0,i.jsx)(Ea.qh,{path:jo.FORM_PARAMETERS_DESIGN({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(nT,{})}),r&&(0,i.jsx)(Ea.qh,{path:jo.FORM_PARAMETERS_BROADCAST({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(HE,{})}),r&&(0,i.jsx)(Ea.qh,{path:jo.FORM_PARAMETERS_STATE({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(dT,{})}),r&&(0,i.jsx)(Ea.qh,{path:jo.FORM_INTEGRATION({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(oE,{})}),r&&(0,i.jsx)(Ea.qh,{path:jo.FORM_EMAILS({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(NE,{})}),r&&(0,i.jsx)(Ea.qh,{path:jo.FORM_PREVIEW({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(sE,{})}),(0,i.jsx)(Ea.qh,{path:fs.COMMUNITY_VOLUNTEERS_IMPORT(":organizationId"),children:(0,i.jsx)(FD,{})}),(0,i.jsx)(Ea.qh,{path:fs.COMMUNITY_FILES_IMPORT(":organizationId"),children:(0,i.jsx)(Bw,{})}),(0,i.jsx)(Ea.qh,{path:bx.MEMBER({organizationId:":organizationId",userInfoId:":userInfoId"}),children:(0,i.jsx)(c$,{children:(0,i.jsx)(GO,{})})}),o&&(0,i.jsx)(Ea.qh,{path:fs.COMMUNITY_CREATE_DELEGATION(":organizationId",":options?"),children:(0,i.jsx)(_C,{})}),o&&(0,i.jsx)(Ea.qh,{path:fs.COMMUNITY_EDIT_DELEGATION(":organizationId",":delegationId"),children:(0,i.jsx)(IC,{})}),s&&(0,i.jsx)(Ea.qh,{path:fs.COMMUNITY_DELEGATIONS(":organizationId"),children:(0,i.jsx)(c$,{children:(0,i.jsx)(xP,{})})}),s&&(0,i.jsx)(Ea.qh,{path:qo.DELEGATION_CATEGORY({organizationId:":organizationId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(c$,{children:(0,i.jsx)(Dw,{isEvent:!1})})}),s&&(0,i.jsx)(Ea.qh,{path:fs.COMMUNITY_DELEGATION(":organizationId",":delegationId"),children:(0,i.jsx)(c$,{children:(0,i.jsx)(xw,{})})}),a&&(0,i.jsx)(Ea.qh,{path:Dx.CREATE({organizationId:":organizationId"}),children:(0,i.jsx)(dz,{})}),l&&(0,i.jsx)(Ea.qh,{path:Dx.UPDATE({organizationId:":organizationId",workflowId:":workflowId"}),children:(0,i.jsx)(cz,{})}),l&&(0,i.jsx)(Ea.qh,{path:Dx.WORKFLOWS({organizationId:":organizationId"}),children:(0,i.jsx)(c$,{children:(0,i.jsx)(Jz,{})})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:ro.COMMUNITY_USERS({organizationId:t}),replace:!0})})]}):(0,i.jsx)(c$,{children:(0,i.jsx)(rd,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(kx,{icon:"crown",subtitle:e("contactez_nous_69860"),title:e("pour_en_profite_62789")})})})};let YP=class extends Um{constructor(e,t,n){super(e,t,n)}getCustomFieldsFilters(e,t,n){return[{slug:"name",name:this.t("nom_du_champ_48329"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Text,hideEmpty:!0},{slug:"label",name:this.t("label_08243"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Text},{slug:"customFieldCategory",name:this.t("cat_gorie_00291"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Select,values:(0,cm.A)(n.customFieldsCategories.nodes,e=>m(e.name)),hideEmpty:!0},{slug:"fieldType",name:this.t("type_35427"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Select,values:Fn.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"variety",name:this.t("typologie_34041"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Select,values:(0,cm.A)(En.filter(e=>!t||e!==Te.Event).map(e=>({id:e,name:Ub(this.t.bind(this),e)})),({name:e})=>e),hideEmpty:!0},{slug:"privacy",name:this.t("Privacy"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:"condition",name:this.t("condition_61066"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Select,values:n.customFields.nodes},{slug:"isEncrypted",name:this.t("est_chiffr_99072"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:"hasValidationRules",name:this.t("r_gles_de_valid_33082"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Checkbox,hideEmpty:!0},{slug:"createdBy",name:this.t("cr_e_par_30622"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"createdAt",name:this.t("cr_e_le_02658"),category:this.t("champs_de_formu_64126"),fieldType:Zt.Datetime,hideEmpty:!0}]}getCustomFieldsPossibleColumns(){return[{slug:"id",name:this.t("id_51738"),isSortable:!0,sortAttribute:De.Id,width:100},{slug:"name",name:this.t("nom_du_champ_48329"),isSortable:!0,sortAttribute:De.Name,minWidth:240},{slug:"label",name:this.t("label_08243"),isSortable:!0,sortAttribute:De.Label,minWidth:180},{slug:"category",name:this.t("Category"),isSortable:!0,sortAttribute:De.Category,minWidth:240},{slug:"variety",name:this.t("typologie_34041"),minWidth:180},{slug:"fieldType",name:this.t("type_35427"),isSortable:!0,sortAttribute:De.Type,width:250},{slug:"numberOfTimesUsed",name:this.t("nombre_d_utilis_58389"),width:200},{slug:"state",name:this.t("Privacy"),isSortable:!0,sortAttribute:De.Status,width:200},{slug:"values",name:this.t("valeurs_34314"),minWidth:240},{slug:"variable",name:this.t("variable_pour_l_45711"),minWidth:180},{slug:"isEncrypted",name:this.t("est_chiffr_99072"),width:200},{slug:"createdBy",name:this.t("cr_par_41994"),minWidth:180},{slug:"createdAt",name:this.t("cr_le_85046"),isSortable:!0,sortAttribute:De.CreatedAt,minWidth:180}]}};YP=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mm,Cm,Si])],YP);const ZP=()=>{const{translate:e,params:{eventId:t}}=bd(),{massActions:n,onMassEditSuccess:o,organizationId:s,predicates:r,segment:a}=SC(),{showNotification:l}=HI(),{mutate:d}=vr(),{mutate:c}=dl(),{mutate:u}=ll(),[m,h]=(0,V.useState)(!1),[p,f]=(0,V.useState)(!1),_=n.getSelectedsInput(r,null),x=n.isAllSelected?a.count:n.numberOfSelected,I=(0,V.useCallback)(e=>{g(e)&&l(e),o()},[o]),v=(0,V.useCallback)(async()=>{const n=(await c({organizationId:s,eventId:t,selecteds:_})).customFieldsMassDuplicate.length;I(e("_1_champs_ont_57847",n))},[c,I,s,t,_,e]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kd,{onClick:()=>h(!0),children:e("_diter_une_prop_26724")}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{icon:"clone",onClick:v,children:e("dupliquer_28256")})}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>f(!0),children:e("supprimer_43083")})})]})]}),m&&(0,i.jsx)(GA,{mutate:e=>d({organizationId:s,eventId:t,massEdit:e}),organizationId:s,selecteds:_,onClose:()=>h(!1),onSuccess:t=>I(e("_1_champs_pers_55120",t))}),p&&(0,i.jsx)(DA,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_63402")],text:e("suppression_de_98457",x),onClose:()=>f(!1),onDelete:async()=>{const n=(await u({organizationId:s,eventId:t,selecteds:_})).numberOfCustomFields;I(e("_1_champs_pers_68086",n))}})]})},XP=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o}}=bd();return(0,i.jsx)(zz,{children:(0,i.jsx)(Mv,{permissions:Ov.CUSTOM_FIELD_EDIT,children:(0,i.jsx)(kd,{onClick:()=>{e.push(tx.CREATE({organizationId:n,eventId:o}))},children:t("cr_er_un_champ_31226")})})})},JP=V.createContext({}),QP=e=>{const t=h$(br,{organizationId:e.organizationId},e=>e.organization.customFieldsCategories.nodes);return(0,i.jsx)(JP.Provider,{value:{getCustomFieldsCategories:t},children:e.children})},eM=e=>{const{translate:t}=bd(),{getCustomFieldsCategories:n}=V.useContext(JP),{result:o,isLoading:s}=$$(n);return s?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zd,{children:t("Category")}),(0,i.jsx)(ju,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(hh,{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))})},tM=e=>{const{params:{organizationId:t,eventId:n}}=bd(),{mutate:o}=vr();return(0,i.jsx)(OC,{column:e.column,initialValue:e.initialValue,mutate:async i=>o({organizationId:t,eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.customFieldId]},slug:e.property,strategy:yt.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},nM=e=>(0,i.jsx)(tM,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.category.id,property:qt.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(eM,{setValue:t,value:e}),renderValue:e.customField.category.name}),iM=e=>{const{translate:t}=bd();return(0,i.jsx)(tM,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.label||"",property:qt.Label,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Qd,{name:t("label_08243"),value:e,onChange:n}),renderValue:e.customField.label||""})},oM=e=>{const{translate:t}=bd();return(0,i.jsx)(tM,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.name,property:qt.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Qd,{label:t("nom_du_champ_48329"),value:e,onChange:n}),renderValue:()=>(0,i.jsxs)(rd,{direction:"column",width:1,children:[(0,i.jsx)(ka,{color:"gray800",css:{clamp:2,width:"100%"},title:e.customField.name,children:e.customField.name}),e.customField.conditionCustomField&&(0,i.jsx)(ka,{color:"gray500",css:{ellipsis:!0,width:"100%"},title:e.customField.conditionCustomField.name,children:t("d_pend_de_1_52961",e.customField.conditionCustomField.name)})]})})},sM=e=>{const{history:t,params:{eventId:n}}=bd(),o=e.customField.variety===Te.UserInfo&&e.customField.numberOfTimesUsed>0;return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:o?(0,i.jsx)(ka,{color:"primary500",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{t.push(tx.CUSTOM_FIELD_USAGE({organizationId:e.organizationId,eventId:n,segmentId:e.segmentId,customFieldId:e.customField.id}))},children:e.customField.numberOfTimesUsed}):e.customField.numberOfTimesUsed})},rM=e=>{const{translate:t}=bd();return(0,i.jsx)(tM,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.isPrivate,property:qt.Privacy,reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(hh,{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)(vu,{color:"gray",leftIcon:"lock",children:t("Private")}):(0,i.jsx)(vu,{color:"primary",leftIcon:"globe",children:t("Public")})})},aM=e=>{const{translate:t}=bd();return"id"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):"name"===e.column.slug?(0,i.jsx)(oM,{column:e.column,customField:e.row,reload:e.reloadRow}):"label"===e.column.slug?(0,i.jsx)(iM,{column:e.column,customField:e.row,reload:e.reloadRow}):"category"===e.column.slug?(0,i.jsx)(nM,{column:e.column,customField:e.row,reload:e.reloadRow}):"fieldType"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(rd,{children:[(0,i.jsx)(ka,{color:"gray800",css:{width:"18px"},children:(0,i.jsx)(Id,{icon:jj(e.row.fieldType,e.row.fieldProperty)})}),(0,i.jsx)(md,{width:"2"}),(0,i.jsx)(ka,{color:"gray800",children:t(e.row.fieldType)})]})}):"numberOfTimesUsed"===e.column.slug?(0,i.jsx)(sM,{column:e.column,customField:e.row,organizationId:e.organizationId,segmentId:e.segmentId}):"state"===e.column.slug?(0,i.jsx)(rM,{column:e.column,customField:e.row,reload:e.reloadRow}):"values"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.values.map(({value:e})=>e).join(", ")}):"variable"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.variety===Te.UserInfo?`{user.${e.row.slug}}`:e.row.variety===Te.Event?`{event.${e.row.slug}}`:e.row.variety===Te.Delegation?`{delegation.${e.row.slug}}`:""}):"variety"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:Ub(t,e.row.variety)}):"isEncrypted"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.isEncrypted?t("oui_54361"):t("non_33516")}):"createdBy"===e.column.slug?(0,i.jsx)(Nz,{column:e.column,createdBy:e.row.createdBy}):"createdAt"===e.column.slug?(0,i.jsx)(Fz,{column:e.column,insertedAt:e.row.insertedAt}):(0,i.jsx)(Qu,{})},lM=e=>{const{history:t,translate:n,params:{eventId:o}}=bd(),{showNotification:s}=HI(),[r,a]=(0,V.useState)(!1),{mutate:l}=dl(),{mutate:d}=ll(),[c,u]=(0,V.useState)(!1),m=e.customField.fieldType!==Oe.Select||e.customField.isSelectV2;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{isOpen:r,onStateChange:a,children:[(0,i.jsxs)(MA,{children:[(0,i.jsx)(su,{onClick:n=>{eu(n.target),t.push(tx.UPDATE({organizationId:e.organizationId,eventId:o,customFieldId:e.customField.id}))},children:(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(Id,{icon:"pen"}),n("_diter_62574")]})}),m&&(0,i.jsx)(su,{onClick:async n=>{eu(n.target);const{customFieldsMassDuplicate:i}=await l({organizationId:e.organizationId,eventId:o,selecteds:{ids:[e.customField.id]}});e.reload(),t.push(tx.UPDATE({organizationId:e.organizationId,eventId:o,customFieldId:i[0].id}))},children:(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(Id,{icon:"clone"}),n("dupliquer_28256")]})})]}),(0,i.jsx)(MA,{children:e.customField.canDelete&&(0,i.jsx)(su,{color:"red",onClick:()=>{a(!1),u(!0)},children:(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(Id,{icon:"trash-can"}),n("supprimer_43083")]})})})]}),c&&(0,i.jsx)(DA,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_96670"),text:n("suppression_de_73669",e.customField.name),onClose:()=>{u(!1)},onDelete:async()=>{await d({organizationId:e.organizationId,eventId:o,selecteds:{ids:[e.customField.id]}}),s(n("le_champ_1_43589",e.customField.name)),e.reload()}})]})},dM=e=>{const{history:t,translate:n,params:{eventId:o}}=bd(),{canCustomFieldEdit:s}=Dv(),r=(0,V.useCallback)(()=>{e.reloadCustomField(e.customField.id)},[e.customField,e.reloadCustomField]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(am,{css:{"&:hover":{background:"$gray100"}},onMouseLeave:e=>{eu(e.target)},children:[s&&(0,i.jsx)(Qu,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:e.state,onClick:(t,n)=>{Gd(n),e.toggleRow(`cf${e.customField.id}`,t,n.shiftKey)}})}),e.columns.map(t=>(0,i.jsx)(aM,{column:t,organizationId:e.organizationId,reloadRow:r,row:e.customField,segmentId:e.segmentId},t.slug)),s&&(0,i.jsxs)(jm,{justify:"end",children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"pen",onClick:()=>{t.push(tx.UPDATE({organizationId:e.organizationId,eventId:o,customFieldId:e.customField.id}))}})})}),(0,i.jsx)(bp,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsx)(lM,{customField:e.customField,organizationId:e.organizationId,reload:e.reload})]})]})})},cM=()=>{const{params:{organizationId:e,eventId:t}}=bd(),{canCustomFieldEdit:n}=Dv(),{columns:o,limit:s,massActions:r,nameDebounced:a,offset:l,possibleColumns:d,predicates:c,reloadKey:u,segmentId:m,setLimit:h,setOffset:p,setSort:f,sort:_}=SC(),{data:x,isLoading:I,reload:v}=Oi("query CustomFields(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel\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 eventId: $eventId\n level: $level\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,eventId:t,level:t?ke.Event:ke.Organization,predicates:c,name:g(a)?a:null,limit:s,offset:l,sort:_},[js.CustomFieldFragment]);const{numberOfPages:b,totalCount:j}=ah(x.data?.rows),C=(0,V.useMemo)(()=>o.flatMap(e=>(0,hd.A)([d.find(t=>t.slug===e)])),[d,o]),[y,A]=(0,V.useState)([]),[S,k]=(0,V.useState)({}),w=(0,V.useCallback)(async t=>{k(e=>({...e,[t]:!0}));const{data:{row:n}}=await function(e,t){return Js("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:[js.CustomFieldFragment]})}({organizationId:e,id:t},await X());A(e=>e.map(e=>e.id===t?n:e)),k(e=>({...e,[t]:!1}))},[k,A]);return(0,V.useEffect)(()=>{A(x.data?.rows.nodes??[])},[x.data]),(0,V.useEffect)(()=>{u>1&&v()},[u]),(0,V.useEffect)(()=>{r.setStates(Object.fromEntries((x.data?.rows.nodes??[]).map(e=>[`cf${e.id}`,{id:e.id,state:"unchecked"}])))},[x.data,r.setStates]),(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(rd,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(_p,{"aria-busy":I,headerRow:(0,i.jsxs)(Wu,{children:[n&&(0,i.jsx)(pm,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:r.selectAllState,onClick:r.toggleSelectAll})}),C.map(e=>e.isSortable?(0,i.jsx)(fp,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:f,sort:_,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(pm,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),n&&(0,i.jsx)(pm,{width:100})]}),paginationRow:(0,i.jsx)(lm,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(rm,{limit:s,numberOfPages:b,offset:l,setLimit:h,setOffset:p,showLimits:!0,totalCount:j})}),children:I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):y.map(t=>S[t.id]?(0,i.jsx)(fm,{},t.id):(0,i.jsx)(dM,{columns:C,customField:t,organizationId:e,reload:v,reloadCustomField:w,segmentId:m,state:r.states[`cf${t.id}`]?.state??"unchecked",toggleRow:r.toggleRow},t.id))})})})},uM=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,customFieldId:s}}=bd(),{data:r,loader:a}=Oi("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:s},[]),l=r.organization?.customField;return(0,i.jsx)(Jm,{returnToFallback:tx.CUSTOM_FIELDS({organizationId:n,eventId:o}),size:"sm",children:a?(0,i.jsx)(Qm,{children:a}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yb,{children:t("nombre_d_utilis_58389")}),(0,i.jsxs)(Qm,{children:[(0,i.jsx)(md,{height:"9"}),(0,i.jsxs)(rd,{align:"center",direction:"column",children:[(0,i.jsx)(rd,{align:"center",css:{background:"$purple100",borderRadius:"24px",color:"$purple700",fontSize:"$textXl"},height:64,justify:"center",width:64,children:(0,i.jsx)(Id,{icon:jj(l.fieldType,l.fieldProperty)})}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:l.name})]}),(0,i.jsx)(md,{height:"9"}),l.positions.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_de_missio_27210",l.positions.length)}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(rd,{direction:"column",gap:"6",children:l.positions.map(t=>(0,i.jsxs)(ka,{css:{cursor:"pointer"},onClick:()=>{e.push(Jo.POSITION({organizationId:n,eventId:t.event.id,positionId:t.id}))},children:[(0,i.jsx)(ka,{color:"gray800",children:t.event.name}),(0,i.jsx)(ka,{color:"gray500",children:t.name})]},t.id))}),(0,i.jsx)(ka,{css:{borderTop:"1px solid $gray200",height:"1px",marginBottom:"$6",marginTop:"$6",width:"100%"}})]}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_formu_84836",l.forms.length)}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(rd,{direction:"column",gap:"6",children:l.forms.map(n=>{const o=n.event?n.event.name:t("communaut_20896");return(0,i.jsxs)(ka,{css:{cursor:"pointer"},onClick:()=>{e.push(jo.FORM({organizationId:n.organization.id,eventId:n.event?.id,formId:n.id}))},children:[(0,i.jsx)(ka,{color:"gray800",children:o}),(0,i.jsx)(ka,{color:"gray500",children:n.name})]},n.id)})}),(0,i.jsx)(md,{height:"9"})]})]})})},mM=()=>{const{translate:e,params:{eventId:t}}=bd(),{canCustomFieldEdit:n,canSegmentEdit:o}=Dv();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(XP,{}),(0,i.jsxs)(Qv,{children:[(0,i.jsx)(Oz,{searchRow:(0,i.jsx)(Tz,{actions:(0,i.jsx)(ZP,{}),searchPlaceholder:e("rechercher_un_c_49598"),showActions:n,showEditColumns:o,showEditMode:n,showSearchColumns:!1})}),(0,i.jsx)(cM,{}),(0,i.jsx)(Ea.dO,{children:(0,i.jsx)(Ea.qh,{path:tx.CUSTOM_FIELD_USAGE({organizationId:":organizationId",eventId:t?":eventId":void 0,segmentId:":segmentId",customFieldId:":customFieldId"}),children:(0,i.jsx)(uM,{})})})]})]})},hM=e=>{const{translate:t,params:{organizationId:n,eventId:o,segmentId:s}}=bd(),{canSegmentEdit:r}=Dv(),a=Ei(YP),l=(0,V.useMemo)(()=>a.getCustomFieldsFilters(n,o,e.organization),[e.organization,n,o]),d=(0,V.useMemo)(()=>a.getCustomFieldsPossibleColumns(),[]);return(0,i.jsx)(QP,{organizationId:n,children:(0,i.jsx)(kz,{canSegmentEdit:r,eventId:o,filters:l,filtersButtonText:t("filtrer_les_cha_91574"),filtersSubtitle:t("appliquer_des_f_27562"),getSegmentPath:e=>tx.CUSTOM_FIELDS_SEGMENT({organizationId:n,eventId:o,segmentId:e}),initialLimit:e.initialLimit??em,initialSegmentsOpen:e.initialSegmentsOpen??!0,organizationId:n,possibleColumns:d,possibleRenderings:[],reload:e.reload,segmentId:s,segmentType:Me.CustomFields,segmentsFolders:e.organization.segmentsFolders,setLimit:e.setLimit,onSegmentClick:e.onSegmentClick,onSegmentDelete:e.onSegmentDelete,onSegmentsToggle:e.onSegmentsToggle,children:(0,i.jsx)(mM,{})})})},gM=[{operator:we.Is,slug:"condition",value:[]}];function pM(e){return(0,V.useMemo)(()=>e.flatMap(e=>e.segments).map(e=>e.id),[e])}const fM=()=>{const{history:e,params:{organizationId:t,eventId:n},translate:o}=bd(),{event:{name:s},localEvent:r,updateLocalEvent:a}=dv();Zc(`${s} ${o("champs_de_formu_64126")}`);const{data:l,loader:d,reload:c}=cl({organizationId:t,eventId:n,level:ke.Event,predicates:gM}),u=pM(l.organization?.segmentsFolders??[]);return d||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:tx.CUSTOM_FIELDS_SEGMENT({organizationId:":organizationId",eventId:":eventId",segmentId:":segmentId"}),children:(0,i.jsx)(hM,{initialLimit:r?.customFieldsLimit,initialSegmentsOpen:r?.areCustomFieldsSegmentsOpen,organization:l.organization,reload:c,setLimit:e=>{a({customFieldsLimit:e})},onSegmentClick:e=>{a({customFieldsSegmentId:e})},onSegmentDelete:async()=>{await a({customFieldsSegmentId:null}),e.replace(tx.CUSTOM_FIELDS({organizationId:t,eventId:n}))},onSegmentsToggle:async e=>{await a({areCustomFieldsSegmentsOpen:e})}})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:tx.CUSTOM_FIELDS_SEGMENT({organizationId:t,eventId:n,segmentId:r?.customFieldsSegmentId&&u.includes(r.customFieldsSegmentId)?r.customFieldsSegmentId:u[0]}),replace:!0})})]})},_M=()=>{const{history:e,params:{organizationId:t},translate:n}=bd(),{localOrganization:o,updateLocalOrganization:s}=_v();Zc(n("champs_de_formu_64126"));const{data:r,loader:a,reload:l}=cl({organizationId:t,level:ke.Organization,predicates:gM}),d=pM(r.organization?.segmentsFolders??[]);return a||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:tx.CUSTOM_FIELDS_SEGMENT({organizationId:":organizationId",segmentId:":segmentId"}),children:(0,i.jsx)(hM,{initialLimit:o?.customFieldsLimit,initialSegmentsOpen:o?.areCustomFieldsSegmentsOpen,organization:r.organization,reload:l,setLimit:e=>{s({customFieldsLimit:e})},onSegmentClick:e=>{s({customFieldsSegmentId:e})},onSegmentDelete:async()=>{await s({customFieldsSegmentId:null}),e.replace(tx.CUSTOM_FIELDS({organizationId:t}))},onSegmentsToggle:async e=>{await s({areCustomFieldsSegmentsOpen:e})}})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:tx.CUSTOM_FIELDS_SEGMENT({organizationId:t,segmentId:o?.customFieldsSegmentId&&d.includes(o.customFieldsSegmentId)?o.customFieldsSegmentId:d[0]}),replace:!0})})]})};let xM=class extends ic{constructor(e){super(e)}delegationCategoryInputDefault(e){return{name:e.name,banners:e.banners}}};xM=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],xM);let IM=class extends ic{constructor(e){super(e)}delegationCategoryBannerInputDefault(){return{bannerType:-1,bannerVehicleType:Ce.Car,min:1,max:10}}};IM=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],IM);const vM=e=>{const{translate:t}=bd(),n=Ei(IM),o=um(),s=(0,V.useMemo)(()=>(e.bannersCustomFields?.nodes??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e.toString(10),children:t},e))},e.id)),[e.bannersCustomFields]);return(0,i.jsxs)(rd,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$6 $4"},direction:"column",gap:"3",width:1,children:[e.values.map((n,r)=>{const a=`${e.prefix}[${r}].`;return(0,i.jsxs)(rd,{align:"start",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"4",children:[(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Gp,{isSearchVisible:!0,label:t("type_de_bandeau_34965"),name:`${a}bannerType`,children:s}),(0,i.jsx)(Ev,{label:t("type_de_v_hicul_88166"),name:`${a}bannerVehicleType`,children:o(bn)})]}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(ec,{label:t("commence_par_la_30514"),min:0,name:`${a}min`,shouldParseAsInt:!0}),(0,i.jsx)(ec,{label:t("jusqu_la_vale_40572"),min:0,name:`${a}max`,shouldParseAsInt:!0})]})]}),(0,i.jsx)(rd,{align:"end",css:{paddingTop:"$6"},children:(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",onClick:()=>{e.change(e.prefix,e.values.filter((e,t)=>t!==r))}})})]},r)}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",onClick:()=>{e.change(e.prefix,[...e.values,n.delegationCategoryBannerInputDefault()])},children:t("ajouter_un_band_94873")})})]})},bM=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,delegationCategoryId:s}}=bd(),{showNotification:r}=HI(),a=Ei(xM),{data:l,loader:d}=Oi("query DelegationCategoryToEdit(\n $organizationId: OrganizationId!\n $delegationCategoryId: DelegationsCategoryId!\n $loadBannersCustomFields: Boolean!\n $bannersCustomFieldsIds: [CustomFieldId!]!\n) {\n organization(id: $organizationId) {\n customFields(ids: $bannersCustomFieldsIds) @include(if: $loadBannersCustomFields) {\n nodes {\n id\n name\n\n values {\n id\n value\n }\n }\n }\n\n delegationCategory(id: $delegationCategoryId) {\n id\n name\n\n banners {\n bannerType\n bannerVehicleType\n min\n max\n }\n }\n }\n}\n",{organizationId:n,delegationCategoryId:s,loadBannersCustomFields:Eg(n),bannersCustomFieldsIds:Eg(n)?Tg():[]},[]);const{mutate:c}=function(e={}){return Di("mutation DelegationCategoryUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationCategoryId: DelegationsCategoryId!\n $delegationCategory: DelegationsCategoryUpdateInput!\n) {\n delegationCategoryUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationCategoryId: $delegationCategoryId\n delegationCategory: $delegationCategory\n ) {\n id\n name\n }\n}\n",e)}(),u=(0,V.useMemo)(()=>Bs(l.organization?.delegationCategory.banners),[l.organization]);return Zc(t("mise_jour_de_17055",l.organization?.delegationCategory.name)),d||(0,i.jsx)(Vd,{height:1,initialValues:{delegationCategory:a.delegationCategoryInputDefault(l.organization.delegationCategory)},render:({form:e,handleSubmit:r,submitting:a,values:d})=>(0,i.jsx)(zp,{button:(0,i.jsx)(kd,{isLoading:a,onClick:r,children:t("mettre_jour_l_94846")}),category:t("mise_jour_de_17055",l.organization.delegationCategory.name),color:"dark",fallbackClosePath:qo.DELEGATION_CATEGORY({organizationId:n,eventId:o,delegationCategoryId:s}),heading:l.organization.delegationCategory.name,children:(0,i.jsxs)(Op,{children:[(0,i.jsx)(Wp,{heading:t("informations_su_03761"),children:(0,i.jsx)(ec,{label:t("nom_de_la_cat_g_03860"),name:"delegationCategory.name"})}),Eg(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:t("bandeaux_v_hicu_49859"),initialIsOpen:u,isToggleable:!0,onToggle:t=>{t||e.change("delegationCategory.banners",[])},children:(0,i.jsx)(vM,{bannersCustomFields:l.organization.customFields,change:e.change,prefix:"delegationCategory.banners",values:d.delegationCategory.banners})})]}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)($p,{children:(0,i.jsx)(kd,{isLoading:a,textAlign:"center",onClick:r,children:t("mettre_jour_l_94846")})})]})}),width:1,onSubmit:async i=>{await c({organizationId:n,eventId:o,delegationCategoryId:s,delegationCategory:i.delegationCategory}),r(t("la_cat_gorie_a_28053")),e.goBack(qo.DELEGATION_CATEGORY({organizationId:n,eventId:o,delegationCategoryId:s}))}})},jM=e=>{const{translate:t}=bd();return(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",children:t("lier_un_champ_p_01331")})}),(0,i.jsx)(lu,{css:{padding:"0"},placement:"top-start",width:400,children:(0,i.jsx)($j,{customFields:e.formCustomFields,selectedCustomFieldsIds:e.selectedCustomFieldsIds,toggle:e.toggle})})]})},CM=e=>{const{translate:t}=bd();return(0,i.jsxs)(rd,{align:"center",css:{background:"$gray50",bd:"gray200 2",padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("aucun_champ_per_72101")}),(0,i.jsx)(jM,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:e.selectedCustomFieldsIds,toggle:e.toggle})]})},yM=e=>{const t=(0,V.useMemo)(()=>Object.fromEntries(e.formCustomFields.map(e=>[e.id,e])),[e.formCustomFields]);return(0,i.jsx)(oh,{ids:e.formCustomFieldsValues.map(e=>e.id),onReorder:e.onReorder,children:(0,i.jsx)(rd,{css:{bd:!0},direction:"column",width:1,children:e.formCustomFieldsValues.map((n,o)=>(0,i.jsx)(kE,{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:hc.A,onDelete:e.onDelete},n.id))})})},AM=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>new Set(e.formCustomFieldsValues.map(({customFieldId:e})=>e)),[e.formCustomFieldsValues]),o=(0,V.useCallback)(t=>{e.change(`${e.prefix}formCustomFields`,t)},[e.prefix,e.change]),s=(0,V.useCallback)(t=>{n.has(t.id)?o(e.formCustomFieldsValues.filter(({customFieldId:e})=>e!==t.id)):o([...e.formCustomFieldsValues,{id:W(),customFieldId:t.id,isMandatory:!0}])},[e.formCustomFieldsValues,n,o]),r=(0,V.useCallback)((t,n)=>{o(Gs(e.formCustomFieldsValues,t,n))},[e.formCustomFieldsValues,o]),a=(0,V.useCallback)((t,n)=>{o((0,Wm.jM)(e.formCustomFieldsValues,e=>{e[t].isMandatory=n}))},[e.formCustomFieldsValues,o]),l=(0,V.useCallback)(t=>{o((0,Wm.jM)(e.formCustomFieldsValues,e=>{e.splice(t,1)}))},[e.formCustomFieldsValues,o]);return(0,i.jsxs)(rd,{gap:"7",children:[(0,i.jsx)(rd,{width:280,children:(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("champs_personna_17489")})}),(0,i.jsx)(rd,{css:{flex:"1"},children:Bs(e.formCustomFieldsValues)?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(yM,{formCustomFields:e.formCustomFields,formCustomFieldsValues:e.formCustomFieldsValues,toggleMandatory:a,onDelete:l,onReorder:r}),(0,i.jsx)(jM,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:n,toggle:s})]}):(0,i.jsx)(CM,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:n,toggle:s})})]})},SM=e=>{const{params:{organizationId:t}}=bd(),n=(0,V.useMemo)(()=>(0,cm.A)((0,Xh.A)(e.customFields.map(e=>e.category),e=>e.id),e=>e.name.toLowerCase()),[e.customFields]),o=(0,V.useMemo)(()=>(0,Vu.A)(e.customFields,e=>e.category.id),[e.customFields]);return(0,i.jsxs)(rd,{direction:"column",children:[n.map((n,s)=>{const r=o[n.id];return(0,i.jsxs)(V.Fragment,{children:[0!==s&&(0,i.jsx)(Dh,{height:"5"}),(0,i.jsxs)(rd,{gap:"7",children:[(0,i.jsx)(rd,{width:280,children:(0,i.jsx)(ka,{font:"gray800 textSm medium",children:n.name})}),(0,i.jsx)(rd,{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)}),Bs(e.customFields)&&e.showFormCustomFields&&(0,i.jsx)(Dh,{height:"5"}),e.showFormCustomFields&&(0,i.jsx)(AM,{change:e.change,formCustomFields:e.formCustomFields,formCustomFieldsValues:e.formCustomFieldsValues,prefix:e.prefix})]})},kM=e=>{const{history:t,translate:n,params:{organizationId:o}}=bd(),s=Ei(V_),{organization:r}=_v(),a=(0,V.useMemo)(()=>(0,cm.A)(e.groups,e=>m(e.name)),[e.groups]),l=(0,V.useCallback)(t=>{const n=e.groupsAccesses.filter((e,n)=>n!==t&&e.groupId).map(({groupId:e})=>e);return a.filter(e=>!n.includes(e.id)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},[a,e.groupsAccesses]),d=(0,V.useMemo)(()=>(0,cm.A)(r.roles.filter(e=>e.accessLevel===je.Event),e=>m(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[r.roles]);return Vs(a)?(0,i.jsxs)(rd,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$7"},direction:"column",children:[(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:n("vous_n_avez_pas_50446")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:n("un_groupe_donne_90412")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(kd,{color:"white",onClick:()=>{t.push(fs.ORGANIZATION_PARAMETERS_GROUPS(o))},children:n("cr_er_un_groupe_03956")})]}):(0,i.jsxs)(rd,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$6 $4"},direction:"column",gap:"3",width:1,children:[e.groupsAccesses.map((t,o)=>(0,i.jsxs)(rd,{css:{background:"white",bd:!0,padding:"$3 $4"},direction:"column",gap:"4",children:[(0,i.jsx)(ka,{css:{textTransform:"uppercase"},font:"gray800 textXs semiBold",children:n("acc_s_n_1_17158",o+1)}),(0,i.jsxs)(rd,{align:"center",gap:"4",children:[(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Gp,{isSearchVisible:!0,label:n("groupe_74342"),name:`event.groupsAccesses[${o}].groupId`,renderOnPortal:!0,shouldParseAsInt:!0,children:l(o)})}),(0,i.jsx)(ka,{color:"gray500",css:{paddingTop:"$6"},fontSize:"textMd",children:(0,i.jsx)(Id,{icon:"arrow-right"})}),(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Gp,{label:n("r_le_59302"),name:`event.groupsAccesses[${o}].roleId`,renderOnPortal:!0,shouldParseAsInt:!0,children:d})}),(0,i.jsx)(ka,{css:{paddingTop:"$6"},children:(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.change("event.groupsAccesses",qs(e.groupsAccesses,o))}})})]})]},o)),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",onClick:()=>{e.change("event.groupsAccesses",e.groupsAccesses.concat([s.eventGroupAccessDefault()]))},children:n("ajouter_un_grou_74184")})})]})},wM=e=>{const{history:t,translate:n,params:{organizationId:o}}=bd(),s=Ei(Mm),r=(0,V.useMemo)(()=>M_.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)(Gp,{isCreateVisible:!0,isSearchVisible:!0,label:n("_metteur_des_e_27849"),name:"event.emailSenderId",onCreateClick:()=>{t.push(fs.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)(md,{height:"4"})]}),(0,i.jsx)(Ba.Yr,{name:"event.languages",children:t=>{!e.hasLanguagesFeature&&t.length>1&&e.change("event.languages",[(0,Dm.A)(t)])}}),(0,i.jsx)(Gp,{label:n("langues_de_l_v_94191"),multiple:!0,name:"event.languages",children:Rc.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(Gp,{isSearchVisible:!0,label:n("fuseau_horaire_14654"),name:"event.timeZone",children:r}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(wI,{label:n("heure_laquell_13491"),name:"event.dayStartTime"}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(Gp,{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)(md,{height:"4"}),(0,i.jsxs)(Ev,{label:n("Layer"),name:"event.layer",children:[(0,i.jsx)("option",{value:de.Google,children:n("plan_24242")}),(0,i.jsx)("option",{value:de.GoogleSatellite,children:n("satellite_64364")}),(0,i.jsx)("option",{value:de.IgnPlan,children:n("plan_ign_03240")})]}),(0,i.jsx)(md,{height:"4"}),(0,i.jsxs)(rd,{gap:"6",children:[(0,i.jsx)(Bp,{label:(0,i.jsx)(fI,{children:n("latitude_par_d_01620")}),name:"event.latitude"}),(0,i.jsx)(Bp,{label:(0,i.jsx)(fI,{children:n("longitude_par_d_28326")}),name:"event.longitude"})]}),e.weezeventOrganizationId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(Kp,{name:"event.isWeezeventSynchronized",children:n("synchroniser_av_82451")})]}),Bs(e.delegationsSpaceLayouts)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(Gp,{label:(0,i.jsx)(fI,{children:n("layout_de_l_esp_40392")}),name:"event.delegationsSpaceLayoutId",children:e.delegationsSpaceLayouts.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(md,{height:"4"}),(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:n("modules_activ_s_07626")}),(0,i.jsx)(Kp,{name:"event.usePositions",children:n("missions_63972")}),(0,i.jsx)(Kp,{name:"event.useAccreditations",children:n("accr_ditations_39450")}),(0,i.jsx)(Kp,{name:"event.useDelegations",children:n("d_l_gations_78318")}),(0,i.jsx)(Kp,{name:"event.useForms",children:n("Form_plural")}),(0,i.jsx)(Kp,{name:"event.useCampaigns",children:n("Campaigns")}),(0,i.jsx)(Kp,{name:"event.useDocuments",children:n("Documents")}),(0,i.jsx)(Kp,{name:"event.useWorkflows",children:n("automatisations_60045")})]})]})},EM=e=>{const{history:t,translate:n,params:{organizationId:o}}=bd(),s=Ei(V_),r=Ei(ld),a=Ei(oj),{hasFeature:l,reload:d}=_v(),{canOrganizationUserEdit:c}=zv(),u=(0,V.useRef)(null),m=(0,V.useMemo)(()=>({event:e.initialValues}),[e.initialValues]),h=(0,V.useMemo)(()=>!(!(e.initialValues.languages.length>1||"number"==typeof e.initialValues.emailSenderId)&&e.initialValues.dayStartTime.startsWith("00:00")&&e.initialValues.usePositions&&e.initialValues.useAccreditations&&e.initialValues.useDelegations&&e.initialValues.useForms&&e.initialValues.useCampaigns&&e.initialValues.useDocuments&&e.initialValues.useWorkflows&&"number"!=typeof e.initialValues.delegationsSpaceLayoutId),[e.initialValues]),p=(0,V.useMemo)(()=>Bs(e.initialValues.groupsAccesses),[e.initialValues]),f=(0,V.useMemo)(()=>e.isEdit&&Bs(Object.keys(e.initialValues.fields)),[e.isEdit,e.initialValues]),_=(0,V.useMemo)(()=>g(e.initialValues.description),[e.initialValues]),x=(0,V.useMemo)(()=>!!e.isEdit&&Bs(e.initialValues.tagsIds),[e.isEdit,e.initialValues]),I=(0,V.useCallback)(t=>r.validateForForm(s.createUpdateEventSchema(a.changedFieldsSchema(e.eventCustomFields,m.event.fields,t.event.fields)))(t),[e.eventCustomFields,m]);return(0,i.jsx)(Vd,{customErrorRef:u,height:1,initialValues:m,initialValuesEqual:()=>!0,render:({form:t,handleSubmit:s,values:r})=>(0,i.jsx)(zp,{button:e.isEdit&&(0,i.jsx)(kd,{isLoading:e.isMutateLoading,onClick:s,children:n("mettre_jour_l_28846")}),category:e.organization.name,color:"dark",fallbackClosePath:So.EVENTS({organizationId:o}),heading:e.isEdit?n("mise_jour_de_17055",e.initialValues.name):n("cr_ation_d_un_94106"),children:(0,i.jsxs)(Op,{ref:u,children:[(0,i.jsx)(Nd,{}),(0,i.jsx)(Wp,{heading:n("dites_en_nous_u_13238"),subtitle:n("param_trer_votr_94121"),children:(0,i.jsx)(K_,{form:t,values:r})}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Wp,{heading:n("options_avanc_e_12396"),initialIsOpen:h,isToggleable:!0,subtitle:n("param_trer_l_m_66748"),children:(0,i.jsx)(wM,{change:t.change,delegationsSpaceLayouts:e.delegationsSpaceLayouts,emailsSenders:e.organization.emailsSenders,hasLanguagesFeature:l(Ae.Languages),showEmailSender:!0,weezeventOrganizationId:e.organization.weezeventOrganizationId})}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Wp,{heading:n("groupes_34813"),initialIsOpen:p,isToggleable:!0,subtitle:n("donner_acc_s_41454"),onToggle:e=>{e||t.change("event.groupsAccesses",[])},children:(0,i.jsx)(kM,{change:t.change,groups:e.organization.groups.nodes,groupsAccesses:r.event.groupsAccesses||[]})})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Wp,{heading:n("champs_de_formu_64126"),initialIsOpen:f,isToggleable:!0,subtitle:n("ajouter_des_inf_87361"),onToggle:e=>{e||t.change("event.fields",{})},children:(0,i.jsx)(SM,{change:t.change,customFields:e.eventCustomFields,formCustomFields:[],formCustomFieldsValues:[],prefix:"event.",showFormCustomFields:!1})}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Wp,{heading:n("Description"),initialIsOpen:_,isToggleable:!0,subtitle:n("ajouter_une_des_44242"),onToggle:e=>{e||t.change("event.description","")},children:(0,i.jsx)(SI,{label:(0,i.jsx)(fI,{children:n("description_58935")}),name:"event.description"})}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Wp,{heading:n("tags_79499"),initialIsOpen:x,isToggleable:!0,subtitle:n("ajouter_des_tag_23887"),onToggle:e=>{e||t.change("event.tagsIds",[])},children:(0,i.jsx)(Rj,{change:t.change,name:"event.",organizationId:o,tags:e.organization.tags.nodes,tagsIds:r.event.tagsIds})}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)($p,{children:(0,i.jsx)(kd,{isLoading:e.isMutateLoading,textAlign:"center",onClick:s,children:e.isEdit?n("mettre_jour_l_28846"):n("cr_er_l_v_neme_16731")})})]})}),validate:I,width:1,onSubmit:async n=>{const i=await e.mutate({organizationId:o,event:c?n.event:{...n.event,groupsAccesses:null}});d(),e.isEdit?t.goBack(So.EVENT({organizationId:o,eventId:i})):t.replace(So.EVENT({organizationId:o,eventId:i}))}})},TM=()=>{const e=Ei(V_),{params:{organizationId:t},translate:n}=bd();Zc(n("cr_er_l_v_neme_16731"));const{data:o,loader:s}=Oi("query EventCreateInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...CreateUpdateEventInfos\n }\n}\n",{organizationId:t},[js.CreateUpdateEventInfosFragment]),{mutate:r,isLoading:a}=function(e={}){return Di("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)(EM,{delegationsSpaceLayouts:Ns,eventCustomFields:o.organization?.eventCustomFields.nodes??Ns,initialValues:e.eventInputDefault(),isEdit:!1,isMutateLoading:a,mutate:async e=>{const{eventCreate:{id:t}}=await r(e);return t},organization:o.organization})},RM=()=>{const e=Ei(V_),{params:{organizationId:t,eventId:n},translate:o}=bd(),{data:s,loader:r}=Oi("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 usePositions\n useAccreditations\n useDelegations\n useForms\n useCampaigns\n useDocuments\n useWorkflows\n delegationsSpaceLayoutId\n\n groupsAccesses {\n groupId\n roleId\n }\n\n delegationsSpaceLayouts {\n id\n name\n }\n }\n}\n",{organizationId:t,eventId:n},[js.CreateUpdateEventInfosFragment]);Zc(`${o("mettre_jour_l_28846")}: ${s.event?.name}`);const{mutate:a,isLoading:l}=function(e={}){return Di("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)(EM,{delegationsSpaceLayouts:s.event?.delegationsSpaceLayouts??Ns,eventCustomFields:s.organization?.eventCustomFields.nodes??Ns,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 OM;let DM=class extends hD{static{OM=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...hD.IMPORT_COLUMNS_DEFAULT,Name:"name",StartAt:"startAt",EndAt:"endAt",Country:"country",DayStartTime:"dayStartTime",Description:"description",Languages:"languages",Latitude:"latitude",Layer:"layer",Longitude:"longitude",Tags:"tags",TimeZone:"timeZone",IsWeezeventSynchronized:"isWeezeventSynchronized",UseAccreditations:"useAccreditations",UseCampaigns:"useCampaigns",UseDelegations:"useDelegations",UseDocuments:"useDocuments",UseForms:"useForms",UsePositions:"usePositions",UseWorkflows:"useWorkflows"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===jt.Update?[OM.IMPORT_COLUMNS_DEFAULT.Id]:[],OM.IMPORT_COLUMNS_DEFAULT.Name,OM.IMPORT_COLUMNS_DEFAULT.StartAt,OM.IMPORT_COLUMNS_DEFAULT.EndAt];constructor(e,t){super(e,t),this.csvInputService=e}};DM=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[cD,Si])],DM);const zM=()=>{const{params:{organizationId:e},translate:t}=bd(),{mutate:n}=function(e={}){return Di("mutation EventsImport($organizationId: OrganizationId!, $input: MappableImportInput!) {\n jobId: eventsImport(organizationId: $organizationId, input: $input)\n}\n",e)}(),{checkEventsImport:o}=HI(),s=(0,V.useCallback)((e,t)=>o(e,t),[o]),{data:r,loader:a}=sl({organizationId:e,variety:Te.Event});return a||(0,i.jsx)(aD,{alertDescriptionKey:"to_add_an_event_37885",children:(0,i.jsx)(zD,{ImportInputService:DM,checkImport:s,closePath:So.EVENTS({organizationId:e}),customFields:r.organization.customFields.nodes,heading:t("import_events_60816"),importTagPrefix:"events",localStorageKeyPrefix:"EVENTS_IMPORT",mutate:n,returnLink:(0,i.jsx)(bm,{to:So.EVENTS({organizationId:e}),children:t("revenir_aux_v_65215")})})})};var $M;!function(e){e.CreatedAt="createdAt",e.CreatedBy="createdBy",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"}($M||($M={}));let PM=class extends Um{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:Zt.Text,hideEmpty:!0},{slug:$M.Description,name:this.t("Description"),category:this.t("Event"),fieldType:Zt.Text},{slug:"startAt",name:this.t("date_de_d_but_43380"),category:this.t("Event"),fieldType:Zt.Date,hideEmpty:!0},{slug:"endAt",name:this.t("date_de_fin_86920"),category:this.t("Event"),fieldType:Zt.Date,hideEmpty:!0},{slug:"state",name:this.t("State"),category:this.t("Event"),fieldType:Zt.Select,values:[{id:oe.Ongoing,name:this.t(oe.Ongoing)},{id:oe.Upcoming,name:this.t(oe.Upcoming)},{id:oe.Done,name:this.t(oe.Done)}],hideEmpty:!0},{slug:"tag",name:this.t("Tag"),category:this.t("Event"),fieldType:Zt.Select,needLoading:!0,organizationId:e,tagContext:Fe.Events},{slug:$M.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("Event"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:$M.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("Event"),fieldType:Zt.Datetime,hideEmpty:!0},...this.customFieldsToFilters(t)]}getEventPossibleColumns(e){return[{slug:$M.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:se.Id,width:100},{slug:$M.Name,name:this.t("nom_de_l_v_nem_08711"),isSearchable:!0,isSortable:!0,sortAttribute:se.Name,minWidth:240},{slug:$M.Description,name:this.t("Description"),minWidth:320},{slug:$M.StartAt,name:this.t("date_de_d_but_43380"),isSortable:!0,sortAttribute:se.StartAt,minWidth:180},{slug:$M.EndAt,name:this.t("date_de_fin_86920"),isSortable:!0,sortAttribute:se.EndAt,minWidth:180},{slug:$M.State,name:this.t("State"),minWidth:180},{slug:$M.Tags,name:this.t("tags_79499"),minWidth:320},{slug:$M.NumberOfMembers,name:this.t("nombre_de_membr_08851"),minWidth:180},{slug:$M.NumberOfMembersAssigned,name:this.t("nombre_de_membr_87779_plural"),minWidth:180},{slug:$M.NumberOfMembersAccredited,name:this.t("nombre_de_membr_25913"),minWidth:180},{slug:$M.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:$M.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:se.CreatedAt,minWidth:180}].concat(this.customFieldsToPossibleColumns(e))}};PM=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mm,Cm,Si])],PM);const MM=e=>{const t=Ti(),n=Ei(Cm);return(0,i.jsxs)(rd,{direction:"column",gap:"1",width:200,children:[(0,i.jsx)(ka,{font:"gray500 textXs regular",children:t("date_de_l_v_ne_69973")}),(0,i.jsx)(ka,{font:"gray800 textSm medium",children:S_(n,e.event.startAt,e.event.endAt)})]})},FM=e=>{const t=Ti();return(0,i.jsxs)(rd,{direction:"column",gap:"1",width:100,children:[(0,i.jsx)(ka,{font:"gray500 textXs regular",children:t("State")}),(0,i.jsx)(rd,{children:(0,i.jsx)(vu,{color:k_(e.event.state),children:t(e.event.state)})})]})},NM=e=>{const t=Ti(),{mutate:n}=function(e={}){return Di("mutation EventsMassArchive(\n $organizationId: OrganizationId!\n $selecteds: MassActionSelectedsInput!\n) {\n eventsMassArchive(organizationId: $organizationId, selecteds: $selecteds)\n}\n",e)}(),{reload:o}=_v();return(0,i.jsx)(DA,{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 LM=class extends ic{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,includeCustomFields:!0,includeDelegations:!0,includeForms:!0,includePositions:!0,includeSegments:!0,includeTemplates:!0,includeWorkflows:!0}}eventDuplicateSchema(){return c.Ik().shape({name:c.Yj().required(this.t("le_nom_est_requ_61536")),startAt:Yp.required(this.t("la_date_d_but_d_30022")).typeError(this.t("la_date_d_but_d_30022")),endAt:Yp.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 As.c9.isDateTime(this.parent.startAt)&&this.parent.startAt.isValid&&As.c9.isDateTime(this.parent.endAt)&&this.parent.endAt.isValid&&this.parent.endAt>=this.parent.startAt}),includeAccreditations:c.zM(),includeCustomDocuments:c.zM(),includeCustomFields:c.zM(),includeDelegations:c.zM(),includeForms:c.zM(),includePositions:c.zM(),includeSegments:c.zM(),includeTemplates:c.zM(),includeWorkflows:c.zM()})}};LM=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],LM);const BM=e=>{const t=Ti(),n=Ei(LM),o=Ei(ld),{mutate:s,isLoading:r}=function(e={}){return Di("mutation EventDuplicate($eventId: EventId!, $options: EventDuplicateInput!) {\n eventDuplicate(eventId: $eventId, options: $options) {\n id\n }\n}\n",e)}(),{organization:a,reload:l}=_v(),[d,c]=(0,V.useState)(!1),u=(0,V.useMemo)(()=>a.events.nodes.filter(t=>t.id!==e.event.id),[a.events.nodes]),m=e.event.endAt.diff(e.event.startAt,"days").days;return(0,i.jsx)(cd.lV,{initialValues:{options:n.eventDuplicateInputDefault(e.event)},initialValuesEqual:La.A,render:({form:n,handleSubmit:o,invalid:s,values:a})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba.Yr,{name:"options.startAt",children:e=>{const t=e.plus({days:m});t.equals(a.options.endAt)||n.change("options.endAt",t)}}),(0,i.jsx)(Ba.Yr,{name:"options.endAt",children:e=>{const t=e.minus({days:m});t.equals(a.options.startAt)||n.change("options.startAt",t)}}),(0,i.jsx)(Cv,{icon:"clone",children:t("dupliquer_l_v_72541",e.event.name)}),(0,i.jsxs)(jv,{css:{overflowY:"auto"},gap:"5",children:[(0,i.jsx)(Zm,{value:d,onChange:e=>{c(e),e||n.change("options.eventId",null)},children:t("dupliquer_les_d_77458")}),d?(0,i.jsx)(Gp,{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)(ec,{label:t("nom_du_nouvel_66511"),name:"options.name"}),(0,i.jsxs)(rd,{gap:"5",children:[(0,i.jsx)(Np,{label:t("nouvelle_date_d_75723"),min:As.c9.utc(),name:"options.startAt"}),(0,i.jsx)(Np,{label:t("nouvelle_date_d_93958"),min:As.c9.utc(),name:"options.endAt"})]})]}),(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(ka,{font:"gray700 textSm medium",children:t("que_souhaitez_v_40297")}),(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsxs)(rd,{gap:"5",children:[(0,i.jsx)(ka,{width:1,children:(0,i.jsx)(Fp,{name:"options.includePositions",children:t("missions_63972")})}),(0,i.jsx)(ka,{width:1,children:(0,i.jsx)(Fp,{name:"options.includeAccreditations",children:t("accr_ditations_39450")})})]}),(0,i.jsxs)(rd,{gap:"5",children:[(0,i.jsx)(ka,{width:1,children:(0,i.jsx)(Fp,{name:"options.includeForms",children:t("Form_plural")})}),(0,i.jsx)(ka,{width:1,children:(0,i.jsx)(Fp,{name:"options.includeDelegations",children:t("d_l_gations_78318")})})]}),(0,i.jsxs)(rd,{gap:"5",children:[(0,i.jsx)(ka,{width:1,children:(0,i.jsx)(Fp,{name:"options.includeSegments",children:t("vues_personnali_80652")})}),(0,i.jsx)(ka,{width:1,children:(0,i.jsx)(Fp,{name:"options.includeCustomDocuments",children:t("documents_perso_87374")})})]}),(0,i.jsxs)(rd,{gap:"5",children:[(0,i.jsx)(ka,{width:1,children:(0,i.jsx)(Fp,{name:"options.includeTemplates",children:t("mod_les_de_camp_58182")})}),(0,i.jsx)(ka,{width:1,children:(0,i.jsx)(Fp,{name:"options.includeWorkflows",children:t("automatisations_60045")})})]}),(0,i.jsxs)(rd,{gap:"5",children:[(0,i.jsx)(ka,{width:1,children:(0,i.jsx)(Fp,{name:"options.includeCustomFields",children:t("champs_de_formu_64126")})}),(0,i.jsx)(ka,{width:1})]})]})]})]}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{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()}})},VM=e=>{const{params:{organizationId:t},translate:n}=bd(),{canEventEdit:o}=zv(),[s,r]=(0,V.useState)(!1),[a,l]=(0,V.useState)(!1),d=(0,V.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)(rd,{align:"center",css:{background:"white",bd:!0,padding:"$4 $6"},gap:"4",children:[(0,i.jsx)(rd,{css:{flex:"1"},children:(0,i.jsx)(bm,{to:fs.VOLUNTEERS(t,e.event.id),children:e.event.name})}),(0,i.jsxs)(rd,{css:{flex:"1",overflow:"hidden"},gap:"8",children:[(0,i.jsx)(MM,{event:e.event}),(0,i.jsx)(FM,{event:e.event}),(0,i.jsxs)(rd,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray500 textXs regular",children:n("tags_79499")}),(0,i.jsx)(UC,{badges:d})]})]}),(0,i.jsxs)(rd,{gap:"3",children:[(0,i.jsx)(kd,{to:fs.VOLUNTEERS(t,e.event.id),children:n("voir_l_v_nemen_72358")}),o&&(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"pen",to:fs.EDIT_EVENT(t,e.event.id),children:n("_diter_62574")}),(0,i.jsx)(ru,{icon:"clone",onClick:e=>{eu(e.target),r(!0)},children:n("dupliquer_28256")})]}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:e=>{eu(e.target),l(!0)},children:n("archiver_26131")})})]})]})]})]}),(0,i.jsx)(Av,{isOpen:s,onClose:()=>{r(!1)},children:(0,i.jsx)(yv,{children:(0,i.jsx)(BM,{event:e.event,reload:e.reload,onClose:()=>{r(!1)}})})}),a&&(0,i.jsx)(NM,{event:e.event,organizationId:t,onClose:()=>l(!1),onSuccess:e.reload})]})},UM=()=>{const{translate:e}=bd();return(0,i.jsxs)(rd,{align:"center",css:{background:"white",bd:!0,minHeight:"75px",padding:"$4 $6"},gap:"4",children:[(0,i.jsx)(rd,{css:{flex:"1"},children:(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1})}),(0,i.jsxs)(rd,{css:{flex:"1"},gap:"8",children:[(0,i.jsxs)(rd,{direction:"column",gap:"1",width:200,children:[(0,i.jsx)(ka,{font:"gray500 textXs regular",children:e("date_de_l_v_ne_69973")}),(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1})]}),(0,i.jsxs)(rd,{direction:"column",gap:"1",width:70,children:[(0,i.jsx)(ka,{font:"gray500 textXs regular",children:e("State")}),(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1})]}),(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray500 textXs regular",children:e("tags_79499")}),(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1})]})]}),(0,i.jsx)(rd,{width:200})]})},WM=()=>{const{params:{organizationId:e}}=bd(),{nameDebounced:t,predicates:n,limit:o,offset:s,setLimit:r,setOffset:a}=SC(),{data:l,isLoading:d,reload:c}=Il({organizationId:e,name:g(t)?t:null,predicates:n,limit:o,offset:s,sort:{attribute:se.StartAt,direction:re.Desc},includeCreatedBy:!1,includeDescription:!1,includeNumberOfMembers:!1}),{numberOfPages:u,totalCount:m}=ah(l.data?.rows);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rd,{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)(UM,{}),(0,i.jsx)(UM,{}),(0,i.jsx)(UM,{})]}):(l.data?.rows.nodes??[]).map(e=>(0,i.jsx)(VM,{event:e,reload:c},e.id))}),(0,i.jsx)(lm,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(rm,{limit:o,numberOfPages:u,offset:s,setLimit:r,setOffset:a,showLimits:!0,totalCount:m})})]})},GM=()=>{const{translate:e,params:{organizationId:t}}=bd(),{canEventEdit:n}=zv();return(0,i.jsx)(zz,{children:n&&(0,i.jsx)(dE,{menu:(0,i.jsx)(ru,{icon:"file-import",to:So.EVENTS_IMPORT({organizationId:t}),onClick:e=>eu(e.target),children:e("importer_via_un_61623")}),path:fs.CREATE_EVENT(t),children:e("cr_er_un_v_nem_28126")})})},qM=e=>{const{params:{organizationId:t}}=bd(),{mutate:n}=yr(),o=(0,V.useCallback)(i=>n({organizationId:t,massEdit:{reset:!1,selecteds:{ids:[e.event.id]},slug:Yt.Description,strategy:yt.Replace,value:i}}),[t,e.event.id,n]);return(0,i.jsx)(X$,{column:e.column,mutate:o,reload:e.reload,text:e.event.description,updatable:!0})},HM=e=>{const{params:{organizationId:t}}=bd(),{mutate:n}=yr();return(0,i.jsx)(OC,{column:e.column,initialValue:e.initialValue,mutate:i=>n({organizationId:t,massEdit:{reset:!1,selecteds:{ids:[e.eventId]},slug:e.property,strategy:yt.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:e.updatable})},KM=e=>{const{translate:t}=bd(),n=Ei(Cm);return(0,i.jsx)(HM,{column:e.column,eventId:e.event.id,initialValue:e.event.endAt,property:Yt.EndAt,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Ih,{label:t("date_de_fin_86920"),value:e,onChange:n}),renderValue:n.toLocaleString(e.event.endAt,zs.DateOnly.WeekdayLongMonthLong),updatable:!0})},YM=e=>{const{translate:t,params:{organizationId:n}}=bd(),{isEditMode:o}=SC();return(0,i.jsx)(HM,{column:e.column,eventId:e.event.id,initialValue:e.event.name,property:Yt.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Qd,{label:t("nom_de_l_v_nem_08711"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Vz,{isEditMode:o,title:e.event.name,updatable:!0,children:(0,i.jsx)(bm,{to:So.EVENT({organizationId:n,eventId:e.event.id}),children:(0,i.jsx)(ka,{css:{clamp:2},title:e.event.name,children:e.event.name})})}),updatable:!0})},ZM=e=>{const{translate:t}=bd(),n=Ei(Cm);return(0,i.jsx)(HM,{column:e.column,eventId:e.event.id,initialValue:e.event.startAt,property:Yt.StartAt,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Ih,{label:t("date_de_d_but_43380"),value:e,onChange:n}),renderValue:n.toLocaleString(e.event.startAt,zs.DateOnly.WeekdayLongMonthLong),updatable:!0})},XM=V.createContext({}),JM=e=>{const t=h$(Pr,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(XM.Provider,{value:{getTags:t},children:e.children})},QM=e=>{const{translate:t}=bd(),{getTags:n}=V.useContext(XM),{result:o,isLoading:s}=$$(n);return s?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zd,{children:t("tags_79499")}),(0,i.jsx)(ju,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Uu,{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))})},eF=e=>{const t=(0,V.useMemo)(()=>e.event.tags||[],[e.event]),n=(0,V.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(HM,{column:e.column,eventId:e.event.id,initialValue:t.map(e=>e.id),property:Yt.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(QM,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(UC,{badges:n}),updatable:!0})},tF=e=>{const{translate:t}=bd(),{mutate:n}=yr(),o=(0,V.useCallback)((t,i)=>n({organizationId:e.organizationId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:i,strategy:yt.Replace,value:t}}),[e.row,n]);return e.column.slug===$M.Id?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===$M.Name?(0,i.jsx)(YM,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===$M.Description?(0,i.jsx)(qM,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===$M.StartAt?(0,i.jsx)(ZM,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===$M.EndAt?(0,i.jsx)(KM,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===$M.Tags?(0,i.jsx)(eF,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===$M.State?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(vu,{color:k_(e.row.state),children:t(e.row.state)})}):e.column.slug===$M.NumberOfMembers?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembers}):e.column.slug===$M.NumberOfMembersAccredited?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembersAccredited}):e.column.slug===$M.NumberOfMembersAssigned?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembersAssigned}):e.column.slug===$M.CreatedBy?(0,i.jsx)(Nz,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===$M.CreatedAt?(0,i.jsx)(Fz,{column:e.column,insertedAt:e.row.insertedAt}):(0,i.jsx)(KC,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:o,reload:e.reloadRow,updatable:!0})},nF=e=>{const{translate:t,params:{organizationId:n}}=bd(),[o,s]=(0,V.useState)(!1),[r,a]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{children:[(0,i.jsx)(ru,{icon:"clone",onClick:e=>{eu(e.target),s(!0)},children:t("dupliquer_28256")}),(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:e=>{eu(e.target),a(!0)},children:t("archiver_26131")})]}),(0,i.jsx)(Av,{isOpen:o,onClose:()=>{s(!1)},children:(0,i.jsx)(yv,{children:(0,i.jsx)(BM,{event:e.event,reload:e.reload,onClose:()=>{s(!1)}})})}),r&&(0,i.jsx)(NM,{event:e.event,organizationId:n,onClose:()=>a(!1),onSuccess:e.reload})]})},iF=e=>{const{translate:t,params:{organizationId:n}}=bd(),{canEventEdit:o}=zv(),s=jC(e.customFields),r=(0,V.useCallback)(()=>{e.reloadEvent(e.event.id)},[e.event,e.reloadEvent]);return(0,i.jsxs)(am,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},onMouseLeave:e=>{eu(e.target)},children:[e.columns.map(t=>{const o=s.get(t.slug);return(0,i.jsx)(tF,{column:t,customField:o,organizationId:n,reloadRow:r,row:e.event},t.slug)}),o&&(0,i.jsxs)(jm,{justify:"center",children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"pen",to:fs.EDIT_EVENT(n,e.event.id)})})}),(0,i.jsx)(bp,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsx)(nF,{event:e.event,reload:e.reload})]})]})},oF=e=>{const{params:{organizationId:t}}=bd(),{canEventEdit:n}=zv(),{columns:o,limit:s,massActions:r,nameDebounced:a,offset:l,possibleColumns:d,predicates:c,setLimit:u,setOffset:m,setSort:h,sort:p}=SC(),f=(0,V.useMemo)(()=>function(e){return{includeCreatedBy:e.includes($M.CreatedBy),includeDescription:e.includes($M.Description),includeNumberOfMembers:e.includes($M.NumberOfMembers)||e.includes($M.NumberOfMembersAccredited)||e.includes($M.NumberOfMembersAssigned)}}(o),[o]),{data:_,isLoading:x,reload:I}=Il({...f,organizationId:t,name:g(a)?a:null,predicates:c,limit:s,offset:l,sort:p}),v=(0,V.useMemo)(()=>o.flatMap(e=>(0,hd.A)([d.find(t=>t.slug===e)])),[d,o]),{numberOfPages:b,totalCount:j}=ah(_.data?.rows),[C,y]=(0,V.useState)([]),[A,S]=(0,V.useState)({}),k=(0,V.useCallback)(async e=>{S(t=>({...t,[e]:!0}));const{data:{row:n}}=await(i={...f,organizationId:t,id:e},o=await X(),Js("query EventsEvent(\n $organizationId: OrganizationId!\n $id: EventId!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\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:[js.EventsEventFragment]}));var i,o;y(t=>t.map(t=>t.id===e?n:t)),S(t=>({...t,[e]:!1}))},[f,S,y]);return(0,V.useEffect)(()=>{y(_.data?.rows.nodes??[])},[_.data]),(0,V.useEffect)(()=>{r.setStates(Object.fromEntries((_.data?.rows.nodes??[]).map(e=>[`e${e.id}`,{id:e.id,state:"unchecked"}])))},[_.data,r.setStates]),(0,i.jsx)(rd,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(_p,{"aria-busy":x,headerRow:(0,i.jsxs)(Wu,{children:[v.map(e=>e.isSortable?(0,i.jsx)(fp,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:h,sort:p,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(pm,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),n&&(0,i.jsx)(pm,{width:100})]}),paginationRow:(0,i.jsx)(lm,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(rm,{limit:s,numberOfPages:b,offset:l,setLimit:u,setOffset:m,showLimits:!0,totalCount:j})}),children:x?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):C.map(t=>A[t.id]?(0,i.jsx)(fm,{},t.id):(0,i.jsx)(iF,{columns:v,customFields:e.customFields,event:t,reload:I,reloadEvent:k,state:r.states[`e${t.id}`]?.state??"unchecked"},t.id))})})},sF=e=>{const{translate:t}=bd(),{canEventEdit:n}=zv(),{rendering:o}=SC(),s=n&&o===bg.List,r=n&&o===bg.List;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(GM,{}),(0,i.jsxs)(Qv,{children:[(0,i.jsx)(Oz,{searchRow:(0,i.jsx)(Tz,{searchPlaceholder:t("rechercher_un_40024"),showActions:n,showEditColumns:s,showEditMode:r,showSearchColumns:!1})}),o===bg.List?(0,i.jsx)(oF,{customFields:e.customFields}):(0,i.jsx)(WM,{})]})]})},rF=e=>{const{history:t,translate:n,params:{organizationId:o,segmentId:s}}=bd(),{localOrganization:r,updateLocalOrganization:a}=_v(),{canSegmentEdit:l}=zv(),d=Ei(PM),c=(0,V.useMemo)(()=>e.organization.customFields.nodes,[e.organization]),u=(0,V.useMemo)(()=>d.getEventsFilters(o,c),[o,c]),m=(0,V.useMemo)(()=>d.getEventPossibleColumns(c),[c]);return(0,i.jsx)(JM,{organizationId:o,children:(0,i.jsx)(kz,{canSegmentEdit:l,filters:u,filtersButtonText:n("filtrer_les_v_48869"),filtersSubtitle:n("appliquer_des_f_84816"),getSegmentPath:e=>fs.EVENTS_SEGMENT(o,e),initialLimit:r?.eventsLimit??em,initialSegmentsOpen:r?.areEventsSegmentsOpen??!0,organizationId:o,possibleColumns:m,possibleRenderings:[bg.Card,bg.List],reload:e.reload,segmentId:s,segmentType:Me.Events,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{a({eventsLimit:e})},onSegmentClick:e=>{a({eventsSegmentId:e})},onSegmentDelete:async()=>{await a({eventsSegmentId:null}),t.replace(So.EVENTS({organizationId:o}))},onSegmentsToggle:async e=>{await a({areEventsSegmentsOpen:e})},children:(0,i.jsx)(sF,{customFields:c})})})},aF=()=>{const{params:{organizationId:e},translate:t}=bd();Zc(t("events_23531"));const{localOrganization:n}=_v(),{data:o,loader:s,reload:r}=Oi("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},[js.SegmentCustomFieldFragment,js.SegmentsFoldersSegmentsFragment]),a=(0,V.useMemo)(()=>(o.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[o.organization]);return s||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:fs.EVENTS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(rF,{organization:o.organization,reload:r})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:fs.EVENTS_SEGMENT(e,n?.eventsSegmentId&&a.includes(n.eventsSegmentId)?n.eventsSegmentId:a[0]),replace:!0})})]})},lF=()=>{const{params:{organizationId:e},translate:t}=bd(),{loader:n,data:o}=Oi("query EventsMobile($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n }\n }\n }\n}\n",{organizationId:e},[]);return n||(Bs(o.organization.events.nodes)?(0,i.jsx)(Fi,{path:fs.DASHBOARD_EVENT_SWITCH(e,o.organization.events.nodes[0].id)}):(0,i.jsx)(ka,{children:t("no_events_found_69870")}))};let dF=class extends ic{constructor(e){super(e)}accreditationsCustomFieldInputSchema(){return c.Ik().shape({customFieldId:c.ai().required(this.t("le_champ_person_80074")),conditionValue:c.gl().required(this.t("la_condition_es_66568"))})}};dF=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],dF);let cF=class extends ic{constructor(e){super(e)}accreditationsSlotInputDefault(){return{name:""}}createAccreditationSlotSchema(){return c.Ik().shape({slot:this.accreditationsSlotInputSchema()})}accreditationsSlotInputSchema(){return c.Ik().shape({name:c.Yj(),maxResources:c.ai().nullable(),date:Yp.typeError(this.t("la_date_est_inv_22002")).nullable()})}};cF=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],cF);let uF=class extends ic{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 c.Ik().shape({name:c.Yj().required(this.t("le_nom_de_l_acc_82676")),accreditationCategoryId:c.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:c.Yj(),privateNote:c.Yj(),acronym:c.Yj(),color:c.Yj().required(this.t("la_couleur_est_95740")),icon:c.Yj().required(this.t("l_ic_ne_est_req_15843")).oneOf(Vn,this.t("l_ic_ne_est_req_15843")),weezeventIsSynchronized:c.zM().required(),address:c.Yj().nullable(),latitude:c.ai().nullable().typeError(this.t("la_latitude_doi_43118")),longitude:c.ai().nullable().typeError(this.t("la_longitude_do_35170")),zoom:c.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:c.Yj().required(this.t("le_fond_de_cart_48524")).oneOf(Hn,this.t("le_fond_de_cart_48524")),slots:c.YO().of(this.accreditationsSlotInput.accreditationsSlotInputSchema()),accreditationDisplay:c.Yj().required(this.t("le_type_d_affic_60154")).oneOf(_n,this.t("le_type_d_affic_60154")).test("calendar-slots",this.t("tous_les_cr_nea_42033"),(e,t)=>e!==xe.Calendar||Bs(t.parent.slots)&&t.parent.slots.every(e=>e.date?.isValid)),numberOfDaysLimit:c.ai().notRequired(),accreditationsCustomFields:c.YO().of(this.accreditationsCustomFieldInput.accreditationsCustomFieldInputSchema()),formCustomFields:c.YO(),tagsIds:c.YO().of(c.ai())})}createUpdateAccreditationSchema(e){const t=this.accreditationInputSchema();return c.Ik().shape({accreditation:e?t.shape({fields:e}):t})}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??Ia.colors.primary500.value,icon:t?.icon??le.BadgeCheck,weezeventIsSynchronized:t?.weezeventIsSynchronized??!0,willAutoAccredit:t?.willAutoAccredit??!1,address:t?.address??null,latitude:t?.latitude??null,longitude:t?.longitude??null,zoom:t?.zoom??Pa,layer:t?.layer??e,accreditationDisplay:t?.accreditationDisplay??xe.List,numberOfDaysLimit:t?.numberOfDaysLimit??null,slots:(0,cm.A)(t?.slots??[],e=>(0,hd.A)([e.date?.toMillis(),e.name])),conditionsOperator:t?.conditionsOperator??Ie.And,accreditationsCustomFields:t?.accreditationsCustomFields??[],tagsIds:t?.tagsIds??[],fields:t?.fields??{},formCustomFields:t?.formCustomFields??[]}}};uF=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si,dF,cF])],uF);const mF=e=>{const t=Ti(),n=e.customFields.find(t=>t.id===e.customFieldValue.customFieldId);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba.Yr,{name:`${e.field}customFieldId`,children:t=>{const n=e.customFields.find(e=>e.id===t);e.change(`${e.field}conditionValue`,n?.fieldType===Oe.Select?[]:"")}}),(0,i.jsxs)(rd,{css:{background:"white",bd:!0,padding:"$3 $4"},direction:"column",gap:"4",children:[(0,i.jsx)(ka,{css:{textTransform:"uppercase"},font:"gray800 textXs semiBold",children:t("condition_n_1_11603",e.index+1)}),(0,i.jsxs)(rd,{align:"center",gap:"4",children:[(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsxs)(Gp,{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)(ka,{color:"gray500",css:{paddingTop:"$6"},fontSize:"textMd",children:(0,i.jsx)(Id,{icon:"arrow-right"})}),(0,i.jsxs)(ka,{css:{flex:"1"},children:[n?.fieldType===Oe.Checkbox&&(0,i.jsxs)(Ev,{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===Oe.Select&&(0,i.jsx)(Gp,{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)(ka,{css:{paddingTop:"$6"},children:(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.onRemove})})]})]})]})},hF=e=>{const{history:t,translate:n,params:{organizationId:o}}=bd();return 0===e.customFields.length?(0,i.jsxs)(rd,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$7"},direction:"column",children:[(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:n("vous_n_avez_pas_62142")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:n("pour_ajouter_de_74432")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(kd,{color:"white",onClick:()=>{t.push(tx.CUSTOM_FIELDS({organizationId:o}))},children:n("cr_eer_un_champ_08883")})]}):(0,i.jsxs)(rd,{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)(V.Fragment,{children:[(0,i.jsx)(mF,{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)(ka,{css:{width:"fit-content"},children:(0,i.jsxs)(Ev,{name:`${e.prefix}conditionsOperator`,children:[(0,i.jsx)("option",{value:Ie.And,children:n(Ie.And)}),(0,i.jsx)("option",{value:Ie.Or,children:n(Ie.Or)})]})}):(0,i.jsx)(ka,{font:"gray800 textSm medium",children:n(e.conditionsOperator)}):null]},o)}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",onClick:()=>{e.change(e.name,[...e.customFieldsValues,{customFieldId:-1,conditionValue:""}])},children:n("ajouter_une_con_66324")})})]})},gF=()=>{const{translate:e}=bd();return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Kp,{name:"accreditation.willAutoAccredit",subtext:e("si_la_case_est_44018"),children:e("autoriser_l_acc_50624")})})},pF=e=>{const{mutate:t}=function(e={}){return Di("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)(iC,{initialName:"",isEdit:!1,mutate:async n=>(await t({eventId:e.eventId,accreditationCategory:{name:n}})).accreditationCategoryCreate,onClose:e.onClose,onSuccess:e.onSuccess})},fF=e=>{const{mutate:t}=function(e={}){return Di("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)(iC,{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})},_F=e=>{const{translate:t,params:{eventId:n}}=bd(),[o,s]=(0,V.useState)(!1),[r,a]=(0,V.useState)(vj(e.event.accreditationsCategories));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ec,{label:t("nom_de_votre_ac_85997"),name:"accreditation.name"}),(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Gp,{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)(ec,{label:(0,i.jsx)(fI,{children:t("Acronym")}),name:"accreditation.acronym"})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(aj,{label:t("Color"),name:"accreditation.color"}),(0,i.jsx)(mj,{label:t("ic_ne_55554"),name:"accreditation.icon"})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(SI,{label:(0,i.jsx)(fI,{children:t("description_58935")}),name:"accreditation.description"}),e.event.isWeezeventConnected&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Kp,{name:"accreditation.weezeventIsSynchronized",children:t("WeezeventIsSynchronized")})]}),o&&(0,i.jsx)(pF,{eventId:n,onClose:()=>{s(!1)},onSuccess:t=>{a(vj([...r,t])),e.change("accreditation.accreditationCategoryId",t.id)}})]})},xF=e=>{const t=Ti(),[n,o]=V.useState(As.c9.invalid("Invalid")),[s,r]=V.useState(0),a=V.useMemo(()=>e.slots.map((e,t)=>({...e,index:t})),[e.slots]),l=V.useMemo(()=>{const t=As.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=V.useMemo(()=>l.slice(s,10+s),[s,l]),c=V.useMemo(()=>Math.ceil(l.length/10),[l]),u=V.useMemo(()=>l.length,[l]);return(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsxs)(rd,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(ka,{css:{flex:"1"},font:"gray800 textMd medium",children:t("liste_de_vos_cr_37612")}),(0,i.jsx)(ka,{width:200,children:(0,i.jsx)(Ih,{max:e.event.endAt,min:e.event.startAt,value:n,onChange:e=>{o(e),r(0)}})})]}),(0,i.jsxs)(rd,{css:{background:"$gray100",bd:!0,padding:"$6"},direction:"column",gap:"3",children:[d.map(t=>e.renderSlot(t)),(0,i.jsx)(rm,{limit:10,numberOfPages:c,offset:s,setOffset:r,totalCount:u})]}),(0,i.jsxs)(ka,{css:{cursor:"pointer"},font:"primary500 textSm medium",onClick:e.onNewSlot,children:["+ ",t("ajouter_un_cr_n_63607")]})]})},IF=e=>{const t=Ti(),{user:n}=Li();return(0,i.jsx)(Ej,{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)(rd,{align:"center",gap:"3",wrap:"wrap",children:[(0,i.jsxs)(ka,{children:[t("r_p_ter_pour_le_06048"),ae.Fr!==n?.language&&" "+t("prochain_e_s_04262")]}),(0,i.jsx)(ka,{width:100,children:(0,i.jsx)(Ev,{name:"value",shouldParseAsInt:!0,children:(0,nm.A)(1,31).map(e=>(0,i.jsx)("option",{value:e,children:e},e))})}),ae.Fr===n?.language&&(0,i.jsx)(ka,{children:t("prochain_e_s_04262")}),(0,i.jsx)(ka,{width:120,children:(0,i.jsxs)(Ev,{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")})]})})]})})},vF=e=>{const t=Ti(),n=Ei(cF);return(0,i.jsx)(Ej,{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,Ta.A)(t.slot,["id","name","date","maxResources"])),e.onClose()},children:({form:n})=>(0,i.jsxs)(rd,{css:{flex:"1",overflowY:"auto"},direction:"column",width:1,children:[(0,i.jsx)(ec,{label:t("nom_du_cr_neau_54351"),name:"slot.name"}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ec,{label:t("MaxResources"),name:"slot.maxResources",shouldParseAsInt:!0}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(Np,{label:t("Date"),max:e.event.endAt,min:e.event.startAt,name:"slot.date",rightIcon:"xmark",onRightIconClick:()=>{n.change("slot.date",null)}})]})})},bF=e=>{const t=Ti(),n=Ei(Cm),o=(0,V.useMemo)(()=>g(e.slot.name)?e.slot.name:t("cr_neau_n_1_80362",e.index+1),[e.slot.name,e.index]),s=(0,V.useMemo)(()=>{const i=e.slot.date?.isValid?n.toLocaleString(e.slot.date,zs.DateOnly.WeekdayLongMonthLong):"",o=e.slot.maxResources?t("_1_membre_maxi_51489",e.slot.maxResources):"";return(0,hd.A)([o,i]).join(" - ")||"-"},[e.slot.maxResources,e.slot.date]),[r,a]=(0,V.useState)(e.initialIsEditOpen),[l,d]=(0,V.useState)(!1),c=!e.slot.date?.isValid,u=(e.slot.assignedResources??0)>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray800 textSm semiBold",children:o}),(0,i.jsx)(ka,{color:"gray500",children:s})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{a(!0)}})})}),(0,i.jsx)(bp,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"clone",size:"sm",onClick:()=>{e.onDuplicate(e.slot)}})})}),(0,i.jsx)(bp,{placement:"top",children:t("dupliquer_28256")})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",disabled:c,leftIcon:"arrows-repeat",size:"sm",onClick:()=>{d(!0)}})})}),(0,i.jsx)(bp,{placement:"top",children:t("r_p_ter_le_cr_n_68038")})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",disabled:u,leftIcon:"trash-can",size:"sm",onClick:()=>{e.remove(e.index)}})})}),(0,i.jsx)(bp,{placement:"top",children:t(u?"des_membres_son_92320":"supprimer_43083")})]})]}),r&&(0,i.jsx)(vF,{event:e.event,slot:e.slot,onClose:()=>{a(!1)},onSuccess:async t=>{e.updateSlots(t,e.index)}}),l&&(0,i.jsx)(IF,{showHours:!1,onClose:()=>{d(!1)},onSubmit:(t,n)=>{e.onRepeat(e.slot,t,n)}})]})},jF=e=>{const t=Ti(),n=Ei(cF),[o,s]=(0,V.useState)(-1),r=(0,V.useMemo)(()=>e.values.accreditation.slots.some(e=>e.date?.isValid),[e.values.accreditation]),a=(0,V.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,V.useCallback)((e,t)=>!!e.date?.isValid&&e.date.startOf("day")===t.startOf("day"),[]),d=(0,V.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,V.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,V.useCallback)((t,n,i)=>{const o=function(e,t,n){if(e.date?.isValid)return(0,nm.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]),m=(0,V.useCallback)(t=>{e.change("accreditation.slots",qs(e.values.accreditation.slots,t))},[e.values.accreditation.slots,e.change]);return(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(xF,{event:e.event,matchDateFilter:l,renderSlot:t=>(0,i.jsx)(bF,{event:e.event,index:t.index,initialIsEditOpen:t.index===o,remove:m,slot:t,updateSlots:a,onDuplicate:c,onRepeat:u},t.index),slots:e.values.accreditation.slots,onNewSlot:d}),(0,i.jsx)(Dh,{height:"5"}),(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{font:"gray900 textMd medium",children:t("type_d_affichag_09962")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("comment_souhait_62602")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(FI,{name:"accreditation.accreditationDisplay",value:xe.List,children:t("afficher_sous_f_71276")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(FI,{name:"accreditation.accreditationDisplay",value:xe.Radio,children:t("afficher_sous_f_61997")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(FI,{name:"accreditation.accreditationDisplay",value:xe.Calendar,children:t("afficher_sous_f_15380")})]}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Dh,{height:"5"}),(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{font:"gray900 textMd medium",children:t("blocage_de_l_ac_17590")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("est_ce_qu_il_y_67585")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(zu,{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)(md,{height:"2"}),(0,i.jsx)(zu,{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)(md,{height:"2"}),(0,i.jsxs)(rd,{align:"center",css:{paddingLeft:"$6"},gap:"2",children:[(0,i.jsx)(ka,{width:80,children:(0,i.jsx)(ec,{min:0,name:"accreditation.numberOfDaysLimit",shouldParseAsInt:!0})}),(0,i.jsx)(ka,{children:t("jours_avant_la_74918")})]})]})]})]})]})},CF=e=>(0,i.jsx)(U_,{names:[`${e.prefix}latitude`,`${e.prefix}longitude`,`${e.prefix}zoom`],render:t=>(0,i.jsx)(Ua,{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})}),yF=111320,AF=e=>e*Math.PI/180;function SF([e,t],[n,i]){const o=AF(n-e),s=AF(i-t),r=Math.sin(o/2)**2+Math.cos(AF(e))*Math.cos(AF(n))*Math.sin(s/2)**2;return 12742e3*Math.asin(Math.sqrt(r))}const kF=e=>`${(e/1e3).toFixed(2)} km`,wF=e=>(0,i.jsxs)(rd,{gap:"2",justify:"between",children:[(0,i.jsx)(ka,{color:"gray500",children:e.label}),(0,i.jsx)(ka,{color:"gray800",children:e.value})]}),EF=e=>{const t=Ti(),n=Ei(Cm),o=(0,V.useMemo)(()=>e.traces.flatMap(t=>{const n=function(e,t,n){if(e.length<2)return null;const i=t===ce.Backward?e.slice().reverse():e,o=function(e){let t,n=0;return e.map(([,,e])=>("number"==typeof e&&(void 0===t||t-e>=5?t=e:e-t>=5&&(n+=e-t,t=e)),n))}(i),s=Math.cos(AF(n.latitude)),r=([e,t])=>[(t-n.longitude)*yF*s,(e-n.latitude)*yF];let a=0,l=1/0,d=0,c=0;for(let e=0;ee.startAt&&t?n.toLocaleString(function(e,t,n){const i=n.distanceFromStart+n.distanceFromFinish,o=n.totalEffort>0?n.effortFromStart/n.totalEffort:0;return e.plus({seconds:Math.round(i/1e3*t*o)})}(e.startAt,t,i),zs.ShortDateTime):null,[n]);return(0,i.jsx)(rd,{direction:"column",gap:"4",children:o.map(({trace:e,projection:n})=>{const o=s(e,e.firstRunnerPace,n),r=s(e,e.lastRunnerPace,n);return(0,i.jsxs)(rd,{css:{border:"1px solid $gray200",borderRadius:"$2",padding:"$3 $4"},direction:"column",gap:"1",children:[(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{css:{color:e.color},children:(0,i.jsx)(Id,{icon:"route"})}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"semiBold",children:e.name})]}),n.distanceToTrace>50&&(0,i.jsx)(ka,{color:"warning700",children:t("le_point_est_78274",Math.round(n.distanceToTrace))}),(0,i.jsx)(wF,{label:t("distance_depuis_55700"),value:kF(n.distanceFromStart)}),(0,i.jsx)(wF,{label:t("distance_jusqu_19272"),value:kF(n.distanceFromFinish)}),n.totalClimb>0&&(0,i.jsx)(wF,{label:t("d_nivel_positi_53034"),value:`${Math.round(n.climbFromStart)} m / ${Math.round(n.totalClimb)} m`}),o&&(0,i.jsx)(wF,{label:t("passage_estim_18732"),value:o}),r&&(0,i.jsx)(wF,{label:t("passage_estim_81350"),value:r})]},e.id)})})},TF=e=>{const t=Ti(),n=e.traces.filter(t=>e.tracesIds.includes(t.id)),o=Fa(e.point);return(0,i.jsxs)(rd,{gap:"7",children:[(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(ka,{color:"gray800",fontWeight:"semiBold",children:t("apparence_75510")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsxs)(Ev,{label:t("Layer"),name:`${e.name}layer`,children:[(0,i.jsx)("option",{value:de.Google,children:"Plan"}),(0,i.jsx)("option",{value:de.GoogleSatellite,children:"Satellite"}),(0,i.jsx)("option",{value:de.IgnPlan,children:"IGN Plan"})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Ev,{label:(0,i.jsx)(fI,{children:t("Zoom")}),name:`${e.name}zoom`,shouldParseAsInt:!0,children:(0,nm.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)(md,{height:"6"}),(0,i.jsx)(Gp,{isSearchVisible:!0,label:(0,i.jsx)(fI,{children:t("Traces")}),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)(md,{height:"7"}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"semiBold",children:t("localisation_38416")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Dj,{addressName:`${e.name}address`,label:(0,i.jsx)(fI,{children:t("Address")}),latitudeName:`${e.name}latitude`,longitudeName:`${e.name}longitude`}),(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Bp,{label:(0,i.jsx)(fI,{children:t("latitude_46176")}),name:`${e.name}latitude`}),(0,i.jsx)(Bp,{label:(0,i.jsx)(fI,{children:t("longitude_01695")}),name:`${e.name}longitude`})]}),o&&n.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(EF,{point:o,traces:n})]})]}),(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(CF,{center:(s=e.center,"number"==typeof s?.latitude&&"number"==typeof s?.longitude?{latitude:s.latitude,longitude:s.longitude}:void 0),layer:e.layer,point:o,prefix:e.name,traces:n})})]});var s},RF=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=bd(),{showNotification:r}=HI(),a=Ei(uF),l=Ei(ld),d=Ei(oj),c=(0,V.useRef)(null),u=(0,V.useMemo)(()=>e.isEdit?s("mise_jour_de_17055",e.initialValues.accreditation.name):s("cr_ation_d_une_01473"),[e.isEdit,e.initialValues]);Zc(u);const{areSlotsOpen:m,isLocalisationOpen:h,areConditionsOpen:p,areCustomFieldsOpen:f,isPrivateNoteOpen:_,areTagsOpen:x}=(0,V.useMemo)(()=>{const t=e.initialValues.accreditation;return{areSlotsOpen:e.isEdit&&Bs(t.slots),isLocalisationOpen:e.isEdit&&(g(t.address)||"number"==typeof t.latitude||"number"==typeof t.longitude),areConditionsOpen:e.isEdit&&Bs(t.accreditationsCustomFields),areCustomFieldsOpen:e.isEdit&&(Bs(Object.keys(t.fields))||Bs(t.formCustomFields)),isPrivateNoteOpen:e.isEdit&&g(t.privateNote),areTagsOpen:e.isEdit&&Bs(t.tagsIds)}},[e.initialValues,e.isEdit]),I=(0,V.useCallback)(t=>l.validateForForm(a.createUpdateAccreditationSchema(d.changedFieldsSchema(e.accreditationCustomFields,e.initialValues.accreditation.fields,t.accreditation.fields)))(t),[e.accreditationCustomFields,e.initialValues]);return(0,i.jsx)(Vd,{customErrorRef:c,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:r,submitting:a,values:l})=>(0,i.jsx)(zp,{button:e.isEdit?(0,i.jsx)(kd,{isLoading:a,onClick:r,children:s("mettre_jour_l_92576")}):null,category:u,color:"dark",fallbackClosePath:Mo.ACCREDITATIONS({organizationId:n,eventId:o}),heading:e.isEdit?e.initialValues.accreditation.name:s("nouvelle_accr_d_32707"),children:(0,i.jsxs)(Op,{ref:c,children:[(0,i.jsx)(Nd,{}),(0,i.jsx)(Wp,{heading:s("informations_su_35382"),children:(0,i.jsx)(_F,{change:t.change,event:e.event})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:s("automatisation_47772"),subtitle:s("attribuer_autom_55909"),children:(0,i.jsx)(gF,{})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:s("cr_neaux_33401"),initialIsOpen:m,isToggleable:!0,subtitle:s("ajouter_les_dif_76832"),onToggle:e=>{e||t.change("accreditation.slots",[])},children:(0,i.jsx)(jF,{change:t.change,event:e.event,values:l})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:s("localisation_38416"),initialIsOpen:h,isToggleable:!0,subtitle:s("indiquez_la_loc_61935"),onToggle:n=>{n||(t.change("accreditation.layer",e.event.layer),t.change("accreditation.zoom",Pa),t.change("accreditation.address",null),t.change("accreditation.latitude",null),t.change("accreditation.longitude",null))},children:(0,i.jsx)(TF,{center:null,layer:l.accreditation.layer,name:"accreditation.",point:l.accreditation,traces:[],tracesIds:[]})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:s("conditions_77756"),initialIsOpen:p,isToggleable:!0,subtitle:s("ajoutez_des_con_94296"),onToggle:e=>{e||t.change("accreditation.accreditationsCustomFields",[])},children:(0,i.jsx)(hF,{change:t.change,conditionsOperator:l.accreditation.conditionsOperator,customFields:e.conditionsCustomFields,customFieldsValues:l.accreditation.accreditationsCustomFields,name:"accreditation.accreditationsCustomFields",prefix:"accreditation."})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:s("champs_de_formu_64126"),initialIsOpen:f,isToggleable:!0,subtitle:s("ajouter_des_inf_14221"),onToggle:e=>{e||(t.change("accreditation.formCustomFields",[]),t.change("accreditation.fields",{}))},children:(0,i.jsx)(SM,{change:t.change,customFields:e.accreditationCustomFields,formCustomFields:e.formCustomFields,formCustomFieldsValues:l.accreditation.formCustomFields,prefix:"accreditation.",showFormCustomFields:!0})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:s("note_priv_e_06303"),initialIsOpen:_,isToggleable:!0,subtitle:s("ajoutez_une_not_89122"),onToggle:e=>{e||t.change("accreditation.privateNote","")},children:(0,i.jsx)(SI,{label:(0,i.jsx)(fI,{children:s("note_priv_e_06303")}),name:"accreditation.privateNote"})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:s("tags_79499"),initialIsOpen:x,isToggleable:!0,subtitle:s("ajouter_des_tag_77298"),onToggle:e=>{e||t.change("accreditation.tagsIds",[])},children:(0,i.jsx)(Rj,{change:t.change,name:"accreditation.",organizationId:n,tags:e.tags,tagsIds:l.accreditation.tagsIds})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)($p,{children:(0,i.jsx)(kd,{isLoading:a,onClick:r,children:(0,i.jsx)(ka,{textAlign:"center",children:e.isEdit?s("mettre_jour_l_92576"):s("cr_er_l_accr_di_16123")})})})]})}),validate:I,width:1,onSubmit:async i=>{const a=await e.mutate({eventId:o,accreditation:{...i.accreditation,slots:i.accreditation.slots.map(e=>(0,ma.A)(e,["index"]))}});r(e.isEdit?s("l_accr_ditation_24401"):s("l_accr_ditation_25694")),e.isEdit?t.goBack(Mo.ACCREDITATION({organizationId:n,eventId:o,accreditationId:a})):t.replace(Mo.ACCREDITATION({organizationId:n,eventId:o,accreditationId:a}))}})},OF=()=>{const{organizationId:e,eventId:t,options:n}=zi(),o=Ei(uF),{data:s,loader:r}=Oi("query AccreditationEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...FormCustomFields\n ...CreatePositionTags\n\n accreditationCustomFields: customFields(\n eventId: $eventId\n variety: Accreditation\n privacy: All\n ) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateAccreditationEvent\n }\n}\n",{organizationId:e,eventId:t},[js.ConditionsCustomFieldsFragment,js.FormCustomFieldsFragment,js.CreatePositionTagsFragment,js.AttachCustomFieldFragment,js.CreateAccreditationEventFragment]),{mutate:a}=function(e={}){return Di("mutation AccreditationCreate($eventId: EventId!, $accreditation: AccreditationInput!) {\n accreditationCreate(eventId: $eventId, accreditation: $accreditation) {\n id\n }\n}\n",e)}(),l=g(n)?parseInt(n,10):null;return r||(0,i.jsx)(RF,{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})},DF=()=>{const{organizationId:e,eventId:t,accreditationId:n}=zi(),o=Ei(uF),{data:s,loader:r}=Oi("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(\n eventId: $eventId\n variety: Accreditation\n privacy: All\n ) {\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},[js.ConditionsCustomFieldsFragment,js.FormCustomFieldsFragment,js.CreatePositionTagsFragment,js.AttachCustomFieldFragment,js.CreateAccreditationEventFragment]),{mutate:a}=function(e={}){return Di("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)(RF,{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 zF;let $F=class extends hD{static{zF=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...hD.IMPORT_COLUMNS_DEFAULT,AccreditationName:"accreditationName",AccreditationCategoryName:"accreditationCategoryName",SlotName:"slotName",SlotDate:"slotDate",MaxResources:"slotMaxResources",Acronym:"acronym",Color:"color",Icon:"icon",Description:"description",ConditionsOperator:"conditionsOperator",Address:"address",Latitude:"latitude",Longitude:"longitude",MapLayer:"mapLayer",MapZoom:"mapZoom",PrivateNote:"privateNote",Tags:"tags"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===jt.Update?[zF.IMPORT_COLUMNS_DEFAULT.Id]:[],zF.IMPORT_COLUMNS_DEFAULT.AccreditationName,zF.IMPORT_COLUMNS_DEFAULT.AccreditationCategoryName];constructor(e,t){super(e,t),this.csvInputService=e}};$F=zF=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[cD,Si])],$F);const PF=()=>{const{params:{organizationId:e,eventId:t},translate:n}=bd(),{mutate:o}=function(e={}){return Di("mutation AccreditationsImport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $input: MappableImportInput!\n) {\n jobId: accreditationsImport(organizationId: $organizationId, eventId: $eventId, input: $input)\n}\n",e)}(),{checkAccreditationsImport:s}=HI(),r=(0,V.useCallback)((e,t,n)=>s(e,t,n),[s]),{data:a,loader:l}=sl({organizationId:e,variety:Te.Accreditation});return l||(0,i.jsx)(aD,{alertDescriptionKey:"pour_ajouter_un_26814",children:(0,i.jsx)(zD,{ImportInputService:$F,checkImport:r,closePath:Mo.ACCREDITATIONS({organizationId:e,eventId:t}),customFields:a.organization.customFields.nodes,heading:n("accreditations_66464"),importTagPrefix:"accreditations",localStorageKeyPrefix:"ACCREDITATIONS_IMPORT",mutate:o,returnLink:(0,i.jsx)(bm,{to:Mo.ACCREDITATIONS({organizationId:e,eventId:t}),children:n("back_to_accredi_24412")})})})};var MF;function FF(e,t){return t===Ig.Table||t===Ig.WeeklyCalendar?{includeConditions:!1,includeCustomFields:t===Ig.Table,includeCreatedBy:!1,includeDescription:!1,includeResources:!0,includeTags:!1}:{includeConditions:e.includes(MF.Conditions),includeCustomFields:!1,includeCreatedBy:e.includes(MF.CreatedBy),includeDescription:e.includes(MF.Description),includeResources:!1,includeTags:e.includes(MF.Tags)}}!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.MaxResources="maxResources",e.AssignedResources="resources",e.Slot="slot",e.SlotDate="slotDate",e.SlotName="slotName",e.ScannedResources="scannedResources",e.WishedResources="wishedResources",e.Tags="tags",e.WeezeventChecklistId="weezeventChecklistId",e.WeezeventIsSynchronized="weezeventIsSynchronized"}(MF||(MF={}));let NF=class extends Um{constructor(e,t,n){super(e,t,n)}getAccreditationsFilters(e,t){return(0,hd.A)([{slug:"name",name:this.t("AccreditationName"),category:this.t("accr_ditations_39450"),fieldType:Zt.Text,hideEmpty:!0},{slug:"accreditation",name:this.t("Accreditation"),category:this.t("accr_ditations_39450"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:MF.Description,name:this.t("Description"),category:this.t("accr_ditations_39450"),fieldType:Zt.Text},{slug:MF.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("accr_ditations_39450"),fieldType:Zt.Text},Bs(e.accreditationsCategories)?{slug:"accreditationCategory",name:this.t("cat_gorie_00291"),category:this.t("accr_ditations_39450"),fieldType:Zt.Select,values:(0,cm.A)(e.accreditationsCategories,e=>m(e.name)),hideEmpty:!0}:null,{slug:"slotName",name:this.t("nom_du_cr_neau_54351"),category:this.t("accr_ditations_39450"),fieldType:Zt.Text},{slug:"slotDate",name:this.t("Date"),category:this.t("accr_ditations_39450"),fieldType:Zt.Date},{slug:"tag",name:"Tag",category:this.t("accr_ditations_39450"),fieldType:Zt.Select,needLoading:!0,organizationId:e.organizationId,eventId:e.id,tagContext:Fe.Accreditations},{slug:"accreditationCustomField",name:this.t("condition_61066"),category:this.t("accr_ditations_39450"),fieldType:Zt.Select,needLoading:!0,organizationId:e.organizationId},{slug:"acronym",name:this.t("Acronym"),category:this.t("accr_ditations_39450"),fieldType:Zt.Text},{slug:"color",name:this.t("Color"),category:this.t("accr_ditations_39450"),fieldType:Zt.Text,hideEmpty:!0},{slug:"icon",name:this.t("ic_ne_55554"),category:this.t("accr_ditations_39450"),fieldType:Zt.Select,values:Vn.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"address",name:this.t("Address"),category:this.t("accr_ditations_39450"),fieldType:Zt.Text},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("accr_ditations_39450"),fieldType:Zt.Number,hideEmpty:!0},{slug:MF.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("accr_ditations_39450"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,organizationId:e.organizationId,eventId:e.id},{slug:MF.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("accr_ditations_39450"),fieldType:Zt.Datetime,hideEmpty:!0},...this.customFieldsToFilters(t)])}getAccreditationsPossibleColumns(e,{isWeezeventConnected:t}){const n=[{slug:MF.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:Wt.Id,width:100},{slug:MF.Name,name:this.t("AccreditationName"),isSearchable:!0,isSortable:!0,sortAttribute:Wt.Name,minWidth:240},{slug:MF.Description,name:this.t("Description"),minWidth:320},{slug:MF.Category,name:this.t("nom_de_la_cat_g_03860"),isSearchable:!0,isSortable:!0,sortAttribute:Wt.Category,minWidth:240},{slug:MF.SlotName,name:this.t("nom_du_cr_neau_54351"),isSearchable:!0,minWidth:240},{slug:MF.SlotDate,name:this.t("Date"),minWidth:180,isSortable:!0,sortAttribute:Ut.Date},{slug:MF.AssignedResources,name:this.t("membres_11310"),minWidth:320},{slug:MF.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:240},{slug:MF.Conditions,name:this.t("conditions_77756"),minWidth:320},{slug:MF.Address,name:this.t("Address"),isSearchable:!0,minWidth:240},{slug:MF.Latitude,name:this.t("latitude_46176"),isSearchable:!0,minWidth:180},{slug:MF.Longitude,name:this.t("longitude_01695"),isSearchable:!0,minWidth:180},{slug:MF.Acronym,name:this.t("Acronym"),isSearchable:!0,isSortable:!0,sortAttribute:Wt.Acronym,minWidth:180},{slug:MF.Color,name:this.t("Color"),isSearchable:!0,width:80},{slug:MF.Icon,name:this.t("ic_ne_55554"),width:80},{slug:MF.IconColor,name:this.t("ic_ne_et_couleu_54485"),width:80},{slug:MF.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:MF.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:MF.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:Wt.CreatedAt,minWidth:180},{slug:MF.AutoAccredit,name:this.t("AutoAccredit"),minWidth:180},{slug:MF.Index,name:this.t("Index"),isSortable:!0,sortAttribute:Wt.Index,width:200}];return t&&n.push({slug:MF.WeezeventIsSynchronized,name:this.t("WeezeventIsSynchronized"),minWidth:180},{slug:MF.WeezeventChecklistId,name:this.t("WeezeventChecklistId"),minWidth:180}),n.concat(this.customFieldsToPossibleColumns(e))}};NF=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mm,Cm,Si])],NF);const LF=e=>{const{params:{eventId:t}}=bd(),{mutate:n}=xr(),o=V.useCallback(async i=>{const o=Ls(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:yt.Replace,value:r}})}return!0},[e.accreditationId,e.property,n]);return(0,i.jsx)(OC,{column:e.column,initialValue:e.initialValue,mutate:o,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},BF=e=>{const{translate:t}=bd();return(0,i.jsx)(LF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.acronym||"",property:Bt.Acronym,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Qd,{label:t("Acronym"),value:e,onChange:n}),renderValue:e.accreditation.acronym||""})},VF=V.createContext({}),UF=e=>{const t=h$(Ka,{eventId:e.eventId},e=>e.event.accreditationsCategories),n=h$(Pr,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(VF.Provider,{value:{getAccreditationsCategories:t,getTags:n},children:e.children})};function WF(){return V.useContext(VF)}const GF=e=>{const t=Ti(),{getAccreditationsCategories:n}=WF(),{result:o,isLoading:s}=$$(n);return s?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zd,{children:t("Category")}),(0,i.jsx)(ju,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(hh,{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))})},qF=e=>{const{organizationId:t,eventId:n}=zi(),{isEditMode:o}=SC(),s=e.accreditationCategory.name;return(0,i.jsx)(LF,{accreditationId:e.accreditationId,column:e.column,initialValue:e.accreditationCategory.id,property:Bt.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(GF,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(Vz,{isEditMode:o,title:s,updatable:!0,children:(0,i.jsx)(bm,{to:Mo.ACCREDITATION_CATEGORY({organizationId:t,eventId:n,accreditationCategoryId:e.accreditationCategory.id}),children:s})})})},HF=e=>{const{translate:t}=bd();return(0,i.jsx)(LF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.color,property:Bt.Color,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(rj,{label:t("Color"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(rd,{align:"center",gap:"3",width:1,children:(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{css:{background:e.accreditation.color,borderRadius:"2px",height:"24px",width:"24px"},onClick:()=>{TI(e.accreditation.color)}})}),(0,i.jsx)(bp,{placement:"top",children:e.accreditation.color})]})})})};function KF(e,t,n){return t.fieldType===Oe.Select?Bs(n)?(0,hd.A)(n.map(e=>t.values.find(t=>t.id===e)?.value)).join(", "):"":e(!0===n?"true":"false")}const YF=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>e.accreditation.accreditationsCustomFields||[],[e.accreditation]),o=(0,V.useMemo)(()=>n.map((e,n)=>({id:n,color:"gray",icon:null,text:`${e.customField.name} : ${KF(t,e.customField,e.conditionValue)}`})),[n]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:o})})},ZF=e=>{const{params:{eventId:t}}=bd(),{mutate:n}=xr(),o=(0,V.useCallback)(i=>n({eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.accreditation.id]},slug:Bt.Description,strategy:yt.Replace,value:i}}),[t,e.accreditation.id,n]);return(0,i.jsx)(X$,{column:e.column,mutate:o,reload:e.reload,text:e.accreditation.description,updatable:!0})},XF=e=>{const{translate:t}=bd();return(0,i.jsx)(LF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.icon,property:Bt.Icon,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(uj,{label:t("Icon"),renderOnPortal:!0,value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Id,{icon:xd(e.accreditation.icon)})})},JF=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>({[Bt.Color]:e.accreditation.color,[Bt.Icon]:e.accreditation.icon}),[e.accreditation]);return(0,i.jsx)(LF,{accreditationId:e.accreditation.id,column:e.column,initialValue:n,property:[Bt.Color,Bt.Icon],reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(rd,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(rj,{label:t("Color"),value:e[Bt.Color],onChange:t=>{n({...e,[Bt.Color]:t})}}),(0,i.jsx)(uj,{label:t("Icon"),renderOnPortal:!0,value:e[Bt.Icon],onChange:t=>{n({...e,[Bt.Icon]:t})}})]}),renderValue:()=>(0,i.jsx)(Xv,{color:e.accreditation.color,icon:e.accreditation.icon})})},QF=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{isEditMode:s}=SC(),r=e.accreditation.name;return(0,i.jsx)(LF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.name,property:Bt.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Qd,{label:t("AccreditationName"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Vz,{isEditMode:s,title:r,updatable:!0,children:(0,i.jsx)(bm,{to:Mo.ACCREDITATION({organizationId:n,eventId:o,accreditationId:e.accreditation.id}),children:(0,i.jsx)(ka,{css:{clamp:2},title:r,children:r})})})})},eN=e=>{const{translate:t}=bd(),{getTags:n}=WF(),{result:o,isLoading:s}=$$(n);return s?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zd,{children:t("tags_79499")}),(0,i.jsx)(ju,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Uu,{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))})},tN=e=>{const t=(0,V.useMemo)(()=>e.accreditation.tags||[],[e.accreditation]),n=(0,V.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(LF,{accreditationId:e.accreditation.id,column:e.column,initialValue:t.map(e=>e.id),property:Bt.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(eN,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(UC,{badges:n})})},nN=e=>{const{translate:t,params:{eventId:n}}=bd(),o=Ei(Cm),{mutate:s}=Qa(),r=(0,V.useMemo)(()=>e.accreditationSlot.date?o.toLocaleString(e.accreditationSlot.date,zs.DateOnly.WeekdayLongMonthLong):"-",[e.accreditationSlot]),a=(0,V.useMemo)(()=>e.accreditationSlot.date?.isValid?e.accreditationSlot.date:As.c9.invalid("Invalid"),[e.accreditationSlot]);return(0,i.jsx)(OC,{column:e.column,initialValue:a,mutate:async t=>s({eventId:n,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:{...(0,Ta.A)(e.accreditationSlot,["id","name","maxResources"]),date:t}}),reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Ih,{label:t("Date"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(ka,{color:"gray900",css:{ellipsis:!0,textTransform:"capitalize"},title:r,width:1,children:r}),updatable:!0})},iN=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{isEditMode:s}=SC(),{mutate:r}=Qa(),a=(0,V.useMemo)(()=>g(e.accreditationSlot.name)?e.accreditationSlot.name:"-",[e.accreditationSlot]);return(0,i.jsx)(OC,{column:e.column,initialValue:e.accreditationSlot.name,mutate:async t=>r({eventId:o,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:{...(0,Ta.A)(e.accreditationSlot,["id","date","maxResources"]),name:t}}),reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Qd,{label:t("nom_du_cr_neau_54351"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Vz,{isEditMode:s,title:a,updatable:!0,children:(0,i.jsx)(bm,{to:Mo.ACCREDITATION_SLOT({organizationId:n,eventId:o,accreditationId:e.accreditationSlot.accreditation.id,accreditationSlotId:e.accreditationSlot.id}),children:(0,i.jsx)(ka,{css:{clamp:2},title:a,children:a})})}),updatable:!0})},oN=e=>{if("number"==typeof e.weezeventOrganizationId&&"number"==typeof e.accreditationSlot.weezeventChecklistId){const t=pf(e.weezeventOrganizationId,e.accreditationSlot.weezeventChecklistId);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(bm,{to:t,children:e.accreditationSlot.weezeventChecklistId})})}return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:"-"})},sN=e=>{const{translate:t,params:{eventId:n}}=bd(),{canAccreditationEdit:o}=Dv(),{mutate:s}=Qa(),r=Ei(Xb),a=jC(e.customFields),l=(0,V.useCallback)(()=>{e.reloadAccreditationSlot(e.accreditationSlot.id)},[e.accreditationSlot,e.reloadAccreditationSlot]),[d,c]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(am,{css:{"&:hover":{background:"$gray100"}},children:[e.columns.map(n=>{const o=a.get(n.slug);return n.slug===MF.Id?(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:e.accreditationSlot.id},n.slug):n.slug===MF.Category?(0,i.jsx)(qF,{accreditationCategory:e.accreditationSlot.accreditationCategory,accreditationId:e.accreditationSlot.accreditation.id,column:n,reload:l},n.slug):n.slug===MF.Name?(0,i.jsx)(QF,{accreditation:e.accreditationSlot.accreditation,column:n,reload:l},n.slug):n.slug===MF.Description?(0,i.jsx)(ZF,{accreditation:e.accreditationSlot.accreditation,column:n,reload:l},n.slug):n.slug===MF.SlotName?e.accreditationSlot.isHidden?(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:"-"},n.slug):(0,i.jsx)(iN,{accreditationSlot:e.accreditationSlot,column:n,reload:l},n.slug):n.slug===MF.SlotDate?e.accreditationSlot.isHidden?(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:"-"},n.slug):(0,i.jsx)(nN,{accreditationSlot:e.accreditationSlot,column:n,reload:l},n.slug):n.slug===MF.MaxResources||n.slug===MF.AssignedResources?(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:(0,i.jsx)(O$,{assignedResources:e.accreditationSlot.assignedResources,resources:e.accreditationSlot.maxResources})},n.slug):n.slug===MF.Tags?(0,i.jsx)(tN,{accreditation:e.accreditationSlot.accreditation,column:n,reload:l},n.slug):n.slug===MF.Conditions?(0,i.jsx)(YF,{accreditation:e.accreditationSlot.accreditation,column:n},n.slug):n.slug===MF.Address?(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:e.accreditationSlot.accreditation.address},n.slug):n.slug===MF.Latitude?(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:e.accreditationSlot.accreditation.latitude},n.slug):n.slug===MF.Longitude?(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:e.accreditationSlot.accreditation.longitude},n.slug):n.slug===MF.Acronym?(0,i.jsx)(BF,{accreditation:e.accreditationSlot.accreditation,column:n,reload:l},n.slug):n.slug===MF.Color?(0,i.jsx)(HF,{accreditation:e.accreditationSlot.accreditation,column:n,reload:l},n.slug):n.slug===MF.Icon?(0,i.jsx)(XF,{accreditation:e.accreditationSlot.accreditation,column:n,reload:l},n.slug):n.slug===MF.IconColor?(0,i.jsx)(JF,{accreditation:e.accreditationSlot.accreditation,column:n,reload:l}):n.slug===MF.FillingRate?(0,i.jsxs)(Qu,{minWidth:n.minWidth,width:n.width,children:[e.accreditationSlot.fillingRate,"%"]},n.slug):n.slug===MF.CreatedBy?(0,i.jsx)(Nz,{column:n,createdBy:e.accreditationSlot.accreditation.createdBy},n.slug):n.slug===MF.CreatedAt?(0,i.jsx)(Fz,{column:n,insertedAt:e.accreditationSlot.insertedAt},n.slug):n.slug===MF.WeezeventIsSynchronized?(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:e.accreditationSlot.accreditation.weezeventIsSynchronized?t("oui_54361"):t("non_33516")},n.slug):n.slug===MF.WeezeventChecklistId?(0,i.jsx)(oN,{accreditationSlot:e.accreditationSlot,column:n,weezeventOrganizationId:e.weezeventOrganizationId}):(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:o?r.getValueString(o,e.accreditationSlot.accreditation.fields,{fileReturnValue:"name"}):""},n.slug)}),o?e.accreditationSlot.isHidden?(0,i.jsx)(Qu,{width:100}):(0,i.jsx)(jm,{justify:"center",children:(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"pen",onClick:()=>c(!0)})})}),(0,i.jsx)(bp,{placement:"top",children:t("_diter_62574")})]})}):null]}),d&&(0,i.jsx)(vF,{event:e.event,slot:{...e.accreditationSlot,maxResources:e.accreditationSlot.maxResources,assignedResources:e.accreditationSlot.assignedResources},onClose:()=>{c(!1)},onSuccess:async t=>{await s({eventId:n,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:t}),l()}})]})},rN=e=>{const{params:{organizationId:t,eventId:n}}=bd(),{canAccreditationEdit:o}=Dv(),{columns:s,columnsSearch:r,limit:a,nameDebounced:l,offset:d,possibleColumns:c,predicates:u,reloadKey:m,rendering:h,setLimit:p,setOffset:f,setSort:_,sort:x}=SC(),I=(0,V.useMemo)(()=>FF(s,h),[s,h]),{data:v,isLoading:b,reload:j}=el({...I,organizationId:t,eventId:n,name:g(l)?l:null,columnsSearch:Bs(r)?r:null,predicates:u,limit:a,offset:d,sort:x}),C=(0,V.useMemo)(()=>s.flatMap(e=>(0,hd.A)([c.find(t=>t.slug===e)])),[c,s]),{numberOfPages:y,totalCount:A}=ah(v.event?.accreditationsSlots),[S,k]=(0,V.useState)([]),[w,E]=(0,V.useState)({}),T=(0,V.useCallback)(async e=>{E(t=>({...t,[e]:!0}));const{event:{accreditationSlot:t}}=await(i={...I,eventId:n,id:e},o=await X(),Js("query AccreditationsAccreditationSlot(\n $eventId: EventId!\n $id: AccreditationsSlotId!\n $customFieldsSlugs: [CustomFieldSlug!]\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeResources: Boolean!\n $includeTags: Boolean!\n) {\n event(id: $eventId) {\n accreditationSlot(id: $id) {\n ...AccreditationsAccreditationSlot\n }\n }\n}\n",{variables:i,token:o||void 0,fragments:[js.AccreditationsAccreditationSlotFragment]}));var i,o;k(n=>n.map(n=>n.id===e?t:n)),E(t=>({...t,[e]:!1}))},[I,E,k]);return(0,V.useEffect)(()=>{k(v.event?.accreditationsSlots.nodes??[])},[v.event]),(0,V.useEffect)(()=>{m>1&&j()},[m]),(0,i.jsx)(rd,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(_p,{"aria-busy":b,headerRow:(0,i.jsxs)(Wu,{children:[C.map(e=>e.isSortable?(0,i.jsx)(fp,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:_,sort:x,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(pm,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),o&&(0,i.jsx)(pm,{width:100})]}),paginationRow:(0,i.jsx)(lm,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(rm,{limit:a,numberOfPages:y,offset:d,setLimit:p,setOffset:f,showLimits:!0,totalCount:A})}),children:b?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):S.map(t=>w[t.id]?(0,i.jsx)(fm,{},t.id):(0,i.jsx)(sN,{accreditationSlot:t,columns:C,customFields:e.customFields,event:v.event,reloadAccreditationSlot:T,weezeventOrganizationId:e.weezeventOrganizationId},t.id))})})},aN=e=>{const{params:{organizationId:t,eventId:n},translate:o}=bd(),{columns:s}=SC(),{user:r}=Li(),{data:a,isLoading:l}=Oi("query AccreditationsHeader($eventId: EventId!) {\n event(id: $eventId) {\n key\n }\n}\n",{eventId:n},[]),{mutate:d}=function(e={}){return Di("mutation AccreditationsExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $segmentId: SegmentId!\n $format: ExportFormat!\n $columns: [String!]!\n) {\n jobId: accreditationsExport(\n organizationId: $organizationId\n eventId: $eventId\n segmentId: $segmentId\n format: $format\n columns: $columns\n )\n}\n",e)}(),[c,u]=(0,V.useState)(!1),[m,h]=(0,V.useState)(!1),[g,p]=(0,V.useState)(!1),{checkExport:f}=HI(),[_,x]=(0,V.useState)(!1);return(0,i.jsxs)(zz,{children:[(0,i.jsx)(Mv,{permissions:Ov.ACCREDITATION_EDIT,children:(0,i.jsx)(dE,{menu:(0,i.jsx)(ru,{icon:"file-import",to:Mo.ACCREDITATIONS_IMPORT({organizationId:t,eventId:n}),onClick:e=>eu(e.target),children:o("importer_via_un_61623")}),path:fs.CREATE_ACCREDITATION(t,n),children:o("cr_er_une_accr_33475")})}),(0,i.jsx)(Mv,{permissions:Ov.ACCREDITATION_EDIT,children:(0,i.jsxs)(nu,{isOpen:c,onStateChange:u,children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{icon:"plus",onClick:()=>{u(!1),x(!0)},children:o("cr_er_une_cat_g_20051")})}),(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"plug-circle-bolt",onClick:e=>{eu(e.target),h(!0)},children:o("exporter_via_l_09843")}),(0,i.jsx)(ru,{icon:"file-xls",onClick:e=>{eu(e.target),p(!0)},children:o("exporter_en_exc_51862")})]})]})]})}),_&&(0,i.jsx)(pF,{eventId:n,onClose:()=>{x(!1)},onSuccess:e.reload}),!l&&(0,i.jsx)(bP,{isOpen:m,link:hf({organizationId:t,eventId:n,lang:r?.language,pathComponent:"accreditations",key:a.event.key}),onClose:()=>{h(!1)}}),!l&&(0,i.jsx)(jP,{isOpen:g,requestExport:async i=>{const{jobId:o}=await d({organizationId:t,eventId:n,segmentId:e.segment.id,format:i,columns:s});f(o,t,n)},showIncludeFiles:!1,onClose:()=>{p(!1)}})]})},lN=e=>{const{translate:t}=bd();return(0,i.jsx)(LF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.willAutoAccredit,property:Bt.AutoAccredit,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Eu,{state:e?"checked":"unchecked",onClick:e=>{n("checked"===e)},children:t("AutoAccredit")}),renderValue:e.accreditation.willAutoAccredit?t("oui_54361"):t("non_33516")})},dN=e=>(0,i.jsx)(LF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.index??0,property:Bt.Index,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(Qd,{min:1,shouldParseAsInt:!0,value:e,onChange:t}),renderValue:e.accreditation.index?.toString(10)??"-"}),cN=e=>{const{translate:t}=bd();return(0,i.jsx)(LF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.weezeventIsSynchronized,property:Bt.WeezeventIsSynchronized,reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(hh,{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")})},uN=e=>{const{mutate:t}=xr(),n=(0,V.useCallback)((n,i)=>t({eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:i,strategy:yt.Replace,value:n}}),[e.row,t]);return e.column.slug===MF.Id?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===MF.Category?(0,i.jsx)(qF,{accreditationCategory:e.row.accreditationCategory,accreditationId:e.row.id,column:e.column,reload:e.reloadRow}):e.column.slug===MF.Name?(0,i.jsx)(QF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===MF.Description?(0,i.jsx)(ZF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===MF.SlotName||e.column.slug===MF.SlotDate?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===MF.MaxResources||e.column.slug===MF.AssignedResources?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(O$,{assignedResources:e.row.assignedResources,resources:e.row.maxResources})}):e.column.slug===MF.Tags?(0,i.jsx)(tN,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===MF.Conditions?(0,i.jsx)(YF,{accreditation:e.row,column:e.column}):e.column.slug===MF.Address?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.address}):e.column.slug===MF.Latitude?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.latitude}):e.column.slug===MF.Longitude?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.longitude}):e.column.slug===MF.Acronym?(0,i.jsx)(BF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===MF.Color?(0,i.jsx)(HF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===MF.Icon?(0,i.jsx)(XF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===MF.IconColor?(0,i.jsx)(JF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===MF.FillingRate?(0,i.jsxs)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===MF.CreatedBy?(0,i.jsx)(Nz,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===MF.AutoAccredit?(0,i.jsx)(lN,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===MF.WeezeventIsSynchronized?(0,i.jsx)(cN,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===MF.WeezeventChecklistId?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===MF.CreatedAt?(0,i.jsx)(Fz,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===MF.Index?(0,i.jsx)(dN,{accreditation:e.row,column:e.column,reload:e.reloadRow}):(0,i.jsx)(KC,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:n,reload:e.reloadRow,updatable:!0})};function mN(){const{history:e,params:{organizationId:t,eventId:n}}=bd(),{mutate:i}=function(e={}){return Di("mutation AccreditationDuplicate($eventId: EventId!, $accreditationId: AccreditationId!) {\n accreditationDuplicate(eventId: $eventId, accreditationId: $accreditationId) {\n id\n }\n}\n",e)}();return(0,V.useCallback)(async o=>{const{accreditationDuplicate:s}=await i({eventId:n,accreditationId:o});e.push(fs.EDIT_ACCREDITATION(t,n,s.id))},[t,n,i])}const hN=e=>{const{translate:t,params:{eventId:n}}=bd(),{showNotification:o}=HI(),{mutate:s}=Ya();return(0,i.jsx)(DA,{buttonText:t("supprimer_43083"),subtext:(0,hd.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()}})},gN=e=>{const t=Ti(),n=mN(),[o,s]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{children:[(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"pen",to:fs.EDIT_ACCREDITATION(e.organizationId,e.eventId,e.accreditation.id),children:t("_diter_62574")}),(0,i.jsx)(ru,{icon:"clone",onClick:async()=>{await n(e.accreditation.id)},children:t("dupliquer_28256")})]}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:e=>{s(!0),eu(e.target)},children:t("supprimer_43083")})})]}),o&&(0,i.jsx)(hN,{accreditation:e.accreditation,onClose:()=>{s(!1)},onSuccess:e.reload})]})},pN=e=>{const t=Ti(),{canAccreditationEdit:n}=Dv(),o=jC(e.customFields),s=(0,V.useCallback)(()=>{e.reloadAccreditation(e.accreditation.id)},[e.accreditation,e.reloadAccreditation]);return(0,i.jsxs)(am,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},onMouseLeave:e=>{eu(e.target)},children:[n&&(0,i.jsx)(Qu,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:e.state,onClick:(t,n)=>e.toggleRow(`a${e.accreditation.id}`,t,n.shiftKey)})}),e.columns.map(t=>{const n=o.get(t.slug);return(0,i.jsx)(uN,{column:t,customField:n,eventId:e.eventId,reloadRow:s,row:e.accreditation},t.slug)}),n&&(0,i.jsxs)(jm,{justify:"center",children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"pen",to:fs.EDIT_ACCREDITATION(e.organizationId,e.eventId,e.accreditation.id)})})}),(0,i.jsx)(bp,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsx)(gN,{accreditation:e.accreditation,eventId:e.eventId,organizationId:e.organizationId,reload:e.reload})]})]})},fN=e=>{const{params:{organizationId:t,eventId:n}}=bd(),{canAccreditationEdit:o}=Dv(),{columns:s,columnsSearch:r,limit:a,massActions:l,nameDebounced:d,offset:c,possibleColumns:u,predicates:m,reloadKey:h,rendering:p,setLimit:f,setOffset:_,setSort:x,sort:I}=SC(),v=(0,V.useMemo)(()=>FF(s,p),[s,p]),{data:b,isLoading:j,reload:C}=Oi("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 $includeDescription: 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",{...v,eventId:n,name:g(d)?d:void 0,columnsSearch:Bs(r)?r:void 0,predicates:m,limit:a,offset:c,sort:I},[js.AccreditationsAccreditationFragment]);const y=(0,V.useMemo)(()=>s.flatMap(e=>(0,hd.A)([u.find(t=>t.slug===e)])),[u,s]),{numberOfPages:A,totalCount:S}=ah(b.data?.rows),[k,w]=(0,V.useState)([]),[E,T]=(0,V.useState)({}),R=(0,V.useCallback)(async e=>{T(t=>({...t,[e]:!0}));const{data:{row:t}}=await function(e,t){return Js("query AccreditationsAccreditation(\n $eventId: EventId!\n $id: AccreditationId!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: 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:[js.AccreditationsAccreditationFragment]})}({...v,eventId:n,id:e},await X());w(n=>n.map(n=>n.id===e?t:n)),T(t=>({...t,[e]:!1}))},[v,T,w]);return(0,V.useEffect)(()=>{w(b.data?.rows.nodes??[])},[b.data]),(0,V.useEffect)(()=>{h>1&&C()},[h]),(0,V.useEffect)(()=>{l.setStates(Object.fromEntries((b.data?.rows.nodes??[]).map(e=>[`a${e.id}`,{id:e.id,state:"unchecked"}])))},[b.data,l.setStates]),(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(rd,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(_p,{"aria-busy":j,headerRow:(0,i.jsxs)(Wu,{children:[o&&(0,i.jsx)(pm,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:l.selectAllState,onClick:l.toggleSelectAll})}),y.map(e=>e.isSortable?(0,i.jsx)(fp,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:x,sort:I,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(pm,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),o&&(0,i.jsx)(pm,{width:100})]}),paginationRow:(0,i.jsx)(lm,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(rm,{limit:a,numberOfPages:A,offset:c,setLimit:f,setOffset:_,showLimits:!0,totalCount:S})}),children:j?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):k.map(o=>E[o.id]?(0,i.jsx)(fm,{},o.id):(0,i.jsx)(pN,{accreditation:o,columns:y,customFields:e.customFields,eventId:n,organizationId:t,reload:C,reloadAccreditation:R,state:l.states[`a${o.id}`]?.state??"unchecked",toggleRow:l.toggleRow},o.id))})})})},_N=e=>{const{params:{organizationId:t,eventId:n}}=bd(),{canMemberAccredit:o}=Dv(),{columns:s,predicates:r,rendering:a}=SC(),l=(0,V.useMemo)(()=>FF(s,a),[s,a]),{data:d}=el({...l,organizationId:t,eventId:n,predicates:r,onlyWithDate:!0});return(0,i.jsx)(rd,{css:{flex:"1"},direction:"column",width:1,children:(0,i.jsx)(ck,{css:{border:"1px solid $gray200"},date:e.selectedDay,display:"week",maxDate:e.endAt,minDate:e.startAt,children:(d.event?.accreditationsSlots.nodes??[]).map(e=>(0,i.jsx)(dk,{endAt:e.date,startAt:e.date,children:(0,i.jsx)(Ck,{accreditation:e.accreditation,accreditationSlot:e,canMemberAccredit:o,showWished:!0,stats:e})},e.id))})})},xN=()=>{const e=Ti(),{eventId:t,massActions:n,onMassEditSuccess:o,organizationId:s,predicates:r,segment:a}=SC(),{showNotification:l}=HI(),{mutate:d}=xr(),{mutate:c}=Ya(),[u,m]=(0,V.useState)(!1),[h,p]=(0,V.useState)(!1),f=n.getSelectedsInput(r,null),_=n.isAllSelected?a.count:n.numberOfSelected,x=(0,V.useCallback)(e=>{g(e)&&l(e),o()},[o]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kd,{onClick:()=>{m(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(lu,{placement:"bottom-end",children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>{p(!0)},children:e("supprimer_43083")})})]}),u&&(0,i.jsx)(UA,{eventId:t,mutate:e=>d({eventId:t,massEdit:e}),organizationId:s,selecteds:f,onClose:()=>{m(!1)},onSuccess:t=>{x(e("_1_accr_ditati_22872",t))}}),h&&(0,i.jsx)(DA,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_31111")],text:e("suppression_de_42723",_),onClose:()=>{p(!1)},onDelete:async()=>{const n=(await c({eventId:t,selecteds:f})).numberOfAccreditations;x(e("_1_accr_ditati_88237",n))}})]})},IN=()=>{const{params:{organizationId:e,eventId:t}}=bd(),{columns:n,infos:o,predicates:s,rendering:r,setInfos:a}=SC(),l=(0,V.useMemo)(()=>FF(n,r),[n,r]),{data:d}=el({...l,organizationId:e,eventId:t,predicates:s,customFieldsSlugs:(o.accreditationsTableLinks||[]).map(e=>e.customFieldSlug)}),c=(0,V.useMemo)(()=>(0,Xh.A)(d.event?.accreditationsSlots.nodes??[],e=>e.accreditationCategory.id).map(e=>e.accreditationCategory),[d.event]),u=(0,V.useMemo)(()=>(0,Xh.A)(d.event?.accreditationsSlots.nodes??[],e=>e.accreditation.id).map(e=>e.accreditation),[d.event]),m=(0,V.useMemo)(()=>o.accreditationsTableLinks||[],[o]),h=(0,V.useCallback)(e=>{a({...o,accreditationsTableLinks:e})},[o,a]);return(0,i.jsx)(rd,{css:{flex:"1"},direction:"column",width:1,children:(0,i.jsx)(sk,{accreditations:u,categories:c,customFields:d.organization?.customFields?.nodes??[],links:m,setLinks:h,showTotal:!1,slots:d.event?.accreditationsSlots.nodes??[]})})},vN=e=>{const t=Ti(),{canAccreditationEdit:n,canSegmentEdit:o}=Dv(),{limit:s,reloadKey:r,rendering:a,segment:l,setReloadKey:d,infos:c,setInfos:u}=SC(),m=(0,V.useMemo)(()=>As.c9.isDateTime(c?.accreditationsCalendarSelectedDay)&&c?.accreditationsCalendarSelectedDay?.isValid?c.accreditationsCalendarSelectedDay:As.c9.fromISO(c?.accreditationsCalendarSelectedDay)?.isValid?As.c9.fromISO(c.accreditationsCalendarSelectedDay,{zone:"utc"}):e.event.startAt,[c]),h=(0,V.useCallback)(e=>{u({...c,accreditationsCalendarSelectedDay:e})},[c,u]),g=a!==Ig.Table&&a!==Ig.WeeklyCalendar&&o,p=a!==Ig.Table&&a!==Ig.WeeklyCalendar&&n;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(aN,{reload:()=>d(r+1),segment:l}),0===e.event.numberOfAccreditations?(0,i.jsx)(Qv,{css:{overflow:"hidden"},children:(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(pA,{subtitle:"",title:t("vous_n_avez_pas_53408")})})}):(0,i.jsxs)(Qv,{children:[(0,i.jsx)(Oz,{searchRow:(0,i.jsx)(Tz,{actions:(0,i.jsx)(xN,{}),controls:a===Ig.WeeklyCalendar&&(0,i.jsx)(ak,{max:e.event.endAt,min:e.event.startAt,value:m,onChange:h}),searchPlaceholder:t("rechercher_une_65646"),showActions:n,showEditColumns:g,showEditMode:p,showSearchColumns:o}),selectSegment:(0,i.jsx)(wz,{pageSelectedText:t("les_1_accr_di_60244",s),segmentSelectedText:t("les_1_accr_di_20650",l.count,l.name)})}),a===Ig.SlotsList?(0,i.jsx)(rN,{customFields:e.customFields,weezeventOrganizationId:e.weezeventOrganizationId}):a===Ig.List?(0,i.jsx)(fN,{customFields:e.customFields}):a===Ig.Table?(0,i.jsx)(IN,{}):(0,i.jsx)(_N,{endAt:e.event.endAt,selectedDay:m,startAt:e.event.startAt})]})]})},bN=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,segmentId:r}}=bd(),{hasPermission:a,localEvent:l,updateLocalEvent:d}=dv(),c=Ei(NF),u=(0,V.useMemo)(()=>e.organization?.customFields.nodes??[],[e.organization]),m=(0,V.useMemo)(()=>c.getAccreditationsFilters(e.event,u),[u,e.event]),h=(0,V.useMemo)(()=>c.getAccreditationsPossibleColumns(u,{isWeezeventConnected:e.event.isWeezeventConnected}),[u,e.event]);return(0,i.jsx)(UF,{eventId:s,organizationId:o,children:(0,i.jsx)(kz,{canSegmentEdit:a(Ov.SEGMENT_EDIT),eventId:s,filters:m,filtersButtonText:n("filtrer_les_acc_57840"),filtersSubtitle:n("appliquer_des_f_18351"),getSegmentPath:e=>fs.ACCREDITATIONS_SEGMENT(o,s,e),hideSegments:0===e.event.numberOfAccreditations,initialLimit:l?.accreditationsLimit??em,initialSegmentsOpen:l?.areAccreditationsSegmentsOpen??!0,organizationId:o,possibleColumns:h,possibleRenderings:[Ig.List,Ig.SlotsList,Ig.Table,Ig.WeeklyCalendar],reload:e.reload,segmentId:r,segmentType:Me.Accreditations,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{d({accreditationsLimit:e})},onSegmentClick:e=>{d({accreditationsSegmentId:e})},onSegmentDelete:async()=>{await d({accreditationsSegmentId:null}),t.replace(Mo.ACCREDITATIONS({organizationId:o,eventId:s}))},onSegmentsToggle:async e=>{await d({areAccreditationsSegmentsOpen:e})},children:(0,i.jsx)(vN,{customFields:u,event:e.event,weezeventOrganizationId:e.organization.weezeventOrganizationId})})})},jN=()=>{const{params:{organizationId:e,eventId:t},translate:n}=bd(),{event:{name:o},localEvent:s}=dv();Zc(`${o} ${n("accr_ditations_39450")}`);const{data:r,loader:a,reload:l}=Oi("query AccreditationsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(eventId: $eventId, variety: Accreditation) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n id\n organizationId\n startAt\n endAt\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},[js.SegmentCustomFieldFragment,js.SegmentsFoldersSegmentsFragment]),d=(0,V.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:fs.ACCREDITATIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(bN,{event:r.event,organization:r.organization,reload:l})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:fs.ACCREDITATIONS_SEGMENT(e,t,s?.accreditationsSegmentId&&d.includes(s.accreditationsSegmentId)?s?.accreditationsSegmentId:d[0]),replace:!0})})]})},CN=()=>{const{hasFeature:e}=_v();return e(Ae.Accreditation)?(0,i.jsx)(jN,{}):(0,i.jsx)(rd,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(kx,{icon:"badge-check"})})},yN=[{name:"accreditationsCategoriesIds",type:"ids",resource:"accreditationsCategories",multiple:!0},{name:"accreditationsIds",type:"ids",resource:"accreditations",multiple:!0}],AN=[{name:"date",type:"date"},{name:"endDate",type:"date",requires:"date"}],SN=[{name:"sortAttribute",type:"enum",values:gi,multiple:!1,allowOtherValues:!0},{name:"sortDirection",type:"enum",values:li,multiple:!1,defaultValue:re.Asc,requires:"sortAttribute"}],kN={name:"delimiter",type:"delimiter"},wN={path:"assignments",params:[kN,{name:"state",type:"enum",values:hi,multiple:!1},{name:"date",type:"date"},{name:"includeLeaders",type:"boolean"},{name:"slugs",type:"slugs",variety:Te.UserInfo,emptyMeans:"all"},{name:"positionCategoryId",type:"ids",resource:"positionsCategories",multiple:!1},{name:"positionId",type:"ids",resource:"positions",multiple:!1},...SN]},EN={path:"accreditations",feature:Ae.Accreditation,params:[kN,{name:"date",type:"date"},{name:"states",type:"enum",values:vn,multiple:!0},{name:"slugs",type:"slugs",variety:Te.UserInfo,emptyMeans:"all"},...yN,{name:"accreditationsSlotsIds",type:"ids",resource:"accreditationsSlots",multiple:!0},...SN]},TN={path:"accreditations-matrix",feature:Ae.Accreditation,params:[kN,...AN,{name:"slugs",type:"slugs",variety:Te.UserInfo,emptyMeans:"none"},...yN]},RN={path:"accreditations-slots",feature:Ae.Accreditation,params:[kN,{name:"includeMembers",type:"boolean"},...yN]},ON={path:"positions",params:[kN,{name:"includeMembers",type:"boolean"},{name:"slugs",type:"slugs",variety:Te.Position,emptyMeans:"all",extraSlugs:["description"]}]},DN={path:"delegations-matrix",feature:Ae.Delegation,params:[kN,...AN,{name:"columns",type:"enum",values:["wished","assigned","quota","scanned"],multiple:!0},...yN]},zN=[wN,EN,TN,RN,ON,DN];function $N(e){return Object.fromEntries(e.params.map(e=>[e.name,"enum"===e.type&&void 0!==e.defaultValue?e.defaultValue:void 0]))}function PN(e,t){const n=Object.fromEntries(e.params.map(e=>{return[e.name,(n=t[e.name],Array.isArray(n)?n.length>0?n.join(","):null:"boolean"==typeof n?n?"true":null:"number"==typeof n?Number.isFinite(n)?n.toString():null:g(n)?n:null)];var n}));return Object.fromEntries(e.params.flatMap(e=>{const t=n[e.name],i=void 0===e.requires||null!==n[e.requires];return null!==t&&i?[[e.name,t]]:[]}))}function MN(){const{params:{organizationId:e,eventId:t}}=bd(),{user:n}=Li();return async(i,o)=>{const s=hf({organizationId:e,eventId:t,lang:n?.language,pathComponent:i.path,searchParams:PN(i,o)}),r=await fetch(s,{method:"POST",headers:{[B]:await X()??""}});if(r.ok){const{url:e}=await r.json();location.href=e}}}const FN=e=>{const{params:{organizationId:t,eventId:n,accreditationId:o},translate:s}=bd();return(0,i.jsxs)(Jk,{children:[(0,i.jsx)(Xk,{to:Mo.ACCREDITATIONS({organizationId:t,eventId:n}),children:s("accr_ditations_39450")}),(0,i.jsx)(Xk,{to:Mo.ACCREDITATION_CATEGORY({organizationId:t,eventId:n,accreditationCategoryId:e.accreditation.accreditationCategoryId}),children:e.accreditation.accreditationCategoryName}),(0,i.jsx)(Xk,{isCurrent:!0,to:Mo.ACCREDITATION({organizationId:t,eventId:n,accreditationId:o}),children:e.accreditation.name})]})},NN=({accreditation:e})=>{const{history:t,params:{organizationId:n,eventId:o,accreditationId:s},translate:r}=bd(),a=mN(),l=MN(),[d,c]=(0,V.useState)(!1);return(0,i.jsx)(eb,{acronym:e.acronym,breadcrumbs:(0,i.jsx)(FN,{accreditation:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mv,{permissions:Ov.ACCREDITATION_EDIT,children:(0,i.jsx)(kd,{to:fs.EDIT_ACCREDITATION(n,o,s),children:r("_diter_l_accr_d_26424")})}),(0,i.jsx)(Mv,{permissions:Ov.ACCREDITATION_EDIT,children:(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"arrow-down-to-bracket",onClick:()=>l(EN,{accreditationsIds:[s]}),children:r("exporter_les_me_63676")}),(0,i.jsx)(ru,{icon:"clone",onClick:async()=>await a(e.id),children:r("dupliquer_28256")})]}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:e=>{eu(e.target),c(!0)},children:r("supprimer_43083")})})]})]})}),d&&(0,i.jsx)(hN,{accreditation:e,onClose:()=>c(!1),onSuccess:()=>t.replace(Mo.ACCREDITATIONS({organizationId:n,eventId:o}))})]}),color:e.color,icon:e.icon,name:e.name,subtext:e.hasSlots?r("creneau",e.numberOfSlots):void 0})},LN=e=>(0,i.jsx)(Oh,{color:e.color,css:{display:"none","@tablet":{display:"block"},...e.css},direction:e.direction}),BN=xa("dt",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontWeight:"$regular",gridColumn:1}}),VN=({children:e,...t})=>(0,i.jsx)(BN,{...t,children:e}),UN=xa("dd",{color:"$gray500",marginInline:0,"@tablet":{color:"$gray800",gridColumn:2}}),WN=({children:e,...t})=>(0,i.jsx)(UN,{...t,children:e}),GN=xa("div",{display:"grid",gridTemplateColumns:"auto",rowGap:"$1","@tablet":{columnGap:"$3",gridTemplateColumns:"auto auto",justifyContent:"space-between"}}),qN=({children:e,...t})=>(0,i.jsx)(GN,{...t,children:e}),HN=xa("dl",{display:"flex",flexDirection:"column",gap:"$4",marginBlock:0,marginInline:0}),KN=({children:e,...t})=>(0,i.jsx)(HN,{...t,children:e}),YN=({accreditationCategoryId:e,accreditationCategoryName:t,accreditationName:n,color:o,customFields:s,fields:r,icon:a,numberOfDaysLimit:l,weezeventChecklistId:d,weezeventOrganizationId:c})=>{const{params:{organizationId:u,eventId:m,accreditationId:h},translate:g}=bd(),p="number"==typeof c&&"number"==typeof d;return(0,i.jsx)($k,{css:{flex:"2 1"},title:g("param_tres_78420"),children:(0,i.jsx)(rd,{direction:"column",gap:"4",width:1,children:(0,i.jsxs)(KN,{children:[(0,i.jsxs)(qN,{children:[(0,i.jsx)(VN,{children:g("cat_gorie_00291")}),(0,i.jsx)(WN,{children:(0,i.jsx)(bm,{to:Mo.ACCREDITATION_CATEGORY({organizationId:u,eventId:m,accreditationCategoryId:e}),children:t})})]}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(LN,{direction:"horizontal"}),(0,i.jsxs)(qN,{children:[(0,i.jsx)(VN,{children:g("Accreditation")}),(0,i.jsx)(WN,{children:(0,i.jsx)(bm,{to:Mo.ACCREDITATION({organizationId:u,eventId:m,accreditationId:h}),children:n})})]})]}),(0,i.jsx)(LN,{direction:"horizontal"}),(0,i.jsxs)(qN,{children:[(0,i.jsx)(VN,{children:g("Color")}),(0,i.jsx)(WN,{children:(0,i.jsx)(ka,{css:{background:o,borderRadius:"20px",height:"20px",width:"20px"}})})]}),(0,i.jsx)(LN,{direction:"horizontal"}),(0,i.jsxs)(qN,{children:[(0,i.jsx)(VN,{children:g("ic_ne_55554")}),(0,i.jsx)(WN,{children:(0,i.jsx)(Id,{icon:xd(a)})})]}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(LN,{direction:"horizontal"}),(0,i.jsxs)(qN,{children:[(0,i.jsx)(VN,{children:g("Deadline")}),(0,i.jsx)(WN,{children:g("_1_jours_avant_40282",l)})]})]}),p&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(LN,{direction:"horizontal"}),(0,i.jsxs)(qN,{children:[(0,i.jsx)(VN,{children:g("WeezeventChecklistId")}),(0,i.jsx)(WN,{children:(0,i.jsx)(bm,{to:pf(c,d),children:d})})]})]}),s.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsxs)(rd,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(ka,{color:"gray500",css:{flex:"1"},children:e.name}),(0,i.jsx)(rd,{justify:"end",width:300,children:(0,i.jsx)(nA,{field:e,fields:r})})]})]},e.slug))]})})})},ZN=xa("div",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontWeight:"$regular"}}),XN=xa("div",{color:"$gray500","@tablet":{color:"$gray800",fontWeight:"$medium"}}),JN=({customFields:e})=>{const t=om(),n=Ti();return(0,i.jsx)($k,{title:n("conditions_77756"),children:Bs(e)?e.map(({customField:e,conditionValue:o},s)=>(0,i.jsxs)(V.Fragment,{children:[0!==s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"4"}),!t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(md,{height:"4"})]})]}),(0,i.jsx)(ZN,{children:e.name}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(XN,{children:KF(n,e,o)})]},s)):(0,i.jsx)(ka,{color:"gray500",textAlign:"center",width:1,children:n("aucune_conditio_36491")})})},QN=({assignedResources:e,maxResources:t})=>{const n=Ti();return(0,i.jsx)($k,{css:{flex:"1 1"},title:n("limite_de_membr_42978"),children:(0,i.jsx)(rd,{css:{justifyContent:"space-between"},direction:"column",height:"100%",children:(0,i.jsx)(ka,{css:{margin:"auto"},children:(0,i.jsx)(Ok,{count:e,total:t??1/0})})})})},eL=({location:e,location:{zoom:t,layer:n,traces:o,address:s}})=>{const r=Ti(),a=ug(e);return(0,i.jsx)($k,{css:{border:a&&!dg?"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:[cg(e)&&(0,i.jsx)(ka,{height:380,width:1,children:(0,i.jsx)(Ua,{initialZoom:t,layer:n,point:Fa(e),traces:o})}),dg(e)&&(0,i.jsx)(ka,{color:"gray800",css:{padding:"$4","@tablet":{padding:"$7"}},children:s})]}):(0,i.jsx)(ka,{color:"gray500",textAlign:"center",width:1,children:r("aucune_localisa_78216")})})},tL=()=>{const{params:{eventId:e,accreditationId:t}}=bd(),{data:n,loader:o}=Oi("query AccreditationChart($eventId: EventId!, $accreditationId: AccreditationId!) {\n event(id: $eventId) {\n accreditation(id: $accreditationId) {\n ...AccreditationChart\n }\n }\n}\n",{eventId:e,accreditationId:t},[js.AccreditationChartFragment]);return o||(0,i.jsx)($k,{title:"Reporting",children:(0,i.jsx)(ka,{height:380,width:1,children:(0,i.jsx)(hw,{accreditation:n.event.accreditation,slots:n.event.accreditation.slots})})})},nL="both",iL="delegationAccreditation",oL="slot",sL=({limitSource:e})=>{const t=Ti();return e===iL?(0,i.jsx)(Id,{icon:"people-group",title:t("limite_fix_e_po_87265")}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Id,{icon:"badge-check",title:t("limite_fix_e_po_40573")}),e===nL&&(0,i.jsxs)(i.Fragment,{children:[" + ",(0,i.jsx)(sL,{limitSource:iL})]})]})},rL=({event:e,slot:t,reload:n})=>{const{history:o,params:{organizationId:s,eventId:r,accreditationId:a},translate:l}=bd(),d=Ei(Cm),c=Ei(lI),{assignedResources:u,maxResources:m,percent:h}=((e,t)=>{const n=t?.assignedResources??0,o=t?.wishedResources??0,s=t?.maxResources??1/0,r=1/0,a=n>=s,l=s-n,d=s-o,c=1/0,u=1/0,m=l===c?nL:lo.push(Mo.ACCREDITATION_SLOT({organizationId:s,eventId:r,accreditationId:a,accreditationSlotId:t.id})),children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(ka,{font:"gray900 textSm medium",children:g(t.name)?t.name:"-"})}),(0,i.jsx)(Qu,{children:t.date?d.toLocaleString(t.date,zs.DateOnly.WeekdayLongMonthLong):"-"}),(0,i.jsx)(Qu,{children:(0,i.jsxs)(rd,{align:"center",css:{"& > div":{width:"100%"}},gap:"2",width:1,children:[(0,i.jsx)(ka,{children:l("_1_2_membres_04485",u,c.toNumberOrInfinity(m))}),m&&(0,i.jsx)(u$,{percent:h})]})}),(0,i.jsx)(jm,{justify:"end",children:(0,i.jsxs)(vm,{children:[(0,i.jsx)(ru,{icon:"pen",onClick:()=>{x(!0)},children:l("_diter_62574")}),(0,i.jsx)(ru,{color:t.assignedResources>0?"disabled":"red",icon:"trash-can",onClick:()=>{v(!0)},children:l("supprimer_43083")})]})})]}),_&&(0,i.jsx)(vF,{event:e,slot:t,onClose:()=>{x(!1)},onSuccess:async e=>{await p({eventId:r,accreditationSlotId:t.id,accreditationSlot:e}),n()}}),I&&(0,i.jsx)(DA,{buttonText:l("supprimer_43083"),subtext:[l("_tes_vous_s_r_d_48876")],text:l("suppression_de_73669",qg(d,t,"")),onClose:()=>{v(!1)},onDelete:async()=>{await f({eventId:r,accreditationSlotId:t.id}),n()}})]})},aL=()=>{const{translate:e,params:{eventId:t,accreditationId:n}}=bd(),[o,s,r]=gm(""),[a,l]=ZR("accreditation.slots.date",As.c9.invalid("Invalid"),gp),[d,c]=(0,V.useState)(0),[u,m]=ZR("accreditation.slots.sort",null),{data:h,isLoading:p,reload:f}=Oi("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:g(s)?s:void 0,date:a?.isValid?a:void 0,offset:d,sort:u},[]);const{numberOfPages:_,totalCount:x}=ah(h.event?.accreditationsSlots),I=(0,V.useCallback)(e=>{m(e),c(0)},[m,c]);return(0,i.jsx)(dm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:o,onChange:r})}),(0,i.jsx)(ka,{width:200,children:(0,i.jsx)(Ih,{max:h.event?.endAt,min:h.event?.startAt,value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fp,{attribute:Ut.Name,setSort:I,sort:u,children:e("nom_du_cr_neau_54351")}),(0,i.jsx)(fp,{attribute:Ut.Date,setSort:I,sort:u,children:e("Date")}),(0,i.jsx)(pm,{children:e("remplissage_75916")}),(0,i.jsx)(pm,{width:100})]}),numberOfPages:_,offset:d,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):h.event.accreditationsSlots.nodes.map(e=>(0,i.jsx)(rL,{event:h.event,reload:f,slot:e},e.id)),setOffset:c,title:e("liste_des_cr_ne_66393"),totalCount:x})},lL=()=>{const{organizationId:e,eventId:t,accreditationId:n}=zi(),{canAccreditationEdit:o}=Dv(),{data:s,loader:r,reload:a}=Oi("query AccreditationDashboard(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $accreditationId: AccreditationId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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 numberOfDaysLimit\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},[js.CustomFieldWithConditionFragment]),{mutate:l}=xr();return r||(0,i.jsx)(Qv,{children:(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[(0,i.jsx)(tL,{}),s.event.accreditation.hasSlots&&(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(aL,{})}),(0,i.jsxs)(rd,{gap:"6",width:1,children:[!s.event.accreditation.hasSlots&&(0,i.jsx)(QN,{assignedResources:s.event.accreditation.assignedResources,maxResources:s.event.accreditation.maxResources}),(0,i.jsx)(YN,{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,numberOfDaysLimit:s.event.accreditation.numberOfDaysLimit})]}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsxs)(rd,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(JN,{customFields:s.event.accreditation.accreditationsCustomFields}),(0,i.jsx)(Kk,{...o?{associateTags:e=>l({eventId:t,massEdit:{reset:!1,selecteds:{ids:[n]},slug:Bt.Tag,strategy:yt.Replace,value:e}}),reload:a}:{},tags:s.event.accreditation.tags}),(0,i.jsx)(Wk,{privateNote:s.event.accreditation.privateNote})]}),(0,i.jsxs)(rd,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Uk,{description:s.event.accreditation.description}),(0,i.jsx)(eL,{location:s.event.accreditation})]})]})]})})},dL=e=>{const{translate:t}=bd(),n=Ei(Yh),{data:o}=Oi("query MassCheckInPositionsSlots($eventId: EventId!) {\n event(id: $eventId) {\n positions {\n nodes {\n id\n name\n\n slots {\n id\n name\n range\n }\n }\n }\n }\n}\n",{eventId:e.eventId},[]);const s=(0,V.useMemo)(()=>(o.event?.positions.nodes??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.slots.map(t=>(0,i.jsx)("option",{value:t.id,children:ng(n,t,e.name,{position:{includeNameAtEnd:!0}})},t.id))},e.id)),[o.event]),{mutate:r}=Dr(),[a,l]=(0,V.useState)([]),[d,c]=(0,V.useState)(At.CheckInOut),[u,m]=(0,V.useState)(null),[h,g]=(0,V.useState)(null),[p,f]=(0,V.useState)(0),[_,x]=(0,V.useState)(!1),I=(0,V.useMemo)(()=>Ps(),[]),v=Bs(a)&&(d===At.Reset||d===At.BreakTime||d===At.CheckIn&&u?.isValid||d===At.CheckOut&&h?.isValid||u?.isValid&&h?.isValid&&h>u||u?.isValid&&!h?.isValid);return(0,i.jsx)(Av,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"sliders",children:t("mise_jour_du_76261")}),(0,i.jsxs)(jv,{gap:"5",children:[(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("pour_quel_cr_ne_94965"),multiple:!0,values:a,onChange:l,children:s}),(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(ka,{font:"gray700 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsxs)(aA,{isChecked:d===At.CheckInOut,text:t("mettre_jour_l_00128"),onClick:()=>c(At.CheckInOut),children:[(0,i.jsx)(Ch,{hint:t("date_et_heure_d_93417"),rightIcon:"xmark",value:u,zone:I,onChange:m,onRightIconClick:()=>m(null)}),(0,i.jsx)(Ch,{hint:t("date_et_heure_d_65738"),rightIcon:"xmark",value:h,zone:I,onChange:g,onRightIconClick:()=>g(null)}),(0,i.jsx)(Qd,{hint:t("temps_de_pause_00051"),shouldParseAsInt:!0,value:p,onChange:f})]}),(0,i.jsx)(aA,{isChecked:d===At.CheckIn,text:t("mettre_jour_l_12738"),onClick:()=>c(At.CheckIn),children:(0,i.jsx)(Ch,{hint:t("date_et_heure_d_93417"),rightIcon:"xmark",value:u,zone:I,onChange:m,onRightIconClick:()=>m(null)})}),(0,i.jsx)(aA,{isChecked:d===At.CheckOut,text:t("mettre_jour_l_31683"),onClick:()=>c(At.CheckOut),children:(0,i.jsx)(Ch,{hint:t("date_et_heure_d_65738"),rightIcon:"xmark",value:h,zone:I,onChange:g,onRightIconClick:()=>g(null)})}),(0,i.jsx)(aA,{isChecked:d===At.BreakTime,text:t("mettre_jour_l_68723"),onClick:()=>c(At.BreakTime),children:(0,i.jsx)(Qd,{css:{maxWidth:"110px"},hint:t("temps_de_pause_00051"),shouldParseAsInt:!0,value:p,onChange:f})}),(0,i.jsx)(aA,{isChecked:d===At.Reset,text:t("remettre_z_ro_11572"),onClick:()=>c(At.Reset)})]})]}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{disabled:!v,isLoading:_,onClick:async()=>{x(!0);try{const n=(await r({eventId:e.eventId,checkIn:{breakTime:p,checkInAt:u?.toUTC(),checkOutAt:h?.toUTC(),strategy:d,positionsSlotsIds:a,selecteds:e.selecteds}})).numberOfMembers;e.onSuccess(t("le_pointage_de_04632",n)),e.onClose()}catch{x(!1)}},children:t("mettre_jour_85141")})})]})})},cL=e=>{const{params:{organizationId:t,eventId:n},translate:o}=bd(),{user:s}=Li(),{checkDocumentsExport:r}=HI(),{data:a}=Oi("query MassDocumentExportCustomDocuments($eventId: EventId!) {\n event(id: $eventId) {\n customDocuments {\n name\n slug\n }\n }\n}\n",{eventId:n},[]),{mutate:l}=Tr(),[d,c]=(0,V.useState)(_t.Assignments),[u,m]=(0,V.useState)(As.c9.invalid("Invalid")),[h,g]=(0,V.useState)(!1),[p,f]=(0,V.useState)(!1),_=(0,V.useMemo)(()=>(0,Xh.A)(a.event?.customDocuments??[],e=>e.slug),[a.event]),x=d===_t.Assignments||d===_t.UserHours||d===_t.UserPlanning||d===_t.UserPlanningList;return(0,i.jsx)(Av,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"file",children:o("exporter_un_doc_23130")}),(0,i.jsxs)(jv,{gap:"5",children:[(0,i.jsx)(zd,{alertStyle:"gray",children:(0,i.jsx)(Pd,{children:o("l_e_mail_peut_m_13253")})}),(0,i.jsxs)(Uu,{isSearchVisible:!0,label:o("quel_document_v_81798"),renderOnPortal:!0,values:[d],onChange:e=>{Bs(e)&&c(e[0])},children:[_.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),(0,i.jsx)("option",{value:_t.Assignments,children:o("fiche_d_affecta_91461")}),(0,i.jsx)("option",{value:_t.UserPlanning,children:o("UserPlanning")}),(0,i.jsx)("option",{value:_t.UserPlanningList,children:o("UserPlanningList")}),(0,i.jsx)("option",{value:_t.UserPlanningDays,children:o("UserPlanningDays")}),(0,i.jsx)("option",{value:_t.Certificate,children:o("Certificate")}),(0,i.jsx)("option",{value:_t.UserHours,children:o("UserHours")})]}),x&&(0,i.jsx)(Ih,{label:o("exportez_vos_do_87332"),value:u,onChange:m}),(0,i.jsx)(Eu,{state:h?"checked":"unchecked",onClick:e=>{g("checked"===e)},children:o("fusionner_les_d_64130")})]}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{isLoading:p,onClick:async()=>{f(!0);const i=_.map(e=>e.slug),o=i.includes(d)?_t.UserCustomDocument:d,a=i.includes(d)?d:void 0,{jobId:c}=await l({organizationId:t,eventId:n,documentsExport:{documentType:o,customDocumentSlug:a,segmentsIds:[],selecteds:e.selecteds,language:s.language,oneFile:h,date:u}});r(c,t,n),e.onSuccess(),e.onClose()},children:o("exporter_59120")})})]})})},uL=e=>{const{translate:t}=bd(),{mutate:n,isLoading:o}=ur(),{data:s}=Wr({eventId:e.eventId}),r=(0,V.useMemo)(()=>s.event?.accreditationsProfilesCategories??[],[s.event]),a=(0,V.useMemo)(()=>r.flatMap(e=>e.accreditationsProfiles),[r]),l=(0,V.useMemo)(()=>Nj(r),[r]),[d,c]=(0,V.useState)([]),u=Bs(d);return(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(wj,{color:"primary",icon:"badge-check"})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{font:"gray900 textLg medium",textAlign:"center",children:t("ajouter_un_prof_36857")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("profil_d_accr_d_02274"),multiple:!1,values:d,onChange:c,children:l}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{disabled:!u,isLoading:o,onClick:async()=>{if(Bs(d)){const i=a.find(e=>e.id===d[0]),o=(await n({eventId:e.eventId,massProfileUpdate:{accreditationProfileId:d[0],selecteds:e.selecteds,strategy:yt.Replace}})).numberOfMembers;e.onSuccess(t("le_profil_d_acc_64681",i.name,o)),e.onClose()}},children:t("ajouter_97327")}),(0,i.jsx)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},mL=e=>{const t=Ti(),{mutate:n,isLoading:o}=Jr(),[s,r]=(0,V.useState)(We.WaitingAccreditation);return(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(wj,{color:"primary",icon:"sliders"})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{font:"gray900 textLg medium",textAlign:"center",children:t("mettre_jour_l_44471")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(hh,{label:t("nouveau_statut_57871"),value:s,onChange:e=>{r(e)},children:[(0,i.jsx)("option",{value:We.NotApplicable,children:t(We.NotApplicable)}),(0,i.jsx)("option",{value:We.Refused,children:t(We.Refused)}),(0,i.jsx)("option",{value:We.WaitingAccreditation,children:t(We.WaitingAccreditation)})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{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)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})};let hL=class extends ZA{translationService;inputName="massAssign";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField()}}step2Fields(){return{positionsSlotsIds:c.YO().of(c.ai()).required(this.t("vous_devez_s_le_28976")).min(1,this.t("vous_devez_s_le_28976"))}}};hL=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],hL);const gL=e=>{const t=Ti();return(0,i.jsx)(QA,{handleSubmit:e.handleSubmit,nextText:t("suivant_affec_68075"),prefix:"massAssign.",strategies:[{label:t("ajouter_des_aff_57793"),value:yt.Add},{label:t("remplacer_les_a_43030"),value:yt.Replace},{label:t("supprimer_des_a_59880"),value:yt.Delete}]})},pL=e=>{const t=Ti(),n=Ei(Yh),o=e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(am,{css:{cursor:"pointer"},onClick:()=>{e.change("massAssign.positionsSlotsIds",Us(e.positionsSlotsIds,e.slot.id,"unchecked"===o))},children:[(0,i.jsx)(Qu,{justify:"center",width:48,children:(0,i.jsx)(wu,{shouldPreventDefault:!1,state:o,onClick:hc.A})}),(0,i.jsx)(Qu,{css:{textTransform:"capitalize"},children:n.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}})}),(0,i.jsx)(Qu,{children:g(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(Qu,{children:(0,i.jsx)(vu,{color:e.slot.assignedResources>=e.slot.resources?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.slot.assignedResources,e.slot.resources)})})]})},fL=e=>{const t=Ti(),n=(0,V.useMemo)(()=>(0,cm.A)(e.slots.filter(t=>t.position.id===e.position.id),e=>e.range.start.toMillis()),[e.slots,e.position]),o=(0,V.useMemo)(()=>n.map(e=>e.id),[n]),s=(0,V.useMemo)(()=>{const t=(0,Pu.A)(e.positionsSlotsIds,o);return t.length===o.length?"checked":0===t.length?"unchecked":"indeterminate"},[o,e.positionsSlotsIds]);return(0,i.jsx)(Vj,{accreditation:e.position,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:n.length,children:(0,i.jsxs)(Hu,{hideBorder:!0,children:[(0,i.jsxs)(Wu,{children:[(0,i.jsx)(pm,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:s,onClick:t=>{"checked"===t?e.change("massAssign.positionsSlotsIds",(0,bs.A)(e.positionsSlotsIds.concat(o))):e.change("massAssign.positionsSlotsIds",(0,yu.A)(e.positionsSlotsIds,o))}})}),(0,i.jsx)(pm,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(pm,{children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(pm,{})]}),n.map(t=>(0,i.jsx)(pL,{change:e.change,positionsSlotsIds:e.positionsSlotsIds,slot:t},t.id))]})})},_L=e=>{const t=(0,V.useMemo)(()=>(0,cm.A)(e.positions.filter(t=>t.positionCategoryId===e.category.id),e=>e.name.toLowerCase()),[e.category,e.positions]);return(0,i.jsx)(Bj,{category:e.category.name,children:t.map(t=>(0,i.jsx)(fL,{change:e.change,position:t,positionsSlotsIds:e.positionsSlotsIds,slots:e.slots},t.id))})},xL=e=>{const t=Ti(),[n,o]=(0,V.useState)(!1),[s,r]=(0,V.useState)(e.segmentId),[a,l]=(0,V.useState)(e.excludeFull?"checked":"unchecked"),[d,c]=(0,V.useState)(e.excludePast?"checked":"unchecked"),[u,m]=(0,V.useState)(e.filterAvailabilities?"checked":"unchecked"),[h,g]=(0,V.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)(rd,{css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"3",children:[(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_une_69998"),value:e.name,onChange:t=>{e.setName(t)}})}),(0,i.jsxs)(hS,{apply:()=>{e.setExcludeFull("checked"===a),e.setExcludePast("checked"===d),e.setFilterAvailabilities("checked"===u),e.setFilterWished("checked"===h),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),m("unchecked"),e.setFilterWished(!1),g("unchecked"),e.setSegmentId(-1),r(-1),e.setName(""),o(!1)},showButtons:!0,onStateChange:o,children:[(0,i.jsxs)(hh,{label:t("vues_personnali_80652"),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)(Eu,{state:a,onClick:l,children:t("masquer_les_cr_14425")}),(0,i.jsx)(Eu,{state:d,onClick:c,children:t("masquer_les_cr_05336")}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(ka,{font:"gray900 textSm medium",children:t("filtres_sur_les_73833")}),(0,i.jsx)(Eu,{state:u,onClick:m,children:t("filtrer_selon_l_74774")}),(0,i.jsx)(Eu,{state:h,onClick:g,children:t("filtrer_selon_l_76350")})]})]})},IL=e=>{const t=Ti(),[n,o,s]=gm(""),[r,a]=ZR("massAssign.filters.segmentId",-1),[l,d]=ZR("massAssign.filters.excludeFull",!1),[c,u]=ZR("massAssign.filters.excludePast",!1),[m,h]=ZR("massAssign.filters.filterAvailabilities",!1),[p,f]=ZR("massAssign.filters.filterWished",!1),{data:_,loader:x}=Oi("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:g(o)?o:void 0,segmentId:-1===r?void 0:r,excludeFull:l,excludePast:c,selecteds:e.selecteds,filterAvailabilities:m,filterWished:p},[]);const I=(0,V.useMemo)(()=>(0,cm.A)((0,Xh.A)((_.event?.positionsSlots.nodes??[]).map(e=>e.positionCategory),e=>e.id),e=>e.name.toLowerCase()),[_.event]),v=(0,V.useMemo)(()=>(0,Xh.A)((_.event?.positionsSlots.nodes??[]).map(e=>e.position),e=>e.id),[_.event]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xL,{excludeFull:l,excludePast:c,filterAvailabilities:m,filterWished:p,name:n,segmentId:r,segments:_.event?.segments??[],setExcludeFull:e=>{d(e)},setExcludePast:u,setFilterAvailabilities:h,setFilterWished:f,setName:s,setSegmentId:e=>{a(e)}}),(0,i.jsx)(md,{height:"6"}),x||(0,i.jsx)(Lj,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:I.map(t=>(0,i.jsx)(_L,{category:t,change:e.change,positions:v,positionsSlotsIds:e.values.massAssign.positionsSlotsIds,slots:_.event?.positionsSlots.nodes??[]},t.id))}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{isLoading:e.submitting,onClick:e.handleSubmit,children:t(e.values.massAssign.strategy===yt.Add?"affecter_les_1_56142":e.values.massAssign.strategy===yt.Replace?"r_affecter_les_73080":"d_saffecter_les_98962",e.numberOfSelected)})})]})},vL=e=>{const t=Ti(),n=Ei(hL),{mutate:o}=Qr();return(0,i.jsx)(JA,{children:(0,i.jsx)(zp,{category:t("affectation"),heading:t("affecter_les_me_77160"),onClose:e.onClose,children:(0,i.jsx)(Op,{children:(0,i.jsxs)(VI,{initialValues:{massAssign:{selecteds:e.selecteds,strategy:yt.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)(BI,{heading:t("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(gL,{handleSubmit:e}),schema:n.step1Schema()}),(0,i.jsx)(BI,{heading:t("affectation_plural"),render:t=>(0,i.jsx)(IL,{change:t.form.change,eventId:e.eventId,handleSubmit:t.handleSubmit,numberOfSelected:e.numberOfSelected,selecteds:e.selecteds,submitting:t.submitting,values:t.values}),schema:n.step2Schema()})]})})})})};let bL=class extends ZA{translationService;inputName="massAvailabilitiesUpdate";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField(),formId:c.ai().required(this.t("le_formulaire_e_77404"))}}step2Fields(){return{slots:c.YO().of(c.Ik()).required(this.t("vous_devez_ajou_68961")).min(1,this.t("vous_devez_ajou_68961"))}}};bL=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],bL);const jL=e=>{const{translate:t}=bd(),{data:n}=Oi("query MassAvailabilitiesUpdateForms($eventId: EventId!) {\n event(id: $eventId) {\n forms(hasSlotDisplay: true) {\n nodes {\n id\n name\n slotDisplay\n }\n }\n }\n}\n",{eventId:e.eventId},[]);const o=(0,V.useMemo)(()=>(n.event?.forms.nodes??[]).filter(e=>e.slotDisplay!==Qe.Hide),[n.event]);return(0,i.jsx)(QA,{handleSubmit:e.handleSubmit,nextText:t("suivant_dispo_94398"),prefix:"massAvailabilitiesUpdate.",strategies:[{label:t("ajouter_des_dis_72846"),value:yt.Add},{label:t("remplacer_les_d_31752"),value:yt.Replace},{label:t("supprimer_des_d_60814"),value:yt.Delete}],children:(0,i.jsx)(Gp,{isSearchVisible:!0,label:t("Form"),name:"massAvailabilitiesUpdate.formId",children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})},CL=e=>{const{translate:t}=bd(),{data:n,loader:o}=Oi("query MassAvailabilitiesUpdateSlots(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n form(id: $formId) {\n id\n name\n\n elements {\n id\n ...FormElementDisplay\n }\n\n ...FormSlotsOptions\n\n customSlotsPeriods {\n ...FormRegisterCustomSlotPeriod\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n dayStartTime\n ranges(formId: $formId)\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId,formId:e.values.massAvailabilitiesUpdate.formId},[js.FormElementDisplayFragment,js.FormSlotsOptionsFragment,js.FormRegisterCustomSlotPeriodFragment]);return(0,i.jsxs)(i.Fragment,{children:[o||(0,i.jsx)(RR,{change:e.change,currentSlots:e.values.massAvailabilitiesUpdate.slots,customSlotsPeriods:n.organization.form.customSlotsPeriods,daysDisplay:n.organization.form.daysDisplay,elements:n.organization.form.elements,event:n.event,prefix:"massAvailabilitiesUpdate.",slotDisplay:n.organization.form.slotDisplay,userInfoFields:{}}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{isLoading:e.submitting,onClick:e.handleSubmit,children:t("mettre_jour_85141")})})]})},yL=e=>{const{translate:t}=bd(),n=Ei(bL),{mutate:o}=function(e={}){return Di("mutation VolunteersRegistrationsMassAvailabilitiesUpdate(\n $eventId: EventId!\n $massAvailabilitiesUpdate: MassAvailabilitiesUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAvailabilitiesUpdate(\n eventId: $eventId\n massAvailabilitiesUpdate: $massAvailabilitiesUpdate\n )\n}\n",e)}();return(0,i.jsx)(JA,{children:(0,i.jsx)(zp,{category:t("disponibilit_s_49923"),heading:t("mettre_jour_l_84190"),onClose:e.onClose,children:(0,i.jsx)(Op,{children:(0,i.jsxs)(VI,{initialValues:{massAvailabilitiesUpdate:{selecteds:e.selecteds,strategy:yt.Add,formId:null,slots:[]}},isEdit:!1,onSubmit:async n=>{const i=(await o({eventId:e.eventId,massAvailabilitiesUpdate:n.massAvailabilitiesUpdate})).numberOfMembers;e.onSuccess(t("_1_membres_ont_07596",i)),e.onClose()},children:[(0,i.jsx)(BI,{heading:t("initialisation_38640"),render:({handleSubmit:t})=>(0,i.jsx)(jL,{eventId:e.eventId,handleSubmit:t}),schema:n.step1Schema()}),(0,i.jsx)(BI,{heading:t("disponibilit_s_49923"),render:({form:t,handleSubmit:n,submitting:o,values:s})=>(0,i.jsx)(CL,{change:t.change,eventId:e.eventId,handleSubmit:n,organizationId:e.organizationId,submitting:o,values:s}),schema:n.step2Schema()})]})})})})},AL=e=>{const t=Ti(),{mutate:n,isLoading:o}=Rr(),[s,r]=(0,V.useState)([]),[a,l]=(0,V.useState)([]);return(0,V.useEffect)(()=>{(async()=>{const t=await ia({eventId:e.eventId},await X());r(t.event.delegations.nodes)})()},[e.eventId]),(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(wj,{color:"error",icon:"people-group"})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{font:"gray900 textLg medium",textAlign:"center",children:t("retirer_des_mem_97655")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("Delegation"),values:a,onChange:l,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{color:"error",isLoading:o,onClick:async()=>{if(Bs(a)){const i=s.find(e=>e.id===a[0]);await n({organizationId:e.organizationId,eventId:e.eventId,delegationId:a[0],selecteds:e.selecteds}),e.onSuccess(t("les_membres_ont_44616",i.name)),e.onClose()}},children:t("retirer_de_la_d_64963")}),(0,i.jsx)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})};let SL=class extends ZA{translationService;inputName="massPreAssign";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField(),level:c.Yj().required(this.t("le_niveau_est_r_81100")).oneOf(Zn,this.t("le_niveau_est_r_81100"))}}step2Fields(){return{positionsCategoriesIds:c.YO().of(c.ai()).test("non-empty-categories",this.t("vous_devez_s_le_32044"),function(){return this.parent.level!==Lt.Categories||this.parent.positionsCategoriesIds.length>0}),positionsIds:c.YO().of(c.ai()).test("non-empty-positions",this.t("vous_devez_s_le_89603"),function(){return this.parent.level!==Lt.Positions||this.parent.positionsIds.length>0})}}};SL=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],SL);const kL=e=>{const t=Ti();return(0,i.jsxs)(QA,{handleSubmit:e.handleSubmit,nextText:t("suivant_pr_a_99182"),prefix:"massPreAssign.",strategies:[{label:t("ajouter_des_pr_46968"),value:yt.Add},{label:t("remplacer_les_p_59777"),value:yt.Replace}],children:[(0,i.jsx)(ka,{font:"gray900 textSm medium",children:t("_quel_niveau_s_87878")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(FI,{name:"massPreAssign.level",value:Lt.Categories,children:t("pr_affecter_su_68204")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(FI,{name:"massPreAssign.level",value:Lt.Positions,children:t("pr_affecter_su_38603")})]})},wL=e=>{const t=Ti();return(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{css:{paddingRight:0},width:48,children:(0,i.jsx)(wu,{state:e.positionsCategoriesIds.includes(e.category.id)?"checked":"unchecked",onClick:t=>{e.change("massPreAssign.positionsCategoriesIds",Us(e.positionsCategoriesIds,e.category.id,"checked"===t))}})}),(0,i.jsx)(Qu,{children:e.category.name}),(0,i.jsx)(Qu,{children:(0,i.jsx)(vu,{color:e.category.assignedResources>=e.category.resources?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.category.assignedResources,e.category.resources)})})]})},EL=e=>{const t=Ti(),[n,o,s]=gm(""),{data:r,isLoading:a}=Oi("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,V.useMemo)(()=>g(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)(dm,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_une_66722"),value:n,onChange:s})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{css:{paddingRight:0},width:48}),(0,i.jsx)(pm,{children:t("nom_de_la_cat_g_03860")}),(0,i.jsx)(pm,{})]}),numberOfPages:1,offset:0,rows:a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):l.map(t=>(0,i.jsx)(wL,{category:t,change:e.change,positionsCategoriesIds:e.values.massPreAssign.positionsCategoriesIds},t.id)),setOffset:hc.A,title:(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{children:t("s_lectionner_le_58635")}),(0,i.jsx)(ka,{font:"gray500 textSm regular",children:t("les_membres_s_l_66443")})]}),totalCount:l.length??0}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{onClick:e.handleSubmit,children:t("pr_affecter_le_81533",e.numberOfSelected)})})]})},TL=e=>{const t=Ti();return(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{css:{paddingRight:0},width:48,children:(0,i.jsx)(wu,{state:e.positionsIds.includes(e.position.id)?"checked":"unchecked",onClick:t=>{e.change("massPreAssign.positionsIds",Us(e.positionsIds,e.position.id,"checked"===t))}})}),(0,i.jsxs)(Qu,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(ka,{font:"gray900 textSm medium",children:e.position.name}),(0,i.jsx)(ka,{color:"gray500",children:e.position.positionCategoryName})]}),(0,i.jsx)(Qu,{children:(0,i.jsx)(vu,{color:e.position.assignedResources>=e.position.resources?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.position.assignedResources,e.position.resources)})})]})},RL=e=>{const t=Ti(),[n,o,s]=gm(""),[r,a]=(0,V.useState)(0),[l,d]=(0,V.useState)(null),{data:c,isLoading:u}=Oi("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:g(o)?o:void 0,offset:r,sort:l},[]);const{numberOfPages:m,totalCount:h}=ah(c.event?.positions);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(dm,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{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)(pm,{css:{paddingRight:0},width:48}),(0,i.jsx)(fp,{attribute:tn.Name,setSort:e=>{d(e),a(0)},sort:l,children:t("nom_de_la_missi_64605")}),(0,i.jsx)(pm,{})]}),numberOfPages:m,offset:r,rows:u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):c.event.positions.nodes.map(t=>(0,i.jsx)(TL,{change:e.change,position:t,positionsIds:e.values.massPreAssign.positionsIds},t.id)),setOffset:a,title:(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{children:t("s_lectionner_le_26300")}),(0,i.jsx)(ka,{font:"gray500 textSm regular",children:t("les_membres_s_l_63510")})]}),totalCount:h}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{onClick:e.handleSubmit,children:t("pr_affecter_le_81533",e.numberOfSelected)})})]})},OL=e=>{const t=Ti(),n=Ei(SL),{mutate:o}=Yl();return(0,i.jsx)(JA,{children:(0,i.jsx)(zp,{category:t("pr_affectation_12256"),heading:t("pr_affecter_le_71377"),onClose:e.onClose,children:(0,i.jsx)(Op,{children:(0,i.jsxs)(VI,{initialValues:{massPreAssign:{level:Lt.Categories,selecteds:e.selecteds,strategy:yt.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)(BI,{heading:t("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(kL,{handleSubmit:e}),schema:n.step1Schema()}),(0,i.jsx)(BI,{heading:t("pr_affectation_68999"),render:t=>t.values.massPreAssign.level===Lt.Categories?(0,i.jsx)(EL,{change:t.form.change,eventId:e.eventId,handleSubmit:t.handleSubmit,numberOfSelected:e.numberOfSelected,values:t.values}):(0,i.jsx)(RL,{change:t.form.change,eventId:e.eventId,handleSubmit:t.handleSubmit,numberOfSelected:e.numberOfSelected,values:t.values}),schema:n.step2Schema()})]})})})})},DL=e=>{const t=Ti(),{mutate:n,isLoading:o}=ta(),[s,r]=(0,V.useState)(ve.WaitingAssignment);return(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(wj,{color:"primary",icon:"sliders"})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("mettre_jour_l_82143")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(hh,{label:t("nouveau_statut_57871"),value:s,onChange:e=>{r(e)},children:[(0,i.jsx)("option",{value:ve.NotApplicable,children:t(ve.NotApplicable)}),(0,i.jsx)("option",{value:ve.Refused,children:t(ve.Refused)}),(0,i.jsx)("option",{value:ve.WaitingAssignment,children:t(ve.WaitingAssignment)})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{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)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},zL=e=>{const{translate:t,params:{eventId:n}}=bd(),{organization:o}=_v(),{canAccreditationRead:s,canCampaignSend:r,canDelegationRead:a,canDocumentRead:l,canMemberAccredit:d,canMemberAssign:c,canMemberAvailabilitiesEdit:u,canMemberCreate:m,canMemberDelete:h,canMemberEdit:p,canPositionRead:f,canPrint:_,canTicketIdRegenerate:x}=Dv(),{showNotification:I}=HI(),{mutate:v}=Sr(),{mutate:b}=Kr(),{mutate:j}=Mr(),{mutate:C}=Xr(),{mutate:y}=Vl(),{data:A,isLoading:S}=Oi("query VolunteerActions($eventId: EventId!) {\n event(id: $eventId) {\n hasDelegations\n hasForms\n numberOfZplDocuments\n weezeventEventId\n }\n}\n",{eventId:n},[]),[k,w]=(0,V.useState)(!1),[E,T]=(0,V.useState)(!1),[R,O]=(0,V.useState)(!1),[D,z]=(0,V.useState)(!1),[$,P]=(0,V.useState)(!1),[M,F]=(0,V.useState)(!1),[N,L]=(0,V.useState)(!1),[B,U]=(0,V.useState)(!1),[W,G]=(0,V.useState)(!1),[q,H]=(0,V.useState)(!1),[K,Y]=(0,V.useState)(!1),[Z,X]=(0,V.useState)(!1),[J,Q]=(0,V.useState)(!1),[ee,te]=(0,V.useState)(!1),[ne,ie]=(0,V.useState)(!1),[oe,se]=(0,V.useState)(!1),[re,ae]=(0,V.useState)(!1),[le,de]=(0,V.useState)(!1),[ce,ue]=(0,V.useState)(!1),me=e.massActions.getSelectedsInput(e.predicates,e.scope),he=e.massActions.isAllSelected?e.totalNumberOfMembers:e.massActions.numberOfSelected,ge=(0,V.useCallback)(t=>{g(t)&&I(t),e.onMassEditSuccess()},[e.onMassEditSuccess]),pe=(0,V.useCallback)(async()=>{const e=(await b({eventId:n,selecteds:me,numberOfCopies:1})).numberOfCreatedMembers;ge(t("_1_membres_ont_35202",e))},[n,b,ge,me]),fe=(0,V.useCallback)(async()=>{const e=(await C({eventId:n,selecteds:me})).numberOfMembers;ge(t("les_accr_ditati_80622",e))},[n,me,ge]),_e=p||u||f||s||a||x||h,xe=(0,V.useMemo)(()=>_&&!S&&!!A.event.weezeventEventId&&!!A.event.numberOfZplDocuments,[_,S,A]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{css:{flex:"1"}}),p&&(0,i.jsx)(kd,{onClick:()=>{w(!0)},children:t("_diter_un_champ_64621")}),!e.showOnlyMassEdit&&f&&c&&(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"wand-magic-sparkles",onClick:()=>z(!0)})})}),(0,i.jsx)(bp,{placement:"top",children:t("affecter_1_me_24704",he)})]}),!e.showOnlyMassEdit&&s&&d&&(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"badge-check",onClick:()=>P(!0)})})}),(0,i.jsx)(bp,{placement:"top",children:t("accr_diter_1_13773",he)})]}),!e.showOnlyMassEdit&&_e&&(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{maxHeight:400,placement:"bottom-end",children:[(0,i.jsxs)(MA,{title:t("gestion_des_mem_51660"),children:[p&&(0,i.jsx)(ru,{icon:"merge",onClick:()=>T(!0),children:t("fusionner_les_m_37150")}),m&&(0,i.jsx)(ru,{icon:"clone",onClick:pe,children:t("CanLeadersDuplicateMembers")}),u&&(0,i.jsx)(ru,{icon:"calendar",isDisabled:!A.event?.hasForms,onClick:()=>F(!0),children:t("mettre_jour_l_84190")})]}),(0,i.jsx)(MA,{title:t("affectation_plural"),children:f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ru,{icon:"wand-magic-sparkles",onClick:()=>O(!0),children:t("changer_le_stat_39694")}),(0,i.jsx)(ru,{icon:"wand-magic-sparkles",onClick:()=>U(!0),children:t("pr_affecter_1_62649",he)}),(0,i.jsx)(ru,{icon:"circle-check",onClick:()=>G(!0),children:t("mettre_jour_l_00128")})]})}),(0,i.jsxs)(MA,{title:t("accr_ditations_39450"),children:[s&&(0,i.jsx)(ru,{icon:"badge-check",onClick:()=>H(!0),children:t("changer_le_stat_27596")}),s&&d&&(0,i.jsx)(ru,{icon:"check",onClick:fe,children:t("valider_les_acc_80801")}),s&&d&&(0,i.jsx)(ru,{icon:"badge-check",onClick:()=>Y(!0),children:t("ajouter_un_prof_96916",he)}),s&&xe&&(0,i.jsx)(ru,{icon:"print",onClick:()=>de(!0),children:t("imprimer_un_bra_94539")}),a&&(0,i.jsx)(ru,{icon:"people-group",isDisabled:!A.event?.hasDelegations,onClick:()=>X(!0),children:t("ajouter_1_mem_86218",he)}),a&&p&&(0,i.jsx)(ru,{icon:"minus",isDisabled:!A.event?.hasDelegations,onClick:()=>Q(!0),children:t("retirer_1_mem_57996",he)})]}),(0,i.jsxs)(MA,{title:t("communication_05277"),children:[p&&(0,i.jsx)(ru,{icon:"file-lines",isDisabled:!A.event?.hasForms,onClick:()=>te(!0),children:t("ajouter_1_mem_52947",he)}),p&&(0,i.jsx)(ru,{icon:"file-lines",isDisabled:!A.event?.hasForms,onClick:()=>ie(!0),children:t("marquer_un_form_10633")}),r&&(0,i.jsx)(ru,{icon:"paper-plane",onClick:()=>se(!0),children:t("SendCampaign")}),l&&(0,i.jsx)(ru,{icon:"file",onClick:()=>ae(!0),children:t("exporter_un_doc_23130")})]}),(0,i.jsxs)(MA,{children:[x&&(0,i.jsx)(ru,{color:"red",icon:"repeat",onClick:()=>ue(!0),children:t("r_g_n_rer_les_c_44410")}),h&&(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>L(!0),children:t("d_sinscrire_de_06416")})]})]})]}),k&&(0,i.jsx)(HA,{eventId:n,mutate:e=>v({organizationId:o.id,eventId:n,massEdit:e}),organizationId:o.id,selecteds:me,onClose:()=>w(!1),onSuccess:e=>{ge(t("_1_membres_ont_07596",e))}}),E&&(0,i.jsx)(LP,{eventId:n,numbersOfSelected:he,organizationId:o.id,usersInfosIds:me.ids||[],onClose:()=>T(!1),onSuccess:ge}),R&&(0,i.jsx)(DL,{eventId:n,selecteds:me,onClose:()=>O(!1),onSuccess:ge}),D&&(0,i.jsx)(vL,{eventId:n,numberOfSelected:he,selecteds:me,onClose:()=>z(!1),onSuccess:ge}),$&&(0,i.jsx)(fS,{eventId:n,numberOfSelected:he,selecteds:me,onClose:()=>P(!1),onSuccess:ge}),M&&(0,i.jsx)(yL,{eventId:n,numberOfSelected:he,organizationId:o.id,selecteds:me,onClose:()=>F(!1),onSuccess:ge}),B&&(0,i.jsx)(OL,{eventId:n,numberOfSelected:he,selecteds:me,onClose:()=>U(!1),onSuccess:ge}),W&&(0,i.jsx)(dL,{eventId:n,organizationId:o.id,selecteds:me,onClose:()=>G(!1),onSuccess:ge}),N&&(0,i.jsx)(DA,{buttonText:t("d_sinscrire_27046"),subtext:[t("_tes_vous_s_r_d_46029")],text:t("d_sinscription_66971",he),onClose:()=>L(!1),onDelete:async()=>{const e=(await j({eventId:n,selecteds:me})).numberOfMembers;ge(t("_1_membres_ont_85190",e))}}),q&&(0,i.jsx)(mL,{eventId:n,selecteds:me,onClose:()=>H(!1),onSuccess:ge}),ee&&(0,i.jsx)(PP,{eventId:n,organizationId:o.id,selecteds:me,onClose:()=>te(!1),onSuccess:ge}),ne&&(0,i.jsx)(MP,{eventId:n,organizationId:o.id,selecteds:me,onClose:()=>ie(!1),onSuccess:ge}),K&&(0,i.jsx)(uL,{eventId:n,selecteds:me,onClose:()=>Y(!1),onSuccess:ge}),Z&&(0,i.jsx)($P,{eventId:n,organizationId:o.id,selecteds:me,onClose:()=>X(!1),onSuccess:ge}),J&&(0,i.jsx)(AL,{eventId:n,organizationId:o.id,selecteds:me,onClose:()=>Q(!1),onSuccess:ge}),oe&&(0,i.jsx)(xS,{eventId:n,organizationId:o.id,selecteds:me,onClose:()=>se(!1),onSuccess:ge}),re&&(0,i.jsx)(cL,{selecteds:me,onClose:()=>ae(!1),onSuccess:e.onMassEditSuccess}),le&&(0,i.jsx)(AS,{eventId:n,isOpen:le,selecteds:me,setIsOpen:de,sort:e.sort}),ce&&(0,i.jsx)(DA,{buttonText:t("r_g_n_rer_37440"),subtext:[t("_tes_vous_s_r_d_60491"),t("cela_rendra_les_60931")],text:t("r_g_n_rer_les_c_44410"),onClose:()=>ue(!1),onDelete:async()=>{const{numberOfEdited:e}=await y({eventId:n,selecteds:me});ge(t("les_codes_barre_03402",e))}})]})},$L=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{hasFeature:s}=_v(),r=Ei(Fg),{canMemberEdit:a}=Dv(),[l,d]=ZR("accreditationMembers.columns",[Pg.Name,Pg.Accreditations]),[c,u]=ZR("accreditationMembers.limit",em),[m,h]=ZR("accreditationMembers.predicates",[]),[g,p]=ZR("accreditationMembers.sort",null),{data:f}=na({organizationId:n,eventId:o,privacy:Re.All,loadCustomDocuments:!1,loadForms:!1,loadSegments:!1}),_=(0,V.useMemo)(()=>f.organization?.customFields.nodes??[],[f.organization]),x=jC(_),I=(0,V.useMemo)(()=>f.event?r.getAccreditationMembersFilters(n,o,_,f.event,{hasDelegations:s(Ae.Delegation)}):[],[o,_,f.event]),v=(0,V.useMemo)(()=>r.getAccreditationMembersPossibleColumns(n,_),[n,_]),b=(0,V.useMemo)(()=>({accreditationCategoryId:e.accreditationCategoryId,accreditationId:e.accreditationId,accreditationProfileCategoryId:e.accreditationProfileCategoryId,accreditationProfileId:e.accreditationProfileId,accreditationSlotId:e.accreditationSlotId}),[e.accreditationCategoryId,e.accreditationId,e.accreditationProfileCategoryId,e.accreditationProfileId,e.accreditationSlotId]);return(0,i.jsx)(Qv,{children:(0,i.jsx)(up,{columns:l,columnsSearch:[],columnsToIncludes:Mg,eventId:o,filters:I,getMassActionId:e=>e.userInfo.id,limit:c,loadDataList:aa,loadDataListParams:{accreditationsCategoriesIds:"number"==typeof e.accreditationCategoryId?[e.accreditationCategoryId]:void 0,accreditationsIds:"number"==typeof e.accreditationId?[e.accreditationId]:void 0,accreditationsProfilesCategoriesIds:"number"==typeof e.accreditationProfileCategoryId?[e.accreditationProfileCategoryId]:void 0,accreditationsProfilesIds:"number"==typeof e.accreditationProfileId?[e.accreditationProfileId]:void 0,accreditationsSlotsIds:"number"==typeof e.accreditationSlotId?[e.accreditationSlotId]:void 0,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:sa,loadRowParams:{includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:n,possibleColumns:v,predicates:m,renderActions:(e,t,n)=>(0,i.jsx)(zL,{massActions:e,predicates:m,scope:b,showOnlyMassEdit:!0,sort:g,totalNumberOfMembers:t,onMassEditSuccess:n}),renderAllSelectedText:e=>t("les_1_membres_31409",e),renderPageSelectedText:e=>t("les_1_membres_00895",e),renderSelectAllText:e=>t("s_lectionner_le_34300",e),rendering:Cg.List,setColumns:d,setLimit:u,setPredicates:h,setSort:p,showEditColumns:!0,showEditMode:a,showFilters:!0,showMassActions:a,showPredicatesBadges:!0,showRowDropdown:a,showRowEdit:a,showSearchColumns:!1,showSelectAll:!0,sort:g,children:(0,i.jsx)(yp,{renderCell:(e,t,n)=>(0,i.jsx)(Uy,{canChangeDelegation:!0,canMemberAccredit:!0,canMemberAssign:!0,column:e,customField:x.get(e.slug),eventId:o,reloadRow:n,row:t})})})})},PL=e=>{const{params:{organizationId:t,eventId:n,accreditationId:o},translate:s}=bd();Zc(e.event.accreditation.name);const r=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":n,accreditationId:e?":accreditationId":o});return(0,i.jsxs)(nb,{children:[(0,i.jsx)(NN,{accreditation:e.event.accreditation}),(0,i.jsxs)(rb,{css:{flex:"1"},children:[(0,i.jsxs)(ob,{css:{px:"$7"},children:[(0,i.jsx)(ib,{path:Mo.ACCREDITATION_DASHBOARD(r(!1)),children:s("tableau_de_bord_24627")}),(0,i.jsx)(ib,{path:Mo.ACCREDITATION_MEMBERS(r(!1)),children:s("membres_125561",e.event.volunteersRegistrations.totalCount)})]}),(0,i.jsx)(sb,{path:Mo.ACCREDITATION_DASHBOARD(r(!0)),children:(0,i.jsx)(lL,{})}),(0,i.jsx)(sb,{path:Mo.ACCREDITATION_MEMBERS(r(!0)),children:(0,i.jsx)($L,{accreditationId:o})})]})]})},ML=()=>{const{params:{organizationId:e,eventId:t,accreditationId:n}}=bd(),{data:o,loader:s}=Oi("query Accreditation($eventId: EventId!, $accreditationId: AccreditationId!) {\n event(id: $eventId) {\n accreditation(id: $accreditationId) {\n id\n name\n accreditationCategoryId\n accreditationCategoryName\n assignedResources\n hasSlots\n acronym\n color\n icon\n numberOfSlots\n }\n\n volunteersRegistrations(accreditationsIds: [$accreditationId]) {\n totalCount\n }\n }\n}\n",{eventId:t,accreditationId:n},[]);return s||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{exact:!0,path:Mo.ACCREDITATION({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId"}),children:(0,i.jsx)(Fi,{path:Mo.ACCREDITATION_DASHBOARD({organizationId:e,eventId:t,accreditationId:n}),replace:!0})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(PL,{event:o.event})})]})},FL=e=>{const t=Ti(),n=e.isEdit?"0px":e.isLeftPanelOpen?"280px":"68px",o=e.isRightPanelOpen?"360px":"68px";return(0,i.jsxs)(yc,{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)(ka,{css:{borderRight:"1px solid $gray200",gridColumn:"1 / 2",gridRow:"1 / 3"},children:e.isLeftPanelOpen&&e.leftPanel}),(0,i.jsx)(rd,{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)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"sidebar",onClick:()=>{e.setIsLeftPanelOpen(!e.isLeftPanelOpen)}})})}),(0,i.jsx)(bp,{placement:"top",children:e.isLeftPanelOpen?t("cacher_la_liste_66205"):t("afficher_la_lis_14277")})]})})]}),(0,i.jsx)(ka,{css:{gridColumn:"2 / 4",gridRow:"1 / 2"},children:e.header}),(0,i.jsx)(ka,{css:{borderTop:"1px solid $gray200",gridColumn:"2 / 3",gridRow:"2 / 3",overflowY:"auto"},children:e.children}),(0,i.jsx)(ka,{css:{gridColumn:"2 / 3",gridRow:"3 / 4"},children:e.buttons}),(0,i.jsx)(ka,{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)(rd,{css:{paddingTop:"$6"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:()=>{e.setIsRightPanelOpen(!0)},children:(0,i.jsx)(Id,{icon:"sidebar"})})}),(0,i.jsx)(bp,{placement:"top",children:t("afficher_les_in_82197")})]})})})]})},NL=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,userInfoId:r}}=bd(),a=Ei(Cm),l=(0,V.useMemo)(()=>e.teams.find(t=>t.leaderUserInfoId===e.userInfo.id),[e.teams,e.userInfo]),d=(0,V.useMemo)(()=>e.teams.flatMap(e=>e.members.flatMap(e=>e.userInfo.id===r?[]:[e.userInfo])),[e.teams]);return(0,i.jsxs)(rd,{align:"center",css:{padding:"$5 $6"},gap:"4",children:[(0,i.jsxs)(ka,{css:{position:"relative"},children:[(0,i.jsx)(Gf,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:32}),(0,i.jsx)(rd,{align:"center",css:{background:Ia.colors[`${e.badgeColorIcon.color}100`].value,border:"2px solid white",borderRadius:"16px",bottom:"-6px",color:Ia.colors[`${e.badgeColorIcon.color}700`].value,fontSize:"8px",position:"absolute",right:"-6px"},height:16,justify:"center",width:16,children:(0,i.jsx)(Id,{icon:e.badgeColorIcon.leftIcon})})]}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(_d,{to:bx.MEMBER_INFORMATION({organizationId:o,eventId:s,userInfoId:r}),children:(0,i.jsx)(ka,{css:{cursor:"pointer","&:hover":{textDecoration:"underline"}},font:"gray900 textXl medium",children:e.userInfo.name})}),(0,i.jsxs)(ka,{color:"gray500",children:["(",e.userInfo.email,")"]}),e.showTeam&&l&&(0,i.jsx)(vu,{leftIcon:"shield",children:n("chef_d_quipe_20641")}),e.delegation&&(0,i.jsx)(vu,{cursor:"pointer",leftIcon:"building",onClick:()=>t.push(qo.DELEGATION({organizationId:o,eventId:s,delegationId:e.delegation.id})),children:e.delegation.name})]}),(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{color:"gray500",children:a.toLocaleString(e.insertedAt,zs.DateOnly.MonthLong)}),e.showTeam&&Bs(e.teams)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{color:"gray500",children:"•"}),(0,i.jsx)(ka,{color:"gray500",children:n("_quipe_1_07445",e.teams[0].teamCode)}),(0,i.jsx)(ka,{color:"gray500",children:"•"}),(0,i.jsx)(My,{teamMembers:d})]})]})]}),e.showTabs&&(0,i.jsx)(ka,{width:320,children:(0,i.jsxs)(vI,{selectedItem:e.isPreAssign?"preassign":"affect",onChange:n=>{"preassign"!==n||e.isPreAssign?"affect"===n&&e.isPreAssign&&t.replace(fs.ASSIGNMENT(o,s,r)):t.replace(fs.PRE_ASSIGNMENT(o,s,r))},children:[(0,i.jsx)(bI,{item:"affect",children:n("affecter_94255")}),(0,i.jsx)(bI,{item:"preassign",children:n("pr_affecter_17434")})]})})]})},LL=e=>{const t=Ti(),n=Ei(Cm);return(0,i.jsxs)(rd,{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)(Gf,{email:e.vr.userInfo.email,image:e.vr.userInfo.picture?.url,name:e.vr.userInfo.name,size:40}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray800 textSm semiBold",children:e.vr.userInfo.name}),(0,i.jsx)(ka,{children:t("inscrit_le_1_12018",n.toLocaleString(e.vr.insertedAt,zs.DateOnly.MonthLong))})]})]})},BL=()=>(0,i.jsxs)(rd,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4"},gap:"3",children:[(0,i.jsx)(ju,{size:40,variant:"circular"}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1})]})]}),VL=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=bd(),r=e.event?.delegations?.nodes??[],a=e.event?.segmentsFolders??[],l=e.event?.volunteersRegistrations.totalCount??0,d=e.event?.volunteersRegistrations.nodes??[];return(0,i.jsxs)(rd,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(rd,{css:{padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(bb,{color:"primary",returnPathFallback:Mo.ACCREDITATIONS({organizationId:n,eventId:o}),children:s("retour_92202")}),(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{font:"gray900 textLg medium",children:s("affectation_plural")}),(0,i.jsx)(vu,{color:"error",size:"sm",children:s("profil_restant",l)})]})]}),(0,i.jsxs)(rd,{css:{px:"$4"},gap:"4",children:[(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:s("rechercher_50038"),value:e.name,onChange:e.setName})}),(0,i.jsxs)(nu,{doNotCloseOnOtherOpen:!0,children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"bars-filter"})}),(0,i.jsx)(lu,{css:{padding:"0"},placement:"bottom",children:(0,i.jsxs)(rd,{css:{padding:"$4 $6"},direction:"column",gap:"4",width:320,children:[(0,i.jsx)(ka,{font:"gray800 textMd medium",children:s("liste_des_filtr_75605")}),(0,i.jsxs)(hh,{label:s("date_d_inscript_31369"),value:e.direction,onChange:e.setDirection,children:[(0,i.jsx)("option",{value:re.Desc,children:s("du_plus_r_cent_76468")}),(0,i.jsx)("option",{value:re.Asc,children:s("du_plus_ancien_08999")})]}),(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zd,{children:s("vue_personnalis_97654")}),e.isLoading?(0,i.jsx)(ju,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(Uu,{isSearchVisible:!0,multiple:!1,renderOnPortal:!0,values:[e.segmentId],onChange:t=>{Bs(t)?e.setSegmentId((0,Dm.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)(Uu,{isSelectAllVisible:!0,label:s("status_d_affect_75769"),multiple:!0,values:e.states,onChange:e.setStates,children:[(0,i.jsx)("option",{value:ve.WaitingAssignment,children:s(ve.WaitingAssignment)}),(0,i.jsx)("option",{value:ve.PreAssigned,children:s(ve.PreAssigned)}),(0,i.jsx)("option",{value:ve.Assigned,children:s(ve.Assigned)})]}),e.showAccreditationStates&&(0,i.jsxs)(Uu,{isSelectAllVisible:!0,label:s("statut_d_accr_d_75527"),multiple:!0,values:e.accreditationStates,onChange:e.setAccreditationStates,children:[(0,i.jsx)("option",{value:We.WaitingAccreditation,children:s(We.WaitingAccreditation)}),(0,i.jsx)("option",{value:We.AutoAccredited,children:s(We.AutoAccredited)}),(0,i.jsx)("option",{value:We.Accredited,children:s(We.Accredited)})]}),e.loadDelegations&&(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zd,{children:s("Delegation")}),e.isLoading?(0,i.jsx)(ju,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(Uu,{isSearchVisible:!0,multiple:!1,renderOnPortal:!0,values:e.delegationId?[e.delegationId]:[],onChange:t=>{Bs(t)?e.setDelegationId((0,Dm.A)(t)):e.setDelegationId(null)},children:r.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})]})})]})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(rd,{css:{flex:"1",overflowY:"auto"},direction:"column",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(BL,{}),(0,i.jsx)(BL,{}),(0,i.jsx)(BL,{})]}):d.map(n=>(0,i.jsx)(LL,{displayBorder:!0,isSelected:n.userInfo.id===e.userInfoId,vr:n,onClick:()=>{t.push(e.getPath(n.userInfo.id))}},n.userInfo.id))})]})},UL=e=>{const[t,n]=V.useState(e.isOpen??!0),o=V.useCallback(t=>{e.setIsOpen?.(t),n(t)},[e.setIsOpen,n]);return V.useEffect(()=>{"boolean"==typeof e.isOpen&&n(e.isOpen)},[e.isOpen]),(0,i.jsxs)(rd,{css:{borderTop:"1px solid $gray200",padding:"$6",...e.css},direction:"column",gap:"4",children:[(0,i.jsxs)(rd,{align:"center",css:{cursor:"pointer",userSelect:"none",...e.titleCss},gap:"4",onClick:()=>{o(!t)},children:[(0,i.jsx)(ka,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(Id,{icon:t?"chevron-down":"chevron-right"})}),(0,i.jsx)(rd,{css:{color:"$gray800",flex:"1",fontWeight:"$semiBold"},children:e.title})]}),t&&e.children]})},WL=e=>{const t=Ti(),n=Ei(Cm),[o,s]=ZR("assignment.rightPanel.areAccreditationsOpen",!0),r=(0,V.useMemo)(()=>function(e,t,n,i){return e.flatMap(e=>e.accreditationsSlots.map(e=>{const o=qg(t,e,e.accreditation.name,{defaultName:"-"});return{name:e.accreditation.name,subtitle:o,path:Mo.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)(UL,{isOpen:o,setIsOpen:s,title:t("accr_ditations_74375"),children:(0,i.jsxs)(Hu,{children:[(0,i.jsx)(Wu,{children:(0,i.jsx)(pm,{children:t("accr_ditation_s_00595")})}),r.map((e,t)=>(0,i.jsx)(am,{children:(0,i.jsxs)(Qu,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(ka,{color:"gray900",fontWeight:"medium",children:e.name}),(0,i.jsx)(ka,{color:"gray500",children:e.subtitle})]})},t))]})})},GL=e=>{const t=Ei(Cm);return(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsxs)(rd,{justify:"between",children:[(0,i.jsx)(ka,{font:"gray800 textXs medium",children:e.comment.writtenBy.userInfo.name}),(0,i.jsx)(ka,{font:"gray500 textXs regular",children:t.toLocaleString(e.comment.insertedAt,{...zs.DateTime,month:"numeric"})})]}),(0,i.jsx)(rd,{css:{background:"$gray100",bd:!0,borderTopLeftRadius:"0",padding:"$2 $3",whiteSpace:"pre-wrap"},children:e.comment.content})]})},qL=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o}}=bd(),{data:s,isLoading:r,reload:a}=Wl({organizationId:t,userInfoId:o}),{mutate:l,isLoading:d}=Ul(),[c,u]=(0,V.useState)(""),{permissions:[m]}=Ry(yy({organizationId:t,eventId:n,userInfoId:o}));return(0,i.jsxs)(rd,{css:{padding:"0 $6 $4 $6"},direction:"column",gap:"3",children:[r?(0,i.jsx)(ju,{borderRadius:"$1",height:40,variant:"rectangular",width:1}):s.organization.userInfo.comments.map(e=>(0,i.jsx)(GL,{comment:e},e.id)),m&&(0,i.jsxs)(Av,{children:[(0,i.jsx)(Sv,{children:(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",children:e("ajouter_un_comm_27671")})}),(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"message",children:e("ajouter_un_comm_27671")}),(0,i.jsx)(jv,{children:(0,i.jsx)(qp,{label:e("commentaire_08754"),value:c,onChange:u})}),(0,i.jsx)(bv,{children:s=>(0,i.jsx)(kd,{disabled:p(c),isLoading:d,onClick:async()=>{await l({organizationId:t,eventId:n,userInfoId:o,comment:{content:c}}),a(),s()},children:e("ajouter_97327")})})]})]})]})},HL=e=>{const t=Ti(),[n,o]=ZR("assignment.rightPanel.areInformationsOpen",!0);return(0,i.jsxs)(UL,{isOpen:n,setIsOpen:o,title:e.title,children:[(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(iA,{children:t("Email")}),(0,i.jsx)(ka,{color:"gray500",css:{ellipsis:!0,fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:e.userInfo.email})]}),e.customFields.map(t=>(0,i.jsx)(oA,{field:t,fields:e.userInfo.fields},t.id)),e.formsIds.map(n=>{const o=eA(n,t);return g(e.userInfo.fields[o.slug])?(0,i.jsx)(oA,{field:o,fields:e.userInfo.fields},o.slug):null})]})},KL=e=>{const t=Ti(),n=Ei(Yh),[o,s]=ZR("assignment.rightPanel.arePositionsOpen",!0),r=(0,V.useMemo)(()=>_A(e.formsUsersInfos,n,e.organizationId,e.eventId),[e.formsUsersInfos,e.organizationId,e.eventId]);return(0,i.jsx)(UL,{isOpen:o,setIsOpen:s,title:t("missions_souhai_23225"),children:(0,i.jsxs)(Hu,{children:[(0,i.jsx)(Wu,{children:(0,i.jsx)(pm,{children:t("mission_souhait_49168")})}),r.map((e,n)=>(0,i.jsx)(am,{children:(0,i.jsxs)(Qu,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{color:"gray900",fontWeight:"medium",children:e.name}),e.form.positionRanking===it.Ranked&&(0,i.jsx)(vu,{children:t("choix_n_1_00613",e.rank)})]}),(0,i.jsx)(ka,{color:"gray500",children:e.range})]})},n))]})})},YL=e=>{const t=Ti(),n=Ei(Cm),o=Ei(Yh),[s,r]=ZR("assignment.rightPanel.areAvailabilitiesOpen",!0),a=(0,V.useMemo)(()=>(0,cm.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===Qe.Calendar||e===Qe.DisplayDays?n.toLocaleString(t.range.start,zs.DateOnly.MonthLong):o.toDisplayString(t.range)),[n,o,e.formsUsersInfos]);return(0,i.jsx)(UL,{isOpen:s,setIsOpen:r,title:t("disponibilit_s_49923"),children:(0,i.jsxs)(Hu,{children:[(0,i.jsx)(Wu,{children:(0,i.jsx)(pm,{children:t("disponibilit_92461")})}),a.map((e,t)=>(0,i.jsx)(am,{children:(0,i.jsx)(Qu,{children:(0,i.jsx)(ka,{color:"gray900",fontWeight:"medium",children:e})})},t))]})})},ZL=e=>{const t=Ti(),n=(0,V.useMemo)(()=>e.formsUsersInfos.map(e=>e.form.id),[e.formsUsersInfos]);return(0,i.jsxs)(rd,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(rd,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:e.onCollapse,children:(0,i.jsx)(Id,{icon:"sidebar"})})}),(0,i.jsx)(bp,{placement:"top",children:t("cacher_les_info_51832")})]}),(0,i.jsx)(ka,{font:"gray900 textMd semiBold",children:t("_propos_de_1_50761",e.userInfo.name)})]}),(0,i.jsx)(qL,{}),(0,i.jsx)(HL,{customFields:e.customFields,formsIds:n,title:t("informations_22954"),userInfo:e.userInfo}),(0,i.jsx)(YL,{formsUsersInfos:e.formsUsersInfos}),e.showWishedPositions&&(0,i.jsx)(KL,{eventId:e.eventId,formsUsersInfos:e.formsUsersInfos,organizationId:e.organizationId}),e.showWishedAccreditations&&(0,i.jsx)(WL,{eventId:e.eventId,formsUsersInfos:e.formsUsersInfos,organizationId:e.organizationId})]})},XL=(0,V.createContext)({}),JL=e=>{const[t,n]=(0,V.useState)(e.accreditationProfileId),[o,s]=(0,V.useState)(e.accreditationsSlotsIds);return(0,i.jsx)(XL.Provider,{value:{accreditationProfileId:t,accreditationsSlotsIds:o,alreadyAssignedProfileId:e.alreadyAssignedProfileId,alreadyAssignedSlotsIds:e.alreadyAssignedSlotsIds,isEdit:e.isEdit,showNextMember:e.showNextMember,setAccreditationProfileId:n,setAccreditationsSlotsIds:s},children:e.children})};function QL(){return(0,V.useContext)(XL)}const eB=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=bd(),{accreditationProfileId:r,accreditationsSlotsIds:a,showNextMember:l}=QL(),{mutate:d,isLoading:c}=Jr(),{mutate:u,isLoading:m}=hr(),h=(0,V.useCallback)(()=>{e.isEdit?t.goBack(fs.VOLUNTEERS(n,o)):l()},[e.isEdit,l]);return(0,i.jsxs)(rd,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,justify:"end",width:1,children:[(0,i.jsx)(ka,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{m||c||(await d({eventId:o,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:We.Refused}}),h())},children:s("refuser_92819")}),(0,i.jsx)(ka,{css:{flex:"1"}}),(0,i.jsx)(kd,{color:"primary",isLoading:m,onClick:async()=>{m||c||(await u({eventId:o,massAccredit:{accreditationsSlotsIds:a,accreditationProfile:{accreditationProfileId:r},selecteds:{ids:[e.userInfoId]},strategy:yt.Replace}}),h())},children:e.isEdit?s("mettre_jour_l_11622"):s("accr_diter_70543")}),(0,i.jsx)(kd,{color:"white",onClick:h,children:e.isEdit?s("annuler_48254"):s("accr_diter_plus_19053")})]})},tB=e=>{const{accreditationsSlotsIds:t,alreadyAssignedSlotsIds:n,setAccreditationsSlotsIds:o}=QL(),s=(0,V.useMemo)(()=>Hg(e.accreditationsSlots.filter(t=>t.accreditationId===e.accreditation.id)),[e.accreditationsSlots,e.accreditation]),r=(0,V.useMemo)(()=>Object.fromEntries(s.map(e=>[e.id,e])),[s]),a=(0,V.useMemo)(()=>Object.fromEntries((e.delegationAccreditationsSlots||[]).map(e=>[e.accreditationSlotId,e])),[e.delegationAccreditationsSlots]),l=(0,V.useCallback)(e=>{const t=a[e],n=r[e];return(0,Lh.A)((0,hd.A)(["number"==typeof n?.maxResources?{assignedResources:n.assignedResources,maxResources:n.maxResources,remaining:n.maxResources-n.assignedResources}:null,"number"==typeof t?.maxResources?{assignedResources:t.assignedResources,maxResources:t.maxResources,remaining:t.maxResources-t.assignedResources}:null]),e=>e.remaining)??null},[a,r]),d=(0,V.useCallback)(e=>{const t=a[e],i=r[e],o=!!t&&t.isFull&&!n.includes(e),s=!!i&&(i.isBlocked||i.isFull&&!n.includes(e));return o||s},[n,a,r]),c=(0,V.useMemo)(()=>e.accreditation.hasSlots?null:(0,i.jsx)(rS,{getAssignedMaxRemaining:l,slotId:e.accreditation.hiddenSlotId}),[l,e.accreditation]),u=t.includes(e.accreditation.hiddenSlotId)?"checked":"unchecked";return(0,i.jsx)(Vj,{accreditation:e.accreditation,badge:c,displayNumberOfSlots:e.accreditation.hasSlots,displaySlots:e.accreditation.hasSlots,numberOfSlots:s.length,renderCheckbox:()=>!e.accreditation.hasSlots&&(0,i.jsx)(wu,{disabled:d(e.accreditation.hiddenSlotId),shouldPreventDefault:!1,state:u,onClick:hc.A}),onClick:()=>{e.accreditation.hasSlots||d(e.accreditation.hiddenSlotId)||o(Us(t,e.accreditation.hiddenSlotId,"unchecked"===u))},children:(0,i.jsx)(rd,{css:{background:"white",padding:"$4"},children:e.accreditation.hasSlots?e.accreditation.accreditationDisplay===xe.Calendar?(0,i.jsx)(lS,{accreditationsSlotsIds:t,slotIdToDas:a,slots:s,onChange:o}):(0,i.jsxs)(rd,{css:{background:"white",bd:!0},direction:"column",width:1,children:[(0,i.jsx)(rd,{css:{padding:"$4"},direction:"column",gap:"3",children:e.accreditation.accreditationDisplay===xe.Radio?(0,i.jsx)(eR,{accreditation:e.accreditation,accreditationsSlotsIds:t,getAssignedMaxRemaining:l,getDisabled:d,slots:s,onChange:o}):(0,i.jsx)(QT,{accreditation:e.accreditation,accreditationsSlotsIds:t,getAssignedMaxRemaining:l,getDisabled:d,slots:s,onChange:o})}),(0,i.jsx)(tR,{accreditation:e.accreditation,accreditationsSlotsIds:t,slots:s,onChange:o})]}):null})})},nB=e=>{const t=(0,V.useMemo)(()=>_g((0,Xh.A)(e.accreditationsSlots.flatMap(t=>t.accreditationCategoryId===e.category.id?[t.accreditation]:[]),e=>e.id)),[e.accreditationsSlots,e.category]);return(0,i.jsx)(Bj,{category:e.category.name,children:t.map(t=>(0,i.jsx)(tB,{accreditation:t,accreditationsSlots:e.accreditationsSlots,delegationAccreditationsSlots:e.delegation?.accreditationsSlots},t.id))})},iB=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>(0,cm.A)((0,Xh.A)(e.accreditationsSlots.map(e=>e.accreditationCategory),e=>e.id),e=>m(e.name)),[e.accreditationsSlots]);return(0,i.jsxs)(rd,{css:{background:"white",bd:"gray200 2",padding:"$4 $5"},direction:"column",gap:"6",children:[(0,i.jsx)(ka,{font:"gray900 textMd medium",children:t("accr_ditations_39450")}),(0,i.jsx)(Lj,{css:{bd:"gray200 2"},children:n.map(t=>(0,i.jsx)(nB,{accreditationsSlots:e.accreditationsSlots,category:t,delegation:e.delegation},t.id))})]})},oB=e=>{const{accreditationProfileId:t,alreadyAssignedProfileId:n,setAccreditationProfileId:o}=QL(),s=(0,V.useMemo)(()=>(0,cm.A)(e.accreditationsProfiles.filter(t=>t.accreditationProfileCategoryId===e.category.id),e=>m(e.name)),[e.accreditationsProfiles,e.category]);return(0,i.jsx)(Bj,{category:e.category.name,children:s.map(s=>(0,i.jsx)(XT,{accreditationProfileId:t,alreadyAssignedProfileId:n,delegationAccreditationsProfiles:e.delegation?.accreditationsProfiles,profile:s,setAccreditationProfileId:o,showDescription:!1},s.id))})},sB=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>(0,cm.A)((0,Xh.A)(e.accreditationsProfiles.map(e=>e.accreditationProfileCategory),e=>e.id),e=>m(e.name)),[e.accreditationsProfiles]);return(0,i.jsxs)(rd,{css:{background:"white",bd:"gray200 2",padding:"$4 $5"},direction:"column",gap:"6",children:[(0,i.jsx)(ka,{font:"gray900 textMd medium",children:t("profils_d_accr_27825")}),(0,i.jsx)(Lj,{css:{bd:"gray200 2"},children:n.map(t=>(0,i.jsx)(oB,{accreditationsProfiles:e.accreditationsProfiles,category:t,delegation:e.delegation},t.id))})]})},rB=e=>{const t=Ti(),n=Ei(Cm),o=(0,V.useMemo)(()=>e.event.accreditationsCategories.flatMap(e=>e.accreditations),[e.event.accreditationsCategories]),s=(0,V.useMemo)(()=>e.event.accreditationsProfilesCategories.flatMap(e=>e.accreditationsProfiles),[e.event.accreditationsProfilesCategories]),r=(0,V.useMemo)(()=>(e.accreditationsCategoriesIds||[]).map(t=>e.event.accreditationsCategories.find(e=>e.id===t).name).join(", "),[e.accreditationsCategoriesIds,e.event]),a=(0,V.useMemo)(()=>(e.accreditationsIds||[]).map(e=>o.find(t=>t.id===e).name).join(", "),[o,e.accreditationsIds]),l=(0,V.useMemo)(()=>(e.accreditationsProfilesIds||[]).map(e=>s.find(t=>t.id===e).name).join(", "),[s,e.accreditationsProfilesIds]),d=(0,V.useMemo)(()=>e.date?n.toLocaleString(e.date,zs.DateOnly.MonthLong):"",[e.date]),c=(0,V.useMemo)(()=>e.segmentId?e.event.segments.find(t=>t.id===e.segmentId).name:"",[e.segmentId,e.event]),u=(0,V.useMemo)(()=>(e.tagsIds||[]).map(t=>e.organization.tags.nodes.find(e=>e.id===t).name).join(", "),[e.tagsIds,e.organization]);return g(r)||g(a)||g(l)||g(d)||g(c)||g(u)||e.excludeFull||e.excludePast||e.onlyDelegation?(0,i.jsxs)(rd,{align:"center",gap:"3",wrap:"wrap",children:[g(r)&&(0,i.jsx)(vu,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setAccreditationsCategoriesIds([]),children:t("cat_gories_1_42029",r)}),g(a)&&(0,i.jsx)(vu,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setAccreditationsIds([]),children:t("accr_ditations_30765",a)}),g(l)&&(0,i.jsx)(vu,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setAccreditationsProfilesIds([]),children:t("profils_d_accr_16603",l)}),g(d)&&(0,i.jsx)(vu,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setDate(null),children:t("date_1_17337",d)}),g(c)&&(0,i.jsx)(vu,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setSegmentId(null),children:t("vue_1_29260",c)}),g(u)&&(0,i.jsx)(vu,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setTagsIds([]),children:t("tags_1_43158",u)}),e.excludeFull&&(0,i.jsx)(vu,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setExcludeFull(!1),children:t("cr_neaux_comple_77561")}),e.excludePast&&(0,i.jsx)(vu,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setExcludePast(!1),children:t("cr_neaux_dans_l_92999")}),e.onlyDelegation&&(0,i.jsx)(vu,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setOnlyDelegation(!1),children:t("accr_ditations_07661")}),(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textXs medium",onClick:e.reset,children:t("r_initialiser_l_66835")})]}):null},aB=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.accreditationsCategoriesIds),[s,r]=(0,V.useState)(e.accreditationsIds),[a,l]=(0,V.useState)(e.accreditationsProfilesIds),[d,c]=(0,V.useState)(e.date),[u,h]=(0,V.useState)(e.tagsIds),[g,p]=(0,V.useState)(e.segmentId?[e.segmentId]:[]),[f,_]=(0,V.useState)(e.onlyDelegation?"checked":"unchecked"),[x,I]=(0,V.useState)(e.excludeFull?"checked":"unchecked"),[v,b]=(0,V.useState)(e.excludePast?"checked":"unchecked"),j=(0,V.useMemo)(()=>(0,cm.A)(e.event.accreditationsCategories,e=>m(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[e.event.accreditationsCategories]),C=(0,V.useMemo)(()=>{return t=e.event.accreditationsCategories,(0,cm.A)(t,e=>m(e.name)).map(e=>{const t=_g(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)});var t},[e.event.accreditationsCategories]),y=(0,V.useMemo)(()=>Nj(e.event.accreditationsProfilesCategories),[e.event.accreditationsProfilesCategories]);return(0,i.jsxs)(rd,{direction:"column",onChange:e=>{e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:[(0,i.jsxs)(rd,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(ka,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),(0,i.jsx)(Uu,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_97056"),renderOnPortal:!0,values:n||[],onChange:o,children:j}),(0,i.jsx)(Uu,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_92029"),renderOnPortal:!0,values:s||[],onChange:r,children:C}),(0,i.jsx)(Uu,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_72321"),renderOnPortal:!0,values:a||[],onChange:l,children:y}),(0,i.jsx)(Ih,{max:e.event.endAt,min:e.event.startAt,placeholder:t("date_du_cr_neau_82295"),value:d,onChange:c}),(0,i.jsx)(Uu,{isSearchVisible:!0,placeholder:t("s_lectionnez_un_19794"),renderOnPortal:!0,values:g,onChange:e=>{Bs(e)?p([(0,Dm.A)(e)]):p([])},children:e.event.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Uu,{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)(Eu,{state:f,onClick:_,children:t("seulement_les_a_45276")}),(0,i.jsx)(Eu,{state:x,onClick:I,children:t("masquer_les_cr_14425")}),(0,i.jsx)(Eu,{state:v,onClick:b,children:t("masquer_les_cr_05336")})]}),(0,i.jsxs)(rd,{align:"center",css:{brderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{e.reset(),e.close()},children:t("r_initialiser_77538")}),(0,i.jsx)(kd,{size:"sm",onClick:()=>{e.setAccreditationsCategoriesIds(n),e.setAccreditationsIds(s),e.setAccreditationsProfilesIds(a),e.setDate(d),e.setExcludeFull("checked"===x),e.setExcludePast("checked"===v),e.setOnlyDelegation("checked"===f),e.setSegmentId(Bs(g)?g[0]:null),e.setTagsIds(u),e.close()},children:t("appliquer_05753")})]})]})},lB=e=>{const t=Ti(),[n,o]=(0,V.useState)(!1),s=(0,V.useCallback)(()=>{e.setAccreditationsCategoriesIds([]),e.setAccreditationsIds([]),e.setAccreditationsProfilesIds([]),e.setDate(null),e.setExcludeFull(!1),e.setExcludePast(!1),e.setOnlyDelegation(!1),e.setSegmentId(null),e.setTagsIds([])},[e.setAccreditationsCategoriesIds,e.setAccreditationsIds,e.setAccreditationsProfilesIds,e.setDate,e.setExcludeFull,e.setExcludePast,e.setOnlyDelegation,e.setSegmentId,e.setTagsIds]);return(0,i.jsxs)(rd,{direction:"column",gap:"3",width:1,children:[(0,i.jsxs)(rd,{gap:"3",children:[(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_une_65646"),value:e.name,onChange:e.setName}),(0,i.jsxs)(nu,{doNotCloseOnOtherOpen:!0,isOpen:n,onStateChange:o,children:[(0,i.jsx)(du,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"bars-filter",children:t("filtres_64574")})})}),(0,i.jsx)(lu,{placement:"bottom-end",width:385,children:(0,i.jsx)(aB,{...e,close:()=>{o(!1)},reset:s})})]})]}),(0,i.jsx)(rB,{...e,reset:s})]})},dB=({event:e,organization:t})=>{const{eventId:n}=zi(),[o,s,r]=gm(""),[a,l]=ZR("accredit.filters.accreditationsCategoriesIds",null),[d,c]=ZR("accredit.filters.accreditationsIds",null),[u,m]=ZR("accredit.filters.accreditationsProfilesIds",null),[h,p]=ZR("accredit.filters.date",null),[f,_]=ZR("accredit.filters.tagsIds",null),[x,I]=ZR("accredit.filters.segmentId",null),[v,b]=ZR("accredit.filters.excludeFull",!1),[j,C]=ZR("accredit.filters.excludePast",!1),[y,A]=ZR("accredit.filters.onlyDelegation",!0),{data:S,loader:k}=Oi("query AccreditSlots(\n $eventId: EventId!\n $name: String\n $accreditationCategoriesIds: [AccreditationsCategoryId!]\n $accreditationsIds: [AccreditationId!]\n $accreditationsProfilesIds: [AccreditationsProfileId!]\n $date: Date\n $tagsIds: [TagId!]\n $segmentId: SegmentId\n $excludeFull: Boolean\n $excludePast: Boolean\n $delegationId: DelegationId\n) {\n event(id: $eventId) {\n accreditationsProfiles(\n name: $name\n ids: $accreditationsProfilesIds\n delegationId: $delegationId\n ) {\n nodes {\n ...AccreditationProfile\n }\n }\n\n accreditationsSlots(\n includeHidden: true\n name: $name\n accreditationsCategoriesIds: $accreditationCategoriesIds\n accreditationsIds: $accreditationsIds\n date: $date\n tagsIds: $tagsIds\n segmentId: $segmentId\n excludeFull: $excludeFull\n excludePast: $excludePast\n delegationId: $delegationId\n ) {\n nodes {\n ...AccreditationsSlot\n }\n }\n }\n}\n",{eventId:n,name:g(s)?s:void 0,accreditationCategoriesIds:Bs(a)?a:void 0,accreditationsIds:Bs(d)?d:void 0,accreditationsProfilesIds:Bs(u)?u:void 0,date:h,tagsIds:Bs(f)?f:void 0,segmentId:x,excludeFull:v,excludePast:j,delegationId:y?e.volunteerRegistration.delegation?.id:void 0},[js.AccreditationProfileFragment,js.AccreditationsSlotFragment]);return(0,i.jsxs)(rd,{css:{background:"$gray50",minHeight:"100%",padding:"$6 $7"},direction:"column",gap:"7",width:1,children:[(0,i.jsx)(lB,{accreditationsCategoriesIds:a,accreditationsIds:d,accreditationsProfilesIds:u,date:h,event:e,excludeFull:v,excludePast:j,name:o,onlyDelegation:y,organization:t,segmentId:x,setAccreditationsCategoriesIds:l,setAccreditationsIds:c,setAccreditationsProfilesIds:m,setDate:p,setExcludeFull:b,setExcludePast:C,setName:r,setOnlyDelegation:A,setSegmentId:I,setTagsIds:_,tagsIds:f}),k||(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[Bs(S.event.accreditationsProfiles.nodes)&&(0,i.jsx)(sB,{accreditationsProfiles:S.event.accreditationsProfiles.nodes,delegation:e.volunteerRegistration.delegation}),Bs(S.event.accreditationsSlots.nodes)&&(0,i.jsx)(iB,{accreditationsSlots:S.event.accreditationsSlots.nodes,delegation:e.volunteerRegistration.delegation})]})]})},cB=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,userInfoId:r}}=bd();Zc(n("accr_ditations_79986",e.event.volunteerRegistration.userInfo.name));const[a,l]=ZR("accredit.isLeftPanelOpen",!0),[d,c]=ZR("accredit.isRightPanelOpen",!0),[u,m,h]=gm(""),[p,f]=ZR("accredit.leftPanelDirection",re.Desc),[_,x]=ZR("accredit.leftPanelSegmentId",-1),[I,v]=ZR("accredit.leftPanelDelegationId",null),[b,j]=ZR("accredit.leftPanelStates",[We.AutoAccredited,We.WaitingAccreditation]),{data:C,isLoading:y}=cr({eventId:s,accreditationStates:b,name:g(m)?m:void 0,segmentId:-1===_?void 0:_,delegationId:I||void 0,direction:p,loadDelegations:!0}),A=(0,V.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(fs.ACCREDIT(o,s,r)):t.replace(fs.ACCREDIT(o,s,i))},[o,s,r,C.event]),S=e.event.volunteerRegistration,k=(0,V.useMemo)(()=>e.isEdit?S.accreditationProfileId:null,[e.isEdit,S]),w=(0,V.useMemo)(()=>{if(e.isEdit)return S.accreditationProfileId;{const e=(0,hd.A)(S.userInfo.formsUsersInfos.flatMap(e=>{const t=S.delegation?.accreditationsProfiles.find(t=>t.accreditationProfileId===e.accreditationProfileId);return"number"==typeof t?.maxResources&&t.assignedResources>=t.maxResources?[]:[e.accreditationProfileId]}));return Bs(e)?e[0]:null}},[e.isEdit,S]),E=(0,V.useMemo)(()=>S.accreditationsUsersInfos.map(({accreditationSlotId:e})=>e),[S]),T=(0,V.useMemo)(()=>[...E,...e.isEdit?[]:S.userInfo.formsUsersInfos.flatMap(e=>e.accreditationsSlots.flatMap(e=>{const t=S.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]}))],[E,S,e.isEdit]);return(0,i.jsx)(JL,{accreditationProfileId:w,accreditationsSlotsIds:T,alreadyAssignedProfileId:k,alreadyAssignedSlotsIds:E,isEdit:e.isEdit,showNextMember:A,children:(0,i.jsx)(FL,{buttons:(0,i.jsx)(eB,{isEdit:e.isEdit,userInfoId:S.userInfo.id}),header:(0,i.jsx)(NL,{badgeColorIcon:_b(S.accreditationState),delegation:S.delegation,insertedAt:S.insertedAt,isPreAssign:!1,showTabs:!1,showTeam:!1,teams:[],userInfo:S.userInfo}),isEdit:e.isEdit,isLeftPanelOpen:a,isRightPanelOpen:d,leftPanel:(0,i.jsx)(VL,{accreditationStates:b,delegationId:I,direction:p,event:C.event,getPath:e=>fs.ACCREDIT(o,s,e),isLoading:y,loadDelegations:!0,name:u,segmentId:_,setAccreditationStates:j,setDelegationId:v,setDirection:f,setName:h,setSegmentId:x,setStates:hc.A,showAccreditationStates:!0,showStates:!1,states:[],userInfoId:S.userInfoId}),rightPanel:(0,i.jsx)(ZL,{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)(dB,{event:e.event,organization:e.organization})})})},uB=e=>{const{organizationId:t,eventId:n,userInfoId:o}=zi(),{data:s,loader:r}=Oi("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 accreditations {\n id\n name\n index\n }\n }\n\n accreditationsProfilesCategories {\n id\n name\n\n accreditationsProfiles {\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 accreditationProfileId\n insertedAt\n\n accreditationsUsersInfos {\n accreditationSlotId\n }\n\n delegation {\n id\n name\n\n ...DelegationAccreditationsSlots\n }\n\n userInfo {\n id\n name\n email\n fields\n\n picture {\n url\n }\n\n formsUsersInfos(level: Event, eventId: $eventId) {\n accreditationProfileId\n\n accreditationsSlots {\n id\n maxResources\n assignedResources\n }\n }\n }\n }\n }\n}\n",{organizationId:t,eventId:n,userInfoId:o},[js.FormsUsersInfosWishedFragment,js.CustomFieldWithConditionFragment,js.DelegationAccreditationsSlotsFragment]);return r||(0,i.jsx)(cB,{event:s.event,isEdit:e.isEdit,organization:s.organization})},mB=e=>(0,i.jsxs)(rd,{css:{background:"white",bd:!0,flex:"1",...e.css},direction:"column",children:[(0,i.jsx)(rd,{css:{flex:"1",padding:"$6"},direction:"column",gap:"2",children:e.children}),e.button&&(0,i.jsx)(rd,{css:{borderTop:"1px solid $gray200",padding:"$4 $6"},justify:"end",children:e.button})]}),hB=()=>{const{translate:e,params:{eventId:t}}=bd(),[n,o,s]=gm(""),[r,a]=(0,V.useState)(""),[l,d]=(0,V.useState)(0),{data:c,isLoading:u,reload:m}=Oi("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:g(o)?o:void 0,state:""!==r?r:void 0,offset:l},[js.EmailRecipientFragment]);const h=um(),{numberOfPages:p,totalCount:f}=ah(c.event?.emails);return(0,i.jsx)(dm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{width:200,children:(0,i.jsxs)(hh,{value:r,onChange:e=>{a(e),d(0)},children:[(0,i.jsx)("option",{value:"",children:e("tous_les_status_67644")}),h(Dn.filter(e=>e!==dt.Queued))]})}),(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{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)(pm,{children:e("nom_du_membre_69353")}),(0,i.jsx)(pm,{children:e("date_d_envoi_74668")}),(0,i.jsx)(pm,{children:e("State")}),(0,i.jsx)(pm,{width:100})]}),numberOfPages:p,offset:l,rows:u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):c.event.emails.nodes.map(e=>(0,i.jsx)(hb,{email:e,emailType:ze.Accreditations,reload:m},e.id)),setOffset:d,title:e("liste_des_envoi_14764"),totalCount:f})},gB=e=>{const t=Ti(),{mutate:n,isLoading:o}=function(e={}){return Di("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)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(wj,{color:"warning",css:{margin:"auto"},icon:"triangle-exclamation"}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{font:"gray900 textLg medium",textAlign:"center",children:t("_tes_vous_sur_d_58206",e.numberOfEmails)}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:t("les_membres_pr_09143")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{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)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},pB=e=>{const t=Ti(),[n,o,s]=gm(""),[r,a]=(0,V.useState)([]),{data:l}=tl({eventId:e.eventId,usersInfosIds:r,name:g(o)?o:void 0}),d=(0,V.useMemo)(()=>(0,Xh.A)((l.event?.volunteersRegistrations.nodes??[]).concat(l.event?.selectedVolunteersRegistrations.nodes??[]),e=>e.id),[l.event]),{mutate:c,isLoading:u}=function(e={}){return Di("mutation AccreditationsEmailsEstimate(\n $eventId: EventId!\n $sendAccreditationsEmails: SendAccreditationsEmailsInput!\n) {\n eventAccreditationsEmailsEstimate(\n eventId: $eventId\n sendAccreditationsEmails: $sendAccreditationsEmails\n )\n}\n",e)}(),[m,h]=(0,V.useState)(wt.Everyone),[p,f]=(0,V.useState)([]),_=m===wt.Everyone||m===wt.Accredited||m===wt.Refused||m===wt.Members&&Bs(r)||m===wt.Segments&&Bs(p),x=!(!e.emailSender||e.emailSender.isValidToSendEmail);return(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(wj,{color:"purple",css:{margin:"auto"},icon:"paper-plane"}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("envoi_des_e_mai_83224")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:t("personnaliser_v_78340")}),(0,i.jsx)(md,{height:"7"}),x&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zd,{alertStyle:"error",children:(0,i.jsx)(Pd,{children:t("vous_ne_pouvez_69435")})}),(0,i.jsx)(md,{height:"4"})]}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:t("que_souhaitez_v_01732")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(zu,{state:m===wt.Everyone?"checked":"unchecked",onClick:()=>{h(wt.Everyone)},children:t("tous_les_e_mail_50843")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:m===wt.Accredited?"checked":"unchecked",onClick:()=>{h(wt.Accredited)},children:t("tous_les_e_mail_02185")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:m===wt.Refused?"checked":"unchecked",onClick:()=>{h(wt.Refused)},children:t("tous_les_e_mail_41162")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:m===wt.Members?"checked":"unchecked",onClick:()=>{h(wt.Members)},children:t("_certains_memb_91094")}),m===wt.Members&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ka,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Uu,{isSearchVisible:!0,multiple:!0,searchElement:(0,i.jsx)(Qd,{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)(md,{height:"3"}),(0,i.jsx)(zu,{state:m===wt.Segments?"checked":"unchecked",onClick:()=>{h(wt.Segments)},children:t("uniquement_ce_54026")}),m===wt.Segments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ka,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Uu,{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)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{disabled:x,isLoading:u,onClick:async()=>{if(_){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)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},fB=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=bd(),{setNumberOfWaitingAccreditations:r}=dv(),[a,l]=(0,V.useState)(!1),[d,c]=(0,V.useState)(null),[u,m]=(0,V.useState)(0),[h,g]=(0,V.useState)(!1);return(0,V.useEffect)(()=>{r(e.event.waitingAccreditation.totalCount)},[e.event]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Qv,{children:[(0,i.jsxs)(rd,{gap:"3",children:[(0,i.jsxs)(mB,{button:(0,i.jsx)(kd,{disabled:0===e.event.waitingAccreditation.totalCount,onClick:()=>{e.event.waitingAccreditation.totalCount>0&&t.push(fs.ACCREDIT(n,o,e.event.waitingAccreditation.nodes[0].userInfoId))},children:s("accr_diter_les_48281")}),children:[(0,i.jsx)(ka,{color:"gray500",fontWeight:"medium",children:s("membres_en_atte_52995")}),(0,i.jsx)(ka,{font:"gray900 displayMd medium",children:e.event.waitingAccreditation.totalCount})]}),(0,i.jsxs)(mB,{button:(0,i.jsx)(kd,{onClick:()=>{l(!0)},children:s("param_trer_et_e_31095")}),children:[(0,i.jsx)(ka,{color:"gray500",fontWeight:"medium",children:s("e_mail_de_confi_84099_plural")}),(0,i.jsx)(ka,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfWaiting})]})]}),(0,i.jsx)(md,{height:"9"}),(0,i.jsx)(ka,{font:"gray900 textLg medium",children:s("historique_des_71419")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsxs)(rd,{gap:"6",children:[(0,i.jsxs)(mB,{children:[(0,i.jsx)(ka,{color:"gray500",fontWeight:"medium",children:s("nombre_d_envois_95106")}),(0,i.jsx)(ka,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfSent})]}),(0,i.jsxs)(mB,{children:[(0,i.jsx)(ka,{color:"gray500",fontWeight:"medium",children:s("nombre_d_ouvert_84187")}),(0,i.jsx)(ka,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfOpen})]}),(0,i.jsxs)(mB,{children:[(0,i.jsx)(ka,{color:"gray500",fontWeight:"medium",children:s("nombre_de_clics_64232")}),(0,i.jsx)(ka,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfClick})]})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(hB,{})]}),a&&(0,i.jsx)(pB,{emailSender:e.organization.emailTemplate?.emailSender,eventId:o,onClose:()=>{l(!1)},onSuccess:(e,t)=>{m(e),c(t),g(!0)}}),h&&(0,i.jsx)(gB,{eventId:o,numberOfEmails:u,reload:e.reload,sendAccreditationsEmails:d,onClose:()=>{g(!1)}})]})},_B=()=>{const e=Ti();return(0,i.jsxs)(tb,{direction:"column",children:[(0,i.jsx)(ka,{font:"blueGray900 textXl medium",children:e("accr_ditations_39450")}),(0,i.jsx)(ka,{color:"gray500",children:e("accr_diter_vos_35773")})]})},xB=()=>{const{params:{organizationId:e,eventId:t},translate:n}=bd(),{event:{name:o},localEvent:s,updateLocalEvent:r}=dv();Zc(`${o} ${n("accr_ditations_39450")}`);const{data:a,loader:l,reload:d}=Oi('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"]??re.Desc},[]);return(0,V.useEffect)(()=>{(async()=>{await Promise.all([r({"accredit.filters.accreditationsCategoriesIds":null}),r({"accredit.filters.accreditationsIds":null}),r({"accredit.filters.accreditationsProfilesIds":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)(nb,{children:[(0,i.jsx)(_B,{}),(0,i.jsx)(fB,{event:a.event,organization:a.organization,reload:d})]})},IB=e=>{const t=Ti(),{mutate:n}=function(e={}){return Di("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)(DA,{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()}})},vB=e=>{const{params:{organizationId:t,eventId:n},translate:o}=bd();return(0,i.jsxs)(Jk,{children:[(0,i.jsx)(Xk,{to:Mo.ACCREDITATIONS({organizationId:t,eventId:n}),children:o("accr_ditations_39450")}),(0,i.jsx)(Xk,{isCurrent:!0,to:Mo.ACCREDITATION_CATEGORY({organizationId:t,eventId:n,accreditationCategoryId:e.category.id}),children:e.category.name})]})},bB=({category:e,reload:t})=>{const{history:n,params:{organizationId:o,eventId:s},translate:r}=bd(),a=MN(),{mutate:l}=function(e={}){return Di("mutation AccreditationCategoryDuplicate(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n) {\n accreditationCategoryDuplicate(\n eventId: $eventId\n accreditationCategoryId: $accreditationCategoryId\n ) {\n id\n }\n}\n",e)}(),[d,c]=(0,V.useState)(!1),[u,m]=(0,V.useState)(!1);return(0,i.jsx)(eb,{breadcrumbs:(0,i.jsx)(vB,{category:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mv,{permissions:Ov.ACCREDITATION_EDIT,children:(0,i.jsx)(kd,{color:"white",onClick:()=>m(!0),children:r("_diter_62574")})}),(0,i.jsx)(Mv,{permissions:Ov.ACCREDITATION_EDIT,children:(0,i.jsx)(kd,{onClick:()=>{n.push(fs.CREATE_ACCREDITATION(o,s,e.id))},children:r("add_accreditation")})}),(0,i.jsx)(Mv,{permissions:Ov.ACCREDITATION_EDIT,children:(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"arrow-down-to-bracket",onClick:()=>a(EN,{accreditationsCategoriesIds:[e.id]}),children:r("exporter_les_me_63676")}),(0,i.jsx)(ru,{icon:"copy",onClick:async()=>{const{accreditationCategoryDuplicate:{id:t}}=await l({eventId:s,accreditationCategoryId:e.id});n.push(Mo.ACCREDITATION_CATEGORY({organizationId:o,eventId:s,accreditationCategoryId:t}))},children:r("dupliquer_28256")})]}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>{c(!0)},children:r("supprimer_43083")})})]})]})}),u&&(0,i.jsx)(fF,{accreditationCategory:e,eventId:s,onClose:()=>{m(!1)},onSuccess:t}),d&&(0,i.jsx)(IB,{accreditationCategory:e,eventId:s,onClose:()=>{c(!1)},onSuccess:()=>{n.replace(Mo.ACCREDITATIONS({organizationId:o,eventId:s}))}})]}),name:e.name,subtext:r("accreditation",e.numberOfAccreditations)})},jB=e=>{const{setNodeRef:t,style:n,handleProps:o}=Hm(e.accreditation.id);return(0,i.jsxs)(rd,{ref:t,align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",padding:"$3"},gap:"3",style:n,children:[(0,i.jsx)(ka,{color:"gray300",css:{cursor:"pointer"},...o,children:(0,i.jsx)(Id,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(ka,{css:{flex:"1"},font:"gray900 textSm medium",children:e.accreditation.name})]})},CB=e=>{const{translate:t,params:{eventId:n,accreditationCategoryId:o}}=bd(),{data:s,loader:r}=Oi("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}=xr(),[l,d]=(0,V.useState)([]),[c,u]=(0,V.useState)(!1),m=(0,V.useCallback)(async()=>{u(!0),await Promise.all(l.map((e,t)=>a({eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:Bt.Index,strategy:yt.Replace,value:t}}))),e.onClose(),e.onSuccess(),u(!1)},[n,l,u,a,e.onClose,e.onSuccess]),h=(0,V.useCallback)((e,t)=>{d(Gs(l,e,t))},[l,d]);return(0,V.useEffect)(()=>{d(_g(s.event?.accreditationCategory.accreditations??[]))},[s.event,d]),(0,i.jsx)(zp,{button:(0,i.jsx)(kd,{isLoading:c,onClick:m,children:t("enregistrer_06519")}),category:t("liste_des_accr_02647"),heading:t("changer_l_ordre_11550"),onClose:e.onClose,children:r||(0,i.jsxs)(Op,{css:{background:"white "},children:[(0,i.jsx)(ka,{font:"gray900 textLg semiBold",children:t("organisation_de_45058")}),(0,i.jsx)(Dh,{height:"5"}),(0,i.jsx)(oh,{ids:l.map(e=>e.id),onReorder:h,children:(0,i.jsxs)(rd,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$sm",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(rd,{align:"center",css:{padding:"$4"},gap:"3",children:(0,i.jsx)(ka,{css:{flex:"1"},font:"gray800 textMd medium",children:s.event.accreditationCategory.name})}),(0,i.jsx)(rd,{css:{background:"$gray100",padding:"$4"},direction:"column",gap:"2",children:l.map(e=>(0,i.jsx)(jB,{accreditation:e},e.id))})]})})]})})},yB=()=>{const{params:{organizationId:e,eventId:t,accreditationCategoryId:n},translate:o}=bd(),[s,r,a]=gm(""),[l,d]=(0,V.useState)(0),[c,u]=(0,V.useState)({direction:re.Asc,attribute:Wt.Index}),{data:m,isLoading:h,reload:p}=Oi("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:g(r)?r:void 0,offset:l,sort:c},[]);const{numberOfPages:f,totalCount:_}=ah(m.event?.accreditations),[x,I]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(dm,{filters:(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:o("rechercher_une_65646"),value:s,onChange:a})}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"gear",onClick:()=>I(!0)})}),(0,i.jsx)(bp,{placement:"top",children:o("changer_l_ordre_11550")})]})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fp,{attribute:Wt.Name,setSort:u,sort:c,children:o("AccreditationName")}),(0,i.jsx)(fp,{attribute:Wt.Index,setSort:u,sort:c,children:o("Index")}),(0,i.jsx)(pm,{children:o("number_of_slots_92461")}),(0,i.jsx)(pm,{children:o("type_d_affichag_55093")})]}),numberOfPages:f,offset:l,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):0===m.event.accreditations.totalCount?(0,i.jsxs)(rd,{align:"center",css:{border:"1px solid $gray200",borderTop:"none",py:"$8"},direction:"column",gap:"4",children:[(0,i.jsx)(wj,{color:"primary",icon:"user-group"}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:o("no_accreditations")})]}):m.event.accreditations.nodes.map(n=>(0,i.jsxs)(am,{css:{userSelect:"none"},children:[(0,i.jsx)(Qu,{css:{fontWeight:"$medium"},children:(0,i.jsx)(bm,{to:Mo.ACCREDITATION({organizationId:e,eventId:t,accreditationId:n.id}),children:hg(n)})}),(0,i.jsx)(Qu,{children:n.index??"-"}),(0,i.jsx)(Qu,{children:n.numberOfSlots}),(0,i.jsx)(Qu,{children:o(n.accreditationDisplay)})]},n.id)),setOffset:d,title:o("liste_des_accr_02647"),totalCount:_}),x&&(0,pn.createPortal)((0,i.jsx)(ka,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"200"},height:1,width:1,children:(0,i.jsx)(CB,{onClose:()=>I(!1),onSuccess:p})}),document.body)]})},AB=()=>{const{translate:e,params:{eventId:t,accreditationCategoryId:n}}=bd(),{data:o,loader:s}=Oi("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},[js.AccreditationChartFragment]),[r,a]=(0,V.useState)(),l=(0,V.useMemo)(()=>o.event?.accreditations?.nodes.find(e=>e.id==r),[r]);return s||(0,i.jsx)($k,{select:(0,i.jsx)(rd,{width:.5,children:(0,i.jsxs)(hh,{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:hg(e)},e.id))]})}),title:e("r_partition_du_55091"),children:(0,i.jsx)(rd,{gap:"4",width:1,children:(0,i.jsx)(ka,{height:380,width:1,children:r&&l?(0,i.jsx)(hw,{accreditation:l,slots:l.slots}):(0,i.jsx)(pA,{title:e("vous_allez_retr_26787")})})})})},SB=()=>(0,i.jsx)(Qv,{children:(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[(0,i.jsx)(rd,{width:1,children:(0,i.jsx)(AB,{})}),(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(yB,{})})]})}),kB=({event:e,reload:t})=>{const{params:{organizationId:n,eventId:o,accreditationCategoryId:s},translate:r}=bd();Zc(e.accreditationCategory.name);const a=e=>({organizationId:e?":organizationId":n,eventId:e?":eventId":o,accreditationCategoryId:e?":accreditationCategoryId":s});return(0,i.jsxs)(nb,{children:[(0,i.jsx)(bB,{category:e.accreditationCategory,reload:t}),(0,i.jsxs)(rb,{css:{flex:"1"},children:[(0,i.jsxs)(ob,{css:{px:"$7"},children:[(0,i.jsx)(ib,{path:Mo.ACCREDITATION_CATEGORY_DASHBOARD(a(!1)),children:r("tableau_de_bord_24627")}),(0,i.jsx)(ib,{path:Mo.ACCREDITATION_CATEGORY_MEMBERS(a(!1)),children:r("membres_125561",e.volunteersRegistrations.totalCount)})]}),(0,i.jsx)(sb,{path:Mo.ACCREDITATION_CATEGORY_DASHBOARD(a(!0)),children:(0,i.jsx)(SB,{})}),(0,i.jsx)(sb,{path:Mo.ACCREDITATION_CATEGORY_MEMBERS(a(!0)),children:(0,i.jsx)($L,{accreditationCategoryId:s})})]})]})},wB=()=>{const{params:{organizationId:e,eventId:t,accreditationCategoryId:n}}=bd(),{data:o,loader:s,reload:r}=Oi("query AccreditationsCategory(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n) {\n event(id: $eventId) {\n accreditationCategory(id: $accreditationCategoryId) {\n id\n name\n assignedResources\n numberOfAccreditations\n }\n\n volunteersRegistrations(accreditationsCategoriesIds: [$accreditationCategoryId]) {\n totalCount\n }\n }\n}\n",{eventId:t,accreditationCategoryId:n},[]);return s||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{exact:!0,path:Mo.ACCREDITATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationCategoryId:":accreditationCategoryId"}),children:(0,i.jsx)(Fi,{path:Mo.ACCREDITATION_CATEGORY_DASHBOARD({organizationId:e,eventId:t,accreditationCategoryId:n}),replace:!0})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(kB,{event:o.event,reload:r})})]})};let EB=class extends ic{constructor(e){super(e)}createUpdateAccreditationProfileValuesDefault(e,t){return{accreditationProfile:this.accreditationProfileInputDefault(e,t)}}accreditationProfileInputSchema(){return c.Ik().shape({accreditationProfileCategoryId:c.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")),name:c.Yj().required(this.t("le_nom_de_l_acc_82676")),description:c.Yj(),acronym:c.Yj().nullable(),color:c.Yj().required(this.t("la_couleur_est_95740")),icon:c.Yj().required(this.t("l_ic_ne_est_req_15843")).oneOf(Vn,this.t("l_ic_ne_est_req_15843")),accreditationsSlotsIds:c.YO().of(c.ai()).min(1,this.t("vous_devez_s_le_34381"))})}createUpdateAccreditationProfileSchema(){return c.Ik().shape({accreditationProfile:this.accreditationProfileInputSchema()})}accreditationProfileInputDefault(e,t){let n=e?.accreditationProfileCategoryId??t;return Number.isInteger(n)||(n=null),{accreditationProfileCategoryId:n,name:e?.name??"",description:e?.description??"",acronym:e?.acronym??"",color:e?.color??Ia.colors.primary500.value,icon:e?.icon??le.BadgeCheck,accreditationsSlotsIds:e?.accreditationsSlotsIds??[]}}};EB=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],EB);const TB=e=>{const{translate:t}=bd(),n=Ei(Cm),o=(0,V.useMemo)(()=>Hg(e.accreditation.slots.filter(t=>e.accreditationsSlotsIds.includes(t.id))),[e.accreditation.slots,e.accreditationsSlotsIds]);return(0,i.jsx)(Vj,{accreditation:e.accreditation,displayNumberOfSlots:e.accreditation.hasSlots,displaySlots:e.accreditation.hasSlots,numberOfSlots:o.length,children:(0,i.jsxs)(Hu,{hideBorder:!0,children:[(0,i.jsxs)(Wu,{children:[(0,i.jsx)(pm,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(pm,{children:t("nom_du_cr_neau_54351")})]}),o.map(e=>(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:e.date?n.toLocaleString(e.date,zs.DateOnly.WeekdayShortMonthLong):"-"}),(0,i.jsx)(Qu,{children:g(e.name)?e.name:"-"})]},e.id))]})})},RB=e=>{const t=(0,V.useMemo)(()=>_g(e.category.accreditations.filter(t=>t.slots.some(t=>e.accreditationsSlotsIds.includes(t.id)))),[e.accreditationsSlotsIds,e.category.accreditations]);return(0,i.jsx)(Bj,{category:e.category.name,children:t.map(t=>(0,i.jsx)(TB,{accreditation:t,accreditationsSlotsIds:e.accreditationsSlotsIds},t.id))})},OB=e=>(0,i.jsx)(Lj,{css:{padding:"0"},children:e.categories.map(t=>(0,i.jsx)(RB,{accreditationsSlotsIds:e.accreditationsSlotsIds,category:t},t.id))}),DB=e=>{const{translate:t}=bd(),n=Ei(Cm),o=(0,V.useMemo)(()=>Kg(n,e.accreditationsCategories),[e.accreditationsCategories]),s=(0,V.useMemo)(()=>vj(e.accreditationsCategories.filter(t=>t.accreditations.some(t=>t.slots.some(t=>e.accreditationsSlotsIds.includes(t.id))))),[e.accreditationsCategories,e.accreditationsSlotsIds]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rd,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$6"},width:1,children:Bs(e.accreditationsSlotsIds)?(0,i.jsx)(OB,{accreditationsSlotsIds:e.accreditationsSlotsIds,categories:s}):(0,i.jsxs)(rd,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",padding:"$9 $7"},direction:"column",width:1,children:[(0,i.jsx)(Xv,{color:"white",css:{background:"white",border:"1px solid $gray200",color:"$gray800"},icon:"badge-check",size:"md"}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{font:"gray800 textMd medium",children:t("aucune_accr_dit_40299")})]})}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"accreditationProfile.accreditationsSlotsIds",triggerElem:(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",children:t("AddAccreditations")}),children:o})]})},zB=e=>{const{mutate:t}=function(e={}){return Di("mutation AccreditationProfileCategoryCreate(\n $eventId: EventId!\n $accreditationProfileCategory: AccreditationsProfilesCategoryInput!\n) {\n accreditationProfileCategoryCreate(\n eventId: $eventId\n accreditationProfileCategory: $accreditationProfileCategory\n ) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(iC,{initialName:"",isEdit:!1,mutate:async n=>(await t({eventId:e.eventId,accreditationProfileCategory:{name:n}})).accreditationProfileCategoryCreate,onClose:e.onClose,onSuccess:e.onSuccess})},$B=e=>{const{mutate:t}=function(e={}){return Di("mutation AccreditationProfileCategoryUpdate(\n $eventId: EventId!\n $accreditationProfileCategoryId: AccreditationsProfilesCategoryId!\n $accreditationProfileCategory: AccreditationsProfilesCategoryInput!\n) {\n accreditationProfileCategoryUpdate(\n eventId: $eventId\n accreditationProfileCategoryId: $accreditationProfileCategoryId\n accreditationProfileCategory: $accreditationProfileCategory\n ) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(iC,{initialName:e.accreditationProfileCategory.name,isEdit:!0,mutate:async n=>(await t({eventId:e.eventId,accreditationProfileCategoryId:e.accreditationProfileCategory.id,accreditationProfileCategory:{name:n}})).accreditationProfileCategoryUpdate,onClose:e.onClose,onSuccess:e.onSuccess})},PB=e=>{const{translate:t,params:{eventId:n}}=bd(),[o,s]=(0,V.useState)(!1),[r,a]=(0,V.useState)(vj(e.event.accreditationsProfilesCategories));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ec,{label:t("nom_de_votre_pr_36577"),name:"accreditationProfile.name"}),(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Gp,{isCreateVisible:!0,isSearchVisible:!0,label:t("cat_gorie_00291"),name:"accreditationProfile.accreditationProfileCategoryId",onCreateClick:()=>s(!0),children:r.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(ec,{label:(0,i.jsx)(fI,{children:t("Acronym")}),name:"accreditationProfile.acronym"})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(aj,{label:t("Color"),name:"accreditationProfile.color"}),(0,i.jsx)(mj,{label:t("ic_ne_55554"),name:"accreditationProfile.icon"})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(SI,{label:(0,i.jsx)(fI,{children:t("description_58935")}),name:"accreditationProfile.description"}),o&&(0,i.jsx)(zB,{eventId:n,onClose:()=>s(!1),onSuccess:t=>{a(vj([...r,t])),e.change("accreditationProfile.accreditationProfileCategoryId",t.id)}})]})},MB=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=bd(),{showNotification:r}=HI(),a=Ei(EB),l=Ei(ld),d=(0,V.useRef)(null),c=(0,V.useMemo)(()=>e.isEdit?s("mise_jour_de_17055",e.initialValues.accreditationProfile.name):s("cr_ation_d_un_p_06796"),[e.isEdit,e.initialValues,s]);return Zc(c),(0,i.jsx)(Vd,{customErrorRef:d,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:r,submitting:a,values:l})=>(0,i.jsx)(zp,{button:e.isEdit?(0,i.jsx)(kd,{isLoading:a,onClick:r,children:s("mettre_jour_l_81963")}):null,category:c,color:"dark",fallbackClosePath:gT.ACCREDITATIONS_PROFILES({organizationId:n,eventId:o}),heading:e.isEdit?e.initialValues.accreditationProfile.name:s("nouveau_profil_88612"),children:(0,i.jsxs)(Op,{ref:d,children:[(0,i.jsx)(Nd,{}),(0,i.jsx)(Wp,{heading:s("informations_su_10044"),children:(0,i.jsx)(PB,{change:t.change,event:e.event})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:s("accr_ditations_39450"),subtitle:s("s_lectionnez_le_99366"),children:(0,i.jsx)(DB,{accreditationsCategories:e.event.accreditationsCategories,accreditationsSlotsIds:l.accreditationProfile.accreditationsSlotsIds})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)($p,{children:(0,i.jsx)(kd,{isLoading:a,onClick:r,children:(0,i.jsx)(ka,{textAlign:"center",children:e.isEdit?s("mettre_jour_l_26779"):s("cr_er_le_profil_04447")})})})]})}),validate:l.validateForForm(a.createUpdateAccreditationProfileSchema()),width:1,onSubmit:async i=>{await e.mutate({eventId:o,accreditationProfile:i.accreditationProfile}),r(e.isEdit?s("le_profil_d_acc_43644"):s("le_profil_d_acc_31514")),t.push(gT.ACCREDITATIONS_PROFILES({organizationId:n,eventId:o}))}})},FB=()=>{const{eventId:e,accreditationProfileCategoryId:t}=zi(),n=Ei(EB),{data:o,loader:s}=Oi("query AccreditationProfileEventInfos($eventId: EventId!) {\n event(id: $eventId) {\n ...CreateAccreditationProfileEvent\n }\n}\n",{eventId:e},[js.CreateAccreditationProfileEventFragment]),{mutate:r}=function(e={}){return Di("mutation AccreditationProfileCreate(\n $eventId: EventId!\n $accreditationProfile: AccreditationsProfileInput!\n) {\n accreditationProfileCreate(eventId: $eventId, accreditationProfile: $accreditationProfile) {\n id\n }\n}\n",e)}();return s||(0,i.jsx)(MB,{event:o.event,initialValues:n.createUpdateAccreditationProfileValuesDefault(null,t),isEdit:!1,mutate:async e=>(await r(e)).accreditationProfileCreate.id})},NB=()=>{const{eventId:e,accreditationProfileId:t}=zi(),n=Ei(EB),{data:o,loader:s}=Oi("query AccreditationProfileToEdit(\n $eventId: EventId!\n $accreditationProfileId: AccreditationsProfileId!\n) {\n event(id: $eventId) {\n ...CreateAccreditationProfileEvent\n\n accreditationProfile(id: $accreditationProfileId) {\n name\n description\n acronym\n color\n icon\n accreditationProfileCategoryId\n accreditationsSlotsIds\n }\n }\n}\n",{eventId:e,accreditationProfileId:t},[js.CreateAccreditationProfileEventFragment]),{mutate:r}=function(e={}){return Di("mutation AccreditationProfileUpdate(\n $eventId: EventId!\n $accreditationProfileId: AccreditationsProfileId!\n $accreditationProfile: AccreditationsProfileInput!\n) {\n accreditationProfileUpdate(\n eventId: $eventId\n accreditationProfileId: $accreditationProfileId\n accreditationProfile: $accreditationProfile\n ) {\n id\n }\n}\n",e)}();return s||(0,i.jsx)(MB,{event:o.event,initialValues:n.createUpdateAccreditationProfileValuesDefault(o.event.accreditationProfile,null),isEdit:!0,mutate:async e=>(await r({...e,accreditationProfileId:t})).accreditationProfileUpdate.id})};var LB;let BB=class extends hD{static{LB=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...hD.IMPORT_COLUMNS_DEFAULT,AccreditationProfileCategoryName:"accreditationProfileCategoryName",AccreditationProfileName:"accreditationProfileName",Acronym:"acronym",Color:"color",Icon:"icon",Description:"description"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===jt.Update?[LB.IMPORT_COLUMNS_DEFAULT.Id]:[],LB.IMPORT_COLUMNS_DEFAULT.AccreditationProfileCategoryName,LB.IMPORT_COLUMNS_DEFAULT.AccreditationProfileName];constructor(e,t){super(e,t),this.csvInputService=e}};BB=LB=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[cD,Si])],BB);const VB=({accreditations:e})=>{const{params:{organizationId:t,eventId:n},translate:o}=bd(),s=Ei(Cm),{mutate:r}=function(e={}){return Di("mutation AccreditationsProfilesImport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $input: MappableImportInput!\n) {\n jobId: accreditationsProfilesImport(\n organizationId: $organizationId\n eventId: $eventId\n input: $input\n )\n}\n",e)}(),{checkAccreditationsProfilesImport:a}=HI(),l=(0,V.useCallback)((e,t,n)=>a(e,t,n),[a]),d=(0,V.useMemo)(()=>e.map(e=>({...e,fields:e.slots.map(t=>({id:t.id,slug:`accreditation_slot_${t.id}`,name:qg(s,t,e.name,{accreditation:{includeNameAtEnd:!0}})}))})),[e]);return(0,i.jsx)(aD,{alertDescriptionKey:"pour_ajouter_un_18028",children:(0,i.jsx)(zD,{ImportInputService:BB,additionalCategories:d,checkImport:l,closePath:gT.ACCREDITATIONS_PROFILES({organizationId:t,eventId:n}),customFields:[],heading:o("profils_d_accr_27825"),importTagPrefix:"accreditations-profiles",localStorageKeyPrefix:"ACCREDITATIONS_PROFILES_IMPORT",mutate:r,returnLink:(0,i.jsx)(bm,{to:gT.ACCREDITATIONS_PROFILES({organizationId:t,eventId:n}),children:o("retour_aux_prof_38933")})})})},UB=()=>{const{params:{eventId:e}}=bd(),{data:t,loader:n}=Oi("query AccreditationsProfilesImportInfos($eventId: EventId!) {\n event(id: $eventId) {\n accreditations {\n nodes {\n ...AccreditationImport\n }\n }\n }\n}\n",{eventId:e},[js.AccreditationImportFragment]);return n||(0,i.jsx)(VB,{accreditations:t.event.accreditations.nodes})};var WB;!function(e){e.Accreditation="accreditation",e.Accreditations="accreditations",e.AccreditationProfile="accreditation_profile",e.AccreditationSlot="accreditationSlotId",e.Acronym="acronym",e.Category="category",e.Color="color",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.Description="description",e.Icon="icon",e.IconColor="iconColor",e.Id="id",e.Name="name"}(WB||(WB={}));let GB=class extends Um{constructor(e,t,n){super(e,t,n)}getAccreditationsProfilesFilters(e){const t=this.t("profils_d_accr_27825");return[{slug:WB.Name,name:this.t("nom_08311"),category:t,fieldType:Zt.Text,hideEmpty:!0},{slug:WB.AccreditationProfile,name:this.t("profil_d_accr_d_02274"),category:t,fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},...Bs(e.accreditationsProfilesCategories)?[{slug:WB.Category,name:this.t("cat_gorie_00291"),category:t,fieldType:Zt.Select,values:(0,cm.A)(e.accreditationsProfilesCategories,e=>m(e.name)),hideEmpty:!0}]:[],{slug:WB.Description,name:this.t("Description"),category:t,fieldType:Zt.Text},{slug:WB.Accreditation,name:this.t("Accreditation"),category:t,fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:WB.AccreditationSlot,name:this.t("cr_neaux_accr_d_70934"),category:t,fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:WB.Acronym,name:this.t("Acronym"),category:t,fieldType:Zt.Text},{slug:WB.Color,name:this.t("Color"),category:t,fieldType:Zt.Text,hideEmpty:!0},{slug:WB.Icon,name:this.t("ic_ne_55554"),category:t,fieldType:Zt.Select,values:Vn.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:WB.CreatedBy,name:this.t("cr_e_par_30622"),category:t,fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,organizationId:e.organizationId,eventId:e.id},{slug:WB.CreatedAt,name:this.t("cr_e_le_02658"),category:t,fieldType:Zt.Datetime,hideEmpty:!0}]}getAccreditationsProfilesPossibleColumns(){return[{slug:WB.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,width:100,sortAttribute:ft.Id},{slug:WB.Name,name:this.t("nom_08311"),isSearchable:!0,isSortable:!0,sortAttribute:ft.Name,minWidth:240},{slug:WB.Description,name:this.t("Description"),minWidth:320},{slug:WB.Category,name:this.t("cat_gorie_00291"),isSearchable:!0,isSortable:!0,sortAttribute:ft.Category,minWidth:200},{slug:WB.Accreditations,name:this.t("accr_ditations_39450"),minWidth:320},{slug:WB.Acronym,name:this.t("Acronym"),isSearchable:!0,minWidth:160},{slug:MF.Color,name:this.t("Color"),isSearchable:!0,width:80},{slug:MF.Icon,name:this.t("ic_ne_55554"),width:80},{slug:MF.IconColor,name:this.t("ic_ne_et_couleu_54485"),width:80},{slug:WB.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:WB.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:ft.CreatedAt,minWidth:180}]}};GB=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mm,Cm,Si])],GB);const qB=e=>{const{translate:t,params:{eventId:n}}=bd(),o=Ei(Cm),{data:s,loader:r}=Gr({eventId:n,loadIsBlocked:!1}),[a,l]=(0,V.useState)(!1),[d,c]=(0,V.useState)(yt.Add),[u,m]=(0,V.useState)([]),h=(0,V.useMemo)(()=>s.event?Kg(o,s.event.accreditationsCategories):null,[o,s.event]),g=Bs(u);return(0,i.jsx)(Av,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"badge-check",children:t("accr_ditations_39450")}),(0,i.jsxs)(jv,{gap:"6",children:[(0,i.jsxs)(hh,{label:t("que_souhaitez_v_87607"),value:d,onChange:c,children:[(0,i.jsx)("option",{value:yt.Add,children:t("ajouter_des_acc_17744")}),(0,i.jsx)("option",{value:yt.Replace,children:t("remplacer_les_a_92733")}),(0,i.jsx)("option",{value:yt.Delete,children:t("supprimer_des_a_04246")})]}),r||(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:u,onChange:m,children:h})]}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{disabled:!g,isLoading:a,onClick:async()=>{l(!0),await e.onSuccess(d,u),e.onClose(),l(!1)},children:t("_diter_62574")})})]})})},HB=()=>{const{translate:e,params:{eventId:t}}=bd(),{massActions:n,onMassEditSuccess:o,predicates:s,segment:r}=SC(),{showNotification:a}=HI(),{mutate:l}=Ir(),{mutate:d}=mr(),{mutate:c}=Xa(),[u,m]=(0,V.useState)(!1),[h,p]=(0,V.useState)(!1),[f,_]=(0,V.useState)(!1),x=n.getSelectedsInput(s,null),I=n.isAllSelected?r.count:n.numberOfSelected,v=(0,V.useCallback)(e=>{g(e)&&a(e),o()},[a,o]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kd,{onClick:()=>m(!0),children:e("_diter_une_prop_26724")}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{icon:"badge-check",onClick:()=>p(!0),children:e("_diter_les_accr_86042")})}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>_(!0),children:e("supprimer_43083")})})]})]}),u&&(0,i.jsx)(WA,{eventId:t,mutate:e=>l({eventId:t,massEdit:e}),selecteds:x,onClose:()=>m(!1),onSuccess:t=>v(e("_1_profils_d_a_11729",t))}),h&&(0,i.jsx)(qB,{onClose:()=>p(!1),onSuccess:async(n,i)=>{const{numberOfAccreditationsProfiles:o}=await d({eventId:t,massAccreditations:{accreditationsSlotsIds:i,strategy:n,selecteds:x}});v(e("_1_profils_d_a_11729",o))}}),f&&(0,i.jsx)(DA,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_06203")],text:e("suppression_de_76750",I),onClose:()=>_(!1),onDelete:async()=>{const n=(await c({eventId:t,selecteds:x})).numberOfAccreditationsProfiles;v(e("_1_profils_d_a_94525",n))}})]})},KB=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=bd();return(0,i.jsx)(zz,{children:(0,i.jsx)(Mv,{permissions:Ov.ACCREDITATION_EDIT,children:(0,i.jsx)(dE,{menu:(0,i.jsx)(ru,{icon:"file-import",to:gT.ACCREDITATIONS_PROFILES_IMPORT({organizationId:t,eventId:n}),onClick:e=>eu(e.target),children:e("importer_via_un_61623")}),path:gT.ACCREDITATIONS_PROFILE_CREATE({organizationId:t,eventId:n}),children:e("cr_er_un_profil_01464")})})})},YB=e=>{const{translate:t,params:{eventId:n}}=bd(),{showNotification:o}=HI(),{mutate:s}=Xa();return(0,i.jsx)(DA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_04327"),text:t("suppression_de_73669",e.accreditationProfile.name),onClose:e.onClose,onDelete:async()=>{await s({eventId:n,selecteds:{ids:[e.accreditationProfile.id]}}),o(t("le_profil_d_acc_21890",e.accreditationProfile.name)),e.onSuccess()}})},ZB=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=bd(),{mutate:r}=Ja(),[a,l]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{children:[(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"pen",to:gT.ACCREDITATIONS_PROFILE_EDIT({organizationId:o,eventId:s,accreditationProfileId:e.accreditationProfile.id}),children:n("_diter_62574")}),(0,i.jsx)(ru,{icon:"clone",onClick:async()=>{const{accreditationProfileDuplicate:{id:n}}=await r({eventId:s,accreditationProfileId:e.accreditationProfile.id});t.push(gT.ACCREDITATIONS_PROFILE_EDIT({organizationId:o,eventId:s,accreditationProfileId:n}))},children:n("dupliquer_28256")})]}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:e=>{l(!0),eu(e.target)},children:n("supprimer_43083")})})]}),a&&(0,i.jsx)(YB,{accreditationProfile:e.accreditationProfile,onClose:()=>l(!1),onSuccess:e.reload})]})},XB=e=>{const{translate:t,params:{eventId:n}}=bd(),o=Ei(Cm),{mutate:s}=mr(),{isEditMode:r}=SC(),{isEditMode:a}=ip(),l=r||a,[d,c]=(0,V.useState)(!0),[u,m]=(0,V.useState)(null),h=(0,V.useMemo)(()=>e.accreditationProfile.accreditationsSlots??[],[e.accreditationProfile]),g=(0,V.useMemo)(()=>pg(h),[h]),p=(0,V.useMemo)(()=>h.map(e=>e.id),[h]),f=(0,V.useCallback)(async e=>{if(e&&d){const{event:e}=await qr({eventId:n,loadIsBlocked:!1},await X());m(Kg(o,e.accreditationsCategories)),c(!1)}},[o,n,d]),_=(0,V.useCallback)(async t=>{await s({eventId:n,massAccreditations:{accreditationsSlotsIds:t,selecteds:{ids:[e.accreditationProfile.id]},strategy:yt.Replace}}),e.reload()},[n,e.accreditationProfile.id,e.reload,s]);return l&&e.updatable?(0,i.jsx)(RC,{column:e.column,css:{gap:"$2"},initialValue:p,renderInput:(e,n)=>d?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ju,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:e,onChange:n,children:u}),renderValue:()=>(0,i.jsx)(UC,{badges:g,doNotSort:!0}),onSave:_,onStateChange:f}):(0,i.jsx)(Qu,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:g,doNotSort:!0})})},JB=e=>{const{params:{eventId:t}}=bd(),{mutate:n}=Ir(),o=V.useCallback(async i=>{const o=Ls(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.accreditationProfileId]},slug:s,strategy:yt.Replace,value:r}})}return!0},[e.accreditationProfileId,e.property,n]);return(0,i.jsx)(OC,{column:e.column,initialValue:e.initialValue,mutate:o,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},QB=e=>{const{translate:t}=bd();return(0,i.jsx)(JB,{accreditationProfileId:e.accreditationProfile.id,column:e.column,initialValue:e.accreditationProfile.acronym||"",property:Vt.Acronym,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Qd,{label:t("Acronym"),value:e,onChange:n}),renderValue:e.accreditationProfile.acronym||""})},eV=e=>{const{translate:t,params:{eventId:n}}=bd(),{data:o,loader:s}=Oi("query AccreditationsProfilesCategories($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfilesCategories {\n id\n name\n }\n }\n}\n",{eventId:n},[]);return s?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zd,{children:t("Category")}),(0,i.jsx)(ju,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(hh,{label:t("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:(o.event.accreditationsProfilesCategories??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},tV=e=>{const{organizationId:t,eventId:n}=zi(),{isEditMode:o}=SC(),s=e.accreditationProfileCategory.name;return(0,i.jsx)(JB,{accreditationProfileId:e.accreditationProfileId,column:e.column,initialValue:e.accreditationProfileCategory.id,property:Vt.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(eV,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(Vz,{isEditMode:o,title:s,updatable:!0,children:(0,i.jsx)(bm,{to:gT.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:t,eventId:n,accreditationProfileCategoryId:e.accreditationProfileCategory.id}),children:s})})})},nV=e=>{const{translate:t}=bd();return(0,i.jsx)(JB,{accreditationProfileId:e.accreditationProfile.id,column:e.column,initialValue:e.accreditationProfile.color,property:Vt.Color,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(rj,{label:t("Color"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(rd,{align:"center",gap:"3",width:1,children:(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{css:{background:e.accreditationProfile.color,borderRadius:"2px",height:"24px",width:"24px"},onClick:()=>{TI(e.accreditationProfile.color)}})}),(0,i.jsx)(bp,{placement:"top",children:e.accreditationProfile.color})]})})})},iV=e=>{const{params:{eventId:t}}=bd(),{mutate:n}=Ir(),o=(0,V.useCallback)(i=>n({eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.accreditationProfile.id]},slug:Vt.Description,strategy:yt.Replace,value:i}}),[t,e.accreditationProfile.id,n]);return(0,i.jsx)(X$,{column:e.column,mutate:o,reload:e.reload,text:e.accreditationProfile.description,updatable:e.updatable})},oV=e=>{const{translate:t}=bd();return(0,i.jsx)(JB,{accreditationProfileId:e.accreditationProfile.id,column:e.column,initialValue:e.accreditationProfile.icon,property:Vt.Icon,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(uj,{label:t("Icon"),renderOnPortal:!0,value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Id,{icon:xd(e.accreditationProfile.icon)})})},sV=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>({[Vt.Color]:e.accreditationProfile.color,[Vt.Icon]:e.accreditationProfile.icon}),[e.accreditationProfile]);return(0,i.jsx)(JB,{accreditationProfileId:e.accreditationProfile.id,column:e.column,initialValue:n,property:[Vt.Color,Vt.Icon],reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(rd,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(rj,{label:t("Color"),value:e[Vt.Color],onChange:t=>{n({...e,[Vt.Color]:t})}}),(0,i.jsx)(uj,{label:t("Icon"),renderOnPortal:!0,value:e[Vt.Icon],onChange:t=>{n({...e,[Vt.Icon]:t})}})]}),renderValue:()=>(0,i.jsx)(Xv,{color:e.accreditationProfile.color,icon:e.accreditationProfile.icon})})},rV=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{isEditMode:s}=SC(),r=e.accreditationProfile.name;return(0,i.jsx)(JB,{accreditationProfileId:e.accreditationProfile.id,column:e.column,initialValue:e.accreditationProfile.name,property:Vt.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Qd,{label:t("nom_08311"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Vz,{isEditMode:s,title:r,updatable:!0,children:(0,i.jsx)(bm,{to:gT.ACCREDITATIONS_PROFILE({organizationId:n,eventId:o,accreditationProfileId:e.accreditationProfile.id}),children:(0,i.jsx)(ka,{css:{clamp:2},title:r,children:r})})})})},aV=e=>e.column.slug===WB.Id?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===WB.Name?(0,i.jsx)(rV,{accreditationProfile:e.row,column:e.column,reload:e.reload}):e.column.slug===WB.Description?(0,i.jsx)(iV,{accreditationProfile:e.row,column:e.column,reload:e.reload,updatable:e.canAccreditationEdit}):e.column.slug===WB.Category?(0,i.jsx)(tV,{accreditationProfileCategory:e.row.accreditationProfileCategory,accreditationProfileId:e.row.id,column:e.column,reload:e.reload}):e.column.slug===WB.Accreditations?(0,i.jsx)(XB,{accreditationProfile:e.row,column:e.column,reload:e.reload,updatable:e.canAccreditationEdit}):e.column.slug===WB.Acronym?(0,i.jsx)(QB,{accreditationProfile:e.row,column:e.column,reload:e.reload}):e.column.slug===WB.Color?(0,i.jsx)(nV,{accreditationProfile:e.row,column:e.column,reload:e.reload}):e.column.slug===WB.Icon?(0,i.jsx)(oV,{accreditationProfile:e.row,column:e.column,reload:e.reload}):e.column.slug===WB.IconColor?(0,i.jsx)(sV,{accreditationProfile:e.row,column:e.column,reload:e.reload}):e.column.slug===WB.CreatedBy?(0,i.jsx)(Nz,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===WB.CreatedAt?(0,i.jsx)(Fz,{column:e.column,insertedAt:e.row.insertedAt}):null,lV=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{canAccreditationEdit:s}=Dv(),r=(0,V.useCallback)(()=>{e.reloadAccreditationProfile(e.accreditationProfile.id)},[e.accreditationProfile,e.reloadAccreditationProfile]);return(0,i.jsxs)(am,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},onMouseLeave:e=>{eu(e.target)},children:[s&&(0,i.jsx)(Qu,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:e.state,onClick:(t,n)=>{Gd(n),e.toggleRow(`ap${e.accreditationProfile.id}`,t,n.shiftKey)}})}),e.columns.map(t=>(0,i.jsx)(aV,{canAccreditationEdit:s,column:t,reload:r,row:e.accreditationProfile},t.slug)),s&&(0,i.jsxs)(jm,{justify:"center",children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"pen",to:gT.ACCREDITATIONS_PROFILE_EDIT({organizationId:n,eventId:o,accreditationProfileId:e.accreditationProfile.id})})})}),(0,i.jsx)(bp,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsx)(ZB,{accreditationProfile:e.accreditationProfile,reload:e.reload})]})]})},dV=()=>{const{params:{eventId:e}}=bd(),{canAccreditationEdit:t}=Dv(),{columns:n,columnsSearch:o,limit:s,massActions:r,nameDebounced:a,offset:l,possibleColumns:d,predicates:c,reloadKey:u,setLimit:m,setOffset:h,setSort:p,sort:f}=SC(),_=(0,V.useMemo)(()=>function(e){return{includeAccreditations:e.includes(WB.Accreditations),includeCreatedBy:e.includes(WB.CreatedBy),includeDescription:e.includes(WB.Description)}}(n),[n]),{data:x,isLoading:I,reload:v}=Oi("query AccreditationsProfiles(\n $eventId: EventId!\n $name: String\n $columnsSearch: [String!]\n $predicates: [Predicate!]\n $limit: Int\n $offset: Int\n $sort: AccreditationsProfilesSort\n $includeAccreditations: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n) {\n data: event(id: $eventId) {\n rows: accreditationsProfiles(\n name: $name\n columnsSearch: $columnsSearch\n predicates: $predicates\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...AccreditationsProfilesProfile\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{..._,eventId:e,name:g(a)?a:void 0,columnsSearch:Bs(o)?o:void 0,predicates:c,limit:s,offset:l,sort:f},[js.AccreditationsProfilesProfileFragment]);const{numberOfPages:b,totalCount:j}=ah(x.data?.rows),C=(0,V.useMemo)(()=>n.flatMap(e=>(0,hd.A)([d.find(t=>t.slug===e)])),[d,n]),[y,A]=(0,V.useState)([]),[S,k]=(0,V.useState)({}),w=(0,V.useCallback)(async t=>{k(e=>({...e,[t]:!0}));const{data:{row:n}}=await function(e,t){return Js("query AccreditationsProfilesProfile(\n $eventId: EventId!\n $id: AccreditationsProfileId!\n $includeAccreditations: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n) {\n data: event(id: $eventId) {\n row: accreditationProfile(id: $id) {\n ...AccreditationsProfilesProfile\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[js.AccreditationsProfilesProfileFragment]})}({..._,eventId:e,id:t},await X());A(e=>e.map(e=>e.id===t?n:e)),k(e=>({...e,[t]:!1}))},[_,e,k,A]);return(0,V.useEffect)(()=>{A(x.data?.rows.nodes??[])},[x.data]),(0,V.useEffect)(()=>{u>1&&v()},[u]),(0,V.useEffect)(()=>{r.setStates(Object.fromEntries((x.data?.rows.nodes??[]).map(e=>[`ap${e.id}`,{id:e.id,state:"unchecked"}])))},[x.data,r.setStates]),(0,i.jsx)(rd,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(_p,{"aria-busy":I,headerRow:(0,i.jsxs)(Wu,{children:[t&&(0,i.jsx)(pm,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:r.selectAllState,onClick:r.toggleSelectAll})}),C.map(e=>e.isSortable?(0,i.jsx)(fp,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:p,sort:f,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(pm,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),t&&(0,i.jsx)(pm,{width:100})]}),paginationRow:(0,i.jsx)(lm,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(rm,{limit:s,numberOfPages:b,offset:l,setLimit:m,setOffset:h,showLimits:!0,totalCount:j})}),children:I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):y.map(e=>S[e.id]?(0,i.jsx)(fm,{},e.id):(0,i.jsx)(lV,{accreditationProfile:e,columns:C,reload:v,reloadAccreditationProfile:w,state:r.states[`ap${e.id}`]?.state??"unchecked",toggleRow:r.toggleRow},e.id))})})},cV=e=>{const t=Ti(),{canAccreditationEdit:n,canSegmentEdit:o}=Dv(),{limit:s,segment:r}=SC();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(KB,{}),0===e.numberOfAccreditationsProfiles?(0,i.jsx)(Qv,{css:{overflow:"hidden"},children:(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(pA,{subtitle:"",title:t("vous_n_avez_pas_24880")})})}):(0,i.jsxs)(Qv,{children:[(0,i.jsx)(Oz,{searchRow:(0,i.jsx)(Tz,{actions:(0,i.jsx)(HB,{}),searchPlaceholder:t("rechercher_un_p_31010"),showActions:n,showEditColumns:o,showEditMode:n,showSearchColumns:o}),selectSegment:(0,i.jsx)(wz,{pageSelectedText:t("les_1_profils_27968",s),segmentSelectedText:t("les_1_profils_67546",r.count,r.name)})}),(0,i.jsx)(dV,{})]})]})},uV=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,segmentId:r}}=bd(),{hasPermission:a,localEvent:l,updateLocalEvent:d}=dv(),c=Ei(GB),u=(0,V.useMemo)(()=>c.getAccreditationsProfilesFilters(e.event),[c,e.event]),m=(0,V.useMemo)(()=>c.getAccreditationsProfilesPossibleColumns(),[c]);return(0,i.jsx)(kz,{canSegmentEdit:a(Ov.SEGMENT_EDIT),eventId:s,filters:u,filtersButtonText:n("filtrer_les_pro_86372"),filtersSubtitle:n("appliquer_des_f_18351"),getSegmentPath:e=>gT.ACCREDITATIONS_PROFILES_SEGMENT({organizationId:o,eventId:s,segmentId:e}),hideSegments:0===e.event.numberOfAccreditationsProfiles,initialLimit:l?.accreditationsProfilesLimit??em,initialSegmentsOpen:l?.areAccreditationsProfilesSegmentsOpen??!0,organizationId:o,possibleColumns:m,possibleRenderings:[],reload:e.reload,segmentId:r,segmentType:Me.AccreditationsProfiles,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{d({accreditationsProfilesLimit:e})},onSegmentClick:e=>{d({accreditationsProfilesSegmentId:e})},onSegmentDelete:async()=>{await d({accreditationsProfilesSegmentId:null}),t.replace(gT.ACCREDITATIONS_PROFILES({organizationId:o,eventId:s}))},onSegmentsToggle:async e=>{await d({areAccreditationsProfilesSegmentsOpen:e})},children:(0,i.jsx)(cV,{numberOfAccreditationsProfiles:e.event.numberOfAccreditationsProfiles})})},mV=()=>{const{params:{organizationId:e,eventId:t},translate:n}=bd(),{event:{name:o},localEvent:s}=dv();Zc(`${o} ${n("profils_d_accr_27825")}`);const{data:r,loader:a,reload:l}=Oi("query AccreditationsProfilesSegments($eventId: EventId!) {\n event(id: $eventId) {\n id\n organizationId\n numberOfAccreditationsProfiles\n\n accreditationsProfilesCategories {\n id\n name\n }\n\n segmentsFolders(segmentType: AccreditationsProfiles) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{eventId:t},[js.SegmentsFoldersSegmentsFragment]),d=(0,V.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:gT.ACCREDITATIONS_PROFILES_SEGMENT({organizationId:":organizationId",eventId:":eventId",segmentId:":segmentId"}),children:(0,i.jsx)(uV,{event:r.event,reload:l})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:gT.ACCREDITATIONS_PROFILES_SEGMENT({organizationId:e,eventId:t,segmentId:s?.accreditationsProfilesSegmentId&&d.includes(s.accreditationsProfilesSegmentId)?s.accreditationsProfilesSegmentId:d[0]}),replace:!0})})]})},hV=()=>{const{hasFeature:e}=_v();return e(Ae.Accreditation)?(0,i.jsx)(mV,{}):(0,i.jsx)(rd,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(kx,{icon:"badge-check"})})},gV=e=>{const{params:{organizationId:t,eventId:n,accreditationProfileId:o},translate:s}=bd();return(0,i.jsxs)(Jk,{children:[(0,i.jsx)(Xk,{to:gT.ACCREDITATIONS_PROFILES({organizationId:t,eventId:n}),children:s("profils_d_accr_27825")}),(0,i.jsx)(Xk,{to:gT.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:t,eventId:n,accreditationProfileCategoryId:e.accreditationProfile.accreditationProfileCategory.id}),children:e.accreditationProfile.accreditationProfileCategory.name}),(0,i.jsx)(Xk,{isCurrent:!0,to:gT.ACCREDITATIONS_PROFILE({organizationId:t,eventId:n,accreditationProfileId:o}),children:e.accreditationProfile.name})]})},pV=({accreditationProfile:e})=>{const{history:t,params:{organizationId:n,eventId:o,accreditationProfileId:s},translate:r}=bd(),{mutate:a}=Ja(),[l,d]=(0,V.useState)(!1);return(0,i.jsx)(eb,{acronym:e.acronym,breadcrumbs:(0,i.jsx)(gV,{accreditationProfile:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mv,{permissions:Ov.ACCREDITATION_EDIT,children:(0,i.jsx)(kd,{to:gT.ACCREDITATIONS_PROFILE_EDIT({organizationId:n,eventId:o,accreditationProfileId:s}),children:r("_diter_62574")})}),(0,i.jsx)(Mv,{permissions:Ov.ACCREDITATION_EDIT,children:(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{icon:"clone",onClick:async()=>{const{accreditationProfileDuplicate:{id:e}}=await a({eventId:o,accreditationProfileId:s});t.push(gT.ACCREDITATIONS_PROFILE_EDIT({organizationId:n,eventId:o,accreditationProfileId:e}))},children:r("dupliquer_28256")})}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:e=>{eu(e.target),d(!0)},children:r("supprimer_43083")})})]})]})}),l&&(0,i.jsx)(YB,{accreditationProfile:e,onClose:()=>d(!1),onSuccess:()=>t.replace(gT.ACCREDITATIONS_PROFILES({organizationId:n,eventId:o}))})]}),color:e.color,icon:e.icon,name:e.name,subtext:r("accreditation",e.accreditationsSlots.length)})},fV=e=>{const{params:{organizationId:t,eventId:n},translate:o}=bd(),s=Ei(Cm),r=(0,V.useMemo)(()=>(0,cm.A)(e.accreditationsSlots,[e=>e.accreditation.name,e=>e.date?.toMillis()??0]),[e.accreditationsSlots]);return(0,i.jsx)(dm,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:o("AccreditationName")}),(0,i.jsx)(pm,{children:o("nom_du_cr_neau_54351")}),(0,i.jsx)(pm,{children:o("cat_gorie_00291")})]}),rows:0===r.length?(0,i.jsxs)(rd,{align:"center",css:{border:"1px solid $gray200",borderTop:"none",py:"$8"},direction:"column",gap:"4",children:[(0,i.jsx)(wj,{color:"primary",icon:"badge-check"}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:o("no_accreditations")})]}):r.map(e=>(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{css:{fontWeight:"$medium"},children:(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(Xv,{color:e.accreditation.color,icon:e.accreditation.icon,size:"sm"}),(0,i.jsx)(bm,{to:Mo.ACCREDITATION({organizationId:t,eventId:n,accreditationId:e.accreditation.id}),children:e.accreditation.name})]})}),(0,i.jsx)(Qu,{children:g(e.name)||e.date?qg(s,e,e.accreditation.name,{date:{localeFormat:zs.DateOnly.WeekdayLongMonthLong}}):"-"}),(0,i.jsx)(Qu,{children:(0,i.jsx)(bm,{to:Mo.ACCREDITATION_CATEGORY({organizationId:t,eventId:n,accreditationCategoryId:e.accreditation.accreditationCategoryId}),children:e.accreditation.accreditationCategoryName})})]},e.id)),title:o("accr_ditations_39450"),totalCount:r.length})},_V=e=>{const{params:{organizationId:t,eventId:n,accreditationProfileId:o},translate:s}=bd();Zc(e.event.accreditationProfile.name);const r=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":n,accreditationProfileId:e?":accreditationProfileId":o});return(0,i.jsxs)(nb,{children:[(0,i.jsx)(pV,{accreditationProfile:e.event.accreditationProfile}),(0,i.jsxs)(rb,{css:{flex:"1"},children:[(0,i.jsxs)(ob,{css:{px:"$7"},children:[(0,i.jsx)(ib,{path:gT.ACCREDITATIONS_PROFILE_DASHBOARD(r(!1)),children:s("tableau_de_bord_24627")}),(0,i.jsx)(ib,{path:gT.ACCREDITATIONS_PROFILE_MEMBERS(r(!1)),children:s("membres_125561",e.event.volunteersRegistrations.totalCount)})]}),(0,i.jsx)(sb,{path:gT.ACCREDITATIONS_PROFILE_DASHBOARD(r(!0)),children:(0,i.jsx)(Qv,{children:(0,i.jsx)(fV,{accreditationsSlots:e.event.accreditationProfile.accreditationsSlots})})}),(0,i.jsx)(sb,{path:gT.ACCREDITATIONS_PROFILE_MEMBERS(r(!0)),children:(0,i.jsx)($L,{accreditationProfileId:o})})]})]})},xV=()=>{const{params:{organizationId:e,eventId:t,accreditationProfileId:n}}=bd(),{data:o,loader:s}=Oi("query AccreditationsProfile(\n $eventId: EventId!\n $accreditationProfileId: AccreditationsProfileId!\n) {\n event(id: $eventId) {\n accreditationProfile(id: $accreditationProfileId) {\n id\n name\n acronym\n color\n icon\n\n accreditationProfileCategory {\n id\n name\n }\n\n accreditationsSlots {\n id\n name\n date\n\n accreditation {\n id\n name\n acronym\n color\n icon\n accreditationCategoryId\n accreditationCategoryName\n }\n }\n }\n\n volunteersRegistrations(accreditationsProfilesIds: [$accreditationProfileId]) {\n totalCount\n }\n }\n}\n",{eventId:t,accreditationProfileId:n},[]);return s||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{exact:!0,path:gT.ACCREDITATIONS_PROFILE({organizationId:":organizationId",eventId:":eventId",accreditationProfileId:":accreditationProfileId"}),children:(0,i.jsx)(Fi,{path:gT.ACCREDITATIONS_PROFILE_DASHBOARD({organizationId:e,eventId:t,accreditationProfileId:n}),replace:!0})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(_V,{event:o.event})})]})},IV=e=>{const t=Ti(),{mutate:n}=function(e={}){return Di("mutation AccreditationProfileCategoryDelete(\n $eventId: EventId!\n $accreditationProfileCategoryId: AccreditationsProfilesCategoryId!\n) {\n accreditationProfileCategoryDelete(\n eventId: $eventId\n accreditationProfileCategoryId: $accreditationProfileCategoryId\n ) {\n id\n }\n}\n",e)}();return(0,i.jsx)(DA,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_50954"),t("cela_supprimera_01527")],text:t("suppression_de_73669",e.accreditationProfileCategory.name),onClose:e.onClose,onDelete:async()=>{await n({eventId:e.eventId,accreditationProfileCategoryId:e.accreditationProfileCategory.id}),e.onSuccess()}})},vV=e=>{const{params:{organizationId:t,eventId:n},translate:o}=bd();return(0,i.jsxs)(Jk,{children:[(0,i.jsx)(Xk,{to:gT.ACCREDITATIONS_PROFILES({organizationId:t,eventId:n}),children:o("profils_d_accr_27825")}),(0,i.jsx)(Xk,{isCurrent:!0,to:gT.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:t,eventId:n,accreditationProfileCategoryId:e.category.id}),children:e.category.name})]})},bV=({category:e,reload:t})=>{const{history:n,params:{organizationId:o,eventId:s},translate:r}=bd(),{mutate:a}=function(e={}){return Di("mutation AccreditationProfileCategoryDuplicate(\n $eventId: EventId!\n $accreditationProfileCategoryId: AccreditationsProfilesCategoryId!\n) {\n accreditationProfileCategoryDuplicate(\n eventId: $eventId\n accreditationProfileCategoryId: $accreditationProfileCategoryId\n ) {\n id\n }\n}\n",e)}(),[l,d]=(0,V.useState)(!1),[c,u]=(0,V.useState)(!1);return(0,i.jsx)(eb,{breadcrumbs:(0,i.jsx)(vV,{category:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mv,{permissions:Ov.ACCREDITATION_EDIT,children:(0,i.jsx)(kd,{color:"white",onClick:()=>u(!0),children:r("_diter_62574")})}),(0,i.jsx)(Mv,{permissions:Ov.ACCREDITATION_EDIT,children:(0,i.jsx)(kd,{onClick:()=>{n.push(gT.ACCREDITATIONS_PROFILE_CREATE({organizationId:o,eventId:s,accreditationProfileCategoryId:e.id}))},children:r("cr_er_un_profil_01464")})}),(0,i.jsx)(Mv,{permissions:Ov.ACCREDITATION_EDIT,children:(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{icon:"copy",onClick:async()=>{const{accreditationProfileCategoryDuplicate:{id:t}}=await a({eventId:s,accreditationProfileCategoryId:e.id});n.push(gT.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:o,eventId:s,accreditationProfileCategoryId:t}))},children:r("dupliquer_28256")})}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>{d(!0)},children:r("supprimer_43083")})})]})]})}),c&&(0,i.jsx)($B,{accreditationProfileCategory:e,eventId:s,onClose:()=>{u(!1)},onSuccess:t}),l&&(0,i.jsx)(IV,{accreditationProfileCategory:e,eventId:s,onClose:()=>{d(!1)},onSuccess:()=>{n.replace(gT.ACCREDITATIONS_PROFILES({organizationId:o,eventId:s}))}})]}),name:e.name,subtext:r("_1_profil_d_ac_37871",e.numberOfAccreditationsProfiles)})},jV=()=>{const{params:{organizationId:e,eventId:t,accreditationProfileCategoryId:n},translate:o}=bd(),[s,r,a]=gm(""),[l,d]=(0,V.useState)(0),[c,u]=(0,V.useState)({direction:re.Asc,attribute:ft.Name}),{data:m,isLoading:h}=Oi("query AccreditationsProfilesCategoryProfiles(\n $eventId: EventId!\n $accreditationProfileCategoryId: AccreditationsProfilesCategoryId\n $name: String\n $offset: Int\n $sort: AccreditationsProfilesSort\n) {\n event(id: $eventId) {\n accreditationsProfiles(\n accreditationProfileCategoryId: $accreditationProfileCategoryId\n name: $name\n limit: 25\n offset: $offset\n sort: $sort\n ) {\n nodes {\n id\n name\n acronym\n color\n icon\n\n accreditationsSlots {\n id\n }\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:t,accreditationProfileCategoryId:n,name:g(r)?r:void 0,offset:l,sort:c},[]);const{numberOfPages:p,totalCount:f}=ah(m.event?.accreditationsProfiles);return(0,i.jsx)(dm,{filters:(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:o("rechercher_un_p_37681"),value:s,onChange:a})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fp,{attribute:ft.Name,setSort:u,sort:c,children:o("nom_08311")}),(0,i.jsx)(pm,{children:o("Acronym")}),(0,i.jsx)(pm,{children:o("number_of_slots_92461")})]}),numberOfPages:p,offset:l,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):0===m.event.accreditationsProfiles.totalCount?(0,i.jsxs)(rd,{align:"center",css:{border:"1px solid $gray200",borderTop:"none",py:"$8"},direction:"column",gap:"4",children:[(0,i.jsx)(wj,{color:"primary",icon:"badge-check"}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:o("aucun_profil_d_17112")})]}):m.event.accreditationsProfiles.nodes.map(n=>(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{css:{fontWeight:"$medium"},children:(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(Xv,{color:n.color,icon:n.icon,size:"sm"}),(0,i.jsx)(bm,{to:gT.ACCREDITATIONS_PROFILE({organizationId:e,eventId:t,accreditationProfileId:n.id}),children:n.name})]})}),(0,i.jsx)(Qu,{children:n.acronym||"-"}),(0,i.jsx)(Qu,{children:n.accreditationsSlots.length})]},n.id)),setOffset:d,title:o("liste_des_profi_29615"),totalCount:f})},CV=({event:e,reload:t})=>{const{params:{organizationId:n,eventId:o,accreditationProfileCategoryId:s},translate:r}=bd();Zc(e.accreditationProfileCategory.name);const a=e=>({organizationId:e?":organizationId":n,eventId:e?":eventId":o,accreditationProfileCategoryId:e?":accreditationProfileCategoryId":s});return(0,i.jsxs)(nb,{children:[(0,i.jsx)(bV,{category:e.accreditationProfileCategory,reload:t}),(0,i.jsxs)(rb,{css:{flex:"1"},children:[(0,i.jsxs)(ob,{css:{px:"$7"},children:[(0,i.jsx)(ib,{path:gT.ACCREDITATIONS_PROFILE_CATEGORY_DASHBOARD(a(!1)),children:r("tableau_de_bord_24627")}),(0,i.jsx)(ib,{path:gT.ACCREDITATIONS_PROFILE_CATEGORY_MEMBERS(a(!1)),children:r("membres_125561",e.volunteersRegistrations.totalCount)})]}),(0,i.jsx)(sb,{path:gT.ACCREDITATIONS_PROFILE_CATEGORY_DASHBOARD(a(!0)),children:(0,i.jsx)(Qv,{children:(0,i.jsx)(jV,{})})}),(0,i.jsx)(sb,{path:gT.ACCREDITATIONS_PROFILE_CATEGORY_MEMBERS(a(!0)),children:(0,i.jsx)($L,{accreditationProfileCategoryId:s})})]})]})},yV=()=>{const{params:{organizationId:e,eventId:t,accreditationProfileCategoryId:n}}=bd(),{data:o,loader:s,reload:r}=Oi("query AccreditationsProfilesCategory(\n $eventId: EventId!\n $accreditationProfileCategoryId: AccreditationsProfilesCategoryId!\n) {\n event(id: $eventId) {\n accreditationProfileCategory(id: $accreditationProfileCategoryId) {\n id\n name\n numberOfAccreditationsProfiles\n }\n\n volunteersRegistrations(\n accreditationsProfilesCategoriesIds: [$accreditationProfileCategoryId]\n ) {\n totalCount\n }\n }\n}\n",{eventId:t,accreditationProfileCategoryId:n},[]);return s||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{exact:!0,path:gT.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationProfileCategoryId:":accreditationProfileCategoryId"}),children:(0,i.jsx)(Fi,{path:gT.ACCREDITATIONS_PROFILE_CATEGORY_DASHBOARD({organizationId:e,eventId:t,accreditationProfileCategoryId:n}),replace:!0})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(CV,{event:o.event,reload:r})})]})},AV=e=>(0,i.jsx)(Qv,{children:(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[(0,i.jsxs)(rd,{gap:"6",width:1,children:[(0,i.jsx)(QN,{assignedResources:e.accreditationSlot.assignedResources,maxResources:e.accreditationSlot.maxResources}),(0,i.jsx)(YN,{accreditationCategoryId:e.accreditationSlot.accreditation.accreditationCategoryId,accreditationCategoryName:e.accreditationSlot.accreditation.accreditationCategoryName,accreditationName:e.accreditationSlot.accreditation.name,color:e.accreditationSlot.accreditation.color,customFields:e.customFields,fields:e.accreditationSlot.accreditation.fields,icon:e.accreditationSlot.accreditation.icon,numberOfDaysLimit:e.accreditationSlot.accreditation.numberOfDaysLimit,weezeventChecklistId:e.accreditationSlot.weezeventChecklistId,weezeventOrganizationId:e.weezeventOrganizationId})]}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsxs)(rd,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(JN,{customFields:e.accreditationSlot.accreditation.accreditationsCustomFields}),(0,i.jsx)(Kk,{tags:e.accreditationSlot.accreditation.tags}),(0,i.jsx)(Wk,{privateNote:e.accreditationSlot.accreditation.privateNote})]}),(0,i.jsxs)(rd,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Uk,{description:e.accreditationSlot.accreditation.description}),(0,i.jsx)(eL,{location:e.accreditationSlot.accreditation})]})]})]})}),SV=e=>{const{params:{organizationId:t,eventId:n,accreditationId:o,accreditationSlotId:s},translate:r}=bd(),a=Ei(Cm),l=(0,V.useMemo)(()=>qg(a,e.slot,e.slot.accreditation.name,{date:{localeFormat:zs.DateOnly.WeekdayLongMonthLong}}),[e.slot]);return(0,i.jsxs)(Jk,{children:[(0,i.jsx)(Xk,{to:Mo.ACCREDITATIONS({organizationId:t,eventId:n}),children:r("accr_ditations_39450")}),(0,i.jsx)(Xk,{to:Mo.ACCREDITATION_CATEGORY({organizationId:t,eventId:n,accreditationCategoryId:e.slot.accreditation.accreditationCategoryId}),children:e.slot.accreditation.accreditationCategoryName}),(0,i.jsx)(Xk,{to:Mo.ACCREDITATION({organizationId:t,eventId:n,accreditationId:o}),children:e.slot.accreditation.name}),(0,i.jsx)(Xk,{isCurrent:!0,to:Mo.ACCREDITATION_SLOT({organizationId:t,eventId:n,accreditationId:o,accreditationSlotId:s}),children:l})]})},kV=e=>{const{history:t,params:{organizationId:n,eventId:o,accreditationId:s},translate:r}=bd(),{user:a}=Li(),l=MN(),{mutate:d}=Za(),[c,u]=(0,V.useState)(!1),m=Ei(Cm),h=(0,V.useMemo)(()=>qg(m,e.slot,e.slot.accreditation.name,{accreditation:{includeNameAtEnd:!0},date:{localeFormat:zs.DateOnly.WeekdayLongMonthLong}}),[e.slot]);return(0,i.jsx)(eb,{acronym:e.slot.accreditation.acronym,breadcrumbs:(0,i.jsx)(SV,{slot:e.slot}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kd,{to:fs.EDIT_ACCREDITATION(n,o,s),children:r("_diter_62574")}),(0,i.jsx)(Mv,{permissions:Ov.ACCREDITATION_EDIT,children:(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"arrow-down-to-bracket",onClick:()=>l(EN,{accreditationsSlotsIds:[e.slot.id]}),children:r("exporter_les_me_63676")}),Eg(n)&&(0,i.jsx)(ru,{icon:"arrow-down-to-bracket",target:"_blank",to:gf(e.slot.links.asoPaxManifestLink,"pdf",{lang:a?.language}),children:"PAX Manifest"})]}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:e.slot.assignedResources>0?"disabled":"red",icon:"trash-can",onClick:e=>{eu(e.target),u(!0)},children:r("supprimer_43083")})})]})]})}),c&&(0,i.jsx)(DA,{buttonText:r("supprimer_43083"),subtext:[r("_tes_vous_s_r_d_48876")],text:r("suppression_de_73669",h),onClose:()=>u(!1),onDelete:async()=>{await d({eventId:o,accreditationSlotId:e.slot.id}),t.replace(Mo.ACCREDITATION({organizationId:n,eventId:o,accreditationId:s}))}})]}),color:e.slot.accreditation.color,icon:e.slot.accreditation.icon,name:h})},wV=e=>{const{params:{organizationId:t,eventId:n,accreditationId:o,accreditationSlotId:s},translate:r}=bd();Zc(qg(Ei(Cm),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)(nb,{children:[(0,i.jsx)(kV,{slot:e.event.accreditationSlot}),(0,i.jsxs)(rb,{css:{flex:"1"},children:[(0,i.jsxs)(ob,{css:{px:"$7"},children:[(0,i.jsx)(ib,{path:Mo.ACCREDITATION_SLOT_DASHBOARD(a(!1)),children:r("tableau_de_bord_24627")}),(0,i.jsx)(ib,{path:Mo.ACCREDITATION_SLOT_MEMBERS(a(!1)),children:r("membres_125561",e.event.volunteersRegistrations.totalCount)})]}),(0,i.jsx)(sb,{path:Mo.ACCREDITATION_SLOT_DASHBOARD(a(!0)),children:(0,i.jsx)(AV,{accreditationSlot:e.event.accreditationSlot,customFields:e.organization.customFields.nodes,weezeventOrganizationId:e.organization.weezeventOrganizationId})}),(0,i.jsx)(sb,{path:Mo.ACCREDITATION_SLOT_MEMBERS(a(!0)),children:(0,i.jsx)($L,{accreditationSlotId:s})})]})]})},EV=()=>{const{params:{organizationId:e,eventId:t,accreditationId:n,accreditationSlotId:o}}=bd(),{data:s,loader:r}=Oi("query AccreditationsSlot(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $accreditationSlotId: AccreditationsSlotId!\n) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(eventId: $eventId, 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 weezeventChecklistId\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 numberOfDaysLimit\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 links {\n asoPaxManifestLink\n }\n }\n\n volunteersRegistrations(accreditationsSlotsIds: [$accreditationSlotId]) {\n totalCount\n }\n }\n}\n",{organizationId:e,eventId:t,accreditationSlotId:o},[js.CustomFieldWithConditionFragment]);return r||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{exact:!0,path:Mo.ACCREDITATION_SLOT({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId",accreditationSlotId:":accreditationSlotId"}),children:(0,i.jsx)(Fi,{path:Mo.ACCREDITATION_SLOT_DASHBOARD({organizationId:e,eventId:t,accreditationId:n,accreditationSlotId:o}),replace:!0})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(wV,{event:s.event,organization:s.organization})})]})},TV=V.createContext({}),RV=e=>{const t=Pi(),[n,o]=V.useState(e.positionsIds),[s,r]=V.useState(e.positionsCategoriesIds),[a,l]=V.useState(e.positionsSlotsIds);return(0,i.jsx)(TV.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 OV(){return V.useContext(TV)}const DV=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=bd(),{isPreAssign:r,positionsIds:a,positionsCategoriesIds:l,positionsSlotsIds:d,showNextVolunteer:c}=OV(),{mutate:u,isLoading:m}=Qr(),{mutate:h,isLoading:g}=Yl(),{mutate:p,isLoading:f}=function(e={}){return Di("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:_,isLoading:x}=ta(),I=(0,V.useCallback)(()=>{e.isEdit?t.goBack(fs.ASSIGNMENTS(n,o)):c()},[e.isEdit,c]);return(0,i.jsxs)(rd,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,width:1,children:[(0,i.jsx)(ka,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{m||g||f||x||(await p({eventId:o,volunteerRegistrationId:e.volunteerRegistrationId}),I())},children:s("refuser_92819")}),(0,i.jsx)(ka,{css:{flex:"1"}}),(0,i.jsx)(kd,{color:"primary",isLoading:m||g,onClick:async()=>{r?(!Bs(a)||m||g||f||x||(await h({eventId:o,massPreAssign:{level:Lt.Positions,positionsIds:a,positionsCategoriesIds:[],selecteds:{ids:[e.userInfoId]},strategy:yt.Replace}}),I()),!Bs(l)||m||g||f||x||(await h({eventId:o,massPreAssign:{level:Lt.Categories,positionsIds:[],positionsCategoriesIds:l,selecteds:{ids:[e.userInfoId]},strategy:yt.Replace}}),I())):m||g||f||x||(Bs(d)?await u({eventId:o,massAssign:{positionsSlotsIds:d,selecteds:{ids:[e.userInfoId]},strategy:yt.Replace}}):await _({eventId:o,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:ve.WaitingAssignment}}),I())},children:e.isEdit?s("mettre_jour_l_30423"):s(r?"pr_affecter_17434":"affecter_94255")}),(0,i.jsx)(kd,{color:"white",onClick:I,children:e.isEdit?s("annuler_48254"):s("affecter_plus_t_97778")})]})},zV=e=>{const[t,n]=V.useState(e.initialIsOpen);return(0,i.jsxs)(rd,{css:{bd:!0,userSelect:"none",...e.css},direction:"column",width:1,children:[(0,i.jsxs)(rd,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsx)(ka,{css:{flex:"1"},children:e.header}),(0,i.jsx)(kd,{color:"white",leftIcon:t?"chevron-up":"chevron-down",size:"sm",onClick:()=>{n(!t)}})]}),t&&(0,i.jsx)(rd,{css:{background:"$gray100",padding:"$6"},direction:"column",children:e.children})]})},$V=e=>{const t=Ti(),n=e.assignedResources/e.neededResources;return(0,i.jsxs)(rd,{css:{background:"white",bd:!0,cursor:"pointer",userSelect:"none"},direction:"column",width:1,onClick:e.onClick,children:[(0,i.jsxs)(rd,{align:"center",css:{padding:"$3 $5"},width:1,children:[(0,i.jsx)(wu,{shouldPreventDefault:!1,state:e.isSelected?"checked":"unchecked",onClick:hc.A}),(0,i.jsx)(md,{width:"4"}),(0,i.jsx)(Xv,{color:e.color,icon:e.icon}),(0,i.jsx)(md,{width:"3"}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[g(e.category)&&(0,i.jsx)(ka,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:e.category}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"semiBold",children:e.title}),(0,i.jsx)(ka,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(md,{width:"2"}),(0,i.jsx)(ka,{color:"gray700",fontSize:"textXs",children:(0,i.jsx)(Id,{icon:"user-group"})}),(0,i.jsx)(md,{width:"2"}),(0,i.jsxs)(ka,{color:"gray700",children:[e.assignedResources,"/",e.neededResources]}),(0,i.jsx)(md,{width:"6"}),(0,i.jsx)(ka,{width:120,children:(0,i.jsx)(u$,{percent:n})}),(0,i.jsx)(md,{width:"3"}),(0,i.jsxs)(ka,{color:"gray700",textAlign:"end",width:36,children:[Math.min(100,Math.round(100*n)),"%"]})]}),(0,i.jsxs)(rd,{css:{borderTop:"1px solid $gray200",padding:"$3 $6","&:empty":{display:"none"}},children:[e.overlaps&&(0,i.jsx)(vu,{color:"warning",leftIcon:"triangle-exclamation",children:t("ce_cr_neau_en_c_55775")}),e.teamMembers]})]})},PV=e=>{const t=Ti(),n=Ei(Yh),{positionsIds:o,positionsCategoriesIds:s,setPositionsIds:r,setPositionsCategoriesIds:a}=OV(),l=()=>{a(Ws(s,e.category.id))};return(0,i.jsx)(zV,{css:{background:"white"},header:(0,i.jsxs)(rd,{align:"center",children:[(0,i.jsx)(wu,{state:s.includes(e.category.id)?"checked":"unchecked",onClick:l}),(0,i.jsx)(md,{width:"3"}),(0,i.jsx)(ka,{color:"gray800",css:{cursor:"pointer"},fontSize:"textMd",fontWeight:"medium",onClick:l,children:e.category.name}),(0,i.jsx)(md,{width:"3"}),(0,i.jsx)(vu,{color:"warning",size:"md",children:t("_1_membre_manq_31014",e.category.resources)}),(0,i.jsx)(md,{width:"3"}),(0,i.jsx)(ka,{css:{flex:"1"}})]}),initialIsOpen:!0,children:(0,i.jsx)(rd,{css:{background:"$gray100"},direction:"column",gap:"2",children:e.category.positions.map(e=>(0,i.jsx)($V,{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(Ws(o,e.id))}},e.id))})})},MV=e=>{const t=Ti(),n=(0,V.useMemo)(()=>function(e,t,n,i,o,s){const{wishedPositionsSlots:r,possiblePositionsSlots:a,otherPositionsSlots:l}=sg(e,t,n,i,o,s),d=new Set,c=e=>Object.values((0,Vu.A)(e,e=>e.positionCategory.id)).flatMap(e=>{const t=Object.values((0,Vu.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)(ka,{font:"gray900 textMd medium",children:t("cat_gorie_mis_36044",n.wishedPositionsCategories.length)}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("cat_gories_ou_m_71206")}),(0,i.jsx)(md,{height:"3"}),n.wishedPositionsCategories.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(PV,{category:e}),(0,i.jsx)(md,{height:"3"})]},e.id)),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{font:"gray900 textMd medium",children:t("autre_cat_gorie_21569",n.possiblePositionsCategories.length)}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("cat_gories_ou_m_50063")}),(0,i.jsx)(md,{height:"3"}),n.possiblePositionsCategories.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(PV,{category:e}),(0,i.jsx)(md,{height:"3"})]},e.id)),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{font:"gray900 textMd medium",children:t("autre_cat_gorie_64824",n.otherPositionsCategories.length)}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("cat_gories_ou_m_74482")}),(0,i.jsx)(md,{height:"3"}),n.otherPositionsCategories.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(PV,{category:e}),(0,i.jsx)(md,{height:"3"})]},e.id))]})},FV=e=>{const{translate:t}=bd(),{isPreAssign:n,teams:o}=OV(),s=(0,V.useMemo)(()=>!n&&Bs(o)?o.flatMap(t=>t.members.flatMap(t=>t.positionsSlotsUsersInfos.map(e=>e.positionSlotId).includes(e.positionSlotId)?[t.userInfo]:[])):[],[n,o,e.positionSlotId]);return Bs(s)?(0,i.jsxs)(rd,{align:"center",css:{marginLeft:"auto"},gap:"1",children:[(0,i.jsx)(My,{teamMembers:s}),(0,i.jsx)(ka,{font:"gray800 textXs regular",children:t("_1_quipier_es_00024",s.length)})]}):null},NV=(e,t)=>{const n={weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"};return g(t.name)?`${t.name} - ${e.toLocaleString(t.range,void 0,n)}`:e.toLocaleString(t.range,void 0,n)},LV=e=>{const t=Ti(),n=Ei(Yh),{positionsSlotsIds:o,setPositionsSlotsIds:s}=OV(),r=(0,V.useMemo)(()=>e.positionsSlots.filter(t=>e.state===ve.Assigned&&o.includes(t.id)),[e.state]),{wishedPositionsSlots:a,possiblePositionsSlots:l,otherPositionsSlots:d}=(0,V.useMemo)(()=>{const t=sg(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,V.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===ve.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{font:"gray900 textMd medium",children:t("cr_neau_affect_50400",r.length)}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("cr_neaux_sur_le_05515",e.userInfo.name)}),(0,i.jsx)(md,{height:"3"}),r.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)($V,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:o.includes(e.id),neededResources:e.resources,overlaps:ig(e,c),subtitle:NV(n,e),teamMembers:(0,i.jsx)(FV,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{s(Ws(o,e.id))}}),(0,i.jsx)(md,{height:"3"})]},e.id)),(0,i.jsx)(md,{height:"6"})]}),(0,i.jsx)(ka,{font:"gray900 textMd medium",children:t("creneau_souhaite",a.length)}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("cr_neaux_dont_l_10130")}),(0,i.jsx)(md,{height:"3"}),a.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)($V,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:o.includes(e.id),neededResources:e.resources,overlaps:ig(e,c),subtitle:NV(n,e),teamMembers:(0,i.jsx)(FV,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{s(Ws(o,e.id))}}),(0,i.jsx)(md,{height:"3"})]},e.id)),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{font:"gray900 textMd medium",children:t("autre_creneau_possible",l.length)}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("cr_neaux_dont_l_99850")}),(0,i.jsx)(md,{height:"3"}),l.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)($V,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:o.includes(e.id),neededResources:e.resources,overlaps:ig(e,c),subtitle:NV(n,e),teamMembers:(0,i.jsx)(FV,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{s(Ws(o,e.id))}}),(0,i.jsx)(md,{height:"3"})]},e.id)),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{font:"gray900 textMd medium",children:t("autre_creneau",d.length)}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("cr_neaux_dont_l_25685")}),(0,i.jsx)(md,{height:"3"}),d.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)($V,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:o.includes(e.id),neededResources:e.resources,overlaps:ig(e,c),subtitle:NV(n,e),teamMembers:(0,i.jsx)(FV,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{s(Ws(o,e.id))}}),(0,i.jsx)(md,{height:"3"})]},e.id))]})},BV=e=>{const t=Ti(),n=Ei(Cm),o=(0,V.useMemo)(()=>(e.positionsCategoriesIds||[]).map(t=>e.event.positionsCategories.find(e=>e.id===t).name).join(", "),[e.positionsCategoriesIds,e.event]),s=(0,V.useMemo)(()=>(e.positionsIds||[]).map(t=>e.event.positions.nodes.find(e=>e.id===t).name).join(", "),[e.positionsIds,e.event]),r=(0,V.useMemo)(()=>e.date?n.toLocaleString(e.date,zs.DateOnly.MonthLong):"",[e.date]),a=(0,V.useMemo)(()=>e.segmentId?e.event.segments.find(t=>t.id===e.segmentId).name:"",[e.segmentId,e.event]),l=(0,V.useMemo)(()=>(e.tagsIds||[]).map(t=>e.organization.tags.nodes.find(e=>e.id===t).name).join(", "),[e.tagsIds,e.organization]);return g(o)||g(s)||g(r)||g(a)||g(l)||e.excludeFull||e.excludePast?(0,i.jsxs)(rd,{align:"center",gap:"3",wrap:"wrap",children:[g(o)&&(0,i.jsx)(vu,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setPositionsCategoriesIds(null)},children:t("cat_gories_1_42029",o)}),g(s)&&(0,i.jsx)(vu,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setPositionsIds(null)},children:t("missions_1_62834",s)}),g(r)&&(0,i.jsx)(vu,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setDate(null)},children:t("date_1_17337",r)}),g(a)&&(0,i.jsx)(vu,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setSegmentId(null)},children:t("vue_1_29260",a)}),g(l)&&(0,i.jsx)(vu,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setTagsIds(null)},children:t("tags_1_43158",l)}),e.excludeFull&&(0,i.jsx)(vu,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludeFull(!1)},children:t("cr_neaux_comple_77561")}),e.excludePast&&(0,i.jsx)(vu,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludePast(!1)},children:t("cr_neaux_dans_l_92999")}),(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textXs medium",onClick:e.reset,children:t("r_initialiser_l_66835")})]}):null},VV=e=>{const t=Ti(),[n,o]=(0,V.useState)(e.positionsCategoriesIds),[s,r]=(0,V.useState)(e.positionsIds),[a,l]=(0,V.useState)(e.date),[d,c]=(0,V.useState)(e.segmentId?[e.segmentId]:[]),[u,m]=(0,V.useState)(e.tagsIds),[h,g]=(0,V.useState)(e.excludeFull?"checked":"unchecked"),[p,f]=(0,V.useState)(e.excludePast?"checked":"unchecked");return(0,i.jsxs)(rd,{direction:"column",onChange:Gd,children:[(0,i.jsxs)(rd,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(ka,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),(0,i.jsx)(Uu,{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)(Uu,{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)(Ih,{max:e.event.endAt,min:e.event.startAt,placeholder:t("date_du_cr_neau_82295"),value:a,onChange:l}),(0,i.jsx)(Uu,{isSearchVisible:!0,placeholder:t("s_lectionnez_un_19794"),renderOnPortal:!0,values:d,onChange:e=>{Bs(e)?c([(0,Dm.A)(e)]):c([])},children:e.event.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Uu,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_73255"),renderOnPortal:!0,values:u||[],onChange:m,children:e.organization.tags.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Eu,{state:h,onClick:g,children:t("masquer_les_cr_14425")}),(0,i.jsx)(Eu,{state:p,onClick:f,children:t("masquer_les_cr_05336")})]}),(0,i.jsxs)(rd,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{e.reset(),e.close()},children:t("r_initialiser_77538")}),(0,i.jsx)(kd,{size:"sm",onClick:()=>{e.setDate(a),e.setExcludeFull("checked"===h),e.setExcludePast("checked"===p),e.setPositionsCategoriesIds(n),e.setPositionsIds(s),e.setSegmentId(Bs(d)?d[0]:null),e.setTagsIds(u),e.close()},children:t("appliquer_05753")})]})]})},UV=e=>{const t=Ti(),[n,o]=(0,V.useState)(!1),s=(0,V.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)(rd,{direction:"column",gap:"3",width:1,children:[(0,i.jsxs)(rd,{gap:"3",children:[(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_une_69998"),value:e.name,onChange:e.setName}),(0,i.jsxs)(nu,{doNotCloseOnOtherOpen:!0,isOpen:n,onStateChange:o,children:[(0,i.jsx)(du,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"bars-filter",children:t("filtres_64574")})})}),(0,i.jsx)(lu,{placement:"bottom-end",width:385,children:(0,i.jsx)(VV,{...e,close:()=>{o(!1)},reset:s})})]})]}),(0,i.jsx)(BV,{...e,reset:s})]})},WV=e=>{const{eventId:t}=zi(),{isPreAssign:n}=OV(),[o,s,r]=gm(""),[a,l]=ZR("assignment.filters.positionsCategoriesIds",null),[d,c]=ZR("assignment.filters.positionsIds",null),[u,m]=ZR("assignment.filters.date",null),[h,p]=ZR("assignment.filters.tagsIds",null),[f,_]=ZR("assignment.filters.segmentId",null),[x,I]=ZR("assignment.filters.excludeFull",!1),[v,b]=ZR("assignment.filters.excludePast",!1),{data:j,loader:C}=Oi("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 name: $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:g(s)?s:void 0,positionsCategoriesIds:Bs(a)?a:void 0,positionsIds:Bs(d)?d:void 0,date:u,tagsIds:Bs(h)?h:void 0,segmentId:f,excludeFull:x,excludePast:v},[js.PositionPositionsCustomFieldsFragment]);return(0,i.jsxs)(rd,{css:{background:"$gray50",minHeight:"100%",padding:"$6 $7"},direction:"column",width:1,children:[(0,i.jsx)(UV,{date:u,event:e.event,excludeFull:x,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:_,setTagsIds:p,tagsIds:h}),(0,i.jsx)(md,{height:"7"}),C||(n?(0,i.jsx)(MV,{positionsSlots:j.event?.positionsSlots.nodes??[],userInfo:e.userInfo,wishedPositionsCategoriesIds:e.wishedPositionsCategoriesIds,wishedPositionsIds:e.wishedPositionsIds,wishedPositionsSlotsIds:e.wishedPositionsSlotsIds,wishedRanges:e.wishedRanges}):(0,i.jsx)(LV,{positionsSlots:j.event?.positionsSlots.nodes??[],state:e.state,userInfo:e.userInfo,wishedPositionsCategoriesIds:e.wishedPositionsCategoriesIds,wishedPositionsIds:e.wishedPositionsIds,wishedPositionsSlotsIds:e.wishedPositionsSlotsIds,wishedRanges:e.wishedRanges}))]})},GV=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,userInfoId:r}}=bd(),a=Pi().pathname.includes("pre-assignment"),{canMemberAssign:l}=Dv();Zc(n("affectations_1_71402",e.event.volunteerRegistration.userInfo.name));const[d,c]=ZR("assignment.isLeftPanelOpen",!0),[u,m]=ZR("assignment.isRightPanelOpen",!0),[h,p,f]=gm(""),[_,x]=ZR("assignment.leftPanelDirection",re.Desc),[I,v]=ZR("assignment.leftPanelSegmentId",-1),[b,j]=ZR("assignment.leftPanelStates",[ve.WaitingAssignment,ve.PreAssigned]),{data:C,isLoading:y}=cr({eventId:s,states:b,name:g(p)?p:void 0,segmentId:-1===I?void 0:I,direction:_,loadDelegations:!1}),A=(0,V.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(fs.ASSIGNMENTS(o,s)):a?t.replace(fs.PRE_ASSIGNMENT(o,s,i)):t.replace(fs.ASSIGNMENT(o,s,i))},[a,o,s,r,C.event]),S=e.event.volunteerRegistration,k=(0,V.useMemo)(()=>S.positionsSlotsUsersInfos.map(({positionSlotId:e})=>e),[S]),w=(0,V.useMemo)(()=>({wishedPositionsCategoriesIds:S.positionsCategories.map(({id:e})=>e),wishedPositionsIds:S.positions.map(({id:e})=>e),wishedPositionsSlotsIds:S.positionsSlots.map(({id:e})=>e),wishedRanges:S.slots.map(({range:e})=>e)}),[S]);return(0,i.jsx)(RV,{isEdit:e.isEdit,positionsCategoriesIds:S.preassignPositionsCategoriesIds,positionsIds:S.preassignPositionsIds,positionsSlotsIds:k,showNextVolunteer:A,teams:S.teams,children:(0,i.jsx)(FL,{buttons:(0,i.jsx)(DV,{isEdit:e.isEdit,userInfoId:S.userInfo.id,volunteerRegistrationId:S.id}),header:(0,i.jsx)(NL,{badgeColorIcon:fb(S.state),delegation:S.delegation,insertedAt:S.insertedAt,isPreAssign:a,showTabs:l,showTeam:!0,teams:S.teams,userInfo:S.userInfo}),isEdit:e.isEdit,isLeftPanelOpen:d,isRightPanelOpen:u,leftPanel:(0,i.jsx)(VL,{accreditationStates:[],delegationId:null,direction:_,event:C.event,getPath:e=>a?fs.PRE_ASSIGNMENT(o,s,e):fs.ASSIGNMENT(o,s,e),isLoading:y,loadDelegations:!1,name:h,segmentId:I,setAccreditationStates:hc.A,setDelegationId:hc.A,setDirection:x,setName:f,setSegmentId:v,setStates:j,showAccreditationStates:!1,showStates:!0,states:b,userInfoId:S.userInfoId}),rightPanel:(0,i.jsx)(ZL,{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)(WV,{event:e.event,organization:e.organization,state:S.state,userInfo:S.userInfo,...w})})})},qV=e=>{const{organizationId:t,eventId:n,userInfoId:o}=zi(),{data:s,loader:r}=Oi("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 delegation {\n id\n name\n }\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},[js.FormsUsersInfosWishedFragment,js.CustomFieldWithConditionFragment,js.UserInfoTeamMemberFragment]);return r||(0,i.jsx)(GV,{event:s.event,isEdit:e.isEdit,organization:s.organization})},HV=e=>{const t=Ti(),{mutate:n,isLoading:o}=function(e={}){return Di("mutation SendAssignmentsEmails(\n $eventId: EventId!\n $sendAssignmentsEmails: SendAssignmentsEmailsInput!\n) {\n eventAssignmentsEmailsSend(eventId: $eventId, sendAssignmentsEmails: $sendAssignmentsEmails)\n}\n",e)}();return(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(wj,{color:"warning",css:{margin:"auto"},icon:"triangle-exclamation"}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{font:"gray900 textLg medium",textAlign:"center",children:t("_tes_vous_sur_d_58206",e.numberOfEmails)}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:t("les_membres_pr_53976")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{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)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},KV=e=>{const t=Ti(),[n,o,s]=gm(""),[r,a]=(0,V.useState)([]),{data:l}=tl({eventId:e.eventId,usersInfosIds:r,name:g(o)?o:void 0}),{mutate:d,isLoading:c}=function(e={}){return Di("mutation AssignmentsEmailsEstimate(\n $eventId: EventId!\n $sendAssignmentsEmails: SendAssignmentsEmailsInput!\n) {\n eventAssignmentsEmailsEstimate(eventId: $eventId, sendAssignmentsEmails: $sendAssignmentsEmails)\n}\n",e)}(),[u,m]=(0,V.useState)(Et.Everyone),h=(0,V.useMemo)(()=>(0,Xh.A)((l.event?.volunteersRegistrations.nodes??[]).concat(l.event?.selectedVolunteersRegistrations.nodes??[]),e=>e.id),[l.event]),[p,f]=(0,V.useState)([]),_=u===Et.Everyone||u===Et.Assigned||u===Et.Refused||u===Et.Members&&Bs(r)||u===Et.Segments&&Bs(p),x=!(!e.emailSender||e.emailSender.isValidToSendEmail);return(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(wj,{color:"purple",css:{margin:"auto"},icon:"paper-plane"}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("envoi_des_e_mai_81363")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:t("personnaliser_v_78340")}),(0,i.jsx)(md,{height:"7"}),x&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zd,{alertStyle:"error",children:(0,i.jsx)(Pd,{children:t("vous_ne_pouvez_69435")})}),(0,i.jsx)(md,{height:"4"})]}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:t("que_souhaitez_v_01732")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(zu,{state:u===Et.Everyone?"checked":"unchecked",onClick:()=>{m(Et.Everyone)},children:t("tous_les_e_mail_39319")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:u===Et.Assigned?"checked":"unchecked",onClick:()=>{m(Et.Assigned)},children:t("tous_les_e_mail_42685")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:u===Et.Refused?"checked":"unchecked",onClick:()=>{m(Et.Refused)},children:t("tous_les_e_mail_41162")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:u===Et.Members?"checked":"unchecked",onClick:()=>{m(Et.Members)},children:t("_certains_memb_91094")}),u===Et.Members&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ka,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Uu,{isSearchVisible:!0,multiple:!0,searchElement:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:n,onChange:s}),values:r,onChange:a,children:h.map(e=>(0,i.jsx)("option",{value:e.userInfo.id,children:e.userInfo.nameOrEmail},e.userInfo.id))})})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:u===Et.Segments?"checked":"unchecked",onClick:()=>{m(Et.Segments)},children:t("uniquement_ce_54026")}),u===Et.Segments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ka,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Uu,{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)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{disabled:x,isLoading:c,onClick:async()=>{if(_){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)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},YV=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o}}=bd(),{localEvent:s,setNumberOfWaitingAssigments:r}=dv(),{data:a,loader:l,reload:d}=Oi('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"]??re.Desc},[]);const c=um(),[u,m,h]=gm(""),[p,f]=(0,V.useState)(""),[_,x]=(0,V.useState)(0),{data:I,isLoading:v,reload:b}=function(e){return Oi("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,[js.EmailRecipientFragment])}({eventId:o,name:g(m)?m:void 0,state:""!==p?p:void 0,offset:_}),[j,C]=(0,V.useState)(!1),[y,A]=(0,V.useState)(null),[S,k]=(0,V.useState)(0),[w,E]=(0,V.useState)(!1);return(0,V.useEffect)(()=>{a.event?.waitingAssignment&&r(a.event.waitingAssignment.totalCount)},[a]),l||(0,i.jsxs)(rd,{css:{padding:"$7"},direction:"column",children:[(0,i.jsx)(ka,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("mes_affectation_73224")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"6",children:[(0,i.jsx)(Iw,{button:(0,i.jsxs)(i.Fragment,{children:[a.event.hasFormWithTeamsAllowed&&(0,i.jsx)(kd,{color:"invisible",disabled:0===a.event.waitingTeams.totalCount,onClick:()=>{e.push(fs.TEAM_ASSIGNMENT(n,o,a.event.waitingTeams.nodes[0].teamCode))},children:t("affecter_les_q_17322")}),(0,i.jsx)(kd,{disabled:0===a.event.waitingAssignment.totalCount,onClick:()=>{e.push(fs.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)(Iw,{button:(0,i.jsx)(kd,{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)(Iw,{button:(0,i.jsx)(kd,{onClick:()=>{e.push(fs.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)(md,{height:"9"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("historique_des_68195")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsxs)(rd,{gap:"6",children:[(0,i.jsx)(Iw,{icon:"paper-plane",iconColor:"purple",text:t("nombre_d_envois_95106"),value:a.event.emailsStats.numberOfSent??0}),(0,i.jsx)(Iw,{icon:"eye",iconColor:"success",text:t("nombre_d_ouvert_84187"),value:a.event.emailsStats.numberOfOpen??0}),(0,i.jsx)(Iw,{icon:"hand-pointer",iconColor:"primary",text:t("nombre_de_clics_64232"),value:a.event.emailsStats.numberOfClick??0})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(dm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{width:200,children:(0,i.jsxs)(hh,{value:p,onChange:e=>{f(e),x(0)},children:[(0,i.jsx)("option",{value:"",children:t("tous_les_status_67644")}),c(Dn.filter(e=>e!==dt.Queued))]})}),(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_un_d_02329"),value:u,onChange:e=>{h(e),x(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:t("nom_du_membre_69353")}),(0,i.jsx)(pm,{children:t("date_d_envoi_74668")}),(0,i.jsx)(pm,{children:t("State")}),(0,i.jsx)(pm,{width:100})]}),numberOfPages:I.event?.emails.numberOfPages??0,offset:_,rows:v?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):Bs(I.event.emails.nodes)?(0,i.jsx)(i.Fragment,{children:I.event.emails.nodes.map(e=>(0,i.jsx)(hb,{email:e,emailType:ze.Assignments,reload:b},e.id))}):(0,i.jsx)(Wy,{subtitle:t("vous_n_avez_pas_92612"),title:t("aucun_courriel_12121")}),setOffset:x,title:t("liste_des_envoi_52697"),totalCount:I.event?.emails.totalCount??0}),j&&(0,i.jsx)(KV,{emailSender:a.organization.emailTemplate?.emailSender,eventId:o,onClose:()=>{C(!1)},onSuccess:(e,t)=>{k(e),A(t),E(!0)}}),w&&(0,i.jsx)(HV,{eventId:o,numberOfEmails:S,reload:d,sendAssignmentsEmails:y,onClose:()=>{E(!1)}})]})},ZV=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o}}=bd(),{localEvent:s}=dv(),{data:r,loader:a}=Oi('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"]??re.Desc},[]);return a||(0,i.jsxs)(rd,{css:{padding:"$7"},direction:"column",children:[(0,i.jsx)(ka,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("mes_affectation_73224")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{gap:"6",children:(0,i.jsx)(Iw,{button:(0,i.jsx)(kd,{disabled:0===r.event.preAssigneds.totalCount,onClick:()=>{e.push(fs.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})})]})},XV=()=>{const{translate:e,params:{eventId:t}}=bd(),{event:{name:n},hasPermission:o,updateLocalEvent:s}=dv(),r=o(Ov.MEMBER_ASSIGN,{eventId:t});return Zc(`${n} ${e("mes_affectation_73224")}`),(0,V.useEffect)(()=>{(async()=>{await Promise.all([s({"assignment.filters.positionsCategoriesIds":null}),s({"assignment.filters.positionsIds":null}),s({"assignment.filters.date":null}),s({"assignment.filters.tagsIds":null}),s({"assignment.filters.segmentId":null}),s({"assignment.filters.excludeFull":!1})])})()},[]),r?(0,i.jsx)(YV,{}):(0,i.jsx)(ZV,{})},JV=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,teamCode:r}}=bd(),a=r===e.team.teamCode,[l,d]=(0,V.useState)(a);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{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(fs.TEAM_ASSIGNMENT(o,s,e.team.teamCode))},children:[(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray800 textSm semiBold",children:e.team.teamCode}),(0,i.jsx)(ka,{color:"gray500",children:n("_1_membre_49737",e.team.members.length)})]}),(0,i.jsx)(ka,{color:"gray900",css:{cursor:"pointer",padding:"$2"},fontSize:"textMd",onClick:e=>{Gd(e),d(!l)},children:(0,i.jsx)(Id,{icon:l?"chevron-down":"chevron-right"})})]}),l&&e.team.members.map((n,r)=>(0,i.jsx)(LL,{displayBorder:r===e.team.members.length-1,isSelected:a,vr:n,onClick:()=>{t.push(fs.TEAM_ASSIGNMENT(o,s,e.team.teamCode))}},n.userInfo.id))]})},QV=e=>{const{params:{organizationId:t,eventId:n,teamCode:o},translate:s}=bd(),r=e.event?.teams.totalCount??0,a=e.event?.teams.nodes??[];return(0,i.jsxs)(rd,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(rd,{css:{padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(bb,{color:"primary",returnPathFallback:fs.TEAM_ASSIGNMENT(t,n,o),children:s("retour_92202")}),(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{font:"gray900 textLg medium",children:s("affectation_plural")}),(0,i.jsx)(vu,{color:"error",size:"sm",children:s("_1_quipe_rest_49090",r)})]})]}),(0,i.jsxs)(rd,{css:{px:"$4"},gap:"4",children:[(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:s("rechercher_50038"),value:e.name,onChange:e.setName})}),(0,i.jsxs)(nu,{doNotCloseOnOtherOpen:!0,children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"bars-filter"})}),(0,i.jsx)(lu,{css:{paddingTop:"0"},placement:"bottom",children:(0,i.jsxs)(rd,{css:{padding:"$4 $6"},direction:"column",gap:"4",width:320,children:[(0,i.jsx)(ka,{font:"gray800 textMd medium",children:s("liste_des_filtr_75605")}),(0,i.jsx)(Qd,{label:s("nombre_de_membr_84892"),shouldParseAsInt:!0,value:e.numberOfMembers||"",onChange:e.setNumberOfMembers})]})})]})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(rd,{css:{flex:"1",overflowY:"auto"},direction:"column",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(BL,{}),(0,i.jsx)(BL,{}),(0,i.jsx)(BL,{})]}):a.map(e=>(0,i.jsx)(JV,{team:e},e.teamCode))})]})},eU=()=>{const{translate:e,params:{eventId:t,teamCode:n}}=bd(),{positionsSlotsIds:o,showNextVolunteer:s}=OV(),{mutate:r,isLoading:a}=function(e={}){return Di("mutation TeamAssignmentRefuse($eventId: EventId!, $teamCode: TeamCode!) {\n teamAssignmentRefuse(eventId: $eventId, teamCode: $teamCode)\n}\n",e)}(),{mutate:l,isLoading:d}=function(e={}){return Di("mutation TeamAssign($eventId: EventId!, $teamCode: TeamCode!, $assignment: AssignmentInput!) {\n teamAssign(eventId: $eventId, teamCode: $teamCode, assignment: $assignment)\n}\n",e)}();return(0,i.jsxs)(rd,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,width:1,children:[(0,i.jsx)(ka,{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)(ka,{css:{flex:"1"}}),(0,i.jsx)(kd,{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)(kd,{color:"white",onClick:s,children:e("affecter_l_qui_37763")})]})},tU=e=>{const t=Ti();return(0,i.jsx)(rd,{align:"center",css:{padding:"$5 $6"},gap:"4",children:(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(ka,{font:"gray900 textXl medium",children:e.team.teamCode}),(0,i.jsx)(ka,{color:"gray500",children:t("_1_membre_49737",e.team.members.length)})]})})},nU=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),s=(0,V.useMemo)(()=>e.team.leaderUserInfo.formsUsersInfos.filter(t=>t.form.id===e.team.formId),[e.team]);return(0,i.jsxs)(rd,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(rd,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:e.onCollapse,children:(0,i.jsx)(Id,{icon:"sidebar"})})}),(0,i.jsx)(bp,{placement:"top",children:t("cacher_les_info_67266")})]}),(0,i.jsx)(ka,{font:"gray900 textMd semiBold",children:t("_propos_de_l_47506")})]}),e.team.members.map(n=>(0,i.jsx)(HL,{customFields:e.customFields,formsIds:[e.team.formId],title:t("informations_de_63884",n.userInfo.nameOrEmail),userInfo:n.userInfo},n.id)),(0,i.jsx)(KL,{eventId:o,formsUsersInfos:s,organizationId:n}),(0,i.jsx)(YL,{formsUsersInfos:s})]})},iU=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,teamCode:r}}=bd(),[a,l]=ZR("assignment.isLeftPanelOpen",!0),[d,c]=ZR("assignment.isRightPanelOpen",!0),[u,m,h]=gm(""),[p,f]=ZR("teamAssignment.numberOfMembers",null),{data:_,isLoading:x}=Oi("query TeamAssignmentWaitingTeams($eventId: EventId!, $name: String, $numberOfMembers: Int) {\n event(id: $eventId) {\n teams(name: $name, numberOfMembers: $numberOfMembers, state: WaitingAssignment) {\n nodes {\n teamCode\n\n members {\n ...VolunteerRegistrationWaitingAssignment\n }\n }\n\n totalCount\n }\n }\n}\n",{eventId:s,name:g(m)?m:void 0,numberOfMembers:"number"==typeof p&&p>0?p:void 0},[js.VolunteerRegistrationWaitingAssignmentFragment]);const I=(0,V.useCallback)(()=>{const e=_.event?.teams.nodes??[],n=e.findIndex(e=>e.teamCode===r),i=e[n+1]?.teamCode??e[0].teamCode;i===r?t.goBack(fs.ASSIGNMENTS(o,s)):t.replace(fs.TEAM_ASSIGNMENT(o,s,i))},[o,s,r,_.event]),v=e.event.team,b=(0,V.useMemo)(()=>({wishedPositionsCategoriesIds:v.positionsCategoriesIds,wishedPositionsIds:v.positionsIds,wishedPositionsSlotsIds:v.positionsSlotsIds,wishedRanges:v.slots.map(({range:e})=>e)}),[v]);return Zc(n("affectation_de_62702",v.teamCode)),(0,i.jsx)(RV,{isEdit:!1,positionsCategoriesIds:[],positionsIds:[],positionsSlotsIds:[],showNextVolunteer:I,teams:[],children:(0,i.jsx)(FL,{buttons:(0,i.jsx)(eU,{}),header:(0,i.jsx)(tU,{team:v}),isEdit:!1,isLeftPanelOpen:a,isRightPanelOpen:d,leftPanel:(0,i.jsx)(QV,{event:_.event,isLoading:x,name:u,numberOfMembers:p,setName:h,setNumberOfMembers:f}),rightPanel:(0,i.jsx)(nU,{customFields:e.event.formsCustomsFields,team:v,onCollapse:()=>{c(!1)}}),setIsLeftPanelOpen:l,setIsRightPanelOpen:c,children:(0,i.jsx)(WV,{event:e.event,organization:e.organization,state:ve.NotApplicable,userInfo:v.leaderUserInfo,...b})})})},oU=()=>{const{params:{organizationId:e,eventId:t,teamCode:n}}=bd(),{data:o,loader:s}=Oi("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},[js.CustomFieldWithConditionFragment,js.FormsUsersInfosWishedFragment]);return s||(0,i.jsx)(iU,{event:o.event,organization:o.organization})},sU=()=>{const{history:e,params:{organizationId:t,eventId:n},translate:o}=bd(),{event:{name:s},hasPermission:r}=dv(),{canCampaignSend:a}=Dv(),l=r(Ov.CAMPAIGN_SEND,{eventId:n});Zc(`${s} ${o("Campaigns")}`);const d=um(),[c,u]=(0,V.useState)(""),[m,h]=(0,V.useState)(""),p=hm(e=>{h(e),j()}),[f,_]=(0,V.useState)(""),[x,I]=(0,V.useState)(""),[v,b]=(0,V.useState)(0),j=()=>{b(0)},[C,y]=(0,V.useState)(null),{data:A,isLoading:S,reload:k}=Oi("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:g(m)?m:void 0,states:""!==f?[f]:void 0,campaignType:""!==x?x:void 0,offset:v,sort:C},[js.CampaignListFragment]);return o$(A.event?.campaigns.nodes??[],k),(0,i.jsxs)(nb,{children:[(0,i.jsxs)(tb,{children:[(0,i.jsx)(ka,{css:{flex:"1"},font:"gray900 displayXs semiBold",children:o("Campaigns")}),l?(0,i.jsx)(dE,{menu:(0,i.jsx)(ru,{icon:"paper-plane",onClick:()=>{e.push(Tx.CREATE_TEMPLATE({organizationId:t,eventId:n}))},children:o("cr_er_un_mod_le_20298")}),onClick:()=>{e.push(Tx.CREATE({organizationId:t,eventId:n}))},children:o("cr_er_une_campa_96023")}):a?(0,i.jsx)(kd,{to:Tx.CREATE({organizationId:t,eventId:n}),children:o("cr_er_une_campa_96023")}):null]}),(0,i.jsxs)(Qv,{children:[(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(db,{content:A.event?.doneCampaigns.totalCount??"-",title:o("nombre_de_campa_52133")}),(0,i.jsx)(db,{content:A.event?.campaignsCost??"-",title:o("co_t_des_campag_08459")})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(rd,{css:{boxShadow:"$xs"},direction:"column",children:(0,i.jsx)(dm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{width:200,children:(0,i.jsxs)(hh,{value:f,onChange:e=>{_(e),j()},children:[(0,i.jsx)("option",{value:"",children:o("toutes_les_camp_81617")}),d(yn)]})}),(0,i.jsx)(ka,{width:200,children:(0,i.jsxs)(hh,{value:x,onChange:e=>{I(e),j()},children:[(0,i.jsx)("option",{value:"",children:o("sms_et_e_mail_94587")}),d(An)]})}),(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:o("rechercher_une_69554"),value:c,onChange:e=>{u(e),p(e)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fp,{attribute:Ee.Name,setSort:y,sort:C,children:o("nom_de_la_campa_45063")}),(0,i.jsx)(fp,{attribute:Ee.Type,css:{flex:"0 150px"},setSort:y,sort:C,children:o("type_35427")}),(0,i.jsx)(pm,{css:{flex:"0 200px"},children:o("nombre_de_desti_21374")}),(0,i.jsx)(pm,{css:{flex:"0 150px"},children:o("co_t_68998")}),(0,i.jsx)(fp,{attribute:Ee.State,css:{flex:"0 150px"},setSort:y,sort:C,children:o("State")}),(0,i.jsx)(pm,{css:{flex:"0 100px"}})]}),numberOfPages:A.event?.campaigns.numberOfPages??0,offset:v,rows:S?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:Bs(A.event.campaigns.nodes)?(0,i.jsx)(i.Fragment,{children:A.event.campaigns.nodes.map(e=>(0,i.jsx)(i$,{campaign:e,canCampaignSend:a,eventId:n,organizationId:t,reload:k},e.id))}):(0,i.jsx)(Wy,{title:o("no_campaigns")})}),setOffset:b,title:o("liste_des_campa_60034"),totalCount:A.event?.campaigns.totalCount??0})})]})]})},rU=({organizationId:e,eventId:t,category:n,clickable:o})=>{const s=Ti();return(0,i.jsx)(am,{children:(0,i.jsx)(Qu,{children:(0,i.jsxs)(rd,{direction:"column",gap:"2",width:1,children:[(0,i.jsxs)(rd,{gap:"3",justify:"between",children:[o?(0,i.jsx)(bm,{to:Jo.POSITION_CATEGORY({organizationId:e,eventId:t,positionCategoryId:n.id}),children:n.name}):(0,i.jsx)(ka,{color:"gray700",children:n.name}),(0,i.jsx)(ka,{color:"gray700",children:s("_1_2_membres_04485",n.assignedResources,n.resources)})]}),(0,i.jsx)(ka,{width:1,children:(0,i.jsx)(u$,{percent:n.assignedResources/n.resources})})]})})},n.id)},aU=e=>(0,i.jsx)(rd,{align:"center",css:{background:"white",bd:!0,cursor:"pointer",padding:"$3 $4"},gap:"3",width:1,children:(0,i.jsxs)(_d,{to:e.path,width:1,children:[(0,i.jsx)(rd,{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)(Id,{icon:"check"})}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{color:"gray800",css:{textDecoration:e.isDone?"line-through":""},fontWeight:"medium",children:e.title}),(0,i.jsx)(ka,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(ka,{color:"gray900",css:{cursor:"pointer"},children:(0,i.jsx)(Id,{icon:"arrow-right"})})]})}),lU=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o}}=bd(),s=Ei(CC),{hasEventRole:r}=dv(),{canCampaignSend:a,canFormEdit:l,canPositionEdit:d}=Dv(),{data:c,loader:u}=Oi("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},[]),m=(0,V.useMemo)(()=>c.event?(0,cm.A)(c.event.positionsCategories,e=>e.name.toLowerCase()):[],[c.event]),h=!(!(r&&a&&l&&d&&c.event)||c.event.onboarding.isFirstCampaignCreated&&c.event.onboarding.isFirstFormCreated&&c.event.onboarding.isFirstPositionCreated);return u||(0,i.jsxs)(rd,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsx)(ka,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:t("tableau_de_bord_24627")}),(0,i.jsx)(md,{height:"7"}),h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zV,{header:(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:t("vos_premiers_pa_81169")}),(0,i.jsx)(ka,{color:"gray500",children:t("pour_bien_d_mar_03933")})]}),initialIsOpen:!0,children:(0,i.jsxs)(rd,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(aU,{isDone:c.event.onboarding.isFirstPositionCreated,path:fs.CREATE_POSITION(n,o),subtitle:t("cr_er_une_nouve_43436"),title:t("cr_er_votre_pre_70209")}),(0,i.jsx)(aU,{isDone:c.event.onboarding.isFirstFormCreated,path:jo.FORMS({organizationId:n,eventId:o}),subtitle:t("cr_er_un_formul_31199"),title:t("cr_er_votre_pre_76199")}),(0,i.jsx)(aU,{isDone:c.event.onboarding.isFirstCampaignCreated,path:Tx.CREATE({organizationId:n,eventId:o}),subtitle:t("communiquer_fac_26569"),title:t("envoyer_votre_p_47899")})]})}),(0,i.jsx)(md,{height:"8"})]}),(0,i.jsxs)(yc,{gap:"6",gridtemplatecolumns:"1fr 1fr 350px",gridtemplaterows:"1fr 1fr",children:[(0,i.jsx)(ka,{css:{gridColumn:"1 / 2",gridRow:"1 / 2"},children:(0,i.jsx)(Iw,{button:(0,i.jsx)(kd,{to:Jo.POSITIONS({organizationId:n,eventId:o}),children:t("voir_les_missio_71964")}),icon:"user-group",iconColor:"primary",text:t("nombre_de_membr_60320",c.event.resources),value:c.event.resources})}),(0,i.jsx)(ka,{css:{gridColumn:"2 / 3",gridRow:"1 / 2"},children:(0,i.jsx)(Iw,{button:(0,i.jsx)(kd,{to:Jo.POSITIONS({organizationId:n,eventId:o}),children:t("voir_les_missio_71964")}),icon:"sitemap",iconColor:"purple",text:t("nombre_de_missi_67304",c.event.numberOfPositions),value:c.event.numberOfPositions})}),(0,i.jsx)(ka,{css:{gridColumn:"1 / 2",gridRow:"2 / 3"},children:(0,i.jsx)(Iw,{button:(0,i.jsx)(kd,{onClick:()=>{e.push(fs.VOLUNTEERS(n,o))},children:t("voir_les_membre_27923")}),icon:"user-check",iconColor:"success",text:t("nombre_de_membr_87779",c.event.assignmentsStats.numberOfAssigned),value:c.event.assignmentsStats.numberOfAssigned})}),(0,i.jsx)(ka,{css:{gridColumn:"2 / 3",gridRow:"2 / 3"},children:(0,i.jsx)(Iw,{button:(0,i.jsx)(kd,{onClick:()=>{e.push(fs.ASSIGNMENTS(n,o))},children:t("voir_mes_affect_10965")}),icon:"wand-magic-sparkles",iconColor:"warning",text:t("nombre_de_membr_63555",c.event.assignmentsStats.numberOfWaitingAssignment),value:c.event.assignmentsStats.numberOfWaitingAssignment})}),(0,i.jsxs)(rd,{css:{bd:!0,gridColumn:"3 / 4",gridRow:"1 / 3",padding:"$6"},direction:"column",justify:"between",children:[(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(ka,{color:"gray500",children:t("taux_de_remplis_11913")}),(0,i.jsxs)(ka,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:[0===c.event.resources?"0":Math.round(c.event.assignedResources/c.event.resources*100),"%"]})]}),(0,i.jsx)(ka,{css:{borderBottom:"1px solid $gray200"},width:1}),(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(ka,{color:"gray500",children:t("temps_de_b_n_vo_87924")}),(0,i.jsx)(ka,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:s.minutesToHoursMinutesString(c.event.volunteerMinutesNeeded)})]}),(0,i.jsx)(ka,{css:{borderBottom:"1px solid $gray200"},width:1}),(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(ka,{color:"gray500",children:t("temps_de_b_n_vo_60725")}),(0,i.jsx)(ka,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:s.minutesToHoursMinutesString(c.event.volunteerMinutesAssigned)})]})]})]}),(0,i.jsx)(md,{height:"8"}),r&&(0,i.jsx)(ka,{css:{boxShadow:"$xs"},children:(0,i.jsx)(dm,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(pm,{children:t("cat_gories_24533")})}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:m.length>0?m.map(e=>(0,i.jsx)(rU,{category:e,clickable:!0,eventId:o,organizationId:n},e.id)):(0,i.jsx)(Wy,{subtitle:t("vous_n_avez_pas_59681"),title:t("aucune_cat_gori_21347")})}),setOffset:hc.A,title:t("liste_des_membr_59735"),totalCount:0})})]})};var dU;let cU=class extends hD{static{dU=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...hD.IMPORT_COLUMNS_DEFAULT,Name:"name",CategoryName:"categoryName",FormId:"formId",Deadline:"deadline",MaxResources:"maxResources",LeadersEmails:"leadersEmails",LeadersFirstNames:"leadersFirstnames",LeadersLastNames:"leadersLastnames",PrivateNote:"privateNote",Tags:"tags"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===jt.Update?[dU.IMPORT_COLUMNS_DEFAULT.Id]:[],dU.IMPORT_COLUMNS_DEFAULT.Name,dU.IMPORT_COLUMNS_DEFAULT.CategoryName,dU.IMPORT_COLUMNS_DEFAULT.FormId];default(e){const t=super.default(e);return t.input={...t.input},t}constructor(e,t){super(e,t),this.csvInputService=e}};cU=dU=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[cD,Si])],cU);const uU=()=>{const{params:{organizationId:e,eventId:t},translate:n}=bd(),{mutate:o}=function(e={}){return Di("mutation DelegationsImport(\n $eventId: EventId!\n $organizationId: OrganizationId!\n $input: DelegationImportInput!\n) {\n jobId: delegationsImport(eventId: $eventId, organizationId: $organizationId, input: $input)\n}\n",e)}(),{checkDelegationsImport:s}=HI(),r=(0,V.useCallback)((e,t,n)=>s(e,t,n),[s,t]),{data:a,loader:l}=sl({organizationId:e,variety:Te.Delegation});return l||(0,i.jsx)(aD,{alertDescriptionKey:"to_add_a_team_51299",children:(0,i.jsx)(zD,{ImportInputService:cU,checkImport:r,closePath:qo.DELEGATIONS({organizationId:e,eventId:t}),customFields:a.organization.customFields.nodes,heading:n("import_de_d_l_g_69356"),importTagPrefix:"delegations",localStorageKeyPrefix:"DELEGATIONS_IMPORT",mutate:o,returnLink:(0,i.jsx)(bm,{to:qo.DELEGATIONS({organizationId:e,eventId:t}),children:n("revenir_aux_d_l_15915")})})})},mU=e=>{const{translate:t,params:{eventId:n}}=bd(),{canDelegationEdit:o,canMemberAccredit:s}=Dv(),[r,a]=(0,V.useState)(e.delegationAccreditationSlot),l=(0,V.useMemo)(()=>pu(e.accreditationSlot.accreditation.color),[e.accreditationSlot]),d=(0,V.useMemo)(()=>({background:l[50],border:`1px solid ${l[500]}`,color:l[700]}),[l]),c=(0,V.useCallback)(async()=>{const{event:{delegation:t}}=await wr({eventId:n,delegationId:e.delegationId,accreditationSlotId:e.accreditationSlot.id},await X());a(t.accreditationSlot)},[e.accreditationSlot,e.delegationId,a]),u=o&&s,[m,h]=(0,V.useState)(!1),g=r.maxResources?`/${r.maxResources}`:"",p=`${r.assignedResources}${g}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{css:{...d,borderRadius:"$1",cursor:u?"pointer":"default",padding:"$2"},direction:"column",gap:"2",height:1,width:1,onClick:()=>{u&&h(!0)},children:[(0,i.jsx)(uk,{background:l[100],count:p,icon:"badge-check",text:t("attribu_es_48167")}),(0,i.jsx)(uk,{background:l[100],count:r.wishedResources,icon:"hand-holding-heart",text:t("souhait_es_78101")}),(0,i.jsx)(uk,{background:l[100],count:r.scannedResources,icon:"scanner-gun",text:t("scann_es_13169")})]}),u&&m&&(0,i.jsx)(jk,{accreditationSlotId:e.accreditationSlot.id,delegationId:e.delegationId,eventId:n,onClose:()=>(h(!1),c())})]})},hU=e=>{const t=(0,V.useMemo)(()=>(e.delegation.allAccreditationsSlots||[]).find(t=>t.accreditationSlotId===e.accreditationSlot.id),[e.delegation,e.accreditationSlot]);return t?(0,i.jsx)(mU,{accreditationSlot:e.accreditationSlot,delegationAccreditationSlot:t,delegationId:e.delegation.id}):null},gU=e=>{const{translate:t}=bd(),{mutate:n}=ur(),o=(0,V.useCallback)(t=>t.accreditationProfileId===e.accreditationProfileId,[e.accreditationProfileId]),s=(0,V.useCallback)(async t=>{const{event:n}=await(i={eventId:e.eventId,delegationId:e.delegationId,accreditationProfileId:e.accreditationProfileId,userInfoId:t},s=await X(),Js("query DelegationAccreditationProfileMember(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationProfileId: AccreditationsProfileId!\n $userInfoId: UsersInfoId!\n) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationProfile(id: $accreditationProfileId) {\n ...DelegationAccreditationProfileStats\n }\n }\n\n member: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...VolunteerRegistrationDelegationAccreditationProfile\n }\n }\n}\n",{variables:i,token:s||void 0,fragments:[js.DelegationAccreditationProfileStatsFragment,js.VolunteerRegistrationDelegationAccreditationProfileFragment]}));var i,s;const r=n.member.wishedAccreditationProfileId===e.accreditationProfileId;return{member:o(n.member)||r?n.member:null,stats:n.delegation.accreditationProfile}},[e.accreditationProfileId,e.delegationId,e.eventId,o]),r=(0,V.useCallback)((t,i)=>n({eventId:e.eventId,massProfileUpdate:{accreditationProfileId:e.accreditationProfileId,selecteds:{ids:[t]},strategy:i}}),[n,e.accreditationProfileId,e.eventId]),a=(0,V.useCallback)(e=>r(e,yt.Add),[r]),l=(0,V.useCallback)(e=>r(e,yt.Delete),[r]);return(0,i.jsx)(Ik,{add:a,assignedText:t("d_j_attribu_33932"),delete:l,deleteText:t("retirer_le_prof_47260"),isAssigned:o,members:e.volunteersRegistrations,name:e.name,reloadMember:s,stats:e.stats})},pU=e=>{const{data:t,loader:n}=Oi("query DelegationAccreditationProfileMembers(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationProfileId: AccreditationsProfileId!\n) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationProfile(id: $accreditationProfileId) {\n ...DelegationAccreditationProfileStats\n\n accreditationProfile {\n name\n }\n\n volunteersRegistrations {\n ...VolunteerRegistrationDelegationAccreditationProfile\n }\n }\n }\n }\n}\n",{eventId:e.eventId,delegationId:e.delegationId,accreditationProfileId:e.accreditationProfileId},[js.DelegationAccreditationProfileStatsFragment,js.VolunteerRegistrationDelegationAccreditationProfileFragment]);return(0,i.jsx)(Jm,{size:"md",onClose:e.onClose,children:n||(0,i.jsx)(gU,{accreditationProfileId:e.accreditationProfileId,delegationId:e.delegationId,eventId:e.eventId,name:t.event.delegation.accreditationProfile.accreditationProfile.name,stats:t.event.delegation.accreditationProfile,volunteersRegistrations:t.event.delegation.accreditationProfile.volunteersRegistrations})})},fU=e=>{const{translate:t,params:{eventId:n}}=bd(),{canDelegationEdit:o,canMemberAccredit:s}=Dv(),[r,a]=(0,V.useState)(e.delegationAccreditationProfile),l=(0,V.useMemo)(()=>pu(e.accreditationProfile.color),[e.accreditationProfile]),d=(0,V.useMemo)(()=>({background:l[50],border:`1px solid ${l[500]}`,color:l[700]}),[l]),c=(0,V.useCallback)(async()=>{const{event:{delegation:t}}=await(i={eventId:n,delegationId:e.delegationId,accreditationProfileId:e.accreditationProfile.id},o=await X(),Js("query DelegationAccreditationProfileStats(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationProfileId: AccreditationsProfileId!\n) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationProfile(id: $accreditationProfileId) {\n ...DelegationAccreditationProfileStats\n }\n }\n }\n}\n",{variables:i,token:o||void 0,fragments:[js.DelegationAccreditationProfileStatsFragment]}));var i,o;a(t.accreditationProfile)},[e.accreditationProfile,e.delegationId,a]),u=o&&s,[m,h]=(0,V.useState)(!1),g=r.maxResources?`/${r.maxResources}`:"",p=`${r.assignedResources}${g}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{css:{...d,borderRadius:"$1",cursor:u?"pointer":"default",padding:"$2"},direction:"column",gap:"2",height:1,justify:"center",width:1,onClick:()=>{u&&h(!0)},children:[(0,i.jsx)(uk,{background:l[100],count:p,icon:"badge-check",text:t("attribu_es_48167")}),(0,i.jsx)(uk,{background:l[100],count:r.wishedResources,icon:"hand-holding-heart",text:t("souhait_es_78101")})]}),u&&m&&(0,i.jsx)(pU,{accreditationProfileId:e.accreditationProfile.id,delegationId:e.delegationId,eventId:n,onClose:()=>(h(!1),c())})]})},_U=e=>{const t=(0,V.useMemo)(()=>(e.delegation.accreditationsProfiles||[]).find(t=>t.accreditationProfileId===e.accreditationProfile.id),[e.delegation,e.accreditationProfile]);return t?(0,i.jsx)(fU,{accreditationProfile:e.accreditationProfile,delegationAccreditationProfile:t,delegationId:e.delegation.id}):null},xU=e=>(0,i.jsxs)(rd,{css:{borderTop:"1px solid $gray200",height:"$cellHeightXl"},children:[e.accreditationsProfiles.map(t=>(0,i.jsx)(rd,{align:"center",css:{borderRight:"1px solid $gray200",padding:"$3 $4"},height:1,width:200,children:(0,i.jsx)(_U,{accreditationProfile:t,delegation:e.delegation})},t.id)),e.accreditationsSlots.map(t=>(0,i.jsx)(rd,{align:"center",css:{borderRight:"1px solid $gray200",padding:"$3 $4"},height:1,width:200,children:(0,i.jsx)(hU,{accreditationSlot:t,delegation:e.delegation})},t.id))]}),IU=e=>{const{params:{organizationId:t,eventId:n}}=bd(),o=(0,V.useMemo)(()=>zS(e.allAccreditationsSlots),[e.allAccreditationsSlots]),s=(0,V.useMemo)(()=>$S(e.allAccreditationsSlots),[e.allAccreditationsSlots]),r=(0,V.useMemo)(()=>e.showAccreditations?MS(s,e.selectedSlotsIds):[],[s,e.selectedSlotsIds,e.showAccreditations]),a=(0,V.useMemo)(()=>FS(r,e.selectedSlotsIds,e.matrixRendering),[r,e.matrixRendering,e.selectedSlotsIds]),l=(0,V.useMemo)(()=>(0,cm.A)(e.allAccreditationsProfiles.filter(t=>e.showProfiles&&(Vs(e.selectedProfilesIds)||e.selectedProfilesIds.includes(t.id))),e=>[m(e.accreditationProfileCategory.name),m(e.name)]),[e.allAccreditationsProfiles,e.selectedProfilesIds,e.showProfiles]),d=(0,V.useMemo)(()=>a.map(e=>e.id),[a]),c=(0,V.useCallback)(e=>(0,i.jsx)(rd,{align:"center",css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",height:"$cellHeightXl",px:"$4"},width:1,children:(0,i.jsx)(bm,{to:qo.DELEGATION({organizationId:t,eventId:n,delegationId:e.id}),children:e.name})},e.id),[t,n]),u=(0,V.useCallback)(e=>(0,i.jsx)(xU,{accreditationsProfiles:l,accreditationsSlots:a,delegation:e},e.id),[a,d]);return(0,i.jsx)(rd,{direction:"column",width:1,children:e.isLoading?(0,i.jsx)(Cd,{}):(0,i.jsx)(NS,{accreditationsProfiles:l,allAccreditations:s,allAccreditationsProfiles:e.allAccreditationsProfiles,allCategories:o,cellWidth:200,data:e.delegations,filteredAccreditations:r,hideQuotaOption:!0,limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,renderLeftColumn:c,renderRow:u,rendering:e.matrixRendering,selectedProfilesIds:e.selectedProfilesIds,selectedSlotsIds:e.selectedSlotsIds,setLimit:e.setLimit,setOffset:e.setOffset,setRendering:e.setMatrixRendering,setSelectedProfilesIds:e.setSelectedProfilesIds,setSelectedSlotsIds:e.setSelectedSlotsIds,setShowAccreditations:e.setShowAccreditations,setShowProfiles:e.setShowProfiles,setShowQuota:hc.A,showAccreditations:e.showAccreditations,showProfiles:e.showProfiles,showQuota:!1,slots:a,totalCount:e.totalCount})})},vU=()=>{const{params:{organizationId:e,eventId:t}}=bd(),{columns:n,infos:o,limit:s,nameDebounced:r,offset:a,predicates:l,rendering:d,setInfos:c,setLimit:u,setOffset:m}=SC(),h=(0,V.useMemo)(()=>kg(n,d),[n,d]),{data:p,isLoading:f}=Oi("query DelegationsAccreditationsMatrix($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfiles(usedInDelegations: true) {\n nodes {\n ...AccreditationProfileMatrix\n }\n }\n\n accreditationsSlots(includeHidden: true, usedInDelegations: true) {\n nodes {\n ...AccreditationSlotMatrix\n }\n }\n }\n}\n",{eventId:t},[js.AccreditationProfileMatrixFragment,js.AccreditationSlotMatrixFragment]),{data:_,isLoading:x}=gl({...h,organizationId:e,eventId:t,level:ke.Event,predicates:l,name:g(r)?r:null,limit:s,offset:a}),{numberOfPages:I,totalCount:v}=ah(_.data?.rows),b=(0,V.useMemo)(()=>o.delegationsMatrixSelectedSlotsIds||[],[o]),j=(0,V.useCallback)(e=>c(t=>({...t,delegationsMatrixSelectedSlotsIds:e})),[o,c]),C=(0,V.useMemo)(()=>o.delegationsMatrixSelectedProfilesIds||[],[o]),y=(0,V.useCallback)(e=>c(t=>({...t,delegationsMatrixSelectedProfilesIds:e})),[o,c]),A=(0,V.useMemo)(()=>o.delegationsMatrixShowAccreditations??!0,[o]),S=(0,V.useCallback)(e=>c(t=>({...t,delegationsMatrixShowAccreditations:e})),[c]),k=(0,V.useMemo)(()=>o.delegationsMatrixShowProfiles??!0,[o]),w=(0,V.useCallback)(e=>c(t=>({...t,delegationsMatrixShowProfiles:e})),[c]),E=(0,V.useMemo)(()=>o.volunteersMatrixRendering||xg.Category,[o]),T=(0,V.useCallback)(e=>c(t=>({...t,volunteersMatrixRendering:e})),[o,c]);return(0,i.jsx)(IU,{allAccreditationsProfiles:p.event?.accreditationsProfiles.nodes??[],allAccreditationsSlots:p.event?.accreditationsSlots.nodes??[],delegations:_.data?.rows.nodes??[],isLoading:x||f,limit:s,matrixRendering:E,numberOfPages:I,offset:a,selectedProfilesIds:C,selectedSlotsIds:b,setLimit:u,setMatrixRendering:T,setOffset:m,setSelectedProfilesIds:y,setSelectedSlotsIds:j,setShowAccreditations:S,setShowProfiles:w,showAccreditations:A,showProfiles:k,totalCount:v})},bU=e=>{const{history:t,params:{organizationId:n,eventId:o},translate:r}=bd(),{mutate:a,isLoading:l}=ql(),[d,c]=(0,V.useState)(!1),[u,m]=(0,V.useState)([]),[h,g]=(0,V.useState)(!0),p=!d||Bs(u);return(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"user-group",subtitle:r("ajoutez_une_d_l_54234"),children:r("cr_ation_d_une_07120")}),(0,i.jsxs)(jv,{children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:r("que_souhaitez_v_87607")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(pE,{state:d?"unchecked":"checked",onClick:()=>c(!1),children:r("cr_er_une_nouve_45377")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(pE,{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)(md,{height:"7"}),(0,i.jsx)(Uu,{isSearchVisible:!0,label:r("_quelle_d_l_ga_55758"),multiple:!1,renderOnPortal:!0,values:u,onChange:m,children:e.parentDelegations.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Zm,{value:h,onChange:g,children:r("je_souhaite_app_69393")})]})]}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{disabled:!p,isLoading:l,onClick:async()=>{let i;if(d&&Bs(u)){const t=u[0],n=e.parentDelegations.find(e=>e.id===t);Bs(n.leadersIds)&&await a({eventId:o,usersInfosIds:n.leadersIds,sendVolunteerRegistrationEmail:!1}),i=s(JSON.stringify({parentId:t,applyParentSettings:h}))}t.push(fs.CREATE_DELEGATION(n,o,i))},children:r("suivant_62774")})})]})},jU=()=>{const{history:e,params:{organizationId:t,eventId:n},translate:o}=bd(),{segment:s,columns:r}=SC(),{data:a}=Oi(qa,{organizationId:t},[]),{mutate:l}=function(e={}){return Di("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,V.useState)(!1),[u,m]=(0,V.useState)(!1),h=Bs(a.organization?.delegations.nodes),{checkExport:g}=HI();return(0,i.jsxs)(zz,{children:[(0,i.jsx)(Mv,{permissions:Ov.DELEGATION_EDIT,children:h?(0,i.jsxs)(Av,{children:[(0,i.jsx)(Sv,{children:(0,i.jsx)(dE,{menu:(0,i.jsx)(ru,{icon:"file-import",to:fs.EVENT_DELEGATIONS_IMPORT(t,n),onClick:e=>eu(e.target),children:o("importer_des_d_05454")}),children:o("cr_er_une_d_l_g_23035")})}),(0,i.jsx)(bU,{parentDelegations:a.organization.delegations.nodes})]}):(0,i.jsx)(dE,{menu:(0,i.jsx)(ru,{icon:"file-import",to:fs.EVENT_DELEGATIONS_IMPORT(t,n),onClick:e=>eu(e.target),children:o("importer_des_d_05454")}),path:fs.CREATE_DELEGATION(t,n),children:o("cr_er_une_d_l_g_23035")})}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsx)(Mv,{permissions:Ov.DELEGATION_EDIT,children:(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{icon:"plus",onClick:()=>{c(!0)},children:o("cr_er_une_cat_g_20051")})})}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{icon:"file-xls",onClick:e=>{eu(e.target),m(!0)},children:o("exporter_en_exc_51862")})})]})]}),(0,i.jsx)(jP,{isOpen:u,requestExport:async e=>{const{jobId:i}=await l({organizationId:t,eventId:n,segmentId:s.id,format:e,columns:r});g(i,t,n)},showIncludeFiles:!1,onClose:()=>{m(!1)}}),d&&(0,i.jsx)(oC,{eventId:n,organizationId:t,onClose:()=>c(!1),onSuccess:i=>{e.push(qo.DELEGATION_CATEGORY({organizationId:t,eventId:n,delegationCategoryId:i.id}))}})]})},CU=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{canDelegationEdit:s,canSegmentEdit:r}=Dv(),{limit:a,rendering:l,segment:d}=SC(),c=r&&l===vg.List,u=s&&l===vg.List;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jU,{}),0===e.numberOfDelegations?(0,i.jsx)(Qv,{css:{overflow:"hidden"},children:(0,i.jsx)(ka,{css:{overflow:"hidden"},width:1,children:(0,i.jsx)(pA,{title:t("vous_n_avez_pas_58215")})})}):(0,i.jsxs)(Qv,{children:[(0,i.jsx)(Oz,{searchRow:(0,i.jsx)(Tz,{actions:(0,i.jsx)(R$,{}),searchPlaceholder:t("rechercher_une_31213"),showActions:s,showEditColumns:c,showEditMode:u,showSearchColumns:r}),selectSegment:(0,i.jsx)(wz,{pageSelectedText:t("les_1_d_l_gat_27248",a),segmentSelectedText:t("les_1_d_l_gat_04594",d.count,d.name)})}),l===vg.AccreditationsMatrix?(0,i.jsx)(vU,{}):(0,i.jsx)(hP,{customFields:e.customFields,eventId:o,level:ke.Event,organizationId:n})]})]})},yU=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,segmentId:r}}=bd(),{hasPermission:a,localEvent:l,updateLocalEvent:d}=dv(),c=Ei(wg),u=(0,V.useMemo)(()=>c.getDelegationsFilters(e.event.organizationId,s,e.organization.customFields.nodes,e.organization.delegationsCategories.nodes),[e.event,e.organization,s]),m=(0,V.useMemo)(()=>c.getDelegationsPossibleColumns(s,e.organization.customFields.nodes),[s,e.organization]);return(0,i.jsx)(p$,{eventId:s,getEditPath:e=>Zi(qo.DELEGATION({organizationId:o,eventId:s,delegationId:e})),getShowPath:e=>qo.DELEGATION({organizationId:o,eventId:s,delegationId:e}),organizationId:o,children:(0,i.jsx)(kz,{canSegmentEdit:a(Ov.SEGMENT_EDIT),eventId:s,filters:u,filtersButtonText:n("filtrer_les_d_l_04628"),filtersSubtitle:n("appliquer_des_f_65318"),getSegmentPath:e=>fs.DELEGATIONS_SEGMENT(o,s,e),hideSegments:0===e.event.numberOfDelegations,initialLimit:l?.delegationsLimit??em,initialSegmentsOpen:l?.areDelegationsSegmentsOpen??!0,organizationId:o,possibleColumns:m,possibleRenderings:[vg.List,vg.AccreditationsMatrix],reload:e.reload,segmentId:r,segmentType:Me.Delegations,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{d({delegationsLimit:e})},onSegmentClick:e=>{d({delegationsSegmentId:e})},onSegmentDelete:async()=>{await d({delegationsSegmentId:null}),t.replace(qo.DELEGATIONS({organizationId:o,eventId:s}))},onSegmentsToggle:async e=>{await d({areDelegationsSegmentsOpen:e})},children:(0,i.jsx)(CU,{customFields:e.organization.customFields.nodes,numberOfDelegations:e.event.numberOfDelegations})})})},AU=()=>{const{params:{organizationId:e,eventId:t},translate:n}=bd(),{event:{name:o},localEvent:s}=dv();Zc(`${o} ${n("d_l_gations_78318")}`);const{data:r,loader:a,reload:l}=Oi("query DelegationsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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},[js.SegmentCustomFieldFragment,js.SegmentsFoldersSegmentsFragment]),d=(0,V.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:fs.DELEGATIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(yU,{event:r.event,organization:r.organization,reload:l})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:fs.DELEGATIONS_SEGMENT(e,t,s?.delegationsSegmentId&&d.includes(s.delegationsSegmentId)?s.delegationsSegmentId:d[0]),replace:!0})})]})},SU=()=>{const{hasFeature:e}=_v();return e(Ae.Delegation)?(0,i.jsx)(AU,{}):(0,i.jsx)(rd,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(kx,{icon:"people-group"})})};let kU=class extends ic{constructor(e){super(e)}delegationsSpaceLayoutTabInputDefault(){return{name:this.t("tab_sans_nom_50048"),description:"",slug:"",canDelete:!0,isVisible:!0,isPinned:!1,segmentType:Me.Volunteers,rendering:Cg.List,infos:{matrixShowAccreditations:!0,matrixShowProfiles:!0}}}defaultDashboardTab(){return{name:this.t("tableau_de_bord_24627"),description:"",slug:Hi.DASHBOARD,canDelete:!1,isVisible:!0,isPinned:!0,segmentType:Me.Volunteers,rendering:Cg.List,infos:{}}}defaultDocumentsTab(){return{name:this.t("Documents"),description:"",slug:Hi.DOCUMENTS,canDelete:!1,isVisible:!0,isPinned:!1,segmentType:Me.Volunteers,rendering:Cg.List,infos:{}}}tabInputSchema(){return c.Ik().shape({name:c.Yj().required(this.t("le_nom_est_requ_61536")),description:c.Yj(),slug:c.Yj().required(this.t("l_url_est_requi_99475")).test("is-valid-slug",this.t("le_slug_ne_doit_10047"),e=>h(e)===e),canDelete:c.zM().required(),isVisible:c.zM().required(),isPinned:c.zM().required(),segmentType:c.Yj().oneOf([Me.Accreditations,Me.Volunteers],this.t("le_type_de_vue_62720")).required(this.t("le_type_de_vue_62720")),rendering:c.Yj().required(this.t("le_type_de_visu_51393"))})}};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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],kU);let wU=class extends ic{tabInput;constructor(e,t){super(e),this.tabInput=t}delegationSpaceLayoutInputDefault(e){return{name:e?.name??"",tabs:e?.tabs??[this.tabInput.defaultDashboardTab(),this.tabInput.defaultDocumentsTab()]}}delegationSpaceLayoutInputSchema(){return c.Ik().shape({name:c.Yj().required(this.t("le_nom_du_layou_34851")),tabs:c.YO().of(this.tabInput.tabInputSchema())})}createUpdateDelegationSpaceLayout(){return c.Ik().shape({delegationsSpaceLayout:this.delegationSpaceLayoutInputSchema()})}};wU=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si,kU])],wU);const EU=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)(!0),{slug:s,canDelete:r,isVisible:a,isPinned:l,segmentType:d,rendering:c}=e.delegationsSpaceLayoutTab,u=(0,V.useMemo)(()=>d===Me.Volunteers?[Cg.AccreditationsMatrix,Cg.List]:[Ig.Table,Ig.WeeklyCalendar],[d]),m=(0,V.useMemo)(()=>e.customFields.filter(e=>e.fieldType===Oe.Select&&!e.canSelectMultiple).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id)),[e.customFields]),g=(0,V.useCallback)(t=>{Gd(t),e.form.change(`${e.prefix}isVisible`,!a)},[a,e.form,e.prefix]),p=(0,V.useMemo)(()=>n&&a,[n,a]),f=r,_=r,x=r&&d===Me.Volunteers&&c===Cg.List,I=r&&d===Me.Volunteers&&c===Cg.AccreditationsMatrix,v=I,b=I,j=b&&Bs(e.accreditationsProfilesOptions),C=r&&(!b||!1!==e.delegationsSpaceLayoutTab.infos?.matrixShowAccreditations),y=j&&!1!==e.delegationsSpaceLayoutTab.infos?.matrixShowProfiles,A=r&&d===Me.Accreditations&&c===Ig.Table&&Bs(e.delegationsSpaceLayoutTab.infos?.accreditationsSlotsIds),S=s===Hi.DOCUMENTS;return(0,i.jsxs)(rd,{css:{background:"white",bd:!0,overflow:"hidden",userSelect:"none"},direction:"column",children:[(0,i.jsxs)(rd,{align:"center",css:{cursor:"pointer",padding:"$3 $4"},gap:"2",onClick:()=>o(!p),children:[(0,i.jsx)(rd,{align:"center",css:{fontSize:"$textXs"},height:20,justify:"center",width:20,children:(0,i.jsx)(Id,{icon:p?"chevron-down":"chevron-right"})}),(0,i.jsx)(ka,{css:{flex:"1"},font:"gray800 textSm semiBold",children:e.delegationsSpaceLayoutTab.name}),(0,i.jsxs)(rd,{gap:"3",children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(kd,{color:"white",disabled:e.isDownDisabled,leftIcon:"chevron-down",size:"sm",onClick:t=>{Gd(t),e.moveDown(e.index)}})}),(0,i.jsx)(bp,{placement:"top",children:t("d_placer_vers_l_52432")})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(kd,{color:"white",disabled:e.isUpDisabled,leftIcon:"chevron-up",size:"sm",onClick:t=>{Gd(t),e.moveUp(e.index)}})}),(0,i.jsx)(bp,{placement:"top",children:t("d_placer_vers_l_49863")})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(kd,{color:"white",leftIcon:l?"thumbtack":"thumbtack-slash",size:"sm",onClick:t=>{Gd(t),e.onPin(e.index)}})}),(0,i.jsx)(bp,{placement:"top",children:t("arriver_sur_ce_15500")})]}),r?(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.onDelete})}),(0,i.jsx)(bp,{placement:"top",children:t("supprimer_le_ta_78990")})]}):(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(kd,{color:"white",leftIcon:a?"eye":"eye-slash",size:"sm",onClick:g})}),(0,i.jsx)(bp,{placement:"top",children:t(a?"cacher_le_tab_97084":"afficher_le_tab_00199")})]})]})]}),p&&(0,i.jsx)(rd,{css:{background:"$gray50",borderTop:"1px solid $gray200",padding:"$6"},direction:"column",children:(0,i.jsxs)(rd,{css:{background:"white",bd:"gray200 2 xs",padding:"$3 $4"},direction:"column",gap:"4",children:[(0,i.jsx)(Ba.Yr,{name:`${e.prefix}name`,children:t=>{e.delegationsSpaceLayoutTab.canDelete&&!1===e.form.getFieldState(`${e.prefix}slug`).touched&&e.form.change(`${e.prefix}slug`,h(t))}}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(ec,{label:t("nom_du_tab_91688"),name:`${e.prefix}name`}),(0,i.jsx)(ec,{disabled:!r,label:t("url_72719"),name:`${e.prefix}slug`})]}),f&&(0,i.jsxs)(Ev,{label:t("type_de_vue_13048"),name:`${e.prefix}segmentType`,children:[(0,i.jsx)("option",{value:Me.Volunteers,children:t("membres_11310")}),(0,i.jsx)("option",{value:Me.Accreditations,children:t("accr_ditations_39450")})]}),_&&(0,i.jsx)(Gp,{label:t("type_de_visuali_85493"),name:`${e.prefix}rendering`,children:u.map(e=>(0,i.jsx)("option",{value:e,children:Ag(t,e)},e))}),x&&(0,i.jsx)(tC,{change:e.form.change,columns:e.delegationsSpaceLayoutTab.infos?.columns??[],customFields:e.customFields,prefix:`${e.prefix}infos.`}),b&&(0,i.jsx)(Kp,{name:`${e.prefix}infos.matrixShowAccreditations`,children:t("afficher_les_ac_56952")}),C&&(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,label:(0,i.jsx)(fI,{children:t("filtrer_pour_ce_14760")}),multiple:!0,name:`${e.prefix}infos.accreditationsSlotsIds`,children:e.accreditationsSlotsOptions}),j&&(0,i.jsx)(Kp,{name:`${e.prefix}infos.matrixShowProfiles`,children:t("afficher_les_pr_66300")}),y&&(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,label:(0,i.jsx)(fI,{children:t("profils_d_accr_27825")}),multiple:!0,name:`${e.prefix}infos.accreditationsProfilesIds`,children:e.accreditationsProfilesOptions}),I&&(0,i.jsxs)(Ev,{label:(0,i.jsx)(fI,{children:t("grouper_les_acc_40252")}),name:`${e.prefix}infos.matrixRendering`,children:[(0,i.jsx)("option",{value:xg.Category,children:t("cat_gorie_00291")}),(0,i.jsx)("option",{value:xg.Date,children:t("Date")})]}),v&&(0,i.jsx)(Kp,{name:`${e.prefix}infos.matrixShowQuota`,children:t("afficher_les_qu_20761")}),A&&(0,i.jsx)(Gp,{isSearchVisible:!0,label:t("champ_personnal_96124"),name:`${e.prefix}infos.customFieldSlug`,children:m}),S&&(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("liste_des_docum_18767"),multiple:!0,name:`${e.prefix}infos.customDocumentsSlugs`,children:e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))})]})})]})},TU=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),s=Ei(kU),r=(0,V.useMemo)(()=>e.isEdit?t("mise_jour_de_17055",e.initialValues.delegationsSpaceLayout.name):t("cr_ation_d_un_l_62705"),[e.initialValues,e.isEdit]),a=(0,V.useCallback)(t=>{e.form.change("delegationsSpaceLayout.tabs",Gs(e.delegationsSpaceLayout.tabs,t,t+1))},[e.delegationsSpaceLayout,e.form]),l=(0,V.useCallback)(t=>{e.form.change("delegationsSpaceLayout.tabs",Gs(e.delegationsSpaceLayout.tabs,t,t-1))},[e.delegationsSpaceLayout,e.form]),d=(0,V.useCallback)(t=>{e.form.change("delegationsSpaceLayout.tabs",e.delegationsSpaceLayout.tabs.map((e,n)=>({...e,isPinned:n===t})))},[e.delegationsSpaceLayout.tabs,e.form]);return Zc(r),(0,i.jsx)(zp,{button:e.isEdit?(0,i.jsx)(kd,{isLoading:e.submitting,onClick:e.handleSubmit,children:t("mettre_jour_l_99541")}):null,category:r,color:"dark",fallbackClosePath:Vk.DELEGATIONS_SPACE_LAYOUTS({organizationId:n,eventId:o}),heading:e.isEdit?e.initialValues.delegationsSpaceLayout.name:t("nouveau_layout_19257"),children:(0,i.jsxs)(Op,{ref:e.centeredContainerRef,children:[(0,i.jsx)(Nd,{}),(0,i.jsx)(Wp,{heading:t("informations_su_00505"),children:(0,i.jsx)(rd,{direction:"column",gap:"6",width:1,children:(0,i.jsx)(ec,{label:t("nom_du_layout_81794"),name:"delegationsSpaceLayout.name"})})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:t("DelegationsSpaceLayout"),children:(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[e.delegationsSpaceLayout.tabs.map((t,n)=>(0,i.jsx)(EU,{accreditationsProfilesOptions:e.accreditationsProfilesOptions,accreditationsSlotsOptions:e.accreditationsSlotsOptions,customDocuments:e.customDocuments,customFields:e.customFields,delegationsSpaceLayoutTab:t,form:e.form,index:n,isDownDisabled:n===e.delegationsSpaceLayout.tabs.length-1,isUpDisabled:0===n,moveDown:a,moveUp:l,prefix:`delegationsSpaceLayout.tabs[${n}].`,onDelete:()=>(t=>{e.form.change("delegationsSpaceLayout.tabs",qs(e.delegationsSpaceLayout.tabs,t))})(n),onPin:d},n)),(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",onClick:()=>{e.form.change("delegationsSpaceLayout.tabs",[...e.delegationsSpaceLayout.tabs,s.delegationsSpaceLayoutTabInputDefault()])},children:t("ajouter_un_tab_01565")})]})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)($p,{children:(0,i.jsx)(kd,{isLoading:e.submitting,textAlign:"center",onClick:e.handleSubmit,children:e.isEdit?t("mettre_jour_l_99541"):t("cr_er_le_layout_39460")})})]})})},RU=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=bd(),{showNotification:r}=HI(),a=Ei(Cm),l=Ei(ld),d=Ei(wU),c=(0,V.useRef)(null),u=(0,V.useMemo)(()=>Kg(a,e.accreditationsCategories),[e.accreditationsCategories]),m=(0,V.useMemo)(()=>PS(e.accreditationsProfiles),[e.accreditationsProfiles]);return(0,i.jsx)(Vd,{customErrorRef:c,height:1,hideDefaultErrors:!0,initialValues:e.initialValues,render:({form:t,handleSubmit:n,submitting:o,values:s})=>(0,i.jsx)(TU,{accreditationsProfilesOptions:m,accreditationsSlotsOptions:u,centeredContainerRef:c,customDocuments:e.customDocuments,customFields:e.customFields,delegationsSpaceLayout:s.delegationsSpaceLayout,form:t,handleSubmit:n,initialValues:e.initialValues,isEdit:e.isEdit,submitting:o}),validate:l.validateForForm(d.createUpdateDelegationSpaceLayout()),width:1,onSubmit:async i=>{await e.mutate({eventId:s,delegationsSpaceLayout:i.delegationsSpaceLayout}),r(n("le_layout_a_t_59662")),t.goBack(Vk.DELEGATIONS_SPACE_LAYOUTS({organizationId:o,eventId:s}))}})},OU=()=>{const{params:{organizationId:e,eventId:t}}=bd(),n=Ei(wU),{data:o,loader:s}=Oi("query DelegationsSpaceLayoutEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo, privacy: Public) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n accreditationsProfiles {\n nodes {\n id\n name\n\n accreditationProfileCategory {\n id\n name\n }\n }\n }\n\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n accreditationDisplay\n index\n\n slots(includeHidden: true) {\n id\n date\n name\n }\n }\n }\n\n customDocuments {\n slug\n name\n }\n }\n}\n",{organizationId:e,eventId:t},[js.SegmentCustomFieldFragment]),{mutate:r}=function(e={}){return Di("mutation DelegationsSpaceLayoutCreate(\n $eventId: EventId!\n $delegationsSpaceLayout : DelegationsSpaceLayoutInput!\n)\n{\n delegationsSpaceLayoutCreate(eventId: $eventId, delegationsSpaceLayout: $delegationsSpaceLayout) {\n id\n }\n}\n",e)}(),a=(0,V.useMemo)(()=>o.event?{delegationsSpaceLayout:n.delegationSpaceLayoutInputDefault()}:{},[o]);return s||(0,i.jsx)(RU,{accreditationsCategories:o.event.accreditationsCategories,accreditationsProfiles:o.event.accreditationsProfiles.nodes,customDocuments:o.event.customDocuments,customFields:o.organization.customFields.nodes,initialValues:a,isEdit:!1,mutate:r})},DU=()=>{const{params:{organizationId:e,eventId:t,delegationsSpaceLayoutId:n}}=bd(),o=Ei(wU),{data:s,loader:r}=Oi("query DelegationsSpaceLayoutToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationsSpaceLayoutId: DelegationsSpaceLayoutId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo, privacy: Public) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n accreditationsProfiles {\n nodes {\n id\n name\n\n accreditationProfileCategory {\n id\n name\n }\n }\n }\n\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n accreditationDisplay\n index\n\n slots(includeHidden: true) {\n id\n date\n name\n }\n }\n }\n\n customDocuments {\n slug\n name\n }\n\n delegationsSpaceLayout(id: $delegationsSpaceLayoutId) {\n name\n\n tabs {\n name\n description\n slug\n canDelete\n isVisible\n isPinned\n segmentType\n rendering\n infos\n }\n }\n }\n}\n",{organizationId:e,eventId:t,delegationsSpaceLayoutId:n},[js.SegmentCustomFieldFragment]),{mutate:a}=function(e={}){return Di("mutation DelegationsSpaceLayoutUpdate(\n $eventId: EventId!\n $delegationsSpaceLayoutId: DelegationsSpaceLayoutId!\n $delegationsSpaceLayout: DelegationsSpaceLayoutInput!\n) {\n delegationsSpaceLayoutUpdate(\n eventId: $eventId\n delegationsSpaceLayoutId: $delegationsSpaceLayoutId\n delegationsSpaceLayout: $delegationsSpaceLayout\n ) {\n id\n }\n}\n",e)}(),l=(0,V.useMemo)(()=>s.event?{delegationsSpaceLayout:o.delegationSpaceLayoutInputDefault(s.event.delegationsSpaceLayout)}:{},[s]);return r||(0,i.jsx)(RU,{accreditationsCategories:s.event.accreditationsCategories,accreditationsProfiles:s.event.accreditationsProfiles.nodes,customDocuments:s.event.customDocuments,customFields:s.organization.customFields.nodes,initialValues:l,isEdit:!0,mutate:async e=>a({...e,delegationsSpaceLayoutId:n})})};let zU=class extends ic{constructor(e){super(e)}customDocumentInputDefault(e){return{name:e?.name??"",slug:e?.slug??"",populationsIds:e?.populationsIds??[],configuration:e?.configuration??this.getConfigurationDefault(),shouldRegenerateTicketIdOnDownload:e?.shouldRegenerateTicketIdOnDownload??!1}}customDocumentInputSchema(){return c.Ik().shape({name:c.Yj().required(this.t("le_nom_est_requ_61536")),slug:c.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:tf,pages:[this.getPageDefault()],width:nf}}getPageDefault(){return{id:W(),accreditationsSlotsIds:[],accreditationAcronym:"",conditionsCustomFields:[],elements:[],hasConditions:!1,positionsSlotsIds:[],segmentsIds:[]}}getContainerElementDefault(e,t,n){return{type:"container",id:e,inContainer:!!t,inGrid:"grid"===t?.type,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,segmentsIds:[],top:0,width:100,zIndex:1}}getGridElementDefault(e,t,n){return{type:"grid",id:e,inContainer:!!t,inGrid:"grid"===t?.type,backgroundColor:"",accreditationsSlotsIds:[],accreditationAcronym:"",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,columnGap:0,columns:2,conditionsCustomFields:[],elements:[],hasBackground:!1,hasConditions:!1,hasRotate:!1,height:100,isRatioLocked:!1,left:0,name:this.t("grille_1_66496",n+1),positionsSlotsIds:[],px:0,py:0,rotateDegree:0,rowGap:0,rows:2,segmentsIds:[],top:0,width:100,zIndex:1}}getImageElementDefault(e,t,n){return{type:"image",id:e,inContainer:!!t,inGrid:"grid"===t?.type,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,segmentsIds:[],top:0,width:100,zIndex:1}}getTextElementDefault(e,t,n){return{type:"text",id:e,inContainer:!!t,inGrid:"grid"===t?.type,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,segmentsIds:[],textTransform:"none",top:0,width:100,zIndex:1}}};zU=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],zU);const $U={Code39:"{user.code39}",Picture:"{user.picture}",QrCode:"{user.qrcode}",Skidata:"{user.skidata}"};function PU(e){return"container"===e.type||"grid"===e.type}function MU(e){const t=e=>e.flatMap(e=>PU(e)?[e].concat(t(e.elements)):[e]);return e.configuration.pages.flatMap(e=>t(e.elements))}function FU(e,t){const n=(e,i,o)=>{for(const s of i){if(s.id===t)return{ancestors:o,element:s,page:e};if(PU(s)){const t=n(e,s.elements,[...o,s]);if(t)return t}}return null};for(const t of e.pages){const e=n(t,t.elements,[]);if(e)return e}return null}const NU=(e,t)=>e<=1?e*t:e;function LU(e,t,n){let i=t,o=n,s=t,r=n,a=null;for(const t of[...e.ancestors,e.element])"grid"===a?.type?(s=(i-a.columnGap*(a.columns-1))/a.columns,r=(o-a.rowGap*(a.rows-1))/a.rows):(s=NU(t.width,i),r=NU(t.height,o)),PU(t)&&(i=s-2*((t.px||0)+t.borderSize),o=r-2*((t.py||0)+t.borderSize),a=t);return{height:Math.max(Math.round(r),2),width:Math.max(Math.round(s),2)}}function BU(e,t,n){return e.toSpliced(Math.min(Math.max(t,0),e.length),0,n)}function VU(e,t){return e.filter(e=>e.id!==t).map(e=>PU(e)?{...e,elements:VU(e.elements,t)}:e)}function UU(e,t,n,i){return e.map(e=>PU(e)?e.id===t?{...e,elements:BU(e.elements,n,i)}:{...e,elements:UU(e.elements,t,n,i)}:e)}function WU(e,t,n){const i=FU(e,t),o=e.pages.find(e=>e.id===n.pageId),s=n.parentId?FU(e,n.parentId):null,r=s?.element??null;if(!i||!o||n.parentId&&(!r||!PU(r)||s.page.id!==n.pageId||r.id===t||s.ancestors.some(e=>e.id===t)))return e;let a={...i.element,inContainer:!!r,inGrid:"grid"===r?.type};return!r&&i.ancestors.length>0&&(a={...a,...LU(i,e.width,e.height),left:i.ancestors[0].left,top:i.ancestors[0].top}),{...e,pages:e.pages.map(e=>{if(e.id!==i.page.id&&e.id!==n.pageId)return e;let o=e.id===i.page.id?VU(e.elements,t):e.elements;return e.id===n.pageId&&(o=r?UU(o,r.id,n.index,a):BU(o,n.index,a)),{...e,elements:o}})}}function GU(e,t,n){const i={...e,id:t,name:n};if(PU(i)){const e=i.elements.map(e=>GU(e,W(),e.name));return{...i,elements:e}}return i}function qU(e,t){return e===tf&&t===nf?"a4":e===of&&t===sf?"a6":e===rf&&t===af?"cb":"custom"}function HU(e){return e.hasConditions&&(Bs(e.accreditationsSlotsIds)||g(e.accreditationAcronym)||Bs(e.positionsSlotsIds)||Bs(e.segmentsIds)||Bs(e.conditionsCustomFields))}function KU(e,t,n,i,o,s){if(e.hasConditions){if(Bs(e.accreditationsSlotsIds))return Bs((0,Pu.A)(e.accreditationsSlotsIds,t));if(g(e.accreditationAcronym)){const t=e.accreditationAcronym.split(",").map(e=>e.trim()).filter(g);return Bs((0,Pu.A)(t,n))}return Bs(e.positionsSlotsIds)?Bs((0,Pu.A)(e.positionsSlotsIds,i)):Bs(e.segmentsIds)?Bs((0,Pu.A)(e.segmentsIds,o)):!Bs(e.conditionsCustomFields)||e.conditionsCustomFields.every(({slug:e,value:t})=>"isEmpty"===t?p(s[e]?.rawValue):"isNotEmpty"===t?g(s[e]?.rawValue):"boolean"==typeof t?s[e]?.rawValue===t:!!Array.isArray(t)&&Bs((0,Pu.A)(Ls(s[e]?.rawValue),t)))}return!0}const YU=(0,V.createContext)({}),ZU=e=>{const{translate:t,params:{eventId:n}}=bd(),o=Ei(Cm),s=Ei(Yh),r=Ei(zU),[a,d]=(0,V.useState)(e.initialCustomDocument),[c,u]=(0,V.useState)(null),[m,p]=(0,V.useState)(null),[f,_]=(0,V.useState)("parameters"),[x,I]=(0,V.useState)(100),[v,b]=(0,V.useState)(null),[j,C]=(0,V.useState)(null),y=(0,V.useCallback)(e=>{d((0,Wm.jM)(t=>{t.name=e}))},[a,d]),A=(0,V.useCallback)((e,t)=>{d((0,Wm.jM)(n=>{n.configuration.pages.forEach(n=>{n.id===m&&(n[e]=t)})}))},[m,d]),S=(0,V.useCallback)(e=>{d((0,Wm.jM)(t=>{t.populationsIds=e}))},[d]),k=(0,V.useCallback)(e=>{d((0,Wm.jM)(t=>{t.slug=h(e,{replacer:l.Empty})}))},[d]),w=(0,V.useCallback)(e=>{d((0,Wm.jM)(t=>{t.configuration.bleed=e}))},[a,d]),E=(0,V.useCallback)((e,t)=>{d((0,Wm.jM)(n=>{n.configuration.height=e,n.configuration.width=t}))},[a,d]),T=(0,V.useCallback)(e=>{d((0,Wm.jM)(t=>{t.shouldRegenerateTicketIdOnDownload=e}))},[a,d]),R=(0,V.useCallback)(()=>{u(null),p(null)},[u,p]),O=(0,V.useCallback)(()=>MU(a).find(e=>e.id===c)||null,[a,c]),D=(0,V.useCallback)(()=>a.configuration.pages.find(e=>e.id===m)||null,[a,m]),z=(0,V.useCallback)(()=>{d((0,Wm.jM)(e=>{e.configuration.pages.push(r.getPageDefault())}))},[d]),$=(0,V.useCallback)(e=>{d((0,Wm.jM)(t=>{t.configuration.pages=t.configuration.pages.filter(t=>t.id!==e)}))},[d]),P=(0,V.useCallback)((e,t)=>{const n=W();d((0,Wm.jM)(i=>{e?MU(i).forEach(i=>{PU(i)&&i.id===e.id&&i.elements.push(r[t](n,i,i.elements.length))}):i.configuration.pages.forEach(e=>{e.id===m&&e.elements.push(r[t](n,null,e.elements.length))})})),u(n)},[m,d,u]),M=(0,V.useCallback)(e=>{P(e,"getContainerElementDefault")},[P]),F=(0,V.useCallback)(e=>{P(e,"getGridElementDefault")},[P]),N=(0,V.useCallback)(e=>{P(e,"getImageElementDefault")},[P]),L=(0,V.useCallback)(e=>{P(e,"getTextElementDefault")},[P]),B=(0,V.useCallback)(e=>{d((0,Wm.jM)(t=>{t.configuration.pages.forEach(t=>{t.elements=t.elements.filter(t=>t.id!==e)}),MU(t).forEach(t=>{PU(t)&&(t.elements=t.elements.filter(t=>t.id!==e))})})),u(null)},[a,d,u]),U=(0,V.useCallback)(e=>{const n=W();d((0,Wm.jM)(i=>{MU(i).forEach(i=>{if(PU(i)){const o=i.elements.find(t=>t.id===e);o&&i.elements.push(GU(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(GU(o,n,t("copie_de_1_62900",o.name)))})})),u(n)},[a,d,u]),G=(0,V.useCallback)(e=>{const n=W();d((0,Wm.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=>GU(e,W(),e.name))}}(o,n,g(o.name)?t("copie_de_1_62900",o.name):""))}))},[]),q=(0,V.useCallback)((e,t)=>{u(e),p(t)},[a,u,p]),H=(0,V.useCallback)(e=>{p(e),u(null),_("design")},[u,p,_]),K=(0,V.useCallback)((e,t,n)=>{d((0,Wm.jM)(i=>{const o=MU(i).find(t=>t.id===e);o&&(o[t]=n)}))},[a]),Y=(0,V.useCallback)((e,t,n)=>{d((0,Wm.jM)(i=>{const o=MU(i).find(t=>t.id===e);o&&(o.left+=t,o.top+=n)}))},[d]),Z=(0,V.useCallback)((e,t)=>{d(n=>({...n,configuration:WU(n.configuration,e,t)}))},[d]),X=(0,V.useCallback)((e,t)=>{d((0,Wm.jM)(n=>{const i=MU(n).find(t=>t.id===e);i&&Object.assign(i,t)}))},[d]),{data:J}=Oi("query CustomDocumentConditions($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n accreditationDisplay\n index\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n }\n }\n\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: Volunteers) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{eventId:n},[]),Q=(0,V.useMemo)(()=>Kg(o,J.event?.accreditationsCategories??[]),[J.event]),ee=(0,V.useMemo)(()=>Yg(s,J.event?.positionsCategories??[]),[J.event]),te=(0,V.useMemo)(()=>(J.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)),[J.event]);return(0,i.jsx)(YU.Provider,{value:{accreditationsOptions:Q,addContainerElement:M,addGridElement:F,addImageElement:N,addPage:z,addTextElement:L,cleanSelecteds:R,customDocument:a,customFields:e.customFields,deleteElement:B,duplicateElement:U,duplicatePage:G,getSelectedElement:O,getSelectedPage:D,movingElementId:j,moveElement:Z,offsetElementPosition:Y,population:e.population,positionsOptions:ee,removePage:$,segmentsOptions:te,selectElement:q,selectPage:H,selectedElementId:c,selectedPageId:m,setBleed:w,setDimensions:E,setElementBox:X,setMovingElementId:C,setName:y,setPopulations:S,setShouldRegenerateTicketIdOnDownload:T,setSlug:k,setSnapGuides:b,setTab:_,setZoom:I,snapGuides:v,tab:f,updateElementProperty:K,updatePageProperty:A,zoom:x},children:e.children})};function XU(){return(0,V.useContext)(YU)}const JU=e=>{const{translate:t}=bd(),{addContainerElement:n,addGridElement:o,addImageElement:s,addTextElement:r}=XU();return(0,i.jsxs)(rd,{css:{bd:!0},direction:"column",children:[(0,i.jsxs)(rd,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{r(e.container)},children:[(0,i.jsx)(rd,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(Id,{icon:"text"})}),(0,i.jsx)(ka,{css:{flex:"1"},font:"gray800 textSm medium",children:t("Text")}),(0,i.jsx)(kd,{color:"white",leftIcon:"plus",size:"sm"})]}),(0,i.jsxs)(rd,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{s(e.container)},children:[(0,i.jsx)(rd,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(Id,{icon:"image"})}),(0,i.jsx)(ka,{css:{flex:"1"},font:"gray800 textSm medium",children:t("image_40624")}),(0,i.jsx)(kd,{color:"white",leftIcon:"plus",size:"sm"})]}),(0,i.jsxs)(rd,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{n(e.container)},children:[(0,i.jsx)(rd,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(Id,{icon:"chart-simple"})}),(0,i.jsx)(ka,{css:{flex:"1"},font:"gray800 textSm medium",children:t("conteneur_33078")}),(0,i.jsx)(kd,{color:"white",leftIcon:"plus",size:"sm"})]}),(0,i.jsxs)(rd,{align:"center",css:{cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{o(e.container)},children:[(0,i.jsx)(rd,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(Id,{icon:"table-cells"})}),(0,i.jsx)(ka,{css:{flex:"1"},font:"gray800 textSm medium",children:t("grille_01987")}),(0,i.jsx)(kd,{color:"white",leftIcon:"plus",size:"sm"})]})]})},QU=e=>{const{translate:t}=bd(),{accreditationsOptions:n,customFields:o,positionsOptions:s,segmentsOptions:r}=XU(),a=(0,V.useMemo)(()=>o.filter(e=>e.fieldType===Oe.Checkbox||e.fieldType===Oe.Select||e.fieldType===Oe.Text||e.fieldType===Oe.Validation).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),[o]),l=e.element.conditionsCustomFields||[],d=l.map(e=>e.slug),c=(t,n)=>{const i=(0,Wm.jM)(l,e=>{e[n].value=t});e.updateProperty(e.elementId,"conditionsCustomFields",i)},u=o.filter(e=>d.includes(e.slug));return(0,i.jsx)(UL,{css:{padding:"$4 $6"},title:t("condition_d_aff_68185"),children:(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(Zm,{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,"segmentsIds",[]),e.updateProperty(e.elementId,"conditionsCustomFields",[])),e.updateProperty(e.elementId,"hasConditions",t)},children:t("afficher_en_fon_47208")}),e.element.hasConditions&&(0,i.jsxs)(rd,{css:{background:"$gray100",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$3 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(Uu,{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)(Qd,{label:t("afficher_en_fon_78748"),value:e.element.accreditationAcronym||"",onChange:t=>{e.updateProperty(e.elementId,"accreditationAcronym",t)}}),(0,i.jsx)(Uu,{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)(Uu,{isSearchVisible:!0,label:t("afficher_si_le_05366"),multiple:!0,values:e.element.segmentsIds||[],onChange:t=>{e.updateProperty(e.elementId,"segmentsIds",t)},children:r}),(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("afficher_en_fon_56078"),multiple:!0,values:d,onChange:t=>{const n=(0,yu.A)(t,d),i=o.filter(e=>n.includes(e.slug)),s=(0,yu.A)(d,t),r=l.filter(e=>!s.includes(e.slug)).concat(i.map(e=>({slug:e.slug,value:e.fieldType===Oe.Checkbox||e.fieldType===Oe.Validation||(e.fieldType===Oe.Text?"isNotEmpty":[])})));e.updateProperty(e.elementId,"conditionsCustomFields",r)},children:a}),u.map((e,n)=>e.fieldType===Oe.Checkbox||e.fieldType===Oe.Validation?(0,i.jsxs)(hh,{label:t("afficher_si_la_42654",e.name),shouldParseAsBoolean:!0,value:l[n].value,onChange:e=>{c(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===Oe.Text?(0,i.jsxs)(hh,{label:t("afficher_si_la_42654",e.name),value:l[n].value,onChange:e=>{c(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)(Uu,{isSearchVisible:!0,label:t("afficher_si_la_42654",e.name),multiple:!0,values:l[n].value||[],onChange:e=>{c(e,n)},children:e.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))},e.id))]})]})})},eW=e=>{const{translate:t}=bd(),{updateElementProperty:n}=XU();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(UL,{css:{padding:"$4 $6"},title:t("apparence_75510"),children:(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[!e.element.inGrid&&(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Qd,{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)(Qd,{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)(ka,{css:{alignSelf:"end"},width:40,children:(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(kd,{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)(bp,{placement:"top",children:e.element.isRatioLocked?t("ne_pas_pr_serve_68003"):t("pr_server_le_ra_39750")})]})})]}),!e.element.inContainer&&(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Qd,{label:"X",rightText:"px",shouldParseAsInt:!0,value:e.element.left,onChange:t=>{n(e.element.id,"left",t)}}),(0,i.jsx)(Qd,{label:"Y",rightText:"px",shouldParseAsInt:!0,value:e.element.top,onChange:t=>{n(e.element.id,"top",t)}})]}),!e.element.inContainer&&(0,i.jsx)(Qd,{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)(Zm,{value:e.element.hasRotate,onChange:t=>{n(e.element.id,"hasRotate",t)},children:t("faire_pivoter_06431")}),e.element.hasRotate&&(0,i.jsx)(Qd,{label:t("degr_79492"),rightText:"deg",shouldParseAsInt:!0,value:e.element.rotateDegree,onChange:t=>{n(e.element.id,"rotateDegree",t)}})]}),("container"===e.element.type||"grid"===e.element.type||"text"===e.element.type)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zm,{value:e.element.hasBackground,onChange:t=>{n(e.element.id,"hasBackground",t)},children:t("afficher_un_arr_96006")}),e.element.hasBackground&&(0,i.jsx)(rj,{label:t("couleur_de_fond_75677"),value:e.element.backgroundColor,onChange:t=>{n(e.element.id,"backgroundColor",t)}})]}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Qd,{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)(rj,{label:t("couleur_de_la_b_84227"),value:e.element.borderColor,onChange:t=>{n(e.element.id,"borderColor",t)}})]}),(0,i.jsx)(Qd,{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)(rd,{gap:"4",children:[(0,i.jsx)(Qd,{label:t("padding_horizon_14268"),rightText:"px",shouldParseAsInt:!0,value:e.element.px,onChange:t=>{n(e.element.id,"px",t)}}),(0,i.jsx)(Qd,{label:t("padding_vertica_78457"),rightText:"px",shouldParseAsInt:!0,value:e.element.py,onChange:t=>{n(e.element.id,"py",t)}})]})]})}),(0,i.jsx)(QU,{element:e.element,elementId:e.element.id,updateProperty:n})]})},tW=e=>{const{translate:t}=bd(),{getSelectedPage:n,selectPage:o,updateElementProperty:s}=XU();return(0,i.jsxs)(rd,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(rd,{css:{padding:"$2 $6"},children:(0,i.jsx)(kd,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{o(n().id)},children:t("retour_92202")})}),(0,i.jsxs)(UL,{css:{padding:"$4 $6"},title:t("initialisation_38640"),children:[(0,i.jsx)(Qd,{label:t("nom_08311"),value:e.container.name,onChange:t=>{s(e.container.id,"name",t)}}),(0,i.jsx)(JU,{container:e.container})]}),(0,i.jsxs)(UL,{css:{padding:"$4 $6"},title:t("conteneur_33078"),children:[(0,i.jsxs)(hh,{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)(Qd,{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)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray700 textSm medium",children:t("alignement_54247")}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsxs)(rd,{children:[(0,i.jsx)(kd,{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)(kd,{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)(kd,{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)(rd,{children:[(0,i.jsx)(kd,{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)(kd,{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)(kd,{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)(eW,{element:e.container})]})},nW=()=>{const{translate:e}=bd(),{getSelectedPage:t,updatePageProperty:n}=XU(),o=t();return(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsxs)(UL,{css:{padding:"$4 $6"},title:e("initialisation_38640"),children:[(0,i.jsx)(Qd,{label:e("nom_de_la_page_82146"),value:o.name||"",onChange:e=>{n("name",e)}}),(0,i.jsx)(JU,{container:null})]}),(0,i.jsx)(QU,{element:o,elementId:o.id,updateProperty:(e,t,i)=>{n(t,i)}})]})},iW=()=>{const{translate:e}=bd(),{getSelectedPage:t}=XU();return t()?(0,i.jsx)(nW,{}):(0,i.jsx)(rd,{css:{px:"$4"},height:1,width:1,children:(0,i.jsxs)(rd,{align:"center",css:{bd:!0,px:"$9"},direction:"column",gap:"4",height:1,justify:"center",width:1,children:[(0,i.jsx)(rd,{css:{border:"1px solid $gray200",borderRadius:"10px",padding:"$3"},children:(0,i.jsx)(Id,{icon:"hand-pointer"})}),(0,i.jsx)(ka,{font:"gray800 textMd medium",textAlign:"center",children:e("pour_ajouter_de_11528")})]})})},oW=e=>{const{translate:t}=bd(),{getSelectedPage:n,selectPage:o,updateElementProperty:s}=XU();return(0,i.jsxs)(rd,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(rd,{css:{padding:"$2 $6"},children:(0,i.jsx)(kd,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{o(n().id)},children:t("retour_92202")})}),(0,i.jsxs)(UL,{css:{padding:"$4 $6"},title:t("initialisation_38640"),children:[(0,i.jsx)(Qd,{label:t("nom_08311"),value:e.grid.name,onChange:t=>{s(e.grid.id,"name",t)}}),(0,i.jsx)(JU,{container:e.grid})]}),(0,i.jsxs)(UL,{css:{padding:"$4 $6"},title:t("grille_01987"),children:[(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Qd,{label:t("colonnes_73889"),shouldParseAsInt:!0,value:e.grid.columns,onChange:t=>{s(e.grid.id,"columns",Math.max(1,t))}}),(0,i.jsx)(Qd,{label:t("lignes_66458"),shouldParseAsInt:!0,value:e.grid.rows,onChange:t=>{s(e.grid.id,"rows",Math.max(1,t))}})]}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Qd,{label:t("_cart_entre_les_90779"),rightText:"px",shouldParseAsInt:!0,value:e.grid.columnGap,onChange:t=>{s(e.grid.id,"columnGap",t)}}),(0,i.jsx)(Qd,{label:t("_cart_entre_les_05132"),rightText:"px",shouldParseAsInt:!0,value:e.grid.rowGap,onChange:t=>{s(e.grid.id,"rowGap",t)}})]})]}),(0,i.jsx)(eW,{element:e.grid})]})},sW=e=>{const{translate:t,params:{organizationId:n}}=bd(),{hasFeature:o}=_v(),{getSelectedPage:s,selectPage:r,updateElementProperty:a}=XU(),l=(d=e.image.source,Object.values($U).includes(d)?e.image.source:"custom");var d;return(0,i.jsxs)(rd,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(rd,{css:{padding:"$2 $6"},children:(0,i.jsx)(kd,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{r(s().id)},children:t("retour_92202")})}),(0,i.jsxs)(UL,{css:{padding:"$4 $6"},title:t("initialisation_38640"),children:[(0,i.jsx)(Qd,{label:t("nom_08311"),value:e.image.name,onChange:t=>{a(e.image.id,"name",t)}}),(0,i.jsxs)(hh,{label:t("source_16397"),value:l,onChange:t=>{a(e.image.id,"source","custom"===t?"":t)},children:[(0,i.jsx)("option",{value:$U.Picture,children:t("photo_de_profil_08618")}),(0,i.jsx)("option",{value:$U.QrCode,children:t("qr_code_du_bill_78196")}),(0,i.jsx)("option",{value:$U.Code39,children:t("code_barres_du_74438")}),(o(Ae.Skidata)||l===$U.Skidata)&&(0,i.jsx)("option",{value:$U.Skidata,children:t("qr_code_skidata_53182")}),(0,i.jsx)("option",{value:"custom",children:t("fichier_ou_lien_26488")})]}),"custom"===l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pI,{accept:Vx.SmallImages,acl:"public-read",label:t("File"),organizationId:n,value:null,onChange:t=>{if(t){const n=`https://${F.HEAVENT_AWS_UPLOADS_BUCKET}.s3.eu-west-1.amazonaws.com/${t.key}`;a(e.image.id,"source",n)}}}),(0,i.jsx)(Qd,{label:t("lien_de_l_image_40053"),placeholder:"https://",value:e.image.source||"",onChange:t=>{a(e.image.id,"source",t)}})]}),(0,i.jsx)(Qd,{label:t("lien_68557"),value:e.image.link||"",onChange:t=>{a(e.image.id,"link",t)}})]}),(0,i.jsx)(eW,{element:e.image})]})},rW=()=>{const{translate:e}=bd(),{customDocument:t,population:n,setBleed:o,setDimensions:s,setName:r,setPopulations:a,setShouldRegenerateTicketIdOnDownload:l,setSlug:d}=XU(),c=t.configuration.height,u=t.configuration.width,m=qU(c,u),h=(0,V.useMemo)(()=>(0,cm.A)(n.values,e=>e.value.toLowerCase()),[n]);return(0,i.jsxs)(rd,{css:{px:"$4"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Qd,{label:e("nom_du_document_73868"),value:t.name,onChange:r}),(0,i.jsxs)(hh,{label:e("format_du_docum_28991"),value:m,onChange:e=>{"a4"===e?s(tf,nf):"a6"===e?s(of,sf):"cb"===e?s(rf,af):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"===m&&(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Qd,{hint:`${Oa(t.configuration.width)}mm`,label:e("largeur_54184"),rightText:"px",shouldParseAsInt:!0,value:t.configuration.width,onChange:e=>{s(c,e)}}),(0,i.jsx)(Qd,{hint:`${Oa(t.configuration.height)}mm`,label:e("hauteur_56576"),rightText:"px",shouldParseAsInt:!0,value:t.configuration.height,onChange:e=>{s(e,u)}})]}),t.configuration.bleed&&(0,i.jsx)(Eu,{state:t.configuration.bleed?"checked":"unchecked",onClick:e=>{o("checked"===e)},children:e("ajouter_des_fon_73494")}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(Qd,{hint:e("ne_doit_conteni_53122"),label:e("nom_de_la_varia_81999"),value:t.slug,onChange:d}),(0,i.jsx)(Uu,{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))}),(0,i.jsx)(Eu,{state:t.shouldRegenerateTicketIdOnDownload?"checked":"unchecked",onClick:e=>{l("checked"===e)},children:e("r_g_n_rer_le_co_99491")})]})},aW=(0,cm.A)(["Arial","Georgia"].concat(["Anton","Archivo","Arimo","Asap","Barlow","Be Vietnam Pro","Bebas Neue","Big Shoulders","Bricolage Grotesque","Bungee","Chivo","Cossette Texte","Cossette Titre","Fira Sans","Fraunces","Google Sans Flex","IBM Plex Sans","Inter","Jost","Kumbh Sans","Lato","League Gothic","Lexend Deca","Merriweather","Montserrat","Noto Sans","Nunito","Open Sans","Oswald","Oxanium","PT Sans","Playfair Display","Plus Jakarta Sans","Poppins","Prompt","Raleway","Righteous","Roboto","Rubik","Saira","Ubuntu","Unbounded"]));function lW(){return(0,V.useMemo)(()=>aW.map(e=>(0,i.jsx)("option",{value:e,children:e},e)),[])}const dW=e=>{const{translate:t}=bd(),{customFields:n,getSelectedPage:o,selectPage:s,updateElementProperty:r}=XU(),a=lW(),l=(0,V.useMemo)(()=>(0,cm.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.email",name:t("e_mail_du_respo_71747")},{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")},{slug:"profile",name:t("profil_d_accr_d_02274")},{slug:"profileCategory",name:t("cat_gorie_du_pr_95638")}]),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,xf.A)(e.text.fontSize*d,2);return(0,i.jsxs)(rd,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(rd,{css:{padding:"$2 $6"},children:(0,i.jsx)(kd,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{s(o().id)},children:t("retour_92202")})}),(0,i.jsx)(UL,{css:{padding:"$4 $6"},title:t("initialisation_38640"),children:(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(Qd,{label:t("nom_du_calque_77484"),value:e.text.name,onChange:t=>{r(e.text.id,"name",t)}}),(0,i.jsx)(qp,{label:t("contenu_29668"),value:e.text.text,onChange:t=>{r(e.text.id,"text",t)}}),(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("ajouter_une_var_79098"),values:[],onChange:t=>{Bs(t)&&r(e.text.id,"text",`${e.text.text} ${t[0]}`.trim())},children:l})]})}),(0,i.jsx)(UL,{css:{padding:"$4 $6"},title:t("typographie_11343"),children:(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(Uu,{isSearchVisible:!0,label:"Police",values:[e.text.fontFamily],onChange:t=>{r(e.text.id,"fontFamily",t[0]||"Open Sans")},children:a}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Qd,{label:t("taille_de_la_po_58427"),shouldParseAsInt:!0,value:e.text.fontSize,onChange:t=>{r(e.text.id,"fontSize",t)}}),(0,i.jsx)(Lp,{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)(rd,{gap:"4",children:[(0,i.jsx)(rj,{label:t("couleur_du_text_32021"),value:e.text.color,onChange:t=>{r(e.text.id,"color",t)}}),(0,i.jsxs)(hh,{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)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray700 textSm medium",children:t("alignement_54247")}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsxs)(rd,{children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(kd,{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)(bp,{placement:"top",children:t("aligner_gauch_04681")})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(kd,{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)(bp,{placement:"top",children:t("centrer_39779")})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(kd,{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)(bp,{placement:"top",children:t("aligner_droit_73883")})]})]}),(0,i.jsxs)(rd,{children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(kd,{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)(bp,{placement:"top",children:t("aligner_en_haut_69916")})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(kd,{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)(bp,{placement:"top",children:t("centrer_39779")})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(kd,{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)(bp,{placement:"top",children:t("aligner_en_bas_42956")})]})]})]})]}),(0,i.jsxs)(hh,{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)(eW,{element:e.text})]})},cW=()=>{const{translate:e}=bd(),{getSelectedElement:t,tab:n,setTab:o}=XU(),s=t();return"container"===s?.type?(0,i.jsx)(tW,{container:s}):"grid"===s?.type?(0,i.jsx)(oW,{grid:s}):"image"===s?.type?(0,i.jsx)(sW,{image:s}):"text"===s?.type?(0,i.jsx)(dW,{text:s}):(0,i.jsxs)(rd,{css:{boxShadow:"$sm",overflow:"hidden auto",py:"$6",paddingBottom:"$11"},direction:"column",gap:"6",height:1,width:1,children:[(0,i.jsx)(rd,{css:{px:"$4"},children:(0,i.jsxs)(vI,{selectedItem:n,onChange:o,children:[(0,i.jsx)(bI,{item:"parameters",children:e("param_tres_78420")}),(0,i.jsx)(bI,{item:"design",children:e("design_15043")})]})}),"parameters"===n&&(0,i.jsx)(rW,{}),"design"===n&&(0,i.jsx)(iW,{})]})},uW=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{css:{borderTop:"1px solid black",height:"1px",left:"0",position:"absolute",top:"19px",width:"11px"}}),(0,i.jsx)(ka,{css:{borderRight:"1px solid black",height:"11px",left:"19px",position:"absolute",top:"0",width:"1px"}}),(0,i.jsx)(ka,{css:{borderTop:"1px solid black",height:"1px",position:"absolute",right:"0",top:"19px",width:"11px"}}),(0,i.jsx)(ka,{css:{borderRight:"1px solid black",height:"11px",position:"absolute",right:"19px",top:"0",width:"1px"}}),(0,i.jsx)(ka,{css:{borderTop:"1px solid black",bottom:"19px",height:"1px",left:"0",position:"absolute",width:"11px"}}),(0,i.jsx)(ka,{css:{borderRight:"1px solid black",bottom:"0",height:"11px",left:"19px",position:"absolute",width:"1px"}}),(0,i.jsx)(ka,{css:{borderTop:"1px solid black",bottom:"19px",height:"1px",position:"absolute",right:"0",width:"11px"}}),(0,i.jsx)(ka,{css:{borderRight:"1px solid black",bottom:"0",height:"11px",position:"absolute",right:"19px",width:"1px"}})]}),mW={x:null,y:null},hW=(e,t)=>e<=1?e*t:e;function gW(e,t,n){return{height:hW(e.height,n),left:e.left,top:e.top,width:hW(e.width,t)}}function pW(e,t,n,i){const o=[{height:i,left:0,top:0,width:n}].concat(e.filter(e=>e.id!==t&&!e.hasRotate).map(e=>gW(e,n,i)));return{x:o.flatMap(e=>[e.left,e.left+e.width/2,e.left+e.width]),y:o.flatMap(e=>[e.top,e.top+e.height/2,e.top+e.height])}}function fW(e,t){let n=mW;return i=>{i.x===n.x&&i.y===n.y||(n=i,t(null===i.x&&null===i.y?null:{...i,pageId:e}))}}function _W(e,t,n){let i=null;return t.forEach(t=>{Math.abs(t-e)<=n&&(null===i||Math.abs(t-e){const t=_W(e,n,i);null!==t&&(null===o.guide||Math.abs(t-e){const a=e.clientX-i,l=e.clientY-o;r||!s&&Math.hypot(a,l){m(),s&&(r||n.onEnd(),function(){const e=e=>{e.stopPropagation()};window.addEventListener("click",e,{capture:!0,once:!0}),setTimeout(()=>{window.removeEventListener("click",e,{capture:!0})},0)}())},d=()=>{s&&!r&&(r=!0,n.onCancel())},c=e=>{"Escape"===e.key&&d()},u=()=>{d(),l()},m=()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",u),document.removeEventListener("keydown",c)};return window.addEventListener("pointermove",a),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",u),document.addEventListener("keydown",c),m}function vW(e,t){const{customDocument:n,offsetElementPosition:i,selectElement:o,setMovingElementId:s,setSnapGuides:r,zoom:a}=XU(),[l,d]=(0,V.useState)(null),c=(0,V.useRef)(null);(0,V.useEffect)(()=>()=>{c.current?.()},[]);const u=(0,V.useCallback)(l=>{if(e.inContainer||0!==l.button)return;const u=a/100,{height:m,pages:h,width:g}=n.configuration,p=h.find(e=>e.id===t)?.elements??[],f=gW(e,g,m),_=pW(p,e.id,g,m),x=fW(t,r);let I={left:0,top:0},v=!1;const b=()=>{v&&(v=!1,x(mW),s(null))};c.current?.();const j=IW(l,3,{onStart:()=>{v=!0,o(e.id,t),s(e.id)},onMove:(t,n,i)=>{let o=e.left+t/u,s=e.top+n/u;if(i.altKey||e.hasRotate)x(mW);else{const e=function(e,t,n){const i=xW(e.left,e.width,t.x,n),o=xW(e.top,e.height,t.y,n);return{guides:{x:i.guide,y:o.guide},left:e.left+i.delta,top:e.top+o.delta}}({...f,left:o,top:s},_,5/u);o=e.left,s=e.top,x(e.guides)}I={left:Math.round(o)-e.left,top:Math.round(s)-e.top},d(I)},onEnd:()=>{i(e.id,I.left,I.top),d(null),b()},onCancel:()=>{d(null),b()}});c.current=()=>{j(),b()}},[n,e,i,t,o,s,r,a]);return{cursor:e.inContainer?void 0:l?"grabbing":"move",left:e.left+(l?.left??0),onPointerDown:u,top:e.top+(l?.top??0)}}const bW=e=>{const{selectedElementId:t,selectElement:n}=XU(),o=vW(e.container,e.pageId);return(0,i.jsx)(rd,{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",cursor:o.cursor,gap:`${e.container.gap}px`,left:`${o.left}px`,outline:t===e.container.id?"2px solid $primary500":"",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:`${o.top}px`,touchAction:e.container.inContainer?void 0:"none",zIndex:e.container.zIndex},direction:e.container.direction,height:e.container.inGrid?1:e.container.height,justify:e.container.justify,width:e.container.inGrid?1:e.container.width,wrap:"wrap",onClick:t=>{Gd(t),n(e.container.id,e.pageId)},onPointerDown:o.onPointerDown,children:e.container.elements.map(t=>(0,i.jsx)(AW,{element:t,pageId:e.pageId},t.id))})},jW=e=>{const{selectedElementId:t,selectElement:n}=XU(),o=vW(e.grid,e.pageId);return(0,i.jsx)(ka,{css:{backgroundColor:e.grid.hasBackground?e.grid.backgroundColor:"none",border:e.grid.borderSize>0?`${e.grid.borderSize}px solid ${e.grid.borderColor}`:"",borderRadius:e.grid.borderRadius>0?`${e.grid.borderRadius}px`:"0",columnGap:`${e.grid.columnGap}px`,cursor:o.cursor,display:"grid",gridTemplateColumns:`repeat(${e.grid.columns}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${e.grid.rows}, minmax(0, 1fr))`,left:`${o.left}px`,outline:t===e.grid.id?"2px solid $primary500":"",overflow:"hidden",paddingBottom:`${e.grid.py||0}px`,paddingLeft:`${e.grid.px||0}px`,paddingRight:`${e.grid.px||0}px`,paddingTop:`${e.grid.py||0}px`,position:e.grid.inContainer?"static":"absolute",rowGap:`${e.grid.rowGap}px`,top:`${o.top}px`,touchAction:e.grid.inContainer?void 0:"none",zIndex:e.grid.zIndex},height:e.grid.inGrid?1:e.grid.height,width:e.grid.inGrid?1:e.grid.width,onClick:t=>{Gd(t),n(e.grid.id,e.pageId)},onPointerDown:o.onPointerDown,children:e.grid.elements.map(t=>(0,i.jsx)(AW,{element:t,pageId:e.pageId},t.id))})},CW=e=>{const{selectedElementId:t,selectElement:n}=XU(),o=vW(e.image,e.pageId);return(0,i.jsx)(ka,{css:{border:e.image.borderSize>0?`${e.image.borderSize}px solid ${e.image.borderColor}`:"",borderRadius:e.image.borderRadius>0?`${e.image.borderRadius}px`:"0",cursor:o.cursor,left:`${o.left}px`,outline:t===e.image.id?"2px solid $primary500":"",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:`${o.top}px`,touchAction:e.image.inContainer?void 0:"none",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.inGrid?1:e.image.height,width:e.image.inGrid?1:e.image.width,onClick:t=>{Gd(t),n(e.image.id,e.pageId)},onPointerDown:o.onPointerDown,children:g(e.image.source)&&(0,i.jsx)("img",{draggable:!1,height:"100%",src:(s=e.image.source,s===$U.Picture?`${F.HEAVENT_ASSETS_URL}/badges/profile.jpg`:s===$U.QrCode||s===$U.Skidata?mf(`https://${F.WEEZEVENT_DOMAIN}`,{height:360,width:360}):s===$U.Code39?mf("12345678",{barcodeType:uf.Code39,height:28,width:234}):s),width:"100%"})});var s},yW=e=>{const{selectedElementId:t,selectElement:n}=XU(),o=vW(e.text,e.pageId),s=NR(e.text.text);return(0,i.jsx)(rd,{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,cursor:o.cursor,left:`${o.left}px`,lineHeight:e.text.lineHeight||1.4,outline:t===e.text.id?"2px solid $primary500":"",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:`${o.top}px`,touchAction:e.text.inContainer?void 0:"none",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:s},height:e.text.inGrid?1:e.text.height,justify:e.text.justify,width:e.text.inGrid?1:e.text.width,onClick:t=>{Gd(t),n(e.text.id,e.pageId)},onPointerDown:o.onPointerDown})},AW=e=>"container"===e.element.type?(0,i.jsx)(bW,{container:e.element,pageId:e.pageId}):"grid"===e.element.type?(0,i.jsx)(jW,{grid:e.element,pageId:e.pageId}):"image"===e.element.type?(0,i.jsx)(CW,{image:e.element,pageId:e.pageId}):"text"===e.element.type?(0,i.jsx)(yW,{pageId:e.pageId,text:e.element}):null,SW=[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:1,y:0},{x:1,y:1},{x:0,y:1},{x:-1,y:1},{x:-1,y:0}],kW=1e4,wW=e=>0===e.x?"ns-resize":0===e.y?"ew-resize":e.x===e.y?"nwse-resize":"nesw-resize",EW=e=>{const{customDocument:t,setElementBox:n,setSnapGuides:o,zoom:s}=XU(),r=(0,V.useRef)(null),a=s/100,{height:l,pages:d,width:c}=t.configuration,u=gW(e.element,c,l),m=8/a;(0,V.useEffect)(()=>()=>{r.current?.()},[]);const h=t=>i=>{if(0!==i.button)return;const s=e.element,m=(0,Ta.A)(s,["height","left","top","width"]),h=pW(d.find(t=>t.id===e.pageId)?.elements??[],s.id,c,l),g=fW(e.pageId,o);r.current?.();const p=IW(i,0,{onMove:(e,i,o)=>{const r=function(e,t,n,i,o){const s=o.isRatioLocked&&e.width>0&&e.height>0,r=0!==t.x,a=0!==t.y&&(!s||0===t.x),l={...mW};let d=e.width+t.x*n,c=e.height+t.y*i;if(o.snapTargets){if(r){const n=1===t.x?e.left+d:e.left+e.width-d,i=_W(n,o.snapTargets.x,o.snapThreshold);null!==i&&(d+=t.x*(i-n),l.x=i)}if(a){const n=1===t.y?e.top+c:e.top+e.height-c,i=_W(n,o.snapTargets.y,o.snapThreshold);null!==i&&(c+=t.y*(i-n),l.y=i)}}if(s){const n=e.width/e.height;0!==t.x?c=d/n:d=c*n;const i=Math.max(1,10/d,10/c);d*=i,c*=i}else d=Math.max(10,d),c=Math.max(10,c);d=Math.round(d),c=Math.round(c);const u=-1===t.x?e.left+e.width-d:e.left,m=-1===t.y?e.top+e.height-c:e.top,h=-1===t.x?u:u+d,g=-1===t.y?m:m+c;return{box:{height:c,left:u,top:m,width:d},guides:{x:null!==l.x&&Math.abs(h-l.x)<=.5?l.x:null,y:null!==l.y&&Math.abs(g-l.y)<=.5?l.y:null}}}(u,t,e/a,i/a,{isRatioLocked:s.isRatioLocked||o.shiftKey,snapTargets:o.altKey?null:h,snapThreshold:5/a});n(s.id,r.box),g(r.guides)},onEnd:()=>{g(mW)},onCancel:()=>{n(s.id,m),g(mW)}});r.current=()=>{p(),g(mW)}};return(0,i.jsx)(ka,{css:{height:`${u.height}px`,left:`${u.left}px`,pointerEvents:"none",position:"absolute",top:`${u.top}px`,width:`${u.width}px`,zIndex:kW},children:SW.map(e=>(0,i.jsx)(ka,{css:{background:"white",border:1/a+"px solid $primary500",cursor:wW(e),height:`${m}px`,left:`calc(${50*(e.x+1)}% - ${m/2}px)`,pointerEvents:"auto",position:"absolute",top:`calc(${50*(e.y+1)}% - ${m/2}px)`,touchAction:"none",width:`${m}px`},"data-testid":`resize-handle-${e.x}-${e.y}`,onClick:Gd,onPointerDown:h(e)},`${e.x},${e.y}`))})},TW=e=>{const{translate:t}=bd(),{customDocument:n,addPage:o,movingElementId:s,removePage:r,selectedElementId:a,selectedPageId:l,selectPage:d,snapGuides:c}=XU(),u=c?.pageId===e.page.id?c:null,m=e.page.elements.find(e=>e.id===a&&!e.hasRotate&&e.id!==s),h=n.configuration.pages.length>1,p=n.configuration.bleed?19:0;return(0,i.jsxs)(rd,{css:{height:"fit-content",width:"fit-content"},direction:"column",gap:"2",children:[(0,i.jsxs)(rd,{align:"center",children:[(0,i.jsx)(ka,{css:{cursor:"pointer",flex:"1"},fontWeight:"semiBold",onClick:t=>{Gd(t),d(e.page.id)},children:g(e.page.name)?e.page.name:t("page_1_33637",e.index+1)}),(0,i.jsxs)(rd,{gap:"2",children:[(0,i.jsx)(kd,{color:"white",leftIcon:"plus",size:"sm",onClick:o}),(0,i.jsx)(kd,{color:"white",disabled:!h,leftIcon:"trash-can",size:"sm",onClick:()=>{r(e.page.id)}})]})]}),(0,i.jsxs)(rd,{css:{background:"white",padding:`${p}px`,position:"relative"},height:2*p+n.configuration.height,width:2*p+n.configuration.width,children:[n.configuration.bleed&&(0,i.jsx)(uW,{}),(0,i.jsxs)(rd,{css:{background:"white",outline:l===e.page.id?"2px solid $primary500":"",position:"relative",userSelect:"none"},height:n.configuration.height,width:n.configuration.width,onClick:t=>{Gd(t),d(e.page.id)},children:[e.page.elements.map(t=>(0,i.jsx)(AW,{element:t,pageId:e.page.id},t.id)),m&&(0,i.jsx)(EW,{element:m,pageId:e.page.id}),"number"==typeof u?.x&&(0,i.jsx)(ka,{css:{background:"$primary500",left:`${u.x}px`,pointerEvents:"none",position:"absolute",top:0,zIndex:kW},height:1,width:"1px"}),"number"==typeof u?.y&&(0,i.jsx)(ka,{css:{background:"$primary500",left:0,pointerEvents:"none",position:"absolute",top:`${u.y}px`,zIndex:kW},height:"1px",width:1})]})]})]})},RW={ArrowDown:{left:0,top:1},ArrowLeft:{left:-1,top:0},ArrowRight:{left:1,top:0},ArrowUp:{left:0,top:-1}},OW=()=>{const{customDocument:e,cleanSelecteds:t,getSelectedElement:n,offsetElementPosition:o,setZoom:s,zoom:r}=XU();return(0,V.useEffect)(()=>{const e=e=>{const t=RW[e.key],i=n();if(t&&i&&!i.inContainer&&!((s=e.target)instanceof HTMLElement&&(s.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes(s.tagName)||null!==s.closest('[aria-pressed="true"]')))){const n=e.shiftKey?10:1;e.preventDefault(),o(i.id,t.left*n,t.top*n)}var s};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n,o]),(0,i.jsxs)(ka,{css:{background:"$gray100",position:"relative"},height:1,width:1,children:[(0,i.jsx)(rd,{align:"center",css:{overflow:"auto",padding:"$9",zoom:`${r}%`},direction:"column",gap:"7",height:1,width:1,onClick:t,children:e.configuration.pages.map((e,t)=>(0,i.jsx)(TW,{index:t,page:e},e.id))}),(0,i.jsx)(ka,{css:{bottom:"24px",position:"absolute",right:"24px",zIndex:1e3},width:140,children:(0,i.jsxs)(hh,{shouldParseAsInt:!0,value:r,onChange:s,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%)"})]})})]})},DW=e=>"page"===e.type?e.pageId:e.elementId;function zW(e,t){return"page"===e.type?"inside":e.canContain?t<.25?"before":t>.75?"after":"inside":t<.5?"before":"after"}function $W(e){return[e.id].concat(PU(e)?e.elements.flatMap($W):[])}const PW=(0,V.createContext)({activeId:null,dropTarget:null});const MW="$colors$primary500";function FW(e){const t=DW(e),{attributes:n,isDragging:i,listeners:o,setNodeRef:s}=(0,th.PM)({data:e,disabled:"page"===e.type,id:t}),{setNodeRef:r}=(0,th.zM)({data:e,id:t}),{dropTarget:a}=(0,V.useContext)(PW),l=(0,V.useCallback)(e=>{s(e),r(e)},[s,r]),d=a&&DW(a.row)===t?a.position:null,c="before"===d?`inset 0 2px 0 ${MW}`:"after"===d?`inset 0 -2px 0 ${MW}`:"inside"===d?`inset 0 0 0 2px ${MW}`:void 0;return{dragProps:"page"===e.type?{}:{...n,...o},dropBoxShadow:c,isDragging:i,setNodeRef:l}}const NW=e=>"container"===e.type?"column"===e.direction?"chart-simple-horizontal":"chart-simple":"grid"===e.type?"table-cells":"image"===e.type?"image":"text",LW=e=>{const{translate:t}=bd(),{deleteElement:n,duplicateElement:o,selectedElementId:s,selectElement:r}=XU(),{dragProps:a,dropBoxShadow:l,isDragging:d,setNodeRef:c}=FW({type:"element",canContain:PU(e.element),elementId:e.element.id,pageId:e.pageId});return(0,i.jsxs)(rd,{css:{opacity:d?.4:1},direction:"column",children:[(0,i.jsxs)(rd,{ref:c,align:"center",css:{background:s===e.element.id?"$primary100":"none",borderRadius:"$1",boxShadow:l,color:s===e.element.id?"$primary500":"$gray800",cursor:"pointer",padding:"$2","& .h-duplicate, & .h-delete":{display:"none"},"&:hover":{background:"$primary100",color:"$primary500","& .h-duplicate, & .h-delete":{display:"block"}}},gap:"3",width:250,onClick:()=>{r(e.element.id,e.pageId)},...a,children:[(0,i.jsx)(ka,{fontSize:"textMd",children:(0,i.jsx)(Id,{icon:NW(e.element)})}),(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(ka,{css:{ellipsis:!0},fontSize:"textSm",fontWeight:"medium",title:e.element.name,width:1,children:e.element.name})}),HU(e.element)&&(0,i.jsx)(ka,{title:t("affich_sous_co_68172"),children:(0,i.jsx)(Id,{icon:"filter"})}),(0,i.jsx)(ka,{className:"h-duplicate",onClick:t=>{Gd(t),o(e.element.id)},children:(0,i.jsx)(Id,{icon:"copy"})}),(0,i.jsx)(ka,{className:"h-delete",onClick:t=>{Gd(t),n(e.element.id)},children:(0,i.jsx)(Id,{icon:"trash-can"})})]}),PU(e.element)&&(0,i.jsx)(rd,{css:{paddingLeft:"$8"},direction:"column",children:e.element.elements.map(t=>(0,i.jsx)(LW,{element:t,pageId:e.pageId},t.id))})]})},BW=e=>(0,i.jsxs)(rd,{align:"center",css:{background:"$primary100",borderRadius:"$1",boxShadow:"$md",color:"$primary500",cursor:"grabbing",padding:"$2"},gap:"3",width:250,children:[(0,i.jsx)(ka,{fontSize:"textMd",children:(0,i.jsx)(Id,{icon:NW(e.element)})}),(0,i.jsx)(ka,{css:{ellipsis:!0,flex:"1"},fontSize:"textSm",fontWeight:"medium",children:e.element.name})]}),VW=e=>{const{translate:t}=bd(),{duplicatePage:n,selectedPageId:o,selectPage:s}=XU(),r=g(e.page.name)?e.page.name:t("page_1_33637",e.index+1),{dropBoxShadow:a,setNodeRef:l}=FW({type:"page",pageId:e.page.id});return(0,i.jsx)(UL,{css:{gap:"0",width:"fit-content"},title:(0,i.jsxs)(rd,{ref:l,align:"center",css:{background:o===e.page.id?"$primary100":"",borderRadius:"$1",boxShadow:a,color:o===e.page.id?"$primary500":"$gray800",fontWeight:"$medium",padding:"$2","& .h-duplicate":{display:"none"},"&:hover":{background:"$primary100",color:"$primary500","& .h-duplicate":{display:"block"}}},gap:"3",width:250,onClick:t=>{Gd(t),s(e.page.id)},children:[(0,i.jsx)(ka,{fontSize:"textMd",children:(0,i.jsx)(Id,{icon:"frame"})}),(0,i.jsx)(ka,{css:{flex:"1"},children:r}),HU(e.page)&&(0,i.jsx)(ka,{title:t("affich_sous_co_68172"),children:(0,i.jsx)(Id,{icon:"filter"})}),(0,i.jsx)(ka,{className:"h-duplicate",onClick:t=>{Gd(t),n(e.page.id)},children:(0,i.jsx)(Id,{icon:"copy"})})]}),titleCss:{gap:"$2"},children:(0,i.jsx)(rd,{css:{paddingLeft:"$8"},direction:"column",children:e.page.elements.map(t=>(0,i.jsx)(LW,{element:t,pageId:e.page.id},t.id))})})},UW=()=>{const{customDocument:e}=XU(),{activeId:t,dndContextProps:n,dropTarget:o}=function(){const{customDocument:e,moveElement:t,selectedElementId:n,selectElement:i}=XU(),o=(0,th.FR)((0,th.MS)(th.AN,{activationConstraint:{distance:4}}),(0,th.MS)(th.uN)),[s,r]=(0,V.useState)(null),[a,l]=(0,V.useState)(null),d=(0,V.useRef)(null),c=(0,V.useRef)(new Set),u=(0,V.useCallback)(e=>{const t=e=>e?`${DW(e.row)}-${e.position}`:null;t(d.current)!==t(e)&&(d.current=e,l(e))},[]),m=(0,V.useCallback)(()=>{c.current=new Set,r(null),u(null)},[u]),h=(0,V.useCallback)(e=>{const t=e.droppableContainers.filter(e=>!c.current.has(e.id));return e.pointerCoordinates?(0,th.TT)({...e,droppableContainers:t}):(0,th.fp)({...e,droppableContainers:t})},[]),g=(0,V.useCallback)(({active:t})=>{const n=FU(e.configuration,t.id);c.current=new Set(n?$W(n.element):[]),r(t.id)},[e]),p=(0,V.useCallback)(e=>{const t=(n=e.over,n?.data.current);var n;const i=function(e){const t=e.activatorEvent;if("number"==typeof t.clientY)return t.clientY+e.delta.y;{const t=e.active.rect.current.translated;return t?t.top+t.height/2:null}}(e);if(e.over&&t&&null!==i){const{height:n,top:o}=e.over.rect;u({position:zW(t,(i-o)/n),row:t})}else u(null)},[u]),f=(0,V.useCallback)(({active:o})=>{const s=o.id,r=d.current?function(e,t,n){const{position:i,row:o}=n,s=e=>e.filter(e=>e.id!==t);if("page"===o.type)return{index:0,pageId:o.pageId,parentId:null};const r=FU(e,o.elementId);if(!r)return null;const{ancestors:a,element:l,page:d}=r;if(PU(l)){if("inside"===i)return{index:s(l.elements).length,pageId:d.id,parentId:l.id};if("after"===i&&s(l.elements).length>0)return{index:0,pageId:d.id,parentId:l.id}}const c=a.at(-1);return{index:s(c?c.elements:d.elements).findIndex(e=>e.id===l.id)+("after"===i?1:0),pageId:d.id,parentId:c?.id??null}}(e.configuration,s,d.current):null;m(),r&&(t(s,r),s===n&&i(s,r.pageId))},[e,t,m,n,i]);return{activeId:s,dndContextProps:{collisionDetection:h,sensors:o,onDragCancel:m,onDragEnd:f,onDragMove:p,onDragOver:p,onDragStart:g},dropTarget:a}}(),s=t?FU(e.configuration,t)?.element:null;return(0,i.jsxs)(th.Mp,{...n,children:[(0,i.jsx)(PW.Provider,{value:{activeId:t,dropTarget:o},children:(0,i.jsx)(rd,{css:{overflowY:"auto"},direction:"column",height:1,width:1,children:e.configuration.pages.map((e,t)=>(0,i.jsx)(VW,{index:t,page:e},e.id))})}),(0,i.jsx)(th.Hd,{dropAnimation:null,children:s&&(0,i.jsx)(BW,{element:s})})]})},WW=()=>{const{history:e,params:{organizationId:t,eventId:n,customDocumentId:o},translate:s}=bd(),{mutate:r,isLoading:a}=function(e={}){return Di("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}=XU(),d=(0,V.useMemo)(()=>JSON.stringify(l),[a]),[c,u]=(0,V.useState)(!1),m=(0,V.useCallback)(()=>{JSON.stringify(l)===d?e.goBack(fs.DOCUMENTS(t,n)):u(!0)},[l,d]);return Zc(s("mise_jour_de_17055",l.name)),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zp,{button:(0,i.jsx)(kd,{isLoading:a,onClick:async()=>{await r({eventId:n,customDocumentId:o,customDocument:l})},children:s("enregistrer_06519")}),category:s("document_person_69340"),color:"dark",heading:l.name,onClose:m,children:(0,i.jsxs)(rd,{height:1,width:1,children:[(0,i.jsx)(ka,{height:1,width:420,children:(0,i.jsx)(cW,{})}),(0,i.jsx)(ka,{css:{flex:"1"},height:1,children:(0,i.jsx)(OW,{})}),(0,i.jsx)(ka,{height:1,width:340,children:(0,i.jsx)(UW,{})})]})}),(0,i.jsx)(rE,{fallbackPath:fs.DOCUMENTS(t,n),isOpen:c,onClose:()=>u(!1)})]})},GW=()=>{const{history:e,params:{organizationId:t,eventId:n,customDocumentId:o}}=bd(),{data:s,loader:r}=Oi('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(\n eventId: $eventId\n variety: UserInfo\n privacy: All\n sort: { attribute: Name, direction: Asc }\n ) {\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 shouldRegenerateTicketIdOnDownload\n }\n }\n}\n',{organizationId:t,eventId:n,customDocumentId:o},[js.ConditionCustomFieldFragment]),a=Ei(zU);return r||s.event?.customDocument||e.replace(fs.DOCUMENTS(t,n)),r||(0,i.jsx)(ZU,{customFields:s.organization.customFields.nodes,initialCustomDocument:a.customDocumentInputDefault(s.event.customDocument),population:s.organization.population,children:(0,i.jsx)(WW,{})})},qW=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=bd(),{mutate:r}=function(e={}){return Di("mutation CustomDocumentCreate($eventId :EventId!, $customDocument: CustomDocumentInput!){\n customDocumentCreate(eventId: $eventId, customDocument: $customDocument){\n id\n }\n}\n",e)}(),a=Ei(zU),[d,c]=(0,V.useState)(""),[u,m]=(0,V.useState)(""),[p,f]=(0,V.useState)(!1),_=(0,V.useCallback)(e=>{c(e),p||m(h(e,{replacer:l.Empty}))},[p,c,m]),x=(0,V.useCallback)(e=>{g(e)?(m(h(e,{replacer:l.Empty})),f(!0)):(m(""),f(!1))},[m,f]);return(0,i.jsxs)(Av,{isOpen:e.isOpen,children:[(0,i.jsx)(Sv,{children:(0,i.jsx)(kd,{children:n("cr_er_un_docume_92512")})}),(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"file",children:n("nouveau_documen_36722")}),(0,i.jsxs)(jv,{gap:"5",children:[(0,i.jsx)(Qd,{label:n("nom_du_document_22604"),value:d,onChange:_}),(0,i.jsx)(Qd,{hint:n("ne_doit_conteni_53122"),label:n("nom_de_la_varia_81999"),value:u,onChange:x})]}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{onClick:async()=>{const{customDocumentCreate:e}=await r({eventId:s,customDocument:{name:d,slug:u,populationsIds:[],configuration:a.getConfigurationDefault(),shouldRegenerateTicketIdOnDownload:!1}});t.push(fs.EDIT_CUSTOM_DOCUMENT(o,s,e.id))},children:n("cr_er_le_docume_02657")})})]})]})},HW=e=>(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(ka,{font:"gray900 textLg medium",children:e.title}),(0,i.jsx)(rd,{css:{background:"white",bd:!0,"& > div:last-child":{borderBottom:"none"}},direction:"column",children:e.children})]}),KW=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=bd(),{showNotification:r}=HI(),{mutate:a}=function(e={}){return Di("mutation CustomDocumentDuplicate($eventId: EventId!, $customDocumentId: CustomDocumentId!) {\n customDocumentDuplicate(eventId: $eventId, customDocumentId: $customDocumentId) {\n id\n }\n}\n",e)}(),{mutate:l}=function(e={}){return Di("mutation CustomDocumentDelete($eventId: EventId!, $customDocumentId: CustomDocumentId!) {\n customDocumentDelete(eventId: $eventId, customDocumentId: $customDocumentId) {\n id\n }\n}\n",e)}(),[d,c]=(0,V.useState)(!1),u=qU(e.customDocument.configuration.height,e.customDocument.configuration.width),m=e.customDocument.populations.join(", ");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"center",css:{borderBottom:"1px solid $gray200",px:"$6"},gap:"4",height:74,width:1,children:[(0,i.jsx)(rd,{align:"center",css:{background:"$success100",borderRadius:"$3",color:"$success700",fontSize:"$textMd"},height:40,justify:"center",width:40,children:(0,i.jsx)(Id,{icon:"pen-ruler"})}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[e.disabled?(0,i.jsx)(ka,{font:"gray800 textMd medium",children:e.customDocument.name}):(0,i.jsx)(bm,{css:{fontSize:"$textMd"},to:fs.DOCUMENTS_USER_CUSTOM_DOCUMENT(o,s,e.userInfoId,e.customDocument.id),children:e.customDocument.name}),(0,i.jsx)(ka,{color:"gray500",children:n("cr_par_1_69201",e.customDocument.createdBy.nameOrEmail)})]}),(0,i.jsxs)(rd,{direction:"column",gap:"1",width:100,children:[(0,i.jsx)(ka,{font:"gray500 textXs regular",children:n("populations_48141")}),(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray800 textSm medium",title:m,width:1,children:g(m)?m:"-"})]}),(0,i.jsxs)(rd,{direction:"column",gap:"1",width:85,children:[(0,i.jsx)(ka,{font:"gray500 textXs regular",children:n("format_54368")}),(0,i.jsx)(ka,{font:"gray800 textSm medium",children:"custom"===u?n("personnalis_40360"):u.toUpperCase()})]}),(0,i.jsxs)(rd,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(ka,{font:"gray500 textXs regular",children:n("nom_de_la_varia_81999")}),(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray800 textSm medium",title:`{user.documents.${e.customDocument.slug}}`,width:1,children:`{user.documents.${e.customDocument.slug}}`})]}),(0,i.jsx)(Mv,{permissions:Ov.DOCUMENT_EDIT,children:(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{t.push(fs.EDIT_CUSTOM_DOCUMENT(o,s,e.customDocument.id))}})}),(0,i.jsx)(bp,{placement:"top",children:n("_diter_62574")})]})}),(0,i.jsx)(Mv,{permissions:Ov.DOCUMENT_EDIT,children:(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{icon:"clone",onClick:async()=>{await a({eventId:s,customDocumentId:e.customDocument.id}),e.reload()},children:n("dupliquer_28256")})}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>{c(!0)},children:n("supprimer_43083")})})]})]})})]}),d&&(0,i.jsx)(DA,{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()}})]})},YW=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>(0,cm.A)(e.customDocuments,e=>e.name.toLowerCase()),[e.customDocuments]),o=(0,V.useMemo)(()=>Object.values((0,Vu.A)(n,e=>e.slug)).some(e=>e.length>1),[n]);return(0,i.jsxs)(i.Fragment,{children:[o&&(0,i.jsxs)(zd,{alertStyle:"warning",children:[(0,i.jsx)($d,{children:t("plusieurs_docum_09566")}),(0,i.jsx)(Pd,{children:t("lorsque_plusieu_27447")})]}),(0,i.jsx)(HW,{title:t("documents_perso_87374"),children:n.map(t=>(0,i.jsx)(KW,{customDocument:t,disabled:0===e.numberOfVolunteersRegistrations,reload:e.reload,userInfoId:e.userInfoId},t.id))})]})},ZW=e=>{const{translate:t}=bd();return(0,i.jsxs)(rd,{align:"center",css:{borderBottom:"1px solid $gray200",px:"$6"},gap:"4",height:74,width:1,children:[(0,i.jsx)(rd,{align:"center",css:{background:Ia.colors[`${e.color}100`],borderRadius:"$3",color:Ia.colors[`${e.color}700`],fontSize:"$textMd"},height:40,justify:"center",width:40,children:(0,i.jsx)(Id,{icon:e.icon})}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(rd,{align:"center",gap:"2",children:[e.disabled?(0,i.jsx)(ka,{font:"gray800 textMd medium",children:e.title}):(0,i.jsx)(bm,{css:{fontSize:"$textMd"},to:e.path,children:e.title}),e.disabled&&(0,i.jsx)(vu,{color:"warning",size:"sm",children:t("le_document_n_e_47973")})]}),(0,i.jsx)(ka,{color:"gray500",children:t("cr_par_1_69201","WeezCrew")})]}),g(e.variable)&&(0,i.jsxs)(rd,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(ka,{font:"gray500 textXs regular",children:t("nom_de_la_varia_81999")}),(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray800 textSm medium",title:"",width:1,children:`{user.documents.${e.variable}}`})]}),void 0!==e.count&&!e.disabled&&(0,i.jsxs)(rd,{direction:"column",gap:"1",width:150,children:[(0,i.jsx)(ka,{font:"gray500 textXs regular",children:e.text}),(0,i.jsx)(ka,{font:"gray800 textSm medium",children:e.count})]})]})},XW=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd();return(0,i.jsx)(HW,{title:t("accr_ditations_39450"),children:(0,i.jsx)(ZW,{color:"blueGray",count:e.numberOfAccreditationsSlots,disabled:0===e.numberOfAccreditationsSlots,icon:"list-ul",path:fs.DOCUMENTS_ASO_PAX_MANIFEST(n,o,e.accreditationSlotId),text:t("nombre_de_cr_ne_40593"),title:"PAX Manifest"})})},JW=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd();return(0,i.jsx)(HW,{title:t("d_l_gations_78318"),children:(0,i.jsx)(ZW,{color:"blueGray",count:e.numberOfDelegations,disabled:0===e.numberOfDelegations,icon:"sitemap",path:fs.DOCUMENTS_DELEGATION_CALENDAR(n,o,e.delegationId),text:t("nombre_de_d_l_g_45708"),title:t("planning_des_ac_44426")})})},QW=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd();return(0,i.jsxs)(HW,{title:t("_v_nement_22345"),children:[(0,i.jsx)(ZW,{color:"pink",icon:"list-ul",path:fs.DOCUMENTS_VOLUNTEERS_LISTING(n,o,e.volunteersSegmentId),text:t("nombre_de_membr_87049"),title:t("liste_des_membr_89037")}),(0,i.jsx)(ZW,{color:"purple",icon:"calendar-day",path:fs.DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING(n,o,e.positionsSegmentId),text:t("nombre_de_missi_56719"),title:t("planning_d_un_g_23684")}),(0,i.jsx)(ZW,{color:"purple",icon:"calendar-day",path:fs.DOCUMENTS_PLANNING(n,o,e.positionsSegmentId),text:t("nombre_de_missi_56719"),title:t("planning_de_l_96909")}),(0,i.jsx)(ZW,{color:"purple",icon:"image",path:fs.DOCUMENTS_USERS_PICTURES(n,o,e.volunteersSegmentId),text:"",title:t("trombinoscope_11316")})]})},eG=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{organization:s}=_v();return(0,i.jsxs)(HW,{title:t("membres_11310"),children:[(0,i.jsx)(ZW,{color:"pink",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"user",path:fs.DOCUMENTS_ASSIGNMENTS(n,o,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("fiche_d_affecta_91461"),variable:"assignments"}),(0,i.jsx)(ZW,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:fs.DOCUMENTS_USER_PLANNING(n,o,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserPlanning"),variable:"planning"}),(0,i.jsx)(ZW,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:fs.DOCUMENTS_USER_PLANNING_LIST(n,o,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserPlanningList"),variable:"planningList"}),(0,i.jsx)(ZW,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:fs.DOCUMENTS_USER_PLANNING_DAYS(n,o,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserPlanningDays"),variable:"planningDays"}),(0,i.jsx)(ZW,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"certificate",path:fs.DOCUMENTS_CERTIFICATE(n,o,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("Certificate"),variable:"certificate"}),(0,i.jsx)(ZW,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"id-card",path:fs.DOCUMENTS_BADGE(n,o,e.assignedUserInfoId,"generic"),text:t("nombre_de_membr_87049"),title:t("BadgeCheck"),variable:"badge"}),(0,i.jsx)(ZW,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"clock",path:fs.DOCUMENTS_HOURS(n,o,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserHours"),variable:"hours"}),s.customBadges.map(s=>(0,i.jsx)(ZW,{color:"success",count:e.numberOfVolunteersRegistrations,disabled:!1,icon:"id-card",path:fs.DOCUMENTS_BADGE(n,o,e.userInfoId,s),text:t("nombre_de_membr_87049"),title:y_(s),variable:s.toLowerCase()},s))]})},tG=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd();return(0,i.jsxs)(HW,{title:t("missions_63972"),children:[(0,i.jsx)(ZW,{color:"blueGray",count:e.numberOfPositions,disabled:0===e.numberOfPositions,icon:"sitemap",path:fs.DOCUMENTS_POSITION(n,o,e.positionId),text:t("nombre_de_fiche_03009"),title:t("fiche_de_missio_00324")}),(0,i.jsx)(ZW,{color:"purple",count:e.numberOfPositions,disabled:0===e.numberOfPositions,icon:"calendar-day",path:fs.DOCUMENTS_POSITION_PLANNING(n,o,e.positionId),text:t("nombre_de_missi_56719"),title:t("planning_d_une_64581")})]})},nG=e=>{const{params:{organizationId:t}}=bd(),{hasFeature:n}=_v(),o=e.event.volunteersRegistrations.nodes[0]?.userInfoId??-1;return(0,i.jsxs)(rd,{direction:"column",gap:"7",children:[n(Ae.CustomDocument)&&Bs(e.event.customDocuments)&&(0,i.jsx)(YW,{customDocuments:e.event.customDocuments,numberOfVolunteersRegistrations:e.event.volunteersRegistrations.totalCount,reload:e.reload,userInfoId:o}),(0,i.jsx)(eG,{assignedUserInfoId:e.event.assignedVolunteersRegistrations.nodes[0]?.userInfoId??-1,numberOfAssignedVolunteersRegistrations:e.event.assignedVolunteersRegistrations.totalCount,numberOfVolunteersRegistrations:e.event.volunteersRegistrations.totalCount,userInfoId:o}),(0,i.jsx)(tG,{numberOfPositions:e.event.positions.totalCount,positionId:e.event.positions.nodes[0]?.id??-1}),Eg(t)&&(0,i.jsx)(XW,{accreditationSlotId:e.event.accreditationsSlots.nodes[0]?.id??-1,numberOfAccreditationsSlots:e.event.accreditationsSlots.totalCount}),(0,i.jsx)(JW,{delegationId:e.event.delegations.nodes[0]?.id??-1,numberOfDelegations:e.event.delegations.totalCount}),(0,i.jsx)(QW,{positionsSegmentId:e.event.positionSegment.id,volunteersSegmentId:e.event.volunteerSegment.id})]})},iG=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(ju,{borderRadius:"$1",height:25,width:1}),(0,i.jsx)(ju,{borderRadius:"$2",height:74,width:1}),(0,i.jsx)(ju,{borderRadius:"$2",height:74,width:1})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(ju,{borderRadius:"$1",height:25,width:1}),(0,i.jsx)(ju,{borderRadius:"$2",height:74,width:1}),(0,i.jsx)(ju,{borderRadius:"$2",height:74,width:1})]})]}),oG=e=>{const{translate:t,params:{eventId:n}}=bd(),{hasFeature:o}=_v(),{event:{name:s}}=dv(),{canDocumentEdit:r}=Dv();Zc(`${s} ${t("Documents")}`);const{data:a,isLoading:l,reload:d}=Oi('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 accreditationsSlots(limit: 1) {\n nodes {\n id\n }\n\n totalCount\n }\n\n delegations(limit: 1) {\n nodes {\n id\n }\n\n totalCount\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 volunteerSegment: segment(segmentType: Volunteers) {\n id\n }\n\n positionSegment: segment(segmentType: Positions) {\n id\n }\n }\n}\n',{eventId:n},[]);return(0,i.jsxs)(nb,{children:[(0,i.jsxs)(tb,{gap:"3",children:[(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray900 displayXs semiBold",children:t("Documents")}),(0,i.jsx)(ka,{color:"gray500",children:t("retrouver_et_pe_99652")})]}),o(Ae.CustomDocument)&&r&&(0,i.jsx)(qW,{isOpen:e.isCreateOpen})]}),(0,i.jsx)(Qv,{children:o(Ae.Documents)?l?(0,i.jsx)(iG,{}):(0,i.jsx)(nG,{event:a.event,reload:d}):(0,i.jsx)(rd,{align:"center",css:{flex:"1"},direction:"column",justify:"center",children:(0,i.jsx)(kx,{icon:"folders"})})})]})},sG=e=>{const t=e.asoPaxManifest.event.accreditationSlot,n=t.accreditation,[o,s]=t.name.split("-"),r=t.date?.toFormat("dd/MM/yyyy")??"";return(0,i.jsxs)(rd,{css:{background:"white",color:"black",fontSize:"12px",pageBreakBefore:"always",padding:"32px 68px"},direction:"column",height:tf,width:nf,children:[(0,i.jsx)(ka,{textAlign:"center",width:1,children:"PAX MANIFEST"}),(0,i.jsx)(md,{height:"9"}),(0,i.jsxs)(rd,{align:"center",css:{background:"black",color:"white",fontSize:"20px"},height:38,justify:"center",width:1,children:[n.name," - ",r]}),(0,i.jsxs)(rd,{css:{padding:"24px 36px 28px 36px"},direction:"column",width:1,children:[(0,i.jsxs)(rd,{width:1,children:[(0,i.jsx)(ka,{css:{fontWeight:"700"},width:142,children:"Aircraft Type :"}),(0,i.jsx)(ka,{width:140,children:"<>"}),(0,i.jsx)(ka,{css:{fontWeight:"700"},width:132,children:"Flight number :"}),(0,i.jsx)(ka,{children:"<>"})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{width:1,children:[(0,i.jsx)(ka,{css:{fontWeight:"700"},width:142,children:"Departure Airport :"}),(0,i.jsx)(ka,{width:140,children:o}),(0,i.jsx)(ka,{width:140,children:r}),(0,i.jsx)(ka,{css:{flex:"1"},textAlign:"end",children:"<>"})]}),(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{width:1,children:[(0,i.jsx)(ka,{css:{fontWeight:"700"},width:142,children:"Arrival Airport :"}),(0,i.jsx)(ka,{width:140,children:s}),(0,i.jsx)(ka,{width:140,children:r}),(0,i.jsx)(ka,{css:{flex:"1"},textAlign:"end",children:"<>"})]})]}),(0,i.jsx)(ka,{css:{background:"black"},height:7,width:1}),(0,i.jsx)(md,{height:"5"}),(0,i.jsxs)(rd,{css:{border:"1px solid black"},direction:"column",width:1,children:[(0,i.jsxs)(rd,{align:"center",css:{background:"black",color:"white",fontWeight:"700"},height:40,width:1,children:[(0,i.jsx)(ka,{css:{px:"$1"},width:35,children:"N°"}),(0,i.jsx)(ka,{css:{flex:"1",px:"$1"},children:"Last name"}),(0,i.jsx)(ka,{css:{flex:"1",px:"$1"},children:"First name"}),(0,i.jsx)(ka,{css:{flex:"1",px:"$1"},children:"Passport number"}),(0,i.jsx)(ka,{css:{flex:"1",px:"$1"},children:"Passport expire date"}),(0,i.jsx)(ka,{css:{px:"$1"},width:85,children:"Nationality"})]}),t.volunteersRegistrations.map((e,t)=>{const n=As.c9.fromISO(e.userInfo.fields?.cf54609?.rawValue),o=As.c9.isDateTime(n)&&n.isValid?n.toFormat("dd/MM/yyyy"):"";return(0,i.jsxs)(rd,{align:"center",css:{background:t%2==0?"#d9d9d9":"white",borderTop:0===t?"none":"1px solid black"},height:20,width:1,children:[(0,i.jsx)(ka,{css:{px:"$1"},width:35,children:t+1}),(0,i.jsx)(ka,{css:{flex:"1",px:"$1"},children:e.userInfo.fields?.lastName?.value?.toUpperCase()}),(0,i.jsx)(ka,{css:{flex:"1",px:"$1"},children:e.userInfo.fields?.firstName?.value}),(0,i.jsx)(ka,{css:{flex:"1",px:"$1"},children:e.userInfo.fields?.cf54607?.value}),(0,i.jsx)(ka,{css:{flex:"1",px:"$1"},children:o}),(0,i.jsx)(ka,{css:{px:"$1"},width:85,children:e.userInfo.fields?.nationality?.rawValue})]},e.id)})]}),(0,i.jsx)(md,{height:"5"}),(0,i.jsxs)(rd,{css:{paddingRight:"48px"},gap:"9",justify:"end",width:1,children:[(0,i.jsx)(ka,{children:"Passengers"}),(0,i.jsx)(ka,{children:`${t.volunteersRegistrations.length}/${t.maxResources}`})]})]})},rG=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{user:s}=Li(),{checkDocumentsExport:r}=HI(),[a,l]=(0,V.useState)([e.segmentsFolders[0].segments[0].id]),[d,c]=(0,V.useState)(e.languages[0]),[u,m]=(0,V.useState)(As.c9.invalid("Invalid")),[h,g]=(0,V.useState)(Tt.OnePerPage),[p,f]=(0,V.useState)(!1),_=(0,V.useMemo)(()=>e.showStrategy&&!e.badgeType,[e.badgeType,e.showStrategy]);return(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(rd,{align:"center",css:{background:"$primary50",borderRadius:"48px",color:"$primary500",height:"48px",fontSize:"20px",width:"48px"},justify:"center",children:(0,i.jsx)(Id,{icon:"envelope"})})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",textAlign:"center",children:e.title}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",dangerouslySetInnerHTML:{__html:t("en_2_clics_rec_97175")},textAlign:"center"}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(zd,{alertStyle:"gray",children:(0,i.jsx)(Pd,{children:t("l_e_mail_peut_m_13253")})}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{css:{flex:"1",overflowY:"auto"},direction:"column",gap:"4",children:[(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("vue_s_personna_35768"),multiple:!0,placeholder:t("s_lectionnez_un_53633"),values:a,onChange:l,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)(hh,{label:t("Language"),placeholder:t("Language"),value:d,onChange:e=>{c(e)},children:e.languages.map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),e.showDate&&(0,i.jsx)(Ih,{label:t("exportez_vos_do_87332"),max:e.endAt,min:e.startAt,value:u,onChange:m}),_&&(0,i.jsx)(hh,{label:t("strat_gie_44389"),value:h,onChange:e=>g(e),children:On.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))}),(0,i.jsx)(Eu,{state:p?"checked":"unchecked",onClick:e=>{f("checked"===e)},children:t("fusionner_les_d_64130")}),(0,i.jsx)(Qd,{label:t("Email"),state:"disabled",value:s?.email??"",onChange:hc.A})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{isLoading:e.isSendLoading,onClick:async()=>{const t=await e.onSend(a,d,p,h,u.isValid?u:void 0);r(t,n,o),e.onClose()},children:t("envoyer_26609")}),(0,i.jsx)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},aG=e=>{const t=Ti(),{mutate:n,isLoading:o}=Tr(),[s,r]=V.useState(!1);return(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(bb,{returnPathFallback:fs.DOCUMENTS(e.organizationId,e.eventId)}),(0,i.jsx)(ka,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"medium",children:e.title}),e.extraButton,(0,i.jsx)(Mv,{permissions:Ov.DOCUMENT_READ,children:(0,i.jsx)(kd,{isLoading:o,onClick:()=>r(!0),children:t("param_trer_l_ex_83342")})}),s&&(0,i.jsx)(rG,{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{jobId:a}=await n({organizationId:e.organizationId,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}})]})},lG=e=>(0,i.jsx)(rd,{css:{background:"$gray50",border:"1px solid $gray200",flex:"1",justifyContent:"center",padding:"$7",overflowX:"hidden",overflowY:"auto",...e.css},height:1,children:(0,i.jsx)(rd,{css:{boxShadow:"$md",borderRadius:"$2",height:"fit-content",overflow:"hidden"},direction:"column",width:e.width,children:e.children})}),dG=e=>{const{history:t,translate:n,params:{eventId:o,accreditationSlotId:s}}=bd(),r=Ei(Cm),{data:a,isLoading:l}=Gr({eventId:o,loadIsBlocked:!1}),d=(0,V.useMemo)(()=>Kg(r,a.event?.accreditationsCategories??[]),[r,a.event]);return(0,i.jsxs)(rd,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(ka,{font:"gray900 textMd semiBold",children:n("aper_u_pour_l_a_28765")}),(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Uu,{isSearchLoading:l,isSearchVisible:!0,values:[s],onChange:n=>{Bs(n)&&t.replace(e.getPath(n[0]))},children:d})}),(0,i.jsx)(ka,{css:{flex:"1"}}),(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",to:e.downloadPath,children:n("t_l_charger_03283")})})]})},cG=()=>{const{params:{organizationId:e,eventId:t,accreditationSlotId:n}}=bd(),{user:o}=Li(),{event:s}=dv(),{data:r,loader:a}=Oi("query AsoPaxManifestDocument($eventId: EventId!, $accreditationSlotId: AccreditationsSlotId!) {\n ...DocumentAsoPaxManifest\n\n event(id: $eventId) {\n languages\n\n segmentsFolders(segmentType: Accreditations) {\n id\n name\n\n segments {\n id\n name\n rendering\n }\n }\n }\n}\n",{eventId:t,accreditationSlotId:n},[js.DocumentAsoPaxManifestFragment]),l=(0,V.useMemo)(()=>(r.event?.segmentsFolders??[]).map(e=>({...e,segments:e.segments.filter(e=>"SlotsList"===e.rendering)})),[r.event]);return Zc(`${s.name} PAX Manifest`),(0,i.jsxs)(rd,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(aG,{documentType:_t.AsoPaxManifest,eventId:t,languages:r.event?.languages??[],organizationId:e,segmentsFolders:l,title:"PAX Manifest"}),(0,i.jsx)(md,{height:"7"}),a||(0,i.jsxs)(rd,{css:{flex:"1",overflow:"auto"},direction:"column",width:1,children:[(0,i.jsx)(dG,{downloadPath:gf(r.event?.accreditationSlot?.links?.asoPaxManifestLink,"pdf",{lang:o?.language}),getPath:n=>fs.DOCUMENTS_ASO_PAX_MANIFEST(e,t,n)}),(0,i.jsx)(lG,{width:1,children:(0,i.jsx)(sG,{asoPaxManifest:r})})]})]})};var uG=n(8962),mG=n.n(uG);const hG=(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(mG().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)})),gG=({css:e,label:t,description:n,icon:o,hint:s,maxSize:r,state:a,value:l,placeholder:d,accept:c,format:u,onChange:m,...h})=>{const p=Ti(),f=(0,V.useRef)(null),{inputId:_,descId:x,errorId:I}=Hd(),[v,b]=(0,V.useState)(""),j=(0,V.useMemo)(()=>g(v),[v]);return(0,i.jsxs)(rd,{css:e,direction:"column",width:1,children:[(0,i.jsx)(Zd,{htmlFor:_,isClickable:!1,children:t}),(0,i.jsx)(Kd,{id:x,children:n}),(t||n)&&(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(Jd,{cursor:"pointer",icon:o,rightIcon:"file",state:a,onClick:()=>{f.current?.click()},children:(0,i.jsxs)(ka,{color:g(l?.name)?"gray800":"gray500",css:{flex:"1","& input":{display:"none"}},children:[g(l?.name)?l.name:d,(0,i.jsx)("input",{ref:f,accept:qx(c),"aria-describedby":n?x:void 0,"aria-errormessage":"error"===a?I:void 0,"aria-invalid":"error"===a,id:_,type:"file",onChange:async e=>{const t=e.target.files?.[0];t&&("number"==typeof r&&t.size>r?b(p("le_fichier_ne_d_59049",lI.bytesToMegabytes(r))):(b(""),m({name:t.name,content:await hG(t,u)})))},...h})]})}),(0,i.jsx)(Yd,{id:I,state:j?"error":a,children:j?v:s})]})};var pG=n(3514);function fG(e){return{color:_u(e.subtitleColor)?e.subtitleColor:"$gray800",fontFamily:e.titleFontFamily||"Open Sans",fontSize:"14px",fontWeight:"700",textTransform:"uppercase"}}const _G=e=>{const t=Ti();return e.options.showInformations?(0,i.jsxs)(rd,{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)(ka,{css:{...fG(e.options),textAlign:"center"},width:1,children:g(e.informationsTitle)?e.informationsTitle:t("informations_22954")}),g(e.informationsContent)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(ka,{css:{wordBreak:"break-word","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(jf,{text:e.renderText(e.informationsContent)})})})]}):null},xG=e=>(0,i.jsx)(rd,{css:{paddingTop:e.isAso?"180px":"73px",position:"relative"},direction:"column",gap:"5",width:e.isAso?157:178,children:e.children}),IG=e=>{const t=Ti(),n=Ei(Cm),o=e.startDate,s=o.plus({week:1}).minus({day:1}),r=_u(e.options.headerColor)?e.options.headerColor:"white",a=e.options.showInformations;return(0,i.jsxs)(rd,{css:{color:_u(e.options.textColor)?e.options.textColor:"$gray800",background:g(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:nf,width:tf,children:[(0,i.jsxs)(rd,{align:"end",css:{position:"absolute",right:"16px",top:"69px"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{css:{color:r,fontSize:"13px",fontWeight:"700",lineHeight:"18px"},children:t("r_capitulatif_74015",e.delegationCalendar.delegation.name)}),(0,i.jsx)(ka,{css:{color:r,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:t("du_1_au_2_12974",n.toLocaleString(o,zs.DateOnly.MonthLong),n.toLocaleString(s,zs.DateOnly.MonthLong))})]}),(0,i.jsxs)(rd,{css:{px:"$4",position:"absolute",top:"140px"},gap:"5",height:635,width:1,children:[a&&(0,i.jsx)(xG,{children:(0,i.jsx)(_G,{informationsContent:e.document.informationsContent,informationsTitle:e.document.informationsTitle,options:e.options,renderText:e.renderText})}),(0,i.jsx)(rd,{css:{background:"white",borderRadius:"$3",flex:"1",fontSize:"12px",padding:"$6 $5"},height:1,children:(0,i.jsx)(ka,{width:1,children:e.children})})]})]})},vG=e=>{const t=(0,V.useMemo)(()=>pu(e.das.accreditation.color),[e.das]),n=(0,V.useMemo)(()=>({background:t[50],border:`1px solid ${t[500]}`,color:t[700]}),[t]);return(0,i.jsxs)(rd,{align:"start",css:{...n,borderRadius:"$1",minHeight:"32px",padding:"$1 $2"},direction:"column",gap:"1",width:1,children:[(0,i.jsxs)(ka,{css:{fontSize:"10px"},children:["x",e.das.assignedResources]}),(0,i.jsx)(ka,{fontSize:"textXs",fontWeight:"medium",children:e.das.accreditation.name})]})},bG=e=>(0,i.jsx)(IG,{delegationCalendar:e.delegationCalendar,document:e.document,options:e.options,renderText:e.renderText,startDate:e.startDate,children:(0,i.jsx)(ck,{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.delegationCalendar.endAt,minDate:e.delegationCalendar.startAt,children:e.accreditationsSlotsDates.map((e,t)=>(0,i.jsx)(dk,{endAt:e.accreditationSlot.date,startAt:e.accreditationSlot.date,children:(0,i.jsx)(vG,{das:e})},t))})}),jG=e=>{const{minDate:t,numberOfWeeks:n}=(0,V.useMemo)(()=>{const t=(0,Zh.A)(e.accreditationsSlotsDates.map(e=>e.accreditationSlot.date)).startOf("week"),n=(0,pG.A)(e.accreditationsSlotsDates.map(e=>e.accreditationSlot.date)).endOf("week");return{minDate:t,numberOfWeeks:Math.ceil(n.diff(t,"weeks").weeks)}},[e.accreditationsSlotsDates]);return(0,i.jsx)(i.Fragment,{children:(0,nm.A)(0,n).map(n=>(0,i.jsx)(bG,{accreditationsSlotsDates:e.accreditationsSlotsDates,delegationCalendar:e.delegationCalendar,document:e.document,options:e.options,renderText:e.renderText,startDate:t.plus({week:n})},n))})},CG=e=>{const t=Ei(Nk),n=e.delegationCalendar.delegation,o=(0,V.useMemo)(()=>n.allAccreditationsSlots.filter(e=>e.accreditationSlot.date?.isValid&&e.assignedResources>0).filter(t=>{if(e.date?.isValid&&e.endDate?.isValid){const n=As.IX.fromDateTimes(e.date.startOf("day"),e.endDate.endOf("day"));return As.IX.fromDateTimes(t.accreditationSlot.date.startOf("day"),t.accreditationSlot.date.endOf("day")).overlaps(n)}return!e.date?.isValid||t.accreditationSlot.date.startOf("day").equals(e.date.startOf("day"))}),[e.date,e.endDate,n]),s=e=>t.renderText(e,{delegation:n});return Bs(o)?(0,i.jsx)(jG,{accreditationsSlotsDates:o,delegationCalendar:e.delegationCalendar,document:e.eventDocument,options:e.options,renderText:s}):(0,i.jsx)(IG,{delegationCalendar:e.delegationCalendar,document:e.eventDocument,options:e.options,renderText:s,startDate:e.delegationCalendar.startAt})},yG=15e5;const AG=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,delegationId:r}}=bd(),[a,l,d]=gm(""),{delegationsOptions:c,isLoading:u}=function({delegationsIds:e,eventId:t,hasSelected:n,level:o,nameDebounced:s,organizationId:r}){const{data:a,isLoading:l}=(d={organizationId:r,level:o,eventId:t,hasSelected:n,name:g(s)?s:void 0,ids:e},Oi(nr,d,[]));var d;const c=(0,V.useMemo)(()=>(0,cm.A)((0,Xh.A)((a.organization?.list.nodes??[]).concat(a.organization?.selected?.nodes??[]),e=>e.id),e=>m(e.name)),[a.organization]);return{delegationsOptions:(0,V.useMemo)(()=>c.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[c]),isLoading:l}}({organizationId:o,level:ke.Event,eventId:s,hasSelected:!0,delegationsIds:[r],nameDebounced:l});return(0,i.jsxs)(rd,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(ka,{font:"gray900 textMd semiBold",children:n("aper_u_pour_la_06126")}),(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Uu,{isSearchLoading:u,isSearchVisible:!0,searchElement:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:n("rechercher_une_31213"),state:"search",value:a,onChange:d}),values:[r],onChange:n=>{Bs(n)&&t.replace(e.getPath(n[0]))},children:c})}),(0,i.jsx)(ka,{css:{flex:"1"}}),(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",to:e.downloadPath,children:n("t_l_charger_03283")})})]})},SG=e=>{const t=Ti();return(0,i.jsx)(Mv,{permissions:Ov.DOCUMENT_EDIT,children:(0,i.jsxs)(rd,{css:{border:"1px solid $gray200",borderRadius:"$2",padding:"$6",overflowX:"hidden",overflowY:"auto",minWidth:"320px"},direction:"column",width:420,children:[(0,i.jsx)(ka,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:t("param_tres_de_l_11729")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("s_lectionnez_le_59909")}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(rd,{direction:"column",gap:"3",width:1,children:e.children})]})})};function kG(e,t,n,i){const{canDocumentEdit:o}=Dv(),{mutate:s}=function(e={}){return Di("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]=V.useState({...t,...e}),[l,d]=V.useState(i.informations2Content||""),[c,u]=V.useState(i.informations2Title||""),[m,h]=V.useState(i.informationsContent||""),[g,p]=V.useState(i.informationsTitle||""),[f,_]=V.useState(i.signature||""),[x,I]=V.useState(i.title||""),v=V.useCallback((0,mm.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:m,informationsTitle:g,signature:f,title:x},informations2Content:l,informations2Title:c,informationsContent:m,informationsTitle:g,options:r,signature:f,title:x,setInformations2Content:async t=>{d(t),await v(e,t,c,m,g,f,x)},setInformations2Title:async t=>{u(t),await v(e,l,t,m,g,f,x)},setInformationsContent:async t=>{h(t),await v(e,l,c,t,g,f,x)},setInformationsTitle:async t=>{p(t),await v(e,l,c,m,t,f,x)},setOptions:async e=>{const t={...r,...e};a(t),await v(t,l,c,m,g,f,x)},setSignature:async t=>{_(t),await v(e,l,c,m,g,t,x)},setTitle:async t=>{I(t),await v(e,l,c,m,g,f,t)}}}const wG=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{user:s}=Li(),{eventDocument:r,informationsContent:a,informationsTitle:l,options:d,setInformationsContent:c,setInformationsTitle:u,setOptions:m}=kG(e.data.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",informationsContent:"",informationsTitle:"",showInformations:!1,subtitleColor:"#1d2939",textColor:"#1d2939",titleFontFamily:"Open Sans"},o,{id:e.data.event.document.id,title:e.data.event.document.title,informationsTitle:e.data.event.document.informationsTitle,informationsContent:e.data.event.document.informationsContent}),h=lW();return(0,i.jsxs)(rd,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(SG,{children:[(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(gG,{accept:Vx.Images,format:"base64",label:t("fond_du_documen_51758"),maxSize:yG,placeholder:t("fond_du_documen_51758"),value:d.background,onChange:e=>{m({background:e})}}),g(d.background?.name)&&(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{m({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(hh,{label:"Police",value:d.fontFamily,onChange:e=>{m({fontFamily:e})},children:h}),(0,i.jsx)(hh,{label:t("police_des_titr_37497"),value:d.titleFontFamily,onChange:e=>{m({titleFontFamily:e})},children:h}),(0,i.jsx)(rj,{label:t("couleur_du_text_32021"),value:d.textColor,onChange:e=>{m({textColor:e})}}),(0,i.jsx)(rj,{label:t("couleur_du_cont_17150"),value:d.headerColor,onChange:e=>{m({headerColor:e})}}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(Zm,{value:d.showInformations,onChange:e=>{m({showInformations:e})},children:t("afficher_la_sec_84744")}),d.showInformations&&(0,i.jsxs)(rd,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(Qd,{label:t("titre_de_la_sec_41575"),value:l,onChange:e=>{u(e)}}),(0,i.jsx)(AI,{initialValue:a,label:t("contenu_de_la_s_43102"),onChange:e=>{c(e)}})]})]}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(AG,{downloadPath:gf(e.data.event.delegation.links.delegationCalendarLink,"pdf",{lang:s?.language}),getPath:e=>fs.DOCUMENTS_DELEGATION_CALENDAR(n,o,e)}),(0,i.jsx)(lG,{children:(0,i.jsx)(CG,{delegationCalendar:e.data.event,eventDocument:r,options:d})})]})]})},EG=()=>{const{translate:e,params:{organizationId:t,eventId:n,delegationId:o}}=bd(),{event:s}=dv(),{data:r,loader:a}=Oi("query DelegationCalendarDocument(\n $eventId: EventId!\n $delegationId: DelegationId!\n $onlyVisible: Boolean!\n) {\n event(id: $eventId) {\n ...EventDelegationsExport\n ...DocumentDelegationCalendar\n }\n}\n",{eventId:n,delegationId:o,onlyVisible:!cv(t)},[js.EventDelegationsExportFragment,js.DocumentDelegationCalendarFragment]);return Zc(`${s.name} ${e("planning_des_ac_44426")}`),(0,i.jsxs)(rd,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(aG,{documentType:_t.DelegationCalendar,endAt:r.event?.endAt,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,startAt:r.event?.startAt,title:e("planning_des_ac_44426")}),(0,i.jsx)(md,{height:"7"}),a||(0,i.jsx)(wG,{data:r})]})};var TG=n(7957),RG=n(6965);const OG=e=>{const t=Ei(Yh),n=(0,V.useMemo)(()=>{const t=e.slot.range.start.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*t.hours+t.minutes)},[e.slot,e.startOfDay]),o=(0,V.useMemo)(()=>{const t=e.slot.range.end.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*t.hours+t.minutes)},[e.slot,e.startOfDay]),s=(0,V.useMemo)(()=>ng(t,e.slot,"",{interval:{options:{hideDate:!0}},slot:{includeRange:!0}}),[e.slot]);return(0,i.jsx)(rd,{align:"center",css:{background:e.palette[50],border:`1px solid ${e.palette[500]}`,borderRadius:"$1",color:e.palette[700],fontSize:"10px",fontWeight:"500",gridColumnStart:n,gridColumnEnd:o,px:"$2"},height:20,children:(0,i.jsx)(ka,{css:{ellipsis:!0},width:1,children:s})},e.slot.id)},DG=e=>{const t=(0,V.useMemo)(()=>e.slots.filter(t=>e.volunteerRegistration.positionsSlotsUsersInfos.some(e=>e.positionSlotId===t.id)),[e.slots,e.volunteerRegistration]);return(0,i.jsxs)(rd,{css:{borderBottom:"1px solid $gray200",minHeight:"28px"},width:1,children:[(0,i.jsx)(rd,{align:"center",css:{borderRight:"1px solid $gray200",color:"$gray700",fontSize:"12px",fontWeight:"500",px:"$4"},width:180,children:e.volunteerRegistration.userInfo.name}),(0,i.jsx)(rd,{align:"center",css:{borderRight:"1px solid $gray200",color:"$gray700",fontSize:"12px",fontWeight:"500",px:"$4"},width:150,children:e.volunteerRegistration.userInfo.phone?.internationalFormat??""}),(0,i.jsx)(rd,{css:{flex:"1",py:"2px",position:"relative"},children:(0,i.jsx)(yc,{align:"center",css:{gridAutoFlow:"column",overflow:"hidden",rowGap:"2px"},gridtemplatecolumns:"repeat(1440, 1fr)",width:1,children:t.map(t=>(0,i.jsx)(OG,{palette:e.palette,slot:t,startOfDay:e.startOfDay},t.id))})})]})},zG=e=>{const t=Ti(),n=Ei(Cm),o=_u(e.options.headerColor)?e.options.headerColor:"white";return(0,i.jsxs)(rd,{css:{background:g(e.options.background?.content)?`url(${e.options.background.content})`:e.position.color,backgroundRepeat:"no-repeat",backgroundSize:"cover",padding:"$7"},direction:"column",gap:"7",height:ef,width:Qp,children:[(0,i.jsxs)(rd,{justify:"between",children:[(0,i.jsx)(ka,{height:65,children:g(e.options.logo?.content)&&(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"auto"})}),(0,i.jsxs)(rd,{align:"end",css:{paddingTop:"26px"},direction:"column",gap:"1",width:1,children:[(0,i.jsx)(ka,{css:{color:o,fontSize:"13px",fontWeight:"700"},children:t("planning_missio_08082",e.position.name)}),(0,i.jsx)(ka,{css:{color:o,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:n.toLocaleString(e.day,zs.DateOnly.WeekdayLongMonthLong)})]})]}),(0,i.jsx)(rd,{css:{background:"white",borderRadius:"$1",flex:"1",overflow:"hidden"},direction:"column",children:(0,i.jsxs)(rd,{direction:"column",width:1,children:[(0,i.jsxs)(rd,{css:{background:"$gray50",borderBottom:"1px solid $gray200"},height:24,width:1,children:[(0,i.jsx)(rd,{css:{borderRight:"1px solid $gray200"},width:180}),(0,i.jsx)(rd,{css:{borderRight:"1px solid $gray200"},width:150}),(0,i.jsx)(rd,{css:{flex:"1"},children:(0,i.jsxs)(yc,{gridtemplatecolumns:"repeat(1440, 1fr)",height:1,width:1,children:[(0,i.jsx)(ka,{css:{gridColumn:"span 60"}}),(0,nm.A)(e.startHour+2,e.startHour+24,2).map(e=>(0,i.jsxs)(rd,{align:"center",css:{fontSize:"$textXs",gridColumn:"span 120"},justify:"center",children:[(0,RG.A)((e>=24?e-24:e).toString(10),2,"0"),":00"]},e))]})})]}),e.volunteersRegistrations.map(t=>(0,i.jsx)(DG,{palette:e.palette,slots:e.slots,startOfDay:e.startOfDay,volunteerRegistration:t},t.id))]})})]})},$G=e=>{const t=e.event.position,n=(0,V.useMemo)(()=>{const t=tg(e.event.dayStartTime);return t?.[0]??0},[e.event.dayStartTime]),o=(0,V.useMemo)(()=>pu(t.color),[t.color]),s=(0,V.useMemo)(()=>qh(t.slots,e.event.startAt,e.event.endAt,n).filter(t=>{if(e.date?.isValid&&e.endDate?.isValid){const n=As.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.date,e.endDate,e.event,t,n]),r=(0,V.useMemo)(()=>Math.ceil(e.event.endAt.plus({day:1}).diff(e.event.startAt,"days").days),[e.event.startAt,e.event.endAt]);return(0,i.jsx)(i.Fragment,{children:(0,nm.A)(0,r).map(r=>{const a=e.event.startAt.plus({day:r}).set({hour:n}),l=As.IX.fromDateTimes(a,a.plus({day:1})),d=s.filter(e=>l.engulfs(e.range));if(Bs(d)){const s=d.map(e=>e.id),l=e.event.volunteersRegistrations.nodes.filter(e=>{const t=e.positionsSlotsUsersInfos.map(e=>e.positionSlotId);return Bs((0,Pu.A)(s,t))});return(0,i.jsx)(V.Fragment,{children:(0,TG.A)(l,33).map((s,l)=>(0,i.jsx)(zG,{day:a,options:e.options,palette:o,position:t,slots:d,startHour:n,startOfDay:a,volunteersRegistrations:s},`${r}-${l}`))},r)}return null})})};const PG=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,positionId:r}}=bd(),[a,l,d]=gm(""),{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:g(n)?n:void 0,ids:s},Oi(ir,l,[]));var l;const d=(0,V.useMemo)(()=>(0,cm.A)((0,Xh.A)((r.organization?.list.nodes??[]).concat(r.organization?.selected?.nodes??[]),e=>e.id),e=>m(e.name)),[r.organization]);return{positionsOptions:(0,V.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)(rd,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(ka,{font:"gray900 textMd semiBold",children:n("aper_u_pour_la_94895")}),(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Uu,{isSearchLoading:u,isSearchVisible:!0,searchElement:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:n("rechercher_une_69998"),state:"search",value:a,onChange:d}),values:[r],onChange:n=>{Bs(n)&&t.replace(e.getPath(n[0]))},children:c})}),(0,i.jsx)(ka,{css:{flex:"1"}}),(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",to:e.downloadPath,children:n("t_l_charger_03283")})})]})},MG=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{user:s}=Li(),{options:r,setOptions:a}=kG(e.data.event.document.options,{background:{name:"",content:""},headerColor:"#ffffff",logo:{name:"",content:""}},o,{id:e.data.event.document.id});return(0,i.jsxs)(rd,{css:{flex:"1"},gap:"7",width:1,children:[(0,i.jsxs)(SG,{children:[(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(gG,{accept:Vx.Images,format:"base64",label:t("fond_du_documen_51758"),maxSize:yG,placeholder:t("fond_du_documen_51758"),value:r.background,onChange:e=>{a({background:e})}}),g(r.background?.name)&&(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{a({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(gG,{accept:Vx.Images,format:"base64",label:t("logo_18191"),maxSize:yG,placeholder:t("logo_18191"),value:r.logo,onChange:e=>{a({logo:e})}}),g(r.logo?.name)&&(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{a({logo:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(rj,{label:t("couleur_du_cont_17150"),value:r.headerColor,onChange:e=>{a({headerColor:e})}})]}),(0,i.jsxs)(rd,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(PG,{downloadPath:gf(e.data.event.position.links.positionPlanningLink,"pdf",{lang:s?.language}),getPath:e=>fs.DOCUMENTS_POSITION_PLANNING(n,o,e)}),(0,i.jsx)(lG,{css:{justifyContent:"start",overflowX:"auto","& > div":{overflowX:"auto"}},width:Qp,children:(0,i.jsx)($G,{event:e.data.event,options:r})})]})]})},FG=()=>{const{translate:e,params:{organizationId:t,eventId:n,positionId:o}}=bd(),{event:s}=dv(),{data:r,loader:a}=Oi("query PositionPlanningDocument($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n ...DocumentPositionPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:n,positionId:o},[js.DocumentPositionPlanningFragment,js.EventPositionsExportFragment]);return Zc(`${s.name} ${e("planning_d_une_64581")}`),(0,i.jsxs)(rd,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(aG,{documentType:_t.PositionPlanning,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,title:e("planning_d_une_64581")}),(0,i.jsx)(md,{height:"7"}),a||(0,i.jsx)(MG,{data:r})]})},NG=e=>{const t=Ti(),n=g(e.acronym)?`${e.name} (${e.acronym})`:e.name;return(0,i.jsxs)(rd,{css:{background:"$gray100",padding:"$7 56px"},direction:"column",children:[(0,i.jsx)(ka,{color:"gray900",fontSize:"displayXs",fontWeight:"medium",children:n}),(0,i.jsx)(ka,{color:"gray800",children:t("fiche_de_missio_00324")})]})},LG=e=>{const t=Ti(),n=Ei(Xb),o=(0,V.useMemo)(()=>e.slugsToDisplay||[],[e.slugsToDisplay]),s=(0,V.useMemo)(()=>Object.fromEntries(o.flatMap(t=>{const n=e.customFields.find(e=>e.slug===t);return n?[[t,n]]:[]})),[o,e.customFields]),r=(0,V.useMemo)(()=>(0,cm.A)(e.volunteers,e=>e.userInfo.name),[e.volunteers]);return(0,i.jsxs)(Hu,{children:[(0,i.jsx)(Wu,{css:{height:"32px"},children:o.map(e=>{const n=s[e];return"email"===e?(0,i.jsx)(pm,{children:t("Email")},e):"fullName"===e?(0,i.jsx)(pm,{children:t("full_name")},e):n?.fileType===gt.Picture?(0,i.jsx)(pm,{width:80,children:n.name},e):"teamCode"===e?(0,i.jsx)(pm,{children:t("code_quipe_14296")},e):"delegationName"===e?(0,i.jsx)(pm,{children:t("Delegation")},e):n?(0,i.jsx)(pm,{children:n.name},e):(0,i.jsx)(pm,{},e)})}),r.map(e=>{const t=e.userInfo;return(0,i.jsx)(am,{css:{height:"28px"},children:o.map(o=>{const r=s[o];if("email"===o)return(0,i.jsx)(Qu,{children:t.email},o);if("fullName"===o)return(0,i.jsx)(pm,{css:{color:"$gray800"},children:t.name},o);if(r?.fileType===gt.Picture){const e=n.getValueString(r,t.fields),s=r.fieldProperty===pt.Picture;return(0,i.jsx)(Qu,{width:80,children:(g(e)||s)&&(0,i.jsx)(Gf,{email:s?t.email:null,image:e,name:s?t.name:null,size:32})},o)}return"teamCode"===o?(0,i.jsx)(Qu,{children:e.teams.map(e=>e.teamCode).join(", ")},o):"delegationName"===o?(0,i.jsx)(Qu,{children:e.delegation?.name??""},o):r?(0,i.jsx)(Qu,{children:n.getValueString(r,t.fields)},o):(0,i.jsx)(Qu,{},o)})},t.id)})]})},BG=e=>{const t=Ti(),{isRenamed:n,finalName:o,rangeString:s}=pR(e.slot);return(0,i.jsx)(i.Fragment,{children:(0,TG.A)(e.volunteers,30).map((r,a)=>(0,i.jsxs)(rd,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(NG,{acronym:e.positionAcronym,name:e.positionName}),(0,i.jsxs)(rd,{css:{padding:"$7 56px"},direction:"column",gap:"3",children:[(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsxs)(ka,{font:"gray800 textSm medium",children:[t("membres_pour_le_20317",o)," (",e.volunteers.length,")"]}),n&&(0,i.jsx)(ka,{font:"gray800 textXs medium",children:s})]}),(0,i.jsx)(LG,{customFields:e.customFields,slugsToDisplay:e.slugsToDisplay,volunteers:r})]})]},a))})};function VG(e,t){const n=[];return"both"!==t&&"email"!==t||n.push(e.userInfo.email),g(e.userInfo.name)&&n.unshift(e.userInfo.name),!e.userInfo.phone||"both"!==t&&"phone"!==t||n.push(`${e.userInfo.phone.internationalFormat} `),n.join(" ")}const UG=e=>{const t=Ti(),n=Ei(Yh),o=(0,V.useMemo)(()=>(0,cm.A)(e.ranges,e=>e.range.start.toMillis()).map(({name:e,range:t})=>(0,hd.A)([g(e)?e:null,n.toDisplayString(t,{formats:{displayWeekday:!0}})]).join(" - ")),[e.ranges]),s=(0,Xh.A)(e.position.leaders.concat(e.position.category.leaders),e=>e.userInfo.id);return(0,i.jsxs)(rd,{css:{background:"white",padding:"$7 56px"},direction:"column",gap:"6",children:[e.displayPositionName&&(0,i.jsxs)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"medium",children:[e.position.category.name," | ",e.position.name]}),(0,i.jsxs)(rd,{gap:"9",children:[(0,i.jsx)(ka,{color:"gray500",width:150,children:t("date_de_la_miss_70346")}),(0,i.jsx)(rd,{css:{flex:"1"},direction:"column",children:o.map((e,t)=>(0,i.jsx)(ka,{color:"gray800",css:{textTransform:"capitalize"},children:e},t))})]}),s.map((n,o)=>(0,i.jsxs)(rd,{gap:"9",children:[(0,i.jsx)(ka,{color:"gray500",width:150,children:t("reponsable_82458")}),(0,i.jsx)(ka,{color:"gray800",css:{flex:"1"},dangerouslySetInnerHTML:{__html:VG(n,e.leadersData)}})]},o)),g(e.position.description)&&(0,i.jsxs)(rd,{gap:"9",children:[(0,i.jsx)(ka,{color:"gray500",width:150,children:t("description_58935")}),(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(jf,{text:e.position.description})})]}),ug(e.position)&&(0,i.jsxs)(rd,{gap:"9",children:[(0,i.jsx)(ka,{color:"gray500",width:150,children:t("localisation_38416")}),(0,i.jsxs)(rd,{color:"gray800",css:{flex:"1"},direction:"column",children:[dg(e.position)&&(0,i.jsx)(ka,{children:e.position.address}),cg(e.position)&&(0,i.jsx)(ka,{children:t("point_gps_1_19889",e.position.latitude,e.position.longitude)}),cg(e.position)&&(0,i.jsx)("a",{href:Cf(e.position.latitude,e.position.longitude),children:(0,i.jsx)("img",{alt:"Position map",src:`${F.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)(rd,{gap:"9",children:[(0,i.jsx)(ka,{color:"gray500",width:150,children:t("nombre_de_cr_ne_40593")}),(0,i.jsx)(ka,{color:"gray800",css:{flex:"1"},children:e.position.numberOfSlots})]}),(0,i.jsxs)(rd,{gap:"9",children:[(0,i.jsx)(ka,{color:"gray500",width:150,children:t("nombre_de_membr_08851")}),(0,i.jsx)(ka,{color:"gray800",css:{flex:"1"},children:e.position.assignedResources})]})]})]})},WG=e=>{const{organization:t,event:n}=e.positionDocumentFragment,o=n.position,s=(0,V.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)(ka,{css:{background:"white"},width:1,children:[e.options.showPositionData&&(0,i.jsxs)(rd,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(NG,{acronym:o.acronym,name:o.name}),(0,i.jsx)(UG,{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,cm.A)(n.volunteersRegistrations.nodes.filter(({positionsSlotsUsersInfos:e})=>e.map(({positionSlotId:e})=>e).includes(s.id)),e=>e.userInfo.name);return(0,i.jsx)(BG,{customFields:t.customFields.nodes,positionAcronym:o.acronym,positionName:o.name,slot:s,slugsToDisplay:e.options.slugsToDisplay,volunteers:r},s.id)})]})},GG=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{user:s}=Li(),{event:r}=dv(),{options:a,setOptions:l}=kG(e.data.event.document.options,{format:Gt.A4Portrait,showPositionData:!0,showVolunteersLists:!0,slugsToDisplay:["fullName","phone"]},o,{id:e.data.event.document.id});return Zc(`${r.name} ${t("fiche_de_missio_00324")}`),(0,i.jsxs)(rd,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(SG,{children:[(0,i.jsxs)(hh,{value:a.format,onChange:e=>{l({format:e})},children:[(0,i.jsx)("option",{value:Gt.A4Portrait,children:t("a4_portrait_92125")}),(0,i.jsx)("option",{value:Gt.A4Landscape,children:t("a4_paysage_24039")})]}),(0,i.jsx)(Eu,{state:a.showPositionData?"checked":"unchecked",onClick:e=>{l({showPositionData:"checked"===e})},children:t("afficher_les_do_85282")}),(0,i.jsx)(Eu,{state:a.showVolunteersLists?"checked":"unchecked",onClick:e=>{l({showVolunteersLists:"checked"===e})},children:t("afficher_les_li_18523")}),(0,i.jsxs)(Uu,{isSearchVisible:!0,multiple:!0,placeholder:t("champs_affich_17945"),values:a.slugsToDisplay,onChange:e=>{l({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)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(PG,{downloadPath:gf(e.data.event.position.links.positionSheetLink,"pdf",{lang:s?.language}),getPath:e=>fs.DOCUMENTS_POSITION(n,o,e)}),(0,i.jsx)(lG,{width:1,children:(0,i.jsx)(WG,{options:a,positionDocumentFragment:e.data})})]})]})},qG=()=>{const{translate:e,params:{organizationId:t,eventId:n,positionId:o}}=bd(),{data:s,loader:r}=Oi("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},[js.DocumentPositionSheetFragment,js.EventPositionsExportFragment]);return(0,i.jsxs)(rd,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(aG,{documentType:_t.Position,eventId:n,languages:s.event?.languages??[],organizationId:t,segmentsFolders:s.event?.segmentsFolders??[],showDate:!0,title:e("fiche_de_missio_61604")}),(0,i.jsx)(md,{height:"7"}),r||(0,i.jsx)(GG,{data:s})]})},HG=e=>{const t=Ti();return(0,i.jsx)(rd,{css:{background:"$gray100",padding:"$6"},direction:"column",children:(0,i.jsx)(ka,{color:"gray900",fontSize:"textXl",fontWeight:"medium",children:t("planning_1_14391",`${e.eventName} - ${e.segmentName}`)})})},KG=e=>{const t=Ti(),n=Ei(Cm),o=(0,Vu.A)(e.slots,e=>e.positionId);return(0,i.jsxs)(rd,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[!0!==e.hideHeader&&(0,i.jsx)(HG,{eventName:e.eventName,segmentName:e.segmentName}),(0,i.jsxs)(rd,{css:{background:"white",padding:"$6",position:"relative"},direction:"column",width:1,children:[(0,i.jsxs)(rd,{children:[(0,i.jsx)(hk,{width:240,children:t("jour_87026")}),(0,i.jsx)(hk,{width:720,children:n.toLocaleString(e.startDate,zs.DateOnly.WeekdayLongMonthLong)})]}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(hk,{width:240,children:t("cr_neaux_33401")}),(0,nm.A)(0,6).map(t=>{const n=e.startDate.plus({hour:2*t}),o=n.plus({hour:2}),s=As.IX.fromDateTimes(n,o);return(0,i.jsx)(hk,{width:120,children:s.toFormat("HH:mm")},t)})]}),e.positions.map((t,n)=>{const s=o[t.id];return(0,i.jsxs)(V.Fragment,{children:[(0,i.jsxs)(rd,{children:[(0,i.jsx)(hk,{css:{color:"$gray700",height:"48px"},width:240,children:(0,i.jsx)(ka,{css:{ellipsis:!0},textAlign:"start",width:1,children:t.name})}),(0,nm.A)(0,6).map(e=>(0,i.jsx)(hk,{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=`${g(t.name)?`${t.name} - `:""}${t.range.toFormat("HH:mm")}`;return(0,i.jsx)(rd,{align:"center",css:{background:t.position.color,borderRadius:"$1",color:uu(t.position.color),fontSize:"$textXs",height:"32px",left:`${r}px`,position:"absolute",top:`${a}px`,width:`${l}px`},children:(0,i.jsx)(ka,{css:{ellipsis:!0,px:"$1"},textAlign:"center",title:d,width:1,children:d})},t.id)})]},t.id)})]})]})},YG=e=>{const t=(0,V.useMemo)(()=>{const t=Gh(e.event.positionsSlots.nodes);if(Bs(t)){const n=Kh(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:As.IX.fromDateTimes(t.start,t.start.set({hour:12,minute:0}))},{...e,range:As.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,V.useMemo)(()=>Bs(t)?Kh(t.map(e=>e.range)):null,[t]),o=n&&(8!==n.startHour||20!==n.endHour);return(0,i.jsx)(i.Fragment,{children:n?(0,nm.A)(0,n.numberOfDays).map((s,r)=>(0,nm.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=As.IX.fromDateTimes(d,c),m=t.filter(e=>e.range.overlaps(u)),h=(0,cm.A)((0,Xh.A)(m.map(e=>e.position),e=>e.id),e=>e.name);return Bs(m)?(0,TG.A)(h,11).map((t,n)=>(0,i.jsx)(KG,{eventName:e.event.name,hideHeader:e.hideHeader,positions:t,segmentName:e.event.segment.name,slots:m,startDate:d},`${r}-${l}-${n}`)):null})):!0!==e.hideHeader?(0,i.jsx)(HG,{eventName:e.event.name,segmentName:e.event.segment.name}):null})},ZG=e=>{const{history:t,translate:n,params:{segmentId:o}}=bd();return(0,i.jsxs)(rd,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(ka,{font:"gray900 textMd semiBold",children:n("aper_u_pour_la_43833")}),(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Uu,{isSearchVisible:!0,values:[o],onChange:n=>{Bs(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))})}),g(e.downloadPath)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{css:{flex:"1"}}),(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",to:e.downloadPath,children:n("t_l_charger_03283")})})]})]})},XG=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:o}}=bd(),{event:s}=dv(),{data:r,loader:a}=Oi("query PlanningDocument($eventId: EventId!, $segmentId: SegmentId!, $date: Date) {\n event(id: $eventId) {\n ...DocumentPositionsPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:n,segmentId:o},[js.DocumentPositionsPlanningFragment,js.EventPositionsExportFragment]);return Zc(`${s.name} ${e("planning_de_l_96909")}`),(0,i.jsxs)(rd,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(aG,{documentType:_t.Planning,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("planning_de_l_96909")}),(0,i.jsx)(md,{height:"7"}),a||(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(ZG,{getPath:e=>fs.DOCUMENTS_PLANNING(t,n,e),segmentsFolders:r.event.segmentsFolders}),(0,i.jsx)(lG,{width:1,children:(0,i.jsx)(ka,{css:{overflow:"auto"},width:1,children:(0,i.jsx)(YG,{event:r.event})})})]})]})};var JG;function QG(){return QG=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=Ti(),n=Ei(Cm),o=(0,V.useMemo)(()=>Wh(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,cm.A)(og(t,e.slots),[e=>e.position.name.toLowerCase(),e=>e.range.start.toMillis()]);return(0,i.jsxs)(rd,{css:{background:"white",fontSize:"12px",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(HG,{eventName:e.eventName,segmentName:e.segmentName}),(0,i.jsxs)(rd,{css:{background:"white",padding:"$6"},direction:"column",width:1,children:[(0,i.jsxs)(rd,{children:[(0,i.jsx)(hk,{width:200,children:t("jours_88317")}),(0,nm.A)(0,o).map(t=>{const o=s.plus({days:t}),r=og(o,e.slots);return(0,i.jsx)(hk,{width:(r.length||1)*tq,children:n.toLocaleString(o,zs.DateOnly.MonthShort)},t)})]}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(hk,{width:200,children:t("missions_63972")}),(0,nm.A)(0,o).map(t=>{const n=s.plus({days:t}),o=(0,cm.A)(Object.values((0,Vu.A)(og(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)(fk,{css:{height:"40px"},width:tq},t):o.map(({position:e,numberOfSlots:n})=>{const o=g(e.acronym)?e.acronym:e.name;return(0,i.jsx)(hk,{width:n*tq,children:(0,i.jsx)(ka,{css:{ellipsis:!0,px:"$1"},textAlign:"center",title:o,width:1,children:o})},`${t}-${e.id}`)})})]}),(0,i.jsxs)(rd,{children:[(0,i.jsx)(hk,{width:200,children:t("cr_neaux_33401")}),(0,nm.A)(0,o).map(e=>{const t=s.plus({days:e}),n=r(t);return 0===n.length?(0,i.jsx)(fk,{css:{height:"40px"},width:tq},e):n.map(t=>(0,i.jsx)(hk,{width:tq,children:t.range.toFormat("HH:mm",{separator:"-"})},`${e}-${t.id}`))})]}),e.volunteersRegistrations.map(e=>{const t=e.userInfo;return(0,i.jsxs)(rd,{children:[(0,i.jsxs)(gk,{width:200,children:[(0,i.jsx)(Gf,{email:t.email,image:t.picture?.url,name:t.name,size:24}),(0,i.jsx)(ka,{css:{flex:"1",ellipsis:""},title:t.name,children:t.name})]}),(0,nm.A)(0,o).map(t=>{const n=s.plus({days:t}),o=r(n);return 0===o.length?(0,i.jsx)(fk,{width:tq},t):o.map(n=>{const o=`${t}-${n.id}`;return void 0!==e.positionsSlotsUsersInfos.find(({positionSlotId:e})=>e===n.id)?(0,i.jsx)(pk,{width:tq,children:(0,i.jsx)(ka,{children:(0,i.jsx)(eq,{})})},o):(0,i.jsx)(fk,{width:tq},o)})})]},e.id)})]})]})},iq=e=>{const t=(0,cm.A)(Gh(e.event.positionsSlots.nodes),e=>e.range.start),n=e.event.volunteersRegistrations.nodes;return(0,i.jsx)(i.Fragment,{children:(0,TG.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,Pu.A)(s,t).length>0});return(0,TG.A)(r,10).map((n,s)=>(0,i.jsx)(nq,{eventName:e.event.name,segmentName:e.event.segment.name,slots:t,volunteersRegistrations:n},`${o}-${s}`))})})},oq=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:o}}=bd(),{event:s}=dv(),{data:r,loader:a}=Oi("query PositionsVolunteersPlanningDocument($eventId: EventId!, $segmentId: SegmentId!) {\n event(id: $eventId) {\n ...DocumentPositionsVolunteersPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:n,segmentId:o},[js.DocumentPositionsVolunteersPlanningFragment,js.EventPositionsExportFragment]);return Zc(`${s.name} ${e("planning_d_un_g_23684")}`),(0,i.jsxs)(rd,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(aG,{documentType:_t.PositionsVolunteersPlanning,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("planning_d_un_g_23684")}),(0,i.jsx)(md,{height:"7"}),a||(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(ZG,{getPath:e=>fs.DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING(t,n,e),segmentsFolders:r.event.segmentsFolders}),(0,i.jsx)(lG,{children:(0,i.jsx)(ka,{css:{overflow:"auto"},width:1,children:(0,i.jsx)(iq,{event:r.event})})})]})]})},sq=e=>e.options.showQrCode?(0,i.jsxs)(rd,{align:"center",css:{background:e.isAso?"transparent":"white",borderRadius:"$2",padding:"$4 $3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(ka,{css:{...fG(e.options),textAlign:"center"},width:1,children:e.isAso?"QR Code pour valider ma présence":e.isEtapeTour?"QR Code de présence":"QR Code"}),(0,i.jsx)(rd,{align:"center",css:{background:e.isAso?"white":"transparent",borderRadius:e.isAso?"$1":"none"},height:112,justify:"center",width:112,children:(0,i.jsx)(ka,{height:104,width:104,children:(0,i.jsx)("img",{height:"100%",src:mf(e.ticketId,{height:90,width:90}),width:"100%"})})})]}):null,rq=e=>{const t=Ti(),n=e.psuis[0].position,o=e.userInfo,s=168===e.organizationId,r=573===e.organizationId,a=858===e.organizationId,l=3676===e.organizationId,d=306===e.organizationId,c=_u(e.options.headerColor)?e.options.headerColor:"white",u={color:_u(e.options.titleColor)?e.options.titleColor:"$gray800",fontFamily:e.options.titleFontFamily||"Open Sans",fontSize:s?"22px":"24px",fontWeight:s?"500":"800",lineHeight:s?"34px":void 0,textAlign:"center"},m=fG(e.options),h=e.options.showInformations||e.options.showInformations2||e.options.showQrCode,p=(0,Xh.A)(n.leaders.concat(n.category.leaders),e=>e.userInfo.id);return(0,i.jsxs)(rd,{css:{color:_u(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:g(e.options.background?.content)?`url(${e.options.background?.content})`:void 0,backgroundRepeat:"repeat-y",backgroundSize:"100% auto",height:`calc-size(auto, round(up, size, ${tf}px))`,width:`${nf}px`},"@page":{size:"A4 portrait"}},direction:"column",children:[(0,i.jsx)(ka,{css:{backgroundAttachment:"fixed",backgroundColor:n.color,backgroundImage:g(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)(rd,{align:"center",css:{marginLeft:"210px",marginTop:"51px"},gap:"4",justify:d?"end":"center",width:568,children:[(0,i.jsxs)(rd,{align:d?"end":"center",css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(ka,{css:{color:c,fontSize:"14px",fontWeight:"700",lineHeight:"18px"},children:g(e.document.title)?e.document.title:t("Assignments")}),(0,i.jsx)(ka,{css:{color:c,fontSize:"28px",fontWeight:"700",lineHeight:"38px"},children:o.name})]}),d&&(0,i.jsx)(ka,{css:{background:`url(${e.userInfo.picture?.url}) no-repeat`,backgroundSize:"contain",borderRadius:"$1",overflowX:"hidden"},height:74,width:74})]}),(0,i.jsx)(md,{height:d?"4":"7"}),(0,i.jsxs)(rd,{css:{paddingLeft:a?"46px":"$4",paddingRight:"$4"},gap:"4",width:1,children:[h&&(0,i.jsxs)(xG,{isAso:a,children:[(0,i.jsx)(_G,{informationsContent:e.document.informationsContent,informationsTitle:e.document.informationsTitle,isAso:a,options:e.options,renderText:e.renderText}),e.options.showInformations2&&(0,i.jsxs)(rd,{css:{background:"white",borderRadius:"$2",padding:"$4 $3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(ka,{css:{...m,textAlign:"center"},width:1,children:g(e.document.informations2Title)?e.document.informations2Title:t("informations_se_69499")}),g(e.document.informations2Content)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(ka,{css:{wordBreak:"break-word","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(jf,{text:e.renderText(e.document.informations2Content)})})})]}),(0,i.jsx)(sq,{isAso:a,isEtapeTour:l,options:e.options,ticketId:e.volunteerRegistration.ticketId}),a&&e.options.showLeaders&&p[0]&&(0,i.jsxs)(ka,{css:{position:"absolute",textAlign:"center",top:"710px"},width:1,children:[(0,i.jsx)(ka,{css:{...fG(e.options),marginBottom:"$1",textAlign:"center"},width:1,children:"TON RESPONSABLE"}),p[0].userInfo.name,(0,i.jsx)("br",{}),p[0].userInfo.phone?.internationalFormat]})]}),(0,i.jsxs)(rd,{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)(ka,{css:{...u,fontSize:"12px",fontWeight:"700"},children:n.category.name}),(0,i.jsx)(md,{height:"1"})]}),(0,i.jsx)(ka,{css:u,width:1,children:n.name}),e.children]})]})]})},aq=e=>{const t=Ti(),n=Ei(Xb),o=Ei(Nk),s=Ei(Si),r=e.psuis[0].position,a=(0,cm.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,h=3618===e.organizationId,p=3676===e.organizationId,f=fG(e.options),_=(0,Xh.A)(r.leaders.concat(r.category.leaders),e=>e.userInfo.id),x="both"===e.options.leadersData||"email"===e.options.leadersData,I="both"===e.options.leadersData||"phone"===e.options.leadersData,v=t=>o.renderText(t,{userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rq,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:v,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:[e.options.showLeaders&&!d&&!c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(ka,{css:{color:_u(e.options.subtitleColor)?e.options.subtitleColor:"$gray800",fontSize:"14px",fontWeight:"700"},textAlign:"center",width:1,children:[t("ton_responsable_16222",_.length)," ",_.map(e=>(0,hd.A)([e.userInfo.name,x?e.userInfo.email:"",I?e.userInfo.phone?.internationalFormat??"":""]).join(" ")).join(", ")]})]}),(0,i.jsx)(md,{height:"7"}),!c&&(0,i.jsxs)(rd,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(ka,{css:f,children:u?"Horaire":p?"Rendez-vous":t("date_de_ta_miss_18706")}),(0,i.jsx)(rd,{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)(ka,{children:[g(e.name)?`${e.name} | `:"",(0,i.jsx)(Jp,{css:{textTransform:"capitalize"},children:n.toFormat("cccc d MMMM yyyy HH:mm",{locale:s.language.toString().toLowerCase()})})," ","-"," ",(0,i.jsx)(Jp,{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)(rd,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(ka,{css:f,children:"Rendez-vous"}),(0,i.jsx)(rd,{direction:"column",gap:"1",children:a.map((e,t)=>(0,i.jsxs)(ka,{children:[(0,i.jsx)(Jp,{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)(md,{height:"6"}),(0,i.jsxs)(rd,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(ka,{css:f,children:u?"Consignes du poste":t("description_de_15187")}),(0,i.jsxs)(rd,{direction:"column",children:[g(r.description)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{css:{"& .h-rich-text > p":{margin:"0"},"& .h-rich-text figure, & .h-rich-text img":{maxWidth:"100%"}},children:(0,i.jsx)(jf,{text:r.description})}),(0,i.jsx)(md,{height:"1"})]}),ug(r)&&(0,i.jsxs)(rd,{css:{"@media print":{breakInside:"avoid",display:"block",overflow:"visible"}},direction:"column",children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{css:f,children:d?"Point de rendez-vous":m?"Lieu du poste":t("lieu_de_rendez_30016")}),dg(r)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{children:r.address})]}),cg(r)&&(d||u||h)&&(0,i.jsxs)(ka,{children:["Point GPS : ",r.latitude,", ",r.longitude]}),cg(r)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsxs)(rd,{gap:"3",width:1,children:[(0,i.jsx)(ka,{css:{width:"100%"},height:u?270:180,children:(0,i.jsx)("a",{href:Cf(r.latitude,r.longitude),style:{background:`url(${F.HEAVENT_API_URL}/image/event/${e.eventId}/position/${r.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),l&&g(r.fields?.cf44697?.url)&&(0,i.jsx)(ka,{css:{background:`url(${r.fields.cf44697.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204}),d&&g(r.fields?.cf46814?.url)&&(0,i.jsx)(ka,{css:{background:`url(${r.fields.cf46814.url}) no-repeat`,backgroundSize:"contain"},height:180,width:1}),c&&g(r.fields?.cf45815?.url)&&(0,i.jsx)(ka,{css:{background:`url(${r.fields.cf45815.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204})]})]}),d&&g(r.fields?.cf46813)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{children:r.fields.cf46813})]})]})]})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(ka,{css:f,children:"UNE QUESTION OU UN PROBLÈME ?"}),(0,i.jsxs)(ka,{children:["Nous sommes là pour vous aider. Contactez votre responsable de secteur :"," ",(0,i.jsxs)(Jp,{fontWeight:"bold",children:[_[0]?.userInfo.name," :"," ",_[0]?.userInfo.phone?.internationalFormat]})]})]})]}),e.customFields.map(t=>{const o=n.getValueString(t,r.fields,{fileReturnValue:"url"});return e.options.positionCustomFields?.includes(t.id)&&g(o)?(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(ka,{css:f,children:t.name}),t.fieldType===Oe.File?function(e){const{extension:t}=Lx(e);return Bx.includes(t)}(n.getValueString(t,r.fields,{fileReturnValue:"name"}))?(0,i.jsx)(ka,{css:{background:`url(${o}) no-repeat`,backgroundPositionX:"left",backgroundSize:"contain"},height:180,width:1}):(0,i.jsx)(ka,{css:{wordBreak:"break-word","& > a":{color:"inherit"}},children:(0,i.jsx)("a",{href:o,rel:"noreferrer",target:"_blank",children:o})}):(0,i.jsx)(ka,{dangerouslySetInnerHTML:{__html:o.replace(/\n/g," ")}})]})]},t.id):null}),g(e.document.signature)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(ka,{css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(jf,{text:v(e.document.signature)})})})]}),c&&g(r.fields?.cf24781?.url)&&(0,i.jsxs)(rq,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:v,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{css:{color:_u(e.options.titleColor)?e.options.titleColor:"$gray800",fontFamily:e.options.titleFontFamily||"Open Sans",fontSize:"16px",fontWeight:"700",textAlign:"center"},children:"(Annexe)"}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(ka,{css:{background:`url(${r.fields.cf24781.url}) no-repeat`,backgroundSize:"contain"},height:300,width:1})]}),p&&g(r.fields?.cf75967?.url)&&(0,i.jsxs)(rq,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:v,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{css:{color:_u(e.options.titleColor)?e.options.titleColor:"$gray800",fontFamily:e.options.titleFontFamily||"Open Sans",fontSize:"16px",fontWeight:"700",textAlign:"center"},children:"(Plan)"}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(ka,{css:{background:`url(${r.fields.cf75967.url}) no-repeat`,backgroundSize:"contain"},height:300,width:1})]}),u&&(0,i.jsx)(rq,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:v,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsx)(ka,{css:{background:"url(https://assets.recrewteer.com/badges/velotour/condition_2026.png) no-repeat",backgroundSize:"contain"},height:601})})]})},lq=e=>{const t=e.assignmentsInfos.event.volunteerRegistration,n=(0,V.useMemo)(()=>If(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,V.useMemo)(()=>(0,cm.A)(Object.entries((0,Vu.A)(n,e=>e.position.id)),([e,t])=>(0,Zh.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)(aq,{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))})},dq=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{eventDocument:s,informations2Content:r,informations2Title:a,informationsContent:l,informationsTitle:d,options:c,signature:u,title:m,setInformations2Content:h,setInformations2Title:p,setInformationsContent:f,setInformationsTitle:_,setOptions:x,setSignature:I,setTitle:v}=kG(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=lW(),j=(0,V.useMemo)(()=>(0,cm.A)(e.data.organization.customFields.nodes,e=>e.name.toLowerCase()),[e.data]),C=e.data.organization.userInfo;return(0,i.jsxs)(rd,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(SG,{children:[(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(gG,{accept:Vx.Images,format:"base64",label:t("fond_du_documen_51758"),maxSize:yG,placeholder:t("fond_du_documen_51758"),value:c.background,onChange:e=>{x({background:e})}}),g(c.background?.name)&&(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{x({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Qd,{label:t("titre_du_docume_33508"),value:m,onChange:e=>{v(e)}}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(hh,{label:"Police",value:c.fontFamily,onChange:e=>{x({fontFamily:e})},children:b}),(0,i.jsx)(hh,{label:t("police_des_titr_37497"),value:c.titleFontFamily,onChange:e=>{x({titleFontFamily:e})},children:b}),(0,i.jsx)(rj,{label:t("couleur_du_titr_08509"),value:c.titleColor,onChange:e=>{x({titleColor:e})}}),(0,i.jsx)(rj,{label:t("couleur_des_sou_18968"),value:c.subtitleColor,onChange:e=>{x({subtitleColor:e})}}),(0,i.jsx)(rj,{label:t("couleur_du_text_32021"),value:c.textColor,onChange:e=>{x({textColor:e})}}),(0,i.jsx)(rj,{label:t("couleur_du_cont_17150"),value:c.headerColor,onChange:e=>{x({headerColor:e})}}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(Zm,{value:c.showInformations,onChange:e=>{x({showInformations:e})},children:t("afficher_la_sec_84744")}),c.showInformations&&(0,i.jsxs)(rd,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(Qd,{label:t("titre_de_la_sec_41575"),value:d,onChange:e=>{_(e)}}),(0,i.jsx)(AI,{initialValue:l,label:t("contenu_de_la_s_43102"),onChange:e=>{f(e)}})]}),(0,i.jsx)(Zm,{value:c.showInformations2,onChange:e=>{x({showInformations2:e})},children:t("afficher_la_sec_67554")}),c.showInformations2&&(0,i.jsxs)(rd,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(Qd,{label:t("titre_de_la_sec_41575"),value:a,onChange:e=>{p(e)}}),(0,i.jsx)(AI,{initialValue:r,label:t("contenu_de_la_s_43102"),onChange:e=>{h(e)}})]}),(0,i.jsx)(Zm,{value:c.showQrCode,onChange:e=>{x({showQrCode:e})},children:t("afficher_le_qr_15635")}),(0,i.jsx)(Zm,{value:c.showLeaders,onChange:e=>{x({showLeaders:e})},children:t("afficher_les_re_08705")}),c.showLeaders&&(0,i.jsx)(rd,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:(0,i.jsxs)(hh,{label:t("donn_es_des_res_45809"),value:c.leadersData,onChange:e=>{x({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)(Oh,{direction:"horizontal"}),(0,i.jsx)(AI,{initialValue:u,label:t("signature_67521"),onChange:e=>{I(e)}}),Bs(j)&&(0,i.jsx)(Uu,{label:t("liste_des_champ_40847"),multiple:!0,values:c.positionCustomFields,onChange:e=>{x({positionCustomFields:e})},children:j.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(pb,{downloadPath:gf(C.links?.userAssignmentsLink??"","pdf",{lang:C.language}),getPath:e=>fs.DOCUMENTS_ASSIGNMENTS(n,o,e)}),(0,i.jsx)(lG,{children:(0,i.jsx)(lq,{assignmentsInfos:e.data,eventDocument:s,options:c})})]})]})},cq=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o}}=bd(),{event:s}=dv(),{data:r,loader:a}=Oi("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},[js.DocumentUserAssignmentsFragment,js.EventVolunteersExportFragment]);return Zc(`${s.name} ${e("fiche_d_affecta_91461")}`),(0,i.jsxs)(rd,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(aG,{documentType:_t.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)(md,{height:"7"}),a||(0,i.jsx)(dq,{data:r})]})},uq=e=>{const t=Ti(),n=Ei(Yh),o=e.options.format===Gt.A4Portrait?lf.A4:e.options.format===Gt.A5Portrait?lf.A5:lf.A6,s=e.badgeDocumentFragment.volunteerRegistration;return(0,i.jsxs)(ka,{width:o.width,children:[(0,i.jsxs)(rd,{css:{background:`linear-gradient(190deg, ${e.options.color} 40%, white 40%)`},direction:"column",height:o.height,width:1,children:[(0,i.jsx)(ka,{css:{height:"calc(40% - 40px)"}}),(0,i.jsxs)(rd,{align:"center",direction:"column",width:1,children:[(0,i.jsx)(Gf,{email:s.userInfo.email,image:s.userInfo.picture?.url,name:s.userInfo.name,size:96}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textXl",fontWeight:"medium",children:s.userInfo.nameOrEmail}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textLg",children:g(e.options.name)?e.options.name:t("membre_45658")})]}),(0,i.jsx)(ka,{css:{flex:"1"}}),g(e.options.logo?.content)&&(0,i.jsx)(rd,{height:96,justify:"center",children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content})}),(0,i.jsx)(md,{height:"6"})]}),e.showPageSeparator&&(0,i.jsx)(ka,{css:{background:"transparent",height:"$space$6"}}),(0,i.jsxs)(rd,{css:{background:"white",pageBreakBefore:"always",padding:"$4 $6"},direction:"column",height:o.height,width:1,children:[g(e.options.logo?.content)&&(0,i.jsx)(rd,{height:32,justify:"center",children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content})}),(0,i.jsx)(md,{height:"6"}),!1!==e.options.showAssignments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{color:"gray900",fontWeight:"medium",children:t("affectation_plural")}),(0,i.jsx)(md,{height:"2"}),s.positionsSlotsUsersInfos.map(({position:e,positionSlot:o},s)=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(ka,{color:"gray500",fontSize:"textXs",children:t("affectation_n_78121",s+1)}),(0,i.jsxs)(ka,{color:"gray800",children:[e.name," :"," ",n.toDisplayString(o.range)]}),(0,i.jsx)(md,{height:"2"})]},s))]}),g(e.options.infos)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{color:"gray500",fontSize:"textXs",children:t("renseigements_c_00093")}),(0,i.jsx)(ka,{color:"gray800",css:{whiteSpace:"pre-wrap"},children:e.options.infos})]})]})]})},mq=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{options:s,setOptions:r}=kG(e.data.event.document.options,{format:Gt.A6Portrait,logo:{name:"",content:""},color:Ia.colors.gray900.value,name:"",infos:"",showAssignments:!0},o,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(rd,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(SG,{children:[(0,i.jsxs)(hh,{label:"Format",value:s.format,onChange:e=>{r({format:e})},children:[(0,i.jsx)("option",{value:Gt.A4Portrait,children:"A4"}),(0,i.jsx)("option",{value:Gt.A5Portrait,children:"A5"}),(0,i.jsx)("option",{value:Gt.A6Portrait,children:"A6"})]}),(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(gG,{accept:Vx.Images,format:"base64",label:t("logo_18191"),maxSize:yG,placeholder:t("logo_18191"),value:s.logo,onChange:e=>{r({logo:e})}}),g(s.logo?.name)&&(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({logo:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(rj,{label:t("couleur_de_fond_75677"),value:s.color,onChange:e=>{r({color:e})}}),(0,i.jsx)(Qd,{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)(qp,{label:t("renseigements_c_00093"),placeholder:t("ex_contact_d_11070"),value:s.infos,onChange:e=>{r({infos:e})}}),(0,i.jsx)(Eu,{state:s.showAssignments?"checked":"unchecked",onClick:e=>{r({showAssignments:"checked"===e})},children:t("afficher_les_af_46643")})]}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(pb,{downloadPath:gf(a.links?.userBadgeLink??"","pdf",{lang:a.language}),getPath:e=>fs.DOCUMENTS_BADGE(n,o,e,"generic")}),(0,i.jsx)(lG,{children:(0,i.jsx)(uq,{badgeDocumentFragment:e.data.event,options:s,showPageSeparator:!0})})]})]})},hq=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o}}=bd(),{event:s}=dv(),{data:r,loader:a}=Oi("query UserBadgeDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserBadge\n ...EventVolunteersExport\n }\n}\n",{eventId:n,userInfoId:o},[js.DocumentUserBadgeFragment,js.EventVolunteersExportFragment]);return Zc(`${s.name} ${e("BadgeCheck")}`),(0,i.jsxs)(rd,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(aG,{documentType:_t.Badge,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("badges_37586")}),(0,i.jsx)(md,{height:"7"}),a||(0,i.jsx)(mq,{data:r})]})},gq=e=>{const t=Ti(),n=Ei(Cm),o=Ei(Yh),s=(0,V.useMemo)(()=>(0,cm.A)(e.certificateDocumentFragment.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.certificateDocumentFragment.volunteerRegistration]),r=As.c9.local(),a=e.certificateDocumentFragment.volunteerRegistration.userInfo,l=g(a.dateOfBirth)&&As.c9.fromISO(a.dateOfBirth).isValid,d=g(a.street)&&g(a.city)&&g(a.postalCode);return(0,i.jsxs)(rd,{css:{background:"white",padding:"$7 56px"},direction:"column",gap:"5",width:1,children:[g(e.options.header.content)&&(0,i.jsx)(ka,{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)(ka,{color:"gray900",fontSize:"textXl",fontWeight:"semiBold",textAlign:"center",children:t("attestation_de_92734")}),(0,i.jsxs)(rd,{css:{bd:!0,padding:"$4"},direction:"column",gap:"6",children:[(0,i.jsxs)(ka,{color:"gray800",fontWeight:"semiBold",children:[t("je_soussign_e_04371",e.options.name)," ",(0,i.jsx)("br",{}),e.options.title]}),(0,i.jsxs)(ka,{css:{"& > span":{fontWeight:"$semiBold"}},children:[t("certifie_que_13123")," ",(0,i.jsx)("span",{children:a.name}),(0,i.jsx)("br",{}),l&&(0,i.jsxs)(i.Fragment,{children:[t("n_e_le_14393")," ",(0,i.jsx)("span",{children:n.toLocaleString(As.c9.fromISO(a.dateOfBirth),zs.DateOnly.MonthLong)}),(0,i.jsx)("br",{})]}),d&&(0,i.jsxs)(i.Fragment,{children:[t("demeurant_78485")," ",(0,i.jsx)("span",{children:g(a.street)?a.street:""}),(0,i.jsx)("br",{}),t("commune_48881")," ",(0,i.jsx)("span",{children:g(a.city)?a.city:""}),(0,i.jsx)("br",{}),t("code_postal_74563")," ",(0,i.jsx)("span",{children:g(a.postalCode)?a.postalCode:""})]})]}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"semiBold",children:t("a_t_b_n_vole_58773")}),(0,i.jsx)(ka,{dangerouslySetInnerHTML:{__html:s.map(({position:e,positionSlot:t})=>`${e.name} : ${o.toDisplayString(t.range)}`).join(" ")}}),(0,i.jsxs)(ka,{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]}),g(e.options.infos)&&(0,i.jsx)(ka,{color:"gray800",css:{whiteSpace:"pre-wrap"},children:e.options.infos})]}),(0,i.jsx)(ka,{color:"gray800",children:t("atteste_sur_l_h_37408")}),(0,i.jsxs)(yc,{gap:"6",gridtemplatecolumns:"repeat(3, 1fr)",children:[(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(ka,{color:"gray800",children:t("signature_67521")}),g(e.options.signature.content)&&(0,i.jsx)(ka,{width:1,children:(0,i.jsx)("img",{src:e.options.signature.content,width:"100%"})})]}),(0,i.jsx)(ka,{color:"gray800",children:t("fait_1_39349",e.options.place)}),(0,i.jsx)(ka,{color:"gray800",children:n.toLocaleString(r,zs.DateOnly.MonthLong)})]})]})},pq=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{options:s,setOptions:r}=kG(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)(rd,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(SG,{children:[(0,i.jsx)(Qd,{label:t("full_name"),placeholder:"Antoine Dupont",value:s.name,onChange:e=>{r({name:e})}}),(0,i.jsx)(Qd,{label:t("fonction_68322"),placeholder:t("pr_sident_30600"),value:s.title,onChange:e=>{r({title:e})}}),(0,i.jsx)(qp,{label:t("nom_et_adresse_81953"),value:s.address,onChange:e=>{r({address:e})}}),(0,i.jsx)(qp,{label:t("informations_su_09057"),value:s.infos,onChange:e=>{r({infos:e})}}),(0,i.jsx)(Qd,{label:t("lieu_de_l_attes_84804"),placeholder:"Montpellier",value:s.place,onChange:e=>{r({place:e})}}),(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(gG,{accept:Vx.Images,format:"base64",hint:t("taille_de_l_ima_12660","682x260px"),label:t("en_t_te_11987"),maxSize:yG,placeholder:t("en_t_te_11987"),value:s.header,onChange:e=>{r({header:e})}}),g(s.header?.name)&&(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({header:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(gG,{accept:Vx.Images,format:"base64",label:t("signature_67521"),maxSize:yG,placeholder:t("signature_67521"),value:s.signature,onChange:e=>{r({signature:e})}}),g(s.signature?.name)&&(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({signature:{name:"",content:""}})},children:t("r_initialiser_77538")})]})]}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(pb,{downloadPath:gf(a.links?.userCertificateLink??"","pdf",{lang:a.language}),getPath:e=>fs.DOCUMENTS_CERTIFICATE(n,o,e)}),(0,i.jsx)(lG,{children:(0,i.jsx)(gq,{certificateDocumentFragment:e.data.event,options:s})})]})]})},fq=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o}}=bd(),{event:s}=dv(),{data:r,loader:a}=Oi("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},[js.OrganizationCertificateDefaultFragment,js.DocumentUserCertificateFragment,js.EventVolunteersExportFragment]);return Zc(`${s.name} ${e("Certificate")}`),(0,i.jsxs)(rd,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(aG,{documentType:_t.Certificate,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("attestations_98371")}),(0,i.jsx)(md,{height:"7"}),a||(0,i.jsx)(pq,{data:r})]})},_q=e=>{const{translate:t,params:{organizationId:n,eventId:o,badgeType:s}}=bd(),{options:r,setOptions:a}=kG(e.event.document.options,s===Se.T24assignment?{logo:{name:"",content:""}}:{habits:""},o,{id:e.event.document.id}),l=e.event.volunteerRegistration.userInfo;return(0,i.jsxs)(rd,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[s===Se.Asoassignment&&(0,i.jsx)(SG,{children:(0,i.jsx)(AI,{initialValue:r.habits,label:"Habitudes",onChange:e=>{a({habits:e})}})}),s===Se.T24assignment&&(0,i.jsx)(SG,{children:(0,i.jsx)(gG,{accept:Vx.Images,format:"base64",label:t("logo_18191"),maxSize:yG,placeholder:t("logo_18191"),value:r.logo,onChange:e=>{a({logo:e})}})}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(pb,{downloadPath:gf(l.links?.userCustomBadgeLinks?.[s]||"","pdf",{lang:l.fields?.language?.rawValue}),getPath:e=>fs.DOCUMENTS_BADGE(n,o,e,s)}),(0,i.jsx)(lG,{children:C_(s,e.event,r,null)})]})]})},xq=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o,badgeType:s}}=bd(),{data:r,loader:a}=Oi("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},[js.DocumentUserCustomBadgeFragment,js.EventVolunteersExportFragment]);return(0,i.jsxs)(rd,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(aG,{badgeType:s,documentType:_t.CustomBadge,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:s===Se.Paris20kmassignment,showStrategy:!0,title:e("badge_1_89709",y_(s))}),(0,i.jsx)(md,{height:"7"}),a||(0,i.jsx)(_q,{event:r.event})]})},Iq=(e,t)=>{if(e===$U.Picture)return t.userInfo.fields?.picture?.url||"";if(e===$U.Skidata){const e=t.utid||"";return mf(e,{height:100,width:100})}if(e===$U.QrCode){const e=t.ticketId;return mf(e,{height:100,width:100})}if(e===$U.Code39){const e=t.ticketId;return mf(e,{barcodeType:uf.Code39,height:28,width:234})}return e},vq=e=>{const t=g(e.element.source)&&g(Iq(e.element.source,e.vr))?(0,i.jsx)("img",{height:"100%",src:Iq(e.element.source,e.vr),width:"100%"}):null;return(0,i.jsx)(ka,{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.inGrid?1:e.element.height,width:e.element.inGrid?1:e.element.width,children:g(e.element.link)?(0,i.jsx)("a",{href:e.element.link,rel:"noreferrer",target:"_blank",children:t}):t})};var bq=n(1184);function jq(e,t,n,i,o=" "){const[s,r]=(0,Bg.A)(n,e=>e.accreditationSlot.date?.isValid),a=Object.fromEntries(Object.values((0,Vu.A)(s,e=>e.accreditationSlot.date.startOf("day").toMillis())).map(e=>[`accreditations.${e[0].accreditationSlot.date.toFormat("yyyyMMdd")}`,(0,cm.A)((0,bs.A)(e.map(e=>e.accreditation.name))).join(o)])),l=Object.fromEntries(Object.values((0,Vu.A)(s,e=>e.accreditationSlot.date.startOf("day").toMillis())).map(t=>[`accreditationsSlots.${t[0].accreditationSlot.date.toFormat("yyyyMMdd")}`,t.map(t=>qg(e,t.accreditationSlot,t.accreditation.name,{accreditation:{includeName:!0},date:{localeFormat:zs.DateOnly.WeekdayLongMonthLong}})).join(o)])),d={"accreditations.nodate":(0,cm.A)((0,bs.A)(r.map(e=>e.accreditation.name))).join(o)},c={"accreditationsSlots.nodate":(0,cm.A)((0,bs.A)(r.map(t=>qg(e,t.accreditationSlot,t.accreditation.name,{accreditation:{includeName:!0},date:{localeFormat:zs.DateOnly.WeekdayLongMonthLong}})))).join(o)},u=(0,cm.A)((0,Xh.A)(s,e=>e.accreditationSlot.date?.startOf("day").toISO()),e=>e.accreditationSlot.date?.startOf("day").toMillis()??0).map(t=>e.toLocaleString(t.accreditationSlot.date,zs.DateOnly.WeekdayLongMonthLong)).join(o),m=function(e){return 3953===e}(t)?n.find(e=>50851===e.accreditation.fields.cf74460)?.accreditation.name??i.fields?.cf73819?.value??"":"";return{accreditationsCategories:(0,cm.A)((0,bs.A)(n.map(e=>e.accreditationCategory.name))).join(o),accreditationsText:(0,cm.A)((0,bs.A)(n.map(e=>e.accreditation.name))).join(o),accreditationsSlots:(0,cm.A)(n.map(n=>qg(e,n.accreditationSlot,n.accreditation.name,{accreditation:{includeName:!Eg(t)},date:{localeFormat:zs.DateOnly.WeekdayLongMonthLong}}))).join(o),accreditationsDates:u,...a,...l,...d,...c,omFonction:m}}const Cq=e=>{const t=Ei(Cm),n=Ei(Nk),o=NR((0,bq.A)(n.renderText(e.element.text,{userInfo:e.vr.userInfo,event:e.event,organization:e.organization,customFields:e.customFields,volunteerRegistration:e.vr,extraInfos:{...vf(t,e.vr.positionsSlotsUsersInfos,"\n"),...jq(t,e.organization.id,e.vr.accreditationsUsersInfos,e.vr.userInfo,"\n")}}),{target:"_blank"}));return(0,i.jsx)(rd,{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.inGrid?1:e.element.height,justify:e.element.justify,width:e.element.inGrid?1:e.element.width})},yq=e=>{const t=t=>t.elements.map(t=>(0,i.jsx)(yq,{accreditationsAcronyms:e.accreditationsAcronyms,accreditationsSlotsIds:e.accreditationsSlotsIds,customFields:e.customFields,element:t,event:e.event,organization:e.organization,positionsSlotsIds:e.positionsSlotsIds,segmentsIds:e.segmentsIds,vr:e.vr},t.id));return KU(e.element,e.accreditationsSlotsIds,e.accreditationsAcronyms,e.positionsSlotsIds,e.segmentsIds,e.vr.userInfo.fields)?"container"===e.element.type?(0,i.jsx)(rd,{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.inGrid?1:e.element.height,justify:e.element.justify,width:e.element.inGrid?1:e.element.width,wrap:"wrap",children:t(e.element)}):"grid"===e.element.type?(0,i.jsx)(ka,{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",columnGap:`${e.element.columnGap}px`,display:"grid",gridTemplateColumns:`repeat(${e.element.columns}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${e.element.rows}, minmax(0, 1fr))`,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",rowGap:`${e.element.rowGap}px`,top:`${e.element.top}px`,whiteSpace:"pre-wrap",zIndex:e.element.zIndex},height:e.element.inGrid?1:e.element.height,width:e.element.inGrid?1:e.element.width,children:t(e.element)}):"image"===e.element.type?(0,i.jsx)(vq,{element:e.element,vr:e.vr}):"text"===e.element.type?(0,i.jsx)(Cq,{customFields:e.customFields,element:e.element,event:e.event,organization:e.organization,vr:e.vr}):null:null},Aq=e=>{const t=e.customDocument.configuration,n=e.volunteerRegistration.accreditationsUsersInfos.map(e=>e.accreditationSlot.id),o=e.volunteerRegistration.accreditationsUsersInfos.flatMap(e=>g(e.accreditation.acronym)?[e.accreditation.acronym]:[]),s=e.volunteerRegistration.positionsSlotsUsersInfos.map(e=>e.positionSlot.id),r=e.volunteerRegistration.segmentsIds,a=t.bleed?19:0;return(0,i.jsx)(i.Fragment,{children:t.pages.map(l=>KU(l,n,o,s,r,e.volunteerRegistration.userInfo.fields)?(0,i.jsxs)(rd,{css:{background:"white",padding:`${a}px`,position:"relative"},height:2*a+t.height,width:2*a+t.width,children:[t.bleed&&(0,i.jsx)(uW,{}),(0,i.jsx)(rd,{css:{background:"white",pageBreakBefore:"always",position:"relative"},height:t.height,width:t.width,children:l.elements.map(t=>(0,i.jsx)(yq,{accreditationsAcronyms:o,accreditationsSlotsIds:n,customFields:e.customFields,element:t,event:e.event,organization:e.organization,positionsSlotsIds:s,segmentsIds:r,vr:e.volunteerRegistration},t.id))})]},l.id):null)})},Sq=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,userInfoId:s,customDocumentId:r}}=bd(),{event:a}=dv(),{data:l,loader:d}=Oi("query UserCustomDocumentExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $customDocumentId: CustomDocumentId!\n) {\n organization(id: $organizationId) {\n id\n name\n dateFormat\n datetimeFormat\n\n customFields(eventId: $eventId) {\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 fields\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},[js.CustomFieldWithConditionFragment,js.EventVolunteersExportFragment,js.CustomBadgeVolunteerRegistrationFragment]),c=(0,V.useMemo)(()=>{if(l.event){const e=l.event.customDocument,t=l.event.volunteerRegistration.userInfo.links;return gf(t?.userCustomDocumentLinks[e?.slug||""]||"","pdf",{lang:l.event.volunteerRegistration.userInfo.fields?.language?.rawValue})}return""},[l.event]);return Zc(`${a.name} ${l.event?.customDocument?.name??""}`),(0,i.jsxs)(rd,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(aG,{customDocumentSlug:l.event?.customDocument?.slug,documentType:_t.UserCustomDocument,eventId:o,extraButton:(0,i.jsx)(Mv,{permissions:Ov.DOCUMENT_EDIT,children:(0,i.jsx)(kd,{color:"white",onClick:()=>{e.push(fs.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)(md,{height:"7"}),d||(0,i.jsxs)(rd,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(pb,{downloadPath:c,getPath:e=>fs.DOCUMENTS_USER_CUSTOM_DOCUMENT(n,o,e,r),populationsIds:Bs(l.event?.customDocument?.populationsIds)?l.event.customDocument.populationsIds:void 0}),(0,i.jsx)(lG,{children:(0,i.jsx)(Aq,{customDocument:l.event.customDocument,customFields:l.organization.customFields.nodes,event:l.event,organization:l.organization,volunteerRegistration:l.event.volunteerRegistration})})]})]})},kq=e=>{const t=_u(e.options.headerColor)?e.options.headerColor:"white";return(0,i.jsxs)(rd,{css:{color:_u(e.options.textColor)?e.options.textColor:"$gray800",background:g(e.options.background?.content)?`url(${e.options.background?.content})`:"#5230a1",backgroundRepeat:"no-repeat",backgroundSize:"cover",fontFamily:e.options.fontFamily||"Open Sans",fontSize:"12px",minHeight:`${tf}px`,pageBreakBefore:"always"},direction:"column",width:nf,children:[(0,i.jsxs)(rd,{align:"end",css:{marginTop:"51px",px:"16px"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{css:{color:t,fontSize:"13px",fontWeight:"700",lineHeight:"18px"},children:e.headerTitle1}),(0,i.jsx)(ka,{css:{color:t,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:e.headerTitle2})]}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{css:{minHeight:"971px",paddingBottom:"$6",paddingLeft:"$4",paddingRight:"$4"},gap:"4",width:1,children:(0,i.jsx)(rd,{css:{background:"white",borderRadius:"$3",flex:"1",fontSize:"12px",overflowX:"hidden",padding:"$4"},direction:"column",children:e.children})})]})},wq=e=>{const t=Ti(),n=Ei(Cm),o=Ei(CC),s=(0,V.useMemo)(()=>e.psuis.filter(t=>t.positionSlot.range.start.startOf("day").toMillis()===e.day.toMillis()),[e.day,e.psuis]),r=(0,V.useMemo)(()=>(0,_f.A)(s,e=>e.timeDifferenceMinutes),[s]);return(0,i.jsxs)(rd,{css:{bd:!0,overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(ka,{css:{padding:"$3 $4",textTransform:"capitalize"},font:"gray800 textSm semiBold",children:n.toLocaleString(e.day,zs.DateOnly.WeekdayLongMonthLong)}),(0,i.jsxs)(Hu,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(Wu,{css:{height:"32px"},children:[(0,i.jsx)(pm,{children:t("nom_de_la_missi_64605")}),(0,i.jsxs)(pm,{align:"start",direction:"column",width:120,children:[(0,i.jsx)(ka,{children:t("d_but_41840")}),(0,i.jsx)(ka,{css:{fontSize:"8px"},children:t("_point_missi_66864")})]}),(0,i.jsxs)(pm,{align:"start",direction:"column",width:120,children:[(0,i.jsx)(ka,{children:t("fin_60104")}),(0,i.jsx)(ka,{css:{fontSize:"8px"},children:t("_point_missi_66864")})]}),(0,i.jsx)(pm,{width:120,children:t("pause_46709")}),(0,i.jsx)(pm,{width:120,children:t("total_07173")})]}),s.map((t,s)=>(0,i.jsxs)(am,{css:{height:"32px"},children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(ka,{font:"gray800 textXs medium",children:t.position.name})}),(0,i.jsxs)(Qu,{align:"start",css:{color:"$gray500"},direction:"column",width:120,children:[(0,i.jsx)(ka,{children:t.checkInAt?.isValid?n.toLocaleString(t.checkInAt.setZone(e.timeZone),zs.TimeOnly):"-"}),(0,i.jsx)(ka,{css:{fontSize:"8px"},children:n.toLocaleString(t.positionSlot.range.start,zs.TimeOnly)})]}),(0,i.jsxs)(Qu,{align:"start",css:{color:"$gray500"},direction:"column",width:120,children:[(0,i.jsx)(ka,{children:t.checkOutAt?.isValid?n.toLocaleString(t.checkOutAt.setZone(e.timeZone),zs.TimeOnly):"-"}),(0,i.jsx)(ka,{css:{fontSize:"8px"},children:n.toLocaleString(t.positionSlot.range.end,zs.TimeOnly)})]}),(0,i.jsx)(Qu,{css:{color:"$gray500"},width:120,children:t.breakTime>0?o.minutesToHoursMinutesString(t.breakTime):"-"}),(0,i.jsx)(Qu,{css:{color:"$gray500"},justify:"end",width:120,children:o.minutesToHoursMinutesString(t.timeDifferenceMinutes)})]},s)),(0,i.jsxs)(Wu,{css:{borderBottom:"none",height:"32px"},children:[(0,i.jsx)(pm,{children:(0,i.jsx)(ka,{font:"gray800 textXs semiBold",children:t("total_de_la_jou_73634")})}),(0,i.jsx)(pm,{justify:"end",width:120,children:(0,i.jsx)(ka,{font:"gray800 textXs semiBold",children:o.minutesToHoursMinutesString(r)})})]})]})]})},Eq=e=>{const t=Ti(),n=Ei(CC),o=e.event.volunteerRegistration,s=o.userInfo,r=(0,V.useMemo)(()=>If(o.positionsSlotsUsersInfos,e.date,null),[o.positionsSlotsUsersInfos]),a=(0,V.useMemo)(()=>(0,cm.A)((0,Xh.A)(r.map(e=>e.positionSlot.range.start.startOf("day")),e=>e.toMillis()),e=>e.toMillis()),[r]),l=(0,V.useMemo)(()=>(0,_f.A)(r,e=>e.timeDifferenceMinutes),[r]);return(0,i.jsx)(kq,{headerTitle1:`${g(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)(rd,{direction:"column",gap:"4",width:1,children:a.map(t=>(0,i.jsx)(wq,{day:t,psuis:r,timeZone:e.event.timeZone},t.toMillis()))})})},Tq=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{eventDocument:s,options:r,title:a,setOptions:l,setTitle:d}=kG(e.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",textColor:"#1d2939",title:""},o,{id:e.event.document.id}),c=lW(),u=e.event.volunteerRegistration.userInfo,m=u.links?.userHoursLink??"";return(0,i.jsxs)(rd,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(SG,{children:[(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(gG,{accept:Vx.Images,format:"base64",label:t("fond_du_documen_51758"),maxSize:yG,placeholder:t("fond_du_documen_51758"),value:r.background,onChange:e=>{l({background:e})}}),g(r.background?.name)&&(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{l({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Qd,{label:t("titre_du_docume_33508"),value:a,onChange:e=>{d(e)}}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(hh,{label:"Police",value:r.fontFamily,onChange:e=>{l({fontFamily:e})},children:c}),(0,i.jsx)(rj,{label:t("couleur_du_cont_17150"),value:r.headerColor,onChange:e=>{l({headerColor:e})}})]}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(pb,{downloadPath:gf(m,"pdf",{lang:u.language}),getPath:e=>fs.DOCUMENTS_HOURS(n,o,e)}),(0,i.jsx)(lG,{children:(0,i.jsx)(Eq,{event:e.event,eventDocument:s,options:r})})]})]})},Rq=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o}}=bd(),{event:s}=dv(),{data:r,loader:a}=Oi("query UserHoursDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUsersHours\n ...EventVolunteersExport\n }\n}\n",{eventId:n,userInfoId:o},[js.DocumentUsersHoursFragment,js.EventVolunteersExportFragment]);return Zc(`${s.name} ${e("UserHours")}`),(0,i.jsxs)(rd,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(aG,{documentType:_t.UserHours,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,title:e("UserHours")}),(0,i.jsx)(md,{height:"7"}),a||(0,i.jsx)(Tq,{event:r.event})]})},Oq=e=>{const t=Ti(),n=Ei(Cm),o=e.event.volunteerRegistration,s=o.userInfo,r=(0,V.useMemo)(()=>(0,Lh.A)(o.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.start)),[o.positionsSlotsUsersInfos]),a=(0,V.useMemo)(()=>(0,Bh.A)(o.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.end)),[o.positionsSlotsUsersInfos]),l=(0,V.useMemo)(()=>(0,cm.A)(Object.entries((0,Vu.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,cm.A)(Object.values((0,Vu.A)(t,e=>e.position.id)),e=>(0,Zh.A)(e.map(e=>e.positionSlot.range.start.toMillis()))).map(e=>{const t=e[0].position,n=(0,cm.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&&g(t.address)?` (${t.address})`:"";return`${t.name} : ${n}${i}`});return[n.toLocaleString(i.positionSlot.range.start.startOf("day"),zs.DateOnly.WeekdayLongMonthLong),o]}),[o.positionsSlotsUsersInfos]);return(0,i.jsxs)(rd,{css:{background:"$gray100",padding:"32px 45px 50px 45px"},direction:"column",width:1,children:[g(e.options.logo?.content)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{height:56,textAlign:"center",width:1,children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"auto"})}),(0,i.jsx)(md,{height:"7"})]}),(0,i.jsxs)(rd,{css:{background:"white",borderRadius:"16px",padding:"32px"},direction:"column",height:1,width:1,children:[(0,i.jsx)(ka,{font:"primary800 displayXs semiBold",children:s.nameOrEmail}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray800",children:t("p_riode_du_1_89633",n.toLocaleString(r,zs.DateTime),n.toLocaleString(a,zs.DateTime))}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(rd,{direction:"column",gap:"4",children:l.map(([e,t],n)=>(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{css:{textTransform:"capitalize"},font:"gray800 textSm bold",children:e}),(0,i.jsx)(rd,{direction:"column",children:t.map((e,t)=>(0,i.jsx)(ka,{children:e},t))})]},n))})]})]})},Dq=e=>{const t=Ti(),n=e.event.volunteerRegistration,o=n.userInfo;return Bs(n.positionsSlotsUsersInfos)?(0,i.jsx)(Oq,{...e}):(0,i.jsxs)(rd,{css:{background:"$gray100",padding:"32px 45px 50px 45px"},direction:"column",width:1,children:[g(e.options.logo?.content)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{height:56,textAlign:"center",width:1,children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"auto"})}),(0,i.jsx)(md,{height:"7"})]}),(0,i.jsxs)(rd,{css:{background:"white",borderRadius:"16px",padding:"32px"},direction:"column",height:1,width:1,children:[(0,i.jsx)(ka,{font:"primary800 displayXs semiBold",children:o.nameOrEmail}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray800",children:t("aucune_affectat_04761")})]})]})},zq=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{options:s,setOptions:r}=kG(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)(rd,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsx)(SG,{children:(0,i.jsx)(gG,{accept:Vx.Images,format:"base64",label:t("logo_18191"),maxSize:yG,placeholder:t("logo_18191"),value:s.logo,onChange:e=>{r({logo:e})}})}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(pb,{downloadPath:gf(a.links?.userPlanningDaysLink??"","pdf",{lang:a.language}),getPath:e=>fs.DOCUMENTS_USER_PLANNING_DAYS(n,o,e)}),(0,i.jsx)(lG,{children:(0,i.jsx)(Dq,{event:e.data.event,options:s})})]})]})},$q=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o}}=bd(),{event:s}=dv(),{data:r,loader:a}=Oi("query UserPlanningDaysDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserPlanningDays\n ...EventVolunteersExport\n }\n}\n",{eventId:n,userInfoId:o},[js.DocumentUserPlanningDaysFragment,js.EventVolunteersExportFragment]);return Zc(`${s.name} ${e("UserPlanningDays")}`),(0,i.jsxs)(rd,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(aG,{documentType:_t.UserPlanningDays,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("plannings_indiv_39650")}),(0,i.jsx)(md,{height:"7"}),a||(0,i.jsx)(zq,{data:r})]})},Pq=e=>{const t=Ti(),n=Ei(Cm),o=e.event.volunteerRegistration,s=o.userInfo,r=e.startDate?As.c9.max(e.startDate,e.event.startAt):e.event.startAt,a=e.startDate?As.c9.min(e.startDate.plus({week:1}).minus({day:1}),e.event.endAt):e.event.endAt,l=_u(e.options.headerColor)?e.options.headerColor:"white",d=e.options.showInformations||e.options.showQrCode;return(0,i.jsxs)(rd,{css:{color:_u(e.options.textColor)?e.options.textColor:"$gray800",background:g(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:nf,width:tf,children:[(0,i.jsxs)(rd,{align:"end",css:{position:"absolute",right:"16px",top:"69px"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{css:{color:l,fontSize:"13px",fontWeight:"700",lineHeight:"18px"},children:t("planning_indivi_05075",s.nameOrEmail)}),(0,i.jsx)(ka,{css:{color:l,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:t("du_1_au_2_12974",n.toLocaleString(r,zs.DateOnly.MonthLong),n.toLocaleString(a,zs.DateOnly.MonthLong))})]}),(0,i.jsxs)(rd,{css:{px:"$4",position:"absolute",top:"140px"},gap:"5",height:635,width:1,children:[d&&(0,i.jsxs)(xG,{children:[(0,i.jsx)(_G,{informationsContent:e.document.informationsContent,informationsTitle:e.document.informationsTitle,options:e.options,renderText:e.renderText}),(0,i.jsx)(sq,{isAso:!1,isEtapeTour:!1,options:e.options,ticketId:o.ticketId})]}),(0,i.jsx)(rd,{css:{background:"white",borderRadius:"$3",flex:"1",fontSize:"12px",padding:"$6 $5"},height:1,children:(0,i.jsx)(ka,{width:1,children:e.children})})]})]})},Mq=e=>{const t=Ti(),n=Ei(Yh),o=(0,V.useMemo)(()=>{const t=pu(e.psui.position.color);return{background:t[50],color:t[700]}},[e.psui]),s=(0,V.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=ng(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)(rd,{css:{...o,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsx)(ka,{css:{fontSize:"10px"},children:r}),(0,i.jsx)(ka,{fontSize:"textXs",fontWeight:"medium",children:e.psui.position.name})]})},Fq=e=>(0,i.jsx)(Pq,{document:e.document,event:e.event,options:e.options,renderText:e.renderText,startDate:e.startDate,children:(0,i.jsx)(ck,{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,n)=>(0,i.jsx)(dk,{endAt:t.range.start,startAt:t.range.start,startHour:e.startHour,children:(0,i.jsx)(Mq,{psui:t,startHour:e.startHour})},n))})}),Nq=e=>{const{minDate:t,numberOfWeeks:n}=(0,V.useMemo)(()=>{const t=(0,Zh.A)(e.assignments.map(e=>e.positionSlot.range.start)).startOf("week"),n=(0,pG.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,nm.A)(0,n).map(n=>(0,i.jsx)(Fq,{assignments:e.assignments,document:e.eventDocument,event:e.event,options:e.options,renderText:e.renderText,startDate:t.plus({week:n}),startHour:e.startHour},n))})},Lq=e=>{const t=Ei(Nk),[n]=(0,V.useMemo)(()=>tg(e.event.dayStartTime),[e.event.dayStartTime]),o=(0,V.useMemo)(()=>{const t=qh(e.event.volunteerRegistration.positionsSlotsUsersInfos.map(e=>({...e,range:e.positionSlot.range})),e.event.startAt,e.event.endAt,n);return(0,cm.A)(If(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 Vs(o)?(0,i.jsx)(Pq,{document:e.eventDocument,event:e.event,options:e.options,renderText:s}):(0,i.jsx)(Nq,{assignments:o,event:e.event,eventDocument:e.eventDocument,options:e.options,renderText:s,startHour:n})},Bq=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{eventDocument:s,informationsTitle:r,informationsContent:a,options:l,setOptions:d,setInformationsTitle:c,setInformationsContent:u}=kG(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=lW(),h=e.data.event?.volunteerRegistration.userInfo,p=h.links?.userPlanningLink??"";return(0,i.jsxs)(rd,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(SG,{children:[(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(gG,{accept:Vx.Images,format:"base64",label:t("fond_du_documen_51758"),maxSize:yG,placeholder:t("fond_du_documen_51758"),value:l.background,onChange:e=>{d({background:e})}}),g(l.background?.name)&&(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{d({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(hh,{label:"Police",value:l.fontFamily,onChange:e=>{d({fontFamily:e})},children:m}),(0,i.jsx)(hh,{label:t("police_des_titr_37497"),value:l.titleFontFamily,onChange:e=>{d({titleFontFamily:e})},children:m}),(0,i.jsx)(rj,{label:t("couleur_des_sou_18968"),value:l.subtitleColor,onChange:e=>{d({subtitleColor:e})}}),(0,i.jsx)(rj,{label:t("couleur_du_text_32021"),value:l.textColor,onChange:e=>{d({textColor:e})}}),(0,i.jsx)(rj,{label:t("couleur_du_cont_17150"),value:l.headerColor,onChange:e=>{d({headerColor:e})}}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(Zm,{value:l.showInformations,onChange:e=>{d({showInformations:e})},children:t("afficher_la_sec_84744")}),l.showInformations&&(0,i.jsxs)(rd,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(Qd,{label:t("titre_de_la_sec_41575"),value:r,onChange:e=>{c(e)}}),(0,i.jsx)(AI,{initialValue:a,label:t("contenu_de_la_s_43102"),onChange:e=>{u(e)}})]}),(0,i.jsx)(Zm,{value:l.showQrCode,onChange:e=>{d({showQrCode:e})},children:t("afficher_le_qr_15635")})]}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(pb,{downloadPath:gf(p,"pdf",{lang:h?.language}),getPath:e=>fs.DOCUMENTS_USER_PLANNING(n,o,e)}),(0,i.jsx)(lG,{children:(0,i.jsx)(Lq,{event:e.data.event,eventDocument:s,options:l})})]})]})},Vq=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o}}=bd(),{event:s}=dv(),{data:r,loader:a}=Oi("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},[js.DocumentUserPlanningFragment,js.EventVolunteersExportFragment]);return Zc(`${s.name} ${e("UserPlanning")}`),(0,i.jsxs)(rd,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(aG,{documentType:_t.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)(md,{height:"7"}),a||(0,i.jsx)(Bq,{data:r})]})},Uq=e=>{const t=Ti(),n=Ei(Yh);return(0,i.jsxs)(rd,{css:{background:"$gray100",padding:"$4 56px"},direction:"column",gap:"2",children:[(0,i.jsx)(ka,{font:"gray900 textXl semiBold",children:t("planning_1_14391",e.nameOrEmail)}),e.interval&&(0,i.jsxs)(rd,{gap:"1",children:[(0,i.jsx)(ka,{color:"gray800",children:t("plage_de_dates_08875")}),(0,i.jsx)(ka,{color:"gray500",children:n.toDisplayString(e.interval,{formats:{displayWeekday:!0},hideTime:!0})})]}),(0,i.jsxs)(rd,{gap:"1",children:[(0,i.jsx)(ka,{color:"gray800",children:t("nombre_d_affect_01587")}),(0,i.jsx)(ka,{color:"gray500",children:e.numberOfAssignments})]})]})};var Wq=n(791);const Gq=e=>{const t=Ti(),n=Ei(Cm),o=Ei(CC);return(0,i.jsx)(rd,{css:{padding:"$6 $8"},children:(0,i.jsxs)(Hu,{children:[(0,i.jsxs)(Wu,{children:[(0,i.jsx)(pm,{css:{px:"$3"},children:t("nom_de_la_missi_64605")}),(0,i.jsx)(pm,{css:{px:"$3"},width:380,children:t("Date")}),e.showHours&&(0,i.jsx)(pm,{css:{px:"$3"},width:120,children:t("total_07173")})]}),e.assignments.map((t,s)=>{const r=Bs(t.slotsNames),a=(0,Wq.A)(t.ranges.map(e=>e.toDuration("minutes").minutes));return(0,i.jsxs)(am,{css:{height:r?"54px":"44px"},children:[(0,i.jsx)(Qu,{align:"center",css:{px:"$3"},children:(0,i.jsx)(ka,{css:{clamp:"2"},font:"gray900 textSm medium",title:t.name,width:1,children:t.name})}),(0,i.jsxs)(Qu,{css:{px:"$3"},direction:"column",gap:"1",justify:"center",width:380,children:[r&&(0,i.jsx)(ka,{color:"gray900",width:1,children:t.slotsNames.join(", ")}),(0,i.jsxs)(ka,{width:1,children:[(0,Tc.A)(n.toLocaleString(t.ranges[0].start,zs.DateOnly.WeekdayShortMonthLong))," ",t.ranges.map(e=>`${e.start.toFormat("HH:mm")}-${e.end.toFormat("HH:mm")}`).join(" | ")]})]}),e.showHours&&(0,i.jsx)(Qu,{css:{px:"$3"},width:120,children:o.minutesToHoursMinutesString(a)})]},s)})]})})},qq=e=>{const t=(0,V.useMemo)(()=>{return t=If(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,e.endDate),(0,cm.A)(Object.entries((0,Vu.A)(t,e=>`${e.position.name}-${e.positionSlot.range.start.startOf("day").toMillis()}`)).map(([e,t])=>{const n=(0,cm.A)(t,e=>e.positionSlot.range.start.toMillis());return{name:t[0].position.name,ranges:n.map(e=>e.positionSlot.range),slotsNames:(0,hd.A)((0,bs.A)(n.map(({positionSlot:e})=>e.name)))}}),({ranges:e})=>e[0].start.toMillis());var t},[e.event.volunteerRegistration,e.date]);return(0,i.jsx)(i.Fragment,{children:(0,TG.A)(t,20).map((t,n)=>{const o=t.flatMap(e=>e.ranges),s=(0,Lh.A)(o.map(e=>e.start),e=>e.toMillis()),r=(0,Bh.A)(o.map(e=>e.end),e=>e.toMillis()),a=As.IX.fromDateTimes(s,r);return(0,i.jsxs)(rd,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(Uq,{interval:a,nameOrEmail:e.event.volunteerRegistration.userInfo.nameOrEmail,numberOfAssignments:t.flatMap(e=>e.ranges).length}),(0,i.jsx)(Gq,{assignments:t,showHours:e.options.showHours})]},n)})})},Hq=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{options:s,setOptions:r}=kG(e.data.event.document.options,{showHours:!0},o,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(rd,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsx)(SG,{children:(0,i.jsx)(Eu,{state:s.showHours?"checked":"unchecked",onClick:e=>{r({showHours:"checked"===e})},children:t("afficher_le_tot_23855")})}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(pb,{downloadPath:gf(a.links?.userPlanningListLink??"","pdf",{lang:a.language}),getPath:e=>fs.DOCUMENTS_USER_PLANNING_LIST(n,o,e)}),(0,i.jsx)(lG,{width:1,children:(0,i.jsx)(qq,{event:e.data.event,options:s})})]})]})},Kq=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:o}}=bd(),{event:s}=dv(),{data:r,loader:a}=Oi("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},[js.DocumentUserPlanningListFragment,js.EventVolunteersExportFragment]);return Zc(`${s.name} ${e("UserPlanningList")}`),(0,i.jsxs)(rd,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(aG,{documentType:_t.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)(md,{height:"7"}),a||(0,i.jsx)(Hq,{data:r})]})},Yq=e=>{const t=Ti(),n=e.documentUsersListing.organization.customFields.nodes,o=(0,V.useMemo)(()=>(0,cm.A)(e.documentUsersListing.event.volunteersRegistrations.nodes,e=>e.userInfo.name),[e.documentUsersListing.event.volunteersRegistrations.nodes]),s=(0,V.useMemo)(()=>(0,TG.A)(o,30),[o]),r=e.documentUsersListing.event.segment;return Bs(o)?(0,i.jsx)(i.Fragment,{children:s.map((s,a)=>(0,i.jsx)(kq,{headerTitle1:g(e.eventDocument.title)?e.eventDocument.title:t("liste_des_membr_89037"),headerTitle2:`${r.name} (${o.length})`,options:e.options,children:(0,i.jsx)(rd,{css:{background:"white"},direction:"column",width:1,children:(0,i.jsx)(LG,{customFields:n,slugsToDisplay:e.options.slugsToDisplay,volunteers:s})})},a))}):(0,i.jsx)(kq,{headerTitle1:g(e.eventDocument.title)?e.eventDocument.title:t("liste_des_membr_89037"),headerTitle2:r.name,options:e.options})},Zq=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{user:s}=Li(),{eventDocument:r,options:a,title:l,setOptions:d,setTitle:c}=kG(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=lW();return(0,i.jsxs)(rd,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(SG,{children:[(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(gG,{accept:Vx.Images,format:"base64",label:t("fond_du_documen_51758"),maxSize:yG,placeholder:t("fond_du_documen_51758"),value:a.background,onChange:e=>{d({background:e})}}),g(a.background?.name)&&(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{d({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Qd,{label:t("titre_du_docume_33508"),value:l,onChange:e=>{c(e)}}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(hh,{label:"Police",value:a.fontFamily,onChange:e=>{d({fontFamily:e})},children:u}),(0,i.jsx)(rj,{label:t("couleur_du_cont_17150"),value:a.headerColor,onChange:e=>{d({headerColor:e})}}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsxs)(Uu,{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")}),(0,i.jsx)("option",{value:"delegationName",children:t("Delegation")}),e.data.organization.customFields.nodes.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id))]})]}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(ZG,{downloadPath:gf(e.data.event.segment.links.usersListingLink,"pdf",{lang:s?.language}),getPath:e=>fs.DOCUMENTS_VOLUNTEERS_LISTING(n,o,e),segmentsFolders:e.data.event.segmentsFolders}),(0,i.jsx)(lG,{width:1,children:(0,i.jsx)(Yq,{documentUsersListing:e.data,eventDocument:r,options:a})})]})]})},Xq=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:o}}=bd(),{event:s}=dv(),{data:r,loader:a}=Oi("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},[js.DocumentUsersListingFragment,js.EventVolunteersExportFragment]);return Zc(`${s.name} ${e("liste_des_membr_89037")}`),(0,i.jsxs)(rd,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(aG,{documentType:_t.VolunteersListing,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("liste_des_membr_89037")}),(0,i.jsx)(md,{height:"7"}),a||(0,i.jsx)(Zq,{data:r,eventId:n})]})},Jq=e=>{const t=Ei(Xb),n=(0,V.useMemo)(()=>e.customFields.find(t=>t.slug===e.options.customFieldSlug),[e.customFields,e.options.customFieldSlug]);return(0,i.jsx)(rd,{css:{columnGap:"$2",rowGap:"$3"},wrap:"wrap",children:e.vrs.map(o=>{const s=o.userInfo,r=Bf(s.name,s.email);return(0,i.jsxs)(rd,{direction:"column",gap:"2",width:84,children:[(0,i.jsx)(ka,{css:{borderRadius:"$1",overflow:"hidden"},height:84,width:84,children:g(s.picture?.url)?(0,i.jsx)("img",{height:"100%",src:s.picture.url,width:"100%"}):(0,i.jsx)(rd,{align:"center",css:{background:Uf(r)},height:1,justify:"center",width:1,children:(0,i.jsx)(ka,{font:"white displaySm medium",children:r})})}),(0,i.jsxs)(rd,{direction:"column",width:1,children:[(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray900 textXs medium",title:s.lastName,children:(s.lastName||"-").toUpperCase()}),(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray900 textXs medium",title:s.firstName,children:s.firstName||"-"}),n&&(0,i.jsx)(ka,{color:"gray500",css:{ellipsis:!0,fontSize:"9px"},title:t.getValueString(n,s.fields)||"-",children:t.getValueString(n,s.fields)||"-"}),e.options.showPhone&&(0,i.jsx)(ka,{color:"gray500",css:{ellipsis:!0,fontSize:"9px"},title:s.phone?.internationalFormat||"-",children:s.phone?.internationalFormat||"-"})]})]},s.id)})})},Qq=e=>{const t=Ti(),n=e.documentUsersPictures.event.volunteersRegistrations.nodes,o=(0,V.useMemo)(()=>(0,TG.A)(n,48),[n]),s=e.documentUsersPictures.event.segment;return Bs(n)?(0,i.jsx)(i.Fragment,{children:o.map((o,r)=>(0,i.jsx)(kq,{headerTitle1:g(e.eventDocument.title)?e.eventDocument.title:t("trombinoscope_11316"),headerTitle2:`${s.name} (${n.length})`,options:e.options,children:(0,i.jsx)(Jq,{customFields:e.documentUsersPictures.organization.customFields.nodes,options:e.options,vrs:o})},r))}):(0,i.jsx)(kq,{headerTitle1:g(e.eventDocument.title)?e.eventDocument.title:t("trombinoscope_11316"),headerTitle2:s.name,options:e.options})},eH=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{user:s}=Li(),{eventDocument:r,options:a,title:l,setOptions:d,setTitle:c}=kG(e.data.event.document.options,{background:{name:"",content:""},customFieldSlug:null,fontFamily:"Open Sans",headerColor:"#ffffff",showPhone:!0,textColor:"#1d2939",title:""},o,{id:e.data.event.document.id,title:e.data.event.document.title}),u=lW();return(0,i.jsxs)(rd,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(SG,{children:[(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(gG,{accept:Vx.Images,format:"base64",label:t("fond_du_documen_51758"),maxSize:yG,placeholder:t("fond_du_documen_51758"),value:a.background,onChange:e=>{d({background:e})}}),g(a.background?.name)&&(0,i.jsx)(ka,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{d({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Qd,{label:t("titre_du_docume_33508"),value:l,onChange:e=>{c(e)}}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(hh,{label:"Police",value:a.fontFamily,onChange:e=>{d({fontFamily:e})},children:u}),(0,i.jsx)(rj,{label:t("couleur_du_cont_17150"),value:a.headerColor,onChange:e=>{d({headerColor:e})}}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("champ_suppl_men_12652"),placeholder:t("champ_suppl_men_12652"),values:a.customFieldSlug?[a.customFieldSlug]:[],onChange:e=>{Bs(e)?d({customFieldSlug:e[0]}):d({customFieldSlug:null})},children:e.data.organization.customFields.nodes.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id))}),a.showPhone&&(0,i.jsx)(Zm,{value:a.showPhone,onChange:e=>{d({showPhone:e})},children:t("afficher_le_num_37843")})]}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(ZG,{downloadPath:gf(e.data.event.segment.links.usersPicturesLink,"pdf",{lang:s?.language}),getPath:e=>fs.DOCUMENTS_USERS_PICTURES(n,o,e),segmentsFolders:e.data.event.segmentsFolders}),(0,i.jsx)(lG,{children:(0,i.jsx)(Qq,{documentUsersPictures:e.data,eventDocument:r,options:a})})]})]})},tH=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:o}}=bd(),{event:s}=dv(),{data:r,loader:a}=Oi("query UsersPicturesDocument(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $segmentId: SegmentId!\n) {\n ...DocumentUsersPictures\n\n event(id: $eventId) {\n ...EventVolunteersExport\n }\n}\n",{organizationId:t,eventId:n,segmentId:o},[js.DocumentUsersPicturesFragment,js.EventVolunteersExportFragment]);return Zc(`${s.name} ${e("trombinoscope_11316")}`),(0,i.jsxs)(rd,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(aG,{documentType:_t.UsersPictures,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("trombinoscope_11316")}),(0,i.jsx)(md,{height:"7"}),a||(0,i.jsx)(eH,{data:r})]})},nH=e=>{const{history:t,translate:n}=bd(),{data:o,loader:s}=Oi("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,V.useState)(ze.Assignments);return s||(0,i.jsxs)(i.Fragment,{children:[(!o.event.emailSender||o.event.emailSender.domainStatus!==he.Success)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{gap:"4",width:1,children:[o.event.emailSender&&o.event.emailSender.domainStatus!==he.Success&&(0,i.jsxs)(zd,{alertStyle:"error",width:1,children:[(0,i.jsx)($d,{children:n("vos_entr_es_dns_68834")}),(0,i.jsx)(Pd,{children:(0,i.jsx)(rd,{width:1,children:(0,i.jsx)(kd,{color:"invisible",css:{color:"inherit",px:"0","&:hover":{color:"inherit"}},rightIcon:"arrow-right",onClick:()=>{t.push(fs.ORGANIZATION_PARAMETERS_EMAILS_DNS(e.organizationId))},children:n("configurer_les_65453")})})})]}),!o.event.emailSender&&(0,i.jsxs)(zd,{alertStyle:"warning",width:1,children:[(0,i.jsx)($d,{children:n("aucun_metteur_26635",F.EMAIL_FROM)}),(0,i.jsx)(Pd,{children:(0,i.jsx)(rd,{width:1,children:(0,i.jsx)(kd,{color:"invisible",css:{color:"inherit",px:"0","&:hover":{color:"inherit"}},rightIcon:"arrow-right",onClick:()=>{t.push(fs.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:n("configurer_les_56837")})})})]})]}),(0,i.jsx)(md,{height:"6"})]}),(0,i.jsxs)(rd,{gap:"7",children:[(0,i.jsxs)(rd,{css:{flex:"1",py:"$3"},direction:"column",children:[(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:n("liste_des_e_mai_73508")}),(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(Hu,{children:[(0,i.jsx)(Wu,{children:(0,i.jsx)(pm,{children:n("type_d_e_mail_06577")})}),(0,i.jsx)(PE,{isSelected:r===ze.VolunteerRegistration,subtitle:n("cet_e_mail_est_75023"),title:n("UserInfoAdminCreate"),onClick:()=>a(ze.VolunteerRegistration)}),(0,i.jsx)(PE,{isSelected:r===ze.Assignments,subtitle:n("cet_e_mail_cont_98777"),title:n("affectation_u_11128"),onClick:()=>a(ze.Assignments)}),(0,i.jsx)(PE,{isSelected:r===ze.Refused,subtitle:n("cet_e_mail_est_69069"),title:n("refus_d_affecta_71455"),onClick:()=>a(ze.Refused)}),(0,i.jsx)(PE,{isSelected:r===ze.Accreditations,subtitle:n("cet_e_mail_cont_75798"),title:n("affectation_u_39802"),onClick:()=>a(ze.Accreditations)}),(0,i.jsx)(PE,{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)(PE,{isSelected:r===ze.DelegationCategoryLeaderAssign,subtitle:n("cet_e_mail_est_67392"),title:n("nomination_en_t_77654"),onClick:()=>a(ze.DelegationCategoryLeaderAssign)}),(0,i.jsx)(PE,{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)(PE,{isSelected:r===ze.DelegationFormInvite,subtitle:n("cet_e_mail_est_19547"),title:n("envoi_du_formul_09434"),onClick:()=>a(ze.DelegationFormInvite)}),(0,i.jsx)(PE,{isSelected:r===ze.PositionLeaderAssign,subtitle:n("cet_e_mail_est_82173"),title:n("nomination_en_t_06971"),onClick:()=>a(ze.PositionLeaderAssign)}),(0,i.jsx)(PE,{isSelected:r===ze.PositionCategoryLeaderAssign,subtitle:n("cet_e_mail_est_70420"),title:n("nomination_en_t_02948"),onClick:()=>a(ze.PositionCategoryLeaderAssign)}),(0,i.jsx)(PE,{isSelected:r===ze.NotifyLeaders,subtitle:n("cet_e_mail_est_90425"),title:n("un_responsable_88525"),onClick:()=>a(ze.NotifyLeaders)}),(0,i.jsx)(PE,{isSelected:r===ze.Code,subtitle:n("cet_e_mail_est_49663"),title:n("code_20843"),onClick:()=>a(ze.Code)})]})]}),(0,i.jsx)(ka,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(rd,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(FE,{emailType:r,eventId:e.eventId,formId:null,organizationId:e.organizationId,source:null})})]})]})},iH=()=>{const e=Ti(),{event:{name:t}}=dv();Zc(`${t} ${e("e_mails_09850")}`);const{organizationId:n,eventId:o}=zi();return(0,i.jsxs)(rd,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsx)(ka,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("mod_les_e_mail_91257")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(nH,{eventId:o,organizationId:n})]})};let oH=class extends ic{constructor(e){super(e)}formParametersAccreditationsInputDefault(e){return{accreditationDisplay:e?.accreditationDisplay||ot.None,accreditationFilter:e?.accreditationFilter||nt.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 c.Ik().shape({accreditationDisplay:c.Yj().required(this.t("la_strat_gie_d_70458")).oneOf(ti,this.t("la_strat_gie_d_70458")),accreditationFilter:c.Yj().required(this.t("la_strat_gie_de_28051")).oneOf(oi,this.t("la_strat_gie_de_28051")),hiddenAccreditationsIds:c.YO().of(c.ai()),showFullAccreditation:c.zM().required(),showAccreditationDescription:c.zM().required(),accreditationTitle:c.Yj(),accreditationSubtitle:c.Yj()})}updateFormParametersAccreditationsSchema(){return c.Ik().shape({form:this.formParametersAccreditationsInputSchema()})}};oH=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],oH);const sH=e=>{const t=Ti(),{data:n,loader:o}=Gr({eventId:e.eventId,loadIsBlocked:!1}),s=Ei(Cm),[r,a]=(0,V.useState)(Bs(e.values.form.hiddenAccreditationsCategoriesIds)||Bs(e.values.form.hiddenAccreditationsIds)||Bs(e.values.form.hiddenAccreditationsSlotsIds)?"hidden":"displayed"),[l,d]=(0,V.useState)(Bs(e.values.form.hiddenAccreditationsCategoriesIds)?"checked":"unchecked"),[c,u]=(0,V.useState)(Bs(e.values.form.hiddenAccreditationsIds)?"checked":"unchecked"),[h,g]=(0,V.useState)(Bs(e.values.form.hiddenAccreditationsSlotsIds)?"checked":"unchecked"),[p,f]=(0,V.useState)(Bs(e.values.form.displayedAccreditationsCategoriesIds)?"checked":"unchecked"),[_,x]=(0,V.useState)(Bs(e.values.form.displayedAccreditationsIds)?"checked":"unchecked"),[I,v]=(0,V.useState)(Bs(e.values.form.displayedAccreditationsSlotsIds)?"checked":"unchecked"),b=(0,V.useMemo)(()=>(0,cm.A)(n.event?.accreditationsCategories??[],e=>m(e.name)),[n.event]),j=(0,V.useMemo)(()=>b.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[b]),C=(0,V.useMemo)(()=>b.map(e=>{const t=_g(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]),y=(0,V.useMemo)(()=>Kg(s,b),[b]);return(0,i.jsx)(rd,{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)(ka,{font:"gray800 textSm semiBold",children:t("pr_f_rences_d_a_19371")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{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)(md,{height:"3"}),"hidden"===r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(Eu,{state:l,onClick:t=>{d(t),"unchecked"===t&&e.change("form.hiddenAccreditationsCategoriesIds",[])},children:t("cacher_certaine_12220")}),"checked"===l&&(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsCategoriesIds",children:j})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Eu,{state:c,onClick:t=>{u(t),"unchecked"===t&&e.change("form.hiddenAccreditationsIds",[])},children:t("cacher_certaine_08734")}),"checked"===c&&(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsIds",children:C})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Eu,{state:h,onClick:t=>{g(t),"unchecked"===t&&e.change("form.hiddenAccreditationsSlotsIds",[])},children:t("cacher_certains_02997")}),"checked"===h&&(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsSlotsIds",children:y})]})]}),(0,i.jsx)(md,{height:"5"})]}),(0,i.jsx)(zu,{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)(md,{height:"3"}),"displayed"===r&&(0,i.jsxs)(rd,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(Eu,{state:p,onClick:t=>{f(t),"unchecked"===t&&e.change("form.displayedAccreditationsCategoriesIds",[])},children:t("afficher_certai_88457")}),"checked"===p&&(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsCategoriesIds",children:j})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Eu,{state:_,onClick:t=>{x(t),"unchecked"===t&&e.change("form.displayedAccreditationsIds",[])},children:t("afficher_certai_29161")}),"checked"===_&&(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsIds",children:C})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Eu,{state:I,onClick:t=>{v(t),"unchecked"===t&&e.change("form.displayedAccreditationsSlotsIds",[])},children:t("afficher_certai_38724")}),"checked"===I&&(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsSlotsIds",children:y})]})]})]})})},rH=e=>{const t=Ti(),[n,o]=(0,V.useState)(Bs(e.values.form.hiddenAccreditationsCategoriesIds)||Bs(e.values.form.hiddenAccreditationsIds)||Bs(e.values.form.hiddenAccreditationsSlotsIds)||Bs(e.values.form.displayedAccreditationsCategoriesIds)||Bs(e.values.form.displayedAccreditationsIds)||Bs(e.values.form.displayedAccreditationsSlotsIds));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zm,{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)(md,{height:"4"}),(0,i.jsx)(sH,{change:e.change,eventId:e.eventId,values:e.values})]})]})},aH=e=>{const t=Ti(),{isNotSavedModalOpen:n,onClose:o,onNotSavedClose:s,onSave:r}=WE(e.initialValues,e.values,e.handleSubmit),a=e.slotDisplay!==Qe.Hide;return(0,i.jsx)(iE,{button:(0,i.jsx)(kd,{isLoading:e.isMutateLoading,onClick:r,children:t("enregistrer_06519")}),title:e.name,onClose:o,children:(0,i.jsx)(UE,{isNotSavedOpen:n,onNotSavedClose:s,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{font:"gray800 textMd semiBold",children:t("param_tres_des_90955")}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:t("comment_souhait_18471")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(FI,{name:"form.accreditationDisplay",value:ot.Accreditation,children:t("afficher_les_ac_56952")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(FI,{name:"form.accreditationDisplay",value:ot.None,children:t("ne_rien_affiche_81467")}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:t("personnalisatio_86385")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Kp,{name:"form.showFullAccreditation",children:t("afficher_les_ac_56062")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(rH,{change:e.change,eventId:e.eventId,values:e.values}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:t("affichage_des_d_57491")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Fp,{name:"form.showAccreditationDescription",children:t("afficher_la_des_94587")}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Dh,{height:"7"}),(0,i.jsx)(ka,{font:"gray800 textMd semiBold",children:t("filtrer_les_acc_57840")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("d_cider_si_le_c_31187")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(FI,{name:"form.accreditationFilter",value:nt.FilterWithSlots,children:t("filtrer_les_acc_66152")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(FI,{name:"form.accreditationFilter",value:nt.None,children:t("ne_pas_filtrer_97321")})]}),(0,i.jsx)(Dh,{height:"7"}),(0,i.jsx)(ka,{font:"gray800 textMd semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("personnaliser_l_44808")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ec,{label:t("nom_de_l_tape_85862"),name:"form.accreditationTitle"}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(SI,{label:t("description_58935"),name:"form.accreditationSubtitle"})]})})})},lH=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=bd(),{data:o,loader:s}=Oi("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},[]);Zc(o.organization?.form.name??"");const r=Ei(ld),a=Ei(oH),{mutate:l,isLoading:d}=function(e={}){return Di("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=V.useMemo(()=>({form:a.formParametersAccreditationsInputDefault(o.organization?.form)}),[o.organization]);return(0,i.jsx)(Vd,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:n,values:r})=>(0,i.jsx)(aH,{change:e.change,eventId:t,handleSubmit:n,initialValues:c,isMutateLoading:d,loader:s,name:o.organization?.form.name??"",slotDisplay:o.organization?.form.slotDisplay||Qe.Hide,values:r}),validate:r.validateForForm(a.updateFormParametersAccreditationsSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:i.form})})};class dH extends ic{constructor(e){super(e)}customSlotInputDefault(){return{name:"",startTime:"",endTime:""}}customSlotInputSchema(){return c.Ik().shape({name:c.Yj().nullable(),startTime:c.Yj().required(this.t("le_d_but_du_cr_40745")),endTime:c.Yj().required(this.t("la_fin_du_cr_ne_90351"))})}}let cH=class extends ic{customSlotInputService;constructor(e,t){super(e),this.customSlotInputService=t}customSlotPeriodInputDefault(){return{name:"",customSlots:[this.customSlotInputService.customSlotInputDefault()],hideNameDates:!1,displayAsCalendar:!1,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}}customSlotPeriodInputSchema(){return c.Ik().shape({customSlotPeriod:c.Ik().shape({name:c.Yj(),customSlots:c.YO().of(this.customSlotInputService.customSlotInputSchema()).required("").min(1,"")})})}};cH=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si,dH])],cH);let uH=class extends ic{constructor(e){super(e)}formParametersAvailabilitiesInputDefault(e){return{slotDisplay:e?.slotDisplay||Qe.Hide,minNumberOfSlots:e?.minNumberOfSlots??1,daysDisplay:e?.daysDisplay||et.AllDays,customSlotsPeriods:(e?.customSlotsPeriods??[]).map(e=>(0,ma.A)(e,["id","conditionCustomField"])),slotTitle:e?.slotTitle||"",slotSubtitle:e?.slotSubtitle||""}}formParametersAvailabilitiesInputSchema(){return c.Ik().shape({slotDisplay:c.Yj().required(this.t("la_strat_gie_d_34961")).oneOf(si,this.t("la_strat_gie_d_34961")),daysDisplay:c.Yj().required(this.t("la_strat_gie_de_56435")).oneOf(ni,this.t("la_strat_gie_de_56435"))})}updateFormParametersAvailabilitiesSchema(){return c.Ik().shape({form:this.formParametersAvailabilitiesInputSchema()})}};uH=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],uH);const mH=e=>{const t=Ti(),n=Ei(cH),o=Ei(dH);return(0,i.jsx)(Av,{isOpen:!0,onClose:e.onClose,children:(0,i.jsx)(yv,{children:(0,i.jsx)(Vd,{direction:"column",hideDefaultErrors:!0,initialValues:{customSlotPeriod:e.customSlotPeriod},render:({form:n,handleSubmit:s,submitting:r,values:a})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Cv,{icon:"sliders-up",subtitle:t("param_trer_les_33935"),children:t("mise_jour_de_14984")}),(0,i.jsxs)(jv,{css:{overflowY:"auto"},gap:"7",children:[(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(Nd,{hideSpacer:!0}),(0,i.jsx)(ec,{hint:t("le_nom_de_la_p_49293"),label:(0,i.jsx)(fI,{children:t("nom_de_la_p_rio_89140")}),name:"customSlotPeriod.name"}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Np,{label:(0,i.jsx)(fI,{children:t("date_de_d_but_43380")}),max:e.event.endAt,min:e.event.startAt,name:"customSlotPeriod.startDate"}),(0,i.jsx)(Np,{label:(0,i.jsx)(fI,{children:t("date_de_fin_86920")}),max:e.event.endAt,min:e.event.startAt,name:"customSlotPeriod.endDate"})]}),(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(Kp,{name:"customSlotPeriod.hasCondition",children:t("conditionner_l_33629")}),a.customSlotPeriod.hasCondition&&(0,i.jsx)(rd,{css:{background:"$gray50",bd:!0,padding:"$4"},direction:"column",gap:"4",children:(0,i.jsx)(wE,{conditionCustomFieldId:a.customSlotPeriod.conditionCustomFieldId,conditionCustomFields:e.conditionCustomFields,conditionValue:a.customSlotPeriod.conditionValue,setConditionCustomFieldId:t=>{const i=e.conditionCustomFields.find(e=>e.id===t);i&&(n.change("customSlotPeriod.conditionValue",i.fieldType===Oe.Checkbox||[]),n.change("customSlotPeriod.conditionCustomFieldId",t))},setConditionValue:e=>{n.change("customSlotPeriod.conditionValue",e)}})})]})]}),(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(ka,{font:"gray800 textMd medium",children:t("cr_neaux_person_16330")}),a.customSlotPeriod.customSlots.map((e,o)=>{const s=`customSlotPeriod.customSlots[${o}].`;return(0,i.jsxs)(rd,{align:"end",gap:"4",children:[(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(ec,{label:t("nom_du_cr_neau_54351"),name:`${s}name`})}),(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(wI,{label:t("SlotStart"),name:`${s}startTime`})}),(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(wI,{label:t("SlotEnd"),name:`${s}endTime`})}),(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",onClick:()=>{n.change("customSlotPeriod.customSlots",qs(a.customSlotPeriod.customSlots,o))}})]},o)}),(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",onClick:()=>{n.change("customSlotPeriod.customSlots",[...a.customSlotPeriod.customSlots,o.customSlotInputDefault()])},children:t("ajouter_un_cr_n_63607")})]}),a.customSlotPeriod.customSlots.length<2&&(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(ka,{font:"gray800 textMd medium",children:t("options_d_affic_10797")}),(0,i.jsx)(Kp,{name:"customSlotPeriod.hideNameDates",children:t("masquer_les_inf_78021")}),(0,i.jsx)(Kp,{name:"customSlotPeriod.displayAsCalendar",children:t("afficher_les_di_90328")})]})]}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{isLoading:r,onClick:s,children:t("mettre_jour_l_81276")})})]}),schema:n.customSlotPeriodInputSchema(),onSubmit:async t=>{await e.onSuccess(t.customSlotPeriod),e.onClose()}})})})},hH=e=>{const t=Ti(),n=Ei(Cm),[o,s]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray900 textSm semiBold",children:g(e.customSlotPeriod.name)?e.customSlotPeriod.name:t("p_riode_de_l_v_78032")}),(0,i.jsxs)(ka,{color:"gray500",children:[e.customSlotPeriod.startDate?n.toLocaleString(e.customSlotPeriod.startDate,zs.DateOnly.WeekdayLongMonthLong):t("d_but_le_l_v_n_58366")," ","-"," ",e.customSlotPeriod.endDate?n.toLocaleString(e.customSlotPeriod.endDate,zs.DateOnly.WeekdayLongMonthLong):t("fin_de_l_v_nem_88380")," ","- ",t("creneau",e.customSlotPeriod.customSlots.length)]})]}),(0,i.jsx)(kd,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>s(!0)}),(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})]}),o&&(0,i.jsx)(mH,{conditionCustomFields:e.conditionCustomFields,customSlotPeriod:e.customSlotPeriod,event:e.event,onClose:()=>s(!1),onSuccess:async t=>{e.updateCustomSlotPeriod(t,e.index)}})]})},gH=e=>{const t=Ti();return(0,i.jsxs)(rd,{css:{background:"$gray50",borderRadius:"$1",marginLeft:"$6",padding:"$6"},direction:"column",gap:"3",width:1,children:[e.customSlotsPeriods.map((t,n)=>(0,i.jsx)(hH,{conditionCustomFields:e.conditionCustomFields,customSlotPeriod:t,event:e.event,index:n,remove:()=>{e.remove(n)},updateCustomSlotPeriod:e.updateCustomSlotPeriod},n)),(0,i.jsxs)(rd,{align:"center",css:{color:"$primary500",cursor:"pointer"},gap:"3",onClick:e.add,children:[(0,i.jsx)(Id,{icon:"plus"}),(0,i.jsx)(ka,{children:t("ajouter_une_p_r_04249")})]})]})},pH=e=>{const t=Ti(),n=Ei(cH),{isNotSavedModalOpen:o,onClose:s,onNotSavedClose:r,onSave:a}=WE(e.initialValues,e.values,e.handleSubmit),l=(0,V.useCallback)(()=>{e.form.change("form.customSlotsPeriods",[...e.values.form.customSlotsPeriods,n.customSlotPeriodInputDefault()])},[e.values.form.customSlotsPeriods,e.form.change]),d=(0,V.useCallback)(t=>{e.form.change("form.customSlotsPeriods",qs(e.values.form.customSlotsPeriods,t))},[e.values.form.customSlotsPeriods,e.form.change]),c=(0,V.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===Qe.Custom,m=e.values.form.slotDisplay===Qe.DisplayDays||e.values.form.slotDisplay===Qe.Calendar||e.values.form.slotDisplay===Qe.Custom;return(0,i.jsx)(iE,{button:(0,i.jsx)(kd,{isLoading:e.isMutateLoading,onClick:a,children:t("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(UE,{isNotSavedOpen:o,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)($x,{heading:t("affichage_des_d_20852"),role:"radiogroup",subtitle:t("personnaliser_l_64536"),children:[(0,i.jsx)(FI,{name:"form.slotDisplay",value:Qe.Display,children:t("demander_au_mem_07520")}),(0,i.jsx)(FI,{name:"form.slotDisplay",value:Qe.DisplayDays,children:t("demander_au_mem_50067")}),(0,i.jsx)(FI,{name:"form.slotDisplay",value:Qe.Calendar,children:t("demander_au_mem_60083")}),(0,i.jsx)(FI,{name:"form.slotDisplay",value:Qe.Custom,children:t("demander_au_mem_31132")}),u&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(gH,{add:l,conditionCustomFields:e.conditionCustomFields,customSlotsPeriods:e.values.form.customSlotsPeriods,event:e.event,remove:d,updateCustomSlotPeriod:c})}),(0,i.jsx)(FI,{name:"form.slotDisplay",value:Qe.Hide,children:t("ne_pas_demander_46686")})]}),e.values.form.slotDisplay!==Qe.Hide&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Dh,{height:"7"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("nombre_de_dispo_22220")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("le_membre_soit_74069")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(ec,{name:"form.minNumberOfSlots",shouldParseAsInt:!0})]}),m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Dh,{height:"7"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("filtrer_les_dis_80634")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("d_cider_de_filt_81078")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(FI,{name:"form.daysDisplay",value:et.AllDays,children:t("afficher_l_ense_11531")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(FI,{name:"form.daysDisplay",value:et.DaysWithSlots,children:t("filtrer_les_jou_51154")})]}),e.values.form.slotDisplay!==Qe.Hide&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Dh,{height:"7"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("personnaliser_l_44808")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ec,{label:t("nom_de_l_tape_85862"),name:"form.slotTitle"}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(SI,{label:t("description_58935"),name:"form.slotSubtitle"})]})]})})})},fH=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=bd(),{data:o,loader:s}=Oi("query FormParametersAvailabilities(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n ...FormCustomFields\n\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},[js.FormCustomFieldsFragment,js.FormSlotsOptionsFragment,js.FormRegisterCustomSlotPeriodFragment]);Zc(o.organization?.form.name??"");const r=Ei(ld),a=Ei(uH),{mutate:l,isLoading:d}=function(e={}){return Di("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=(0,V.useMemo)(()=>(o.organization?.formCustomFields.nodes??[]).filter(e=>[Oe.Checkbox,Oe.Country,Oe.Language,Oe.Nationality,Oe.Select].includes(e.fieldType)),[o.organization]),u=(0,V.useMemo)(()=>({form:a.formParametersAvailabilitiesInputDefault(o.organization?.form)}),[o.organization]);return(0,i.jsx)(Vd,{direction:"column",height:1,initialValues:u,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(pH,{conditionCustomFields:c,event:o.event,form:e,handleSubmit:t,initialValues:u,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 _H=class extends ic{constructor(e){super(e)}formParametersMissionsInputDefault(e){return{positionDisplay:e?.positionDisplay||tt.None,positionFilter:e?.positionFilter||nt.FilterWithSlots,positionRanking:e?.positionRanking||it.Unranked,positionLimit:e?.positionLimit||3,hiddenPositionsCategoriesIds:e?.hiddenPositionsCategoriesIds||[],hiddenPositionsIds:e?.hiddenPositionsIds||[],hiddenPositionsSlotsIds:e?.hiddenPositionsSlotsIds||[],hiddenPositionsTagsIds:e?.hiddenPositionsTagsIds||[],displayedPositionsCategoriesIds:e?.displayedPositionsCategoriesIds||[],displayedPositionsIds:e?.displayedPositionsIds||[],displayedPositionsSlotsIds:e?.displayedPositionsSlotsIds||[],displayedPositionsTagsIds:e?.displayedPositionsTagsIds||[],showFullPosition:e?.showFullPosition??!0,showPositionCategoryDescription:e?.showPositionCategoryDescription??!1,showPositionDescription:e?.showPositionDescription??!1,positionTitle:e?.positionTitle||"",positionSubtitle:e?.positionSubtitle||"",willAutoAssign:e?.willAutoAssign??!1}}formParametersMissionsInputSchema(){return c.Ik().shape({positionDisplay:c.Yj().required(this.t("la_strat_gie_d_44170")).oneOf(ii,this.t("la_strat_gie_d_44170")),positionFilter:c.Yj().required(this.t("la_strat_gie_de_13294")).oneOf(oi,this.t("la_strat_gie_de_13294")),positionRanking:c.Yj().required(this.t("le_type_de_clas_66819")).oneOf(Ln,this.t("le_type_de_clas_66819")),positionLimit:c.ai().required(this.t("le_nombre_maxim_38249")).min(1,this.t("le_nombre_de_ch_27910")),hiddenPositionsCategoriesIds:c.YO().of(c.ai()),hiddenPositionsIds:c.YO().of(c.ai()),hiddenPositionsSlotsIds:c.YO().of(c.ai()),hiddenPositionsTagsIds:c.YO().of(c.ai()),displayedPositionsCategoriesIds:c.YO().of(c.ai()),displayedPositionsIds:c.YO().of(c.ai()),displayedPositionsSlotsIds:c.YO().of(c.ai()),displayedPositionsTagsIds:c.YO().of(c.ai()),showFullPosition:c.zM().required(),showPositionCategoryDescription:c.zM().required(),showPositionDescription:c.zM().required(),positionTitle:c.Yj(),positionSubtitle:c.Yj(),willAutoAssign:c.zM().required()})}updateFormParametersMissionsSchema(){return c.Ik().shape({form:this.formParametersMissionsInputSchema()})}};_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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],_H);const xH=e=>(0,i.jsxs)(rd,{css:{cursor:"pointer",position:"relative"},direction:"column",gap:"1",onClick:e.onSelect,children:[e.isSelected&&(0,i.jsx)(rd,{align:"center",css:{background:"$primary500",borderRadius:"20px",color:"white",fontSize:"$textMd",position:"absolute",right:"-10px",top:"-10px"},height:20,justify:"center",width:20,children:(0,i.jsx)(Id,{icon:"check"})}),(0,i.jsx)(ka,{css:{background:"$gray100",border:e.isSelected?"2px solid $primary500":"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)(ka,{font:"gray800 textSm semiBold",children:e.name})]}),IH=e=>{const t=Ti(),{data:n,loader:o}=Oi("query FormParametersMissionsHiddenDisplayed($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n tags(context: Positions) {\n nodes {\n id\n name\n }\n }\n }\n\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",{organizationId:e.organizationId,eventId:e.eventId},[]);const s=Ei(Yh),[r,a]=(0,V.useState)(Bs(e.values.form.hiddenPositionsCategoriesIds)||Bs(e.values.form.hiddenPositionsIds)||Bs(e.values.form.hiddenPositionsSlotsIds)||Bs(e.values.form.hiddenPositionsTagsIds)?"hidden":"displayed"),[l,d]=(0,V.useState)(Bs(e.values.form.hiddenPositionsCategoriesIds)?"checked":"unchecked"),[c,u]=(0,V.useState)(Bs(e.values.form.hiddenPositionsIds)?"checked":"unchecked"),[h,g]=(0,V.useState)(Bs(e.values.form.hiddenPositionsSlotsIds)?"checked":"unchecked"),[p,f]=(0,V.useState)(Bs(e.values.form.hiddenPositionsTagsIds)?"checked":"unchecked"),[_,x]=(0,V.useState)(Bs(e.values.form.displayedPositionsCategoriesIds)?"checked":"unchecked"),[I,v]=(0,V.useState)(Bs(e.values.form.displayedPositionsIds)?"checked":"unchecked"),[b,j]=(0,V.useState)(Bs(e.values.form.displayedPositionsSlotsIds)?"checked":"unchecked"),[C,y]=(0,V.useState)(Bs(e.values.form.displayedPositionsTagsIds)?"checked":"unchecked"),A=(0,V.useMemo)(()=>(0,cm.A)(n.event?.positionsCategories??[],e=>m(e.name)),[n.event]),S=(0,V.useMemo)(()=>A.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)),[A]),k=(0,V.useMemo)(()=>Yg(s,A),[A,s]),w=(0,V.useMemo)(()=>(0,cm.A)(n.organization?.tags.nodes??[],e=>m(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[n.organization]);return(0,i.jsx)(rd,{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)(ka,{font:"gray800 textSm semiBold",children:t("pr_f_rences_d_a_19371")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:"hidden"===r?"checked":"unchecked",onClick:t=>{"checked"===t&&(a("hidden"),e.change("form.displayedPositionsCategoriesIds",[]),e.change("form.displayedPositionsIds",[]),e.change("form.displayedPositionsSlotsIds",[]),e.change("form.displayedPositionsTagsIds",[]))},children:t("cacher_des_cat_31908")}),(0,i.jsx)(md,{height:"3"}),"hidden"===r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(Eu,{state:l,onClick:t=>{d(t),"unchecked"===t&&e.change("form.hiddenPositionsCategoriesIds",[])},children:t("cacher_certaine_12220")}),"checked"===l&&(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsCategoriesIds",children:A.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Eu,{state:c,onClick:t=>{u(t),"unchecked"===t&&e.change("form.hiddenPositionsIds",[])},children:t("cacher_certaine_19933")}),"checked"===c&&(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsIds",children:S})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Eu,{state:h,onClick:t=>{g(t),"unchecked"===t&&e.change("form.hiddenPositionsSlotsIds",[])},children:t("cacher_certains_02997")}),"checked"===h&&(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsSlotsIds",children:k})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Eu,{state:p,onClick:t=>{f(t),"unchecked"===t&&e.change("form.hiddenPositionsTagsIds",[])},children:t("cacher_certains_66424")}),"checked"===p&&(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsTagsIds",children:w})]})]}),(0,i.jsx)(md,{height:"5"})]}),(0,i.jsx)(zu,{state:"displayed"===r?"checked":"unchecked",onClick:t=>{a("displayed"),"checked"===t&&(e.change("form.hiddenPositionsCategoriesIds",[]),e.change("form.hiddenPositionsIds",[]),e.change("form.hiddenPositionsSlotsIds",[]),e.change("form.hiddenPositionsTagsIds",[]))},children:t("afficher_des_ca_37473")}),(0,i.jsx)(md,{height:"3"}),"displayed"===r&&(0,i.jsxs)(rd,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(Eu,{state:_,onClick:t=>{x(t),"unchecked"===t&&e.change("form.displayedPositionsCategoriesIds",[])},children:t("afficher_certai_88457")}),"checked"===_&&(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsCategoriesIds",children:A.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Eu,{state:I,onClick:t=>{v(t),"unchecked"===t&&e.change("form.displayedPositionsIds",[])},children:t("affficher_certa_32341")}),"checked"===I&&(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsIds",children:S})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Eu,{state:b,onClick:t=>{j(t),"unchecked"===t&&e.change("form.displayedPositionsSlotsIds",[])},children:t("afficher_certai_38724")}),"checked"===b&&(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsSlotsIds",children:k})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Eu,{state:C,onClick:t=>{y(t),"unchecked"===t&&e.change("form.displayedPositionsTagsIds",[])},children:t("afficher_certai_47793")}),"checked"===C&&(0,i.jsxs)(rd,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Gp,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsTagsIds",children:w})]})]})]})})},vH=e=>{const t=Ti(),[n,o]=(0,V.useState)(Bs(e.values.form.hiddenPositionsCategoriesIds)||Bs(e.values.form.hiddenPositionsIds)||Bs(e.values.form.hiddenPositionsSlotsIds)||Bs(e.values.form.hiddenPositionsTagsIds)||Bs(e.values.form.displayedPositionsCategoriesIds)||Bs(e.values.form.displayedPositionsIds)||Bs(e.values.form.displayedPositionsSlotsIds)||Bs(e.values.form.displayedPositionsTagsIds));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zm,{value:n,onChange:t=>{o(t),t||(e.change("form.hiddenPositionsCategoriesIds",[]),e.change("form.hiddenPositionsIds",[]),e.change("form.hiddenPositionsSlotsIds",[]),e.change("form.hiddenPositionsTagsIds",[]),e.change("form.displayedPositionsCategoriesIds",[]),e.change("form.displayedPositionsIds",[]),e.change("form.displayedPositionsSlotsIds",[]),e.change("form.displayedPositionsTagsIds",[]))},children:t("afficher_masq_74825")}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(IH,{change:e.change,eventId:e.eventId,organizationId:e.organizationId,values:e.values})]})]})},bH=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{isNotSavedModalOpen:s,onClose:r,onNotSavedClose:a,onSave:l}=WE(e.initialValues,e.values,e.handleSubmit),d=e.slotDisplay!==Qe.Hide&&e.values.form.positionDisplay!==tt.None;return(0,i.jsx)(iE,{button:(0,i.jsx)(kd,{isLoading:e.isMutateLoading,onClick:l,children:t("enregistrer_06519")}),title:e.name,onClose:r,children:(0,i.jsx)(UE,{isNotSavedOpen:s,onNotSavedClose:a,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("param_tres_des_93365")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("d_cider_du_type_01830")}),(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{gap:"8",children:[(0,i.jsx)(xH,{isSelected:e.values.form.positionRanking===it.Unranked,name:t("choix_illimit_s_72460"),src:wc.FormPositionUnranked,onSelect:()=>{e.change("form.positionRanking",it.Unranked)}}),(0,i.jsx)(xH,{isSelected:e.values.form.positionRanking===it.Ranked,name:t("classement_des_43897"),src:wc.FormPositionRanked,onSelect:()=>{e.change("form.positionRanking",it.Ranked),e.values.form.positionDisplay===tt.None&&e.change("form.positionDisplay",tt.Position)}})]}),e.values.form.positionRanking===it.Ranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ec,{label:t("nombre_de_choix_19811"),name:"form.positionLimit",shouldParseAsInt:!0})]}),(0,i.jsx)(Dh,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("affichage_des_m_65982")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("personnaliser_l_26207")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:t("comment_souhait_23788")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(FI,{name:"form.positionDisplay",value:tt.Category,children:t("afficher_les_ca_26287")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(FI,{name:"form.positionDisplay",value:tt.Position,children:t("afficher_les_mi_31841")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(FI,{name:"form.positionDisplay",value:tt.Slot,children:t("afficher_les_cr_32311")}),e.values.form.positionRanking===it.Unranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(FI,{name:"form.positionDisplay",value:tt.None,children:t("ne_rien_affiche_81467")})]}),e.values.form.positionDisplay!==tt.None&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:t("personnalisatio_94071")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Kp,{name:"form.showFullPosition",children:t("afficher_les_mi_35510")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(vH,{change:e.change,eventId:o,organizationId:n,values:e.values}),e.values.form.positionRanking!==it.Ranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:t("affichage_des_d_57491")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(Fp,{name:"form.showPositionCategoryDescription",children:t("afficher_la_des_67852")}),e.values.form.positionDisplay!==tt.Category&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(Fp,{name:"form.showPositionDescription",children:t("afficher_la_des_21998")})]})]}),(0,i.jsx)(Dh,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("automatisation_49411")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("d_cider_si_l_af_60345")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(Kp,{name:"form.willAutoAssign",children:e.values.form.positionDisplay===tt.Category?t("la_pr_affectat_61978"):e.values.form.positionDisplay===tt.Position?t("la_pr_affectat_20431"):t("l_affectation_s_68435")})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Dh,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("filtrer_les_cat_63783")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("d_cider_si_le_c_98644")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(FI,{name:"form.positionFilter",value:nt.FilterWithSlots,children:t("filtrer_les_cat_52780")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(FI,{name:"form.positionFilter",value:nt.None,children:t("ne_pas_filtrer_73952")})]}),e.values.form.positionDisplay!==tt.None&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Dh,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:t("personnaliser_l_44808")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ec,{label:t("nom_de_l_tape_85862"),name:"form.positionTitle"}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(SI,{label:t("description_58935"),name:"form.positionSubtitle"})]})]})})})},jH=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=bd(),{data:o,loader:s}=Oi("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 hiddenPositionsTagsIds\n displayedPositionsCategoriesIds\n displayedPositionsIds\n displayedPositionsSlotsIds\n displayedPositionsTagsIds\n showFullPosition\n showPositionCategoryDescription\n showPositionDescription\n positionTitle\n positionSubtitle\n willAutoAssign\n }\n }\n}\n",{organizationId:e,formId:n},[]);Zc(o.organization?.form.name??"");const r=Ei(ld),a=Ei(_H),{mutate:l,isLoading:d}=function(e={}){return Di("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=V.useMemo(()=>({form:a.formParametersMissionsInputDefault(o.organization?.form)}),[o.organization]);return(0,i.jsx)(Vd,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(bH,{change:e.change,handleSubmit:t,initialValues:c,isMutateLoading:d,loader:s,name:o.organization?.form.name??"",slotDisplay:o.organization?.form.slotDisplay??Qe.Hide,values:n}),validate:r.validateForForm(a.updateFormParametersMissionsSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:i.form})})},CH=e=>{const t=Ti(),n=Ei(Cm),o=um(),s=e.endpoint.params.some(e=>"endDate"===e.name),r=(0,V.useMemo)(()=>(0,cm.A)(e.data.event.accreditationsCategories,e=>m(e.name)),[e.data.event]),a=(0,V.useMemo)(()=>(0,cm.A)(e.data.event.positionsCategories,e=>m(e.name)),[e.data.event]),l=(0,V.useMemo)(()=>(0,Xh.A)(e.data.event.formsCustomsFields.concat(e.data.organization.usersInfosCustomFields.nodes),e=>e.slug),[e.data]),d={accreditationsCategoriesIds:t("cat_gories_d_ac_73496"),accreditationsIds:t("accr_ditations_39450"),accreditationsSlotsIds:t("cr_neaux_33401"),columns:t("colonnes_73889"),date:t(s?"date_de_d_but_43380":"Date"),delimiter:t("s_parateur_36232"),endDate:t("date_de_fin_86920"),includeLeaders:t("reponsable_82458"),includeMembers:t("membres_11310"),positionCategoryId:t("Catégorie de missions"),positionId:t("Position"),slugs:t("champs_91671"),sortAttribute:t("trier_par_05826"),sortDirection:t("ordre_78726"),state:t("statut_d_affect_57444"),states:t("statut_d_accr_d_75527")},c={assigned:t("attribu_es_48167"),quota:t("quota_00069"),scanned:t("scann_es_13169"),wished:t("souhait_es_78101"),[rn.AccreditationState]:t("statut_d_accr_d_75527"),[rn.Delegation]:t("Delegation"),[rn.Email]:t("e_mail_13869"),[rn.FirstName]:t("pr_nom_66988"),[rn.Id]:t("id_51738"),[rn.InsertedAt]:t("date_d_inscript_31369"),[rn.LastName]:t("nom_08311"),[rn.LocalId]:t("id_sur_l_v_nem_01171"),[rn.Name]:t("Nom complet"),[rn.PairedAt]:t("Date d'appairage"),[rn.State]:t("statut_d_affect_57444"),[rn.TeamCode]:t("code_quipe_14296"),[rn.UpdatedAt]:t("date_de_mise_74553"),[re.Asc]:t("croissant_68432"),[re.Desc]:t("d_croissant_08512")},u=e=>"slugs"===e.type?"all"===e.emptyMeans?t("tous_les_champs_57939"):t("aucun_champ_23523"):"states"===e.name?t("tous_les_status_67644"):t("tous_39916"),h=s=>{const h=e.values[s.name],g=d[s.name]??s.name,p=void 0===s.requires||void 0!==e.values[s.requires]&&null!==e.values[s.requires]&&""!==e.values[s.requires]?void 0:"disabled",f={flex:"1 1 0",minWidth:"160px"},_=t=>e.onChange(s.name,t);switch(s.type){case"boolean":return(0,i.jsxs)(hh,{css:f,label:g,shouldParseAsBoolean:!0,value:!0===h,onChange:_,children:[(0,i.jsx)("option",{value:"false",children:t("ne_pas_les_incl_04166")}),(0,i.jsx)("option",{value:"true",children:t("les_inclure_90965")})]},s.name);case"date":return(0,i.jsx)(Ih,{css:f,label:g,state:p,value:"string"==typeof h?h:null,onChange:e=>{_(e.isValid?e.toFormat("yyyyMMdd"):null)}},s.name);case"delimiter":return(0,i.jsxs)(hh,{css:f,label:g,value:"string"==typeof h?h:"",onChange:_,children:[(0,i.jsx)("option",{value:"",children:t("virgule_par_d_64346")}),(0,i.jsx)("option",{value:";",children:t("point_virgule_15722")}),(0,i.jsx)("option",{value:"\t",children:t("tabulation_85540")})]},s.name);case"enum":case"ids":case"slugs":{const d="enum"===s.type?(e=>e.every(e=>void 0!==c[e])?e.map(e=>(0,i.jsx)("option",{value:e,children:c[e]},e)):o([...e]))(s.values):"ids"===s.type?(e=>{switch(e.resource){case"accreditationsCategories":return r.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id));case"accreditations":return r.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:_g(e.accreditations).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id));case"accreditationsSlots":return Kg(n,r);case"positionsCategories":return a.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id));case"positions":return a.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,cm.A)(e.positions,e=>m(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))}})(s):(n=>{const o=n.variety===Te.Position?e.data.organization.positionsCustomFields.nodes:l;return[...(n.extraSlugs??[]).map(e=>(0,i.jsx)("option",{value:e,children:"description"===e?t("Description"):e},e)),...o.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))]})(s);if("slugs"===s.type||s.multiple)return(0,i.jsx)(Uu,{css:f,isSearchVisible:!0,isSelectAllVisible:!0,label:g,multiple:!0,placeholder:u(s),renderOnPortal:!0,state:p,values:Array.isArray(h)?h:[],onChange:_,children:d},s.name);{const e="ids"===s.type||void 0===s.defaultValue;return(0,i.jsxs)(hh,{css:f,label:g,shouldParseAsInt:"ids"===s.type,state:p,value:null==h?"":h.toString(),onChange:e=>{_("number"==typeof e&&Number.isNaN(e)?null:e)},children:[e&&(0,i.jsx)("option",{value:"",children:"positionId"===s.name?t("toutes_les_miss_87817"):"positionCategoryId"===s.name?t("toutes_les_cat_63746"):"sortAttribute"===s.name?t("aucun_tri_90071"):t("tous_les_status_67644")}),d]},s.name)}}}};return(0,i.jsx)(rd,{direction:"column",gap:"6",children:(0,TG.A)(e.endpoint.params,5).map((e,t)=>(0,i.jsx)(rd,{align:"start",css:{columnGap:"$4",rowGap:"$6"},wrap:"wrap",children:e.map(h)},t))})},yH=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{user:s}=Li(),{isLoading:r,copy:a}=RI(),[l,d]=(0,V.useState)(!1),[c,u]=(0,V.useState)("api"),[m,h]=(0,V.useState)(()=>$N(e.endpoint)),g=hf({organizationId:n,eventId:o,lang:s?.language,pathComponent:e.endpoint.path,key:e.data.event.key,searchParams:PN(e.endpoint,m)}),p="sheets"===c?`=IMPORTDATA("${g}")`:g,f=function(e,t){const n=PN(e,t);return e.params.filter(e=>void 0!==n[e.name]&&("enum"!==e.type||e.defaultValue!==n[e.name])).length}(e.endpoint,m),_="string"==typeof m.delimiter&&""!==m.delimiter&&","!==m.delimiter;return(0,i.jsxs)(rd,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$xs",padding:"$5 $6"},direction:"column",gap:"6",width:1,children:[(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsxs)(rd,{align:"center",gap:"3",justify:"between",children:[(0,i.jsxs)(rd,{css:{minWidth:"0"},direction:"column",children:[(0,i.jsxs)(rd,{align:"center",gap:"2",wrap:"wrap",children:[(0,i.jsx)(ka,{font:"gray900 textMd medium",children:e.title}),f>0&&(0,i.jsx)(vu,{color:"primary",children:t("_1_param_tre_m_53568",f)})]}),(0,i.jsx)(ka,{font:"gray500 textSm regular",children:e.description})]}),(0,i.jsx)(kd,{color:"white",css:{flexShrink:"0"},leftIcon:"sliders-up",rightIcon:l?"chevron-up":"chevron-down",onClick:()=>d(!l),children:t("personnaliser_84232")})]}),(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(Qd,{css:{flex:"1",minWidth:"0","& .h-styled-input-container":{background:"white"}},state:"disabled",value:p,onChange:hc.A}),(0,i.jsx)(kd,{isLoading:r,leftIcon:"copy",onClick:()=>a(p),children:t("copier_75889")})]})]}),l&&(0,i.jsxs)(rd,{css:{borderTop:"1px solid $gray200",paddingTop:"$5"},direction:"column",gap:"6",children:[(0,i.jsxs)(rd,{css:{maxWidth:"100%",width:"280px"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray900 textSm medium",children:t("Format du lien")}),(0,i.jsxs)(vI,{color:"primary",selectedItem:c,onChange:e=>u(e),children:[(0,i.jsx)(bI,{item:"api",children:"API"}),(0,i.jsx)(bI,{item:"sheets",children:"Google Sheet"})]})]}),"sheets"===c&&_&&(0,i.jsx)(zd,{alertStyle:"warning",children:(0,i.jsx)(Pd,{children:t("google_sheets_a_66636")})}),(0,i.jsx)(CH,{data:e.data,endpoint:e.endpoint,values:m,onChange:(e,t)=>{h(n=>({...n,[e]:t}))}}),(0,i.jsxs)(rd,{align:"center",gap:"3",justify:"between",wrap:"wrap",children:[(0,i.jsx)(ka,{font:"gray500 textXs regular",children:t("les_param_tres_72412")}),(0,i.jsx)(kd,{color:"invisible-gray",leftIcon:"rotate-left",onClick:()=>h($N(e.endpoint)),children:t("r_initialiser_l_27814")})]})]})]})},AH=e=>{const{translate:t}=bd(),{hasFeature:n}=_v(),o={assignments:t("affectations_de_70985"),accreditations:t("accr_ditations_55053"),"accreditations-matrix":t("accr_ditations_29354"),"accreditations-slots":t("cr_neaux_d_accr_44687"),positions:t("missions_63972"),"delegations-matrix":t("d_l_gations_sou_41605")},s={assignments:t("exporter_vos_me_66217"),accreditations:t("exporter_toutes_28045"),"accreditations-matrix":t("exporter_toutes_67075"),"accreditations-slots":t("liste_des_cr_ne_56641"),positions:t("liste_des_missi_29192"),"delegations-matrix":t("accr_ditations_29277")};return(0,i.jsx)(rd,{direction:"column",gap:"3",width:1,children:zN.filter(e=>void 0===e.feature||n(e.feature)).map(t=>(0,i.jsx)(yH,{data:e.data,description:s[t.path],endpoint:t,title:o[t.path]},t.path))})},SH=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=bd(),{event:{name:o}}=dv();Zc(`${o} API`);const{hasFeature:s}=_v(),{data:r,loader:a}=Oi("query EventApi($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n usersInfosCustomFields: customFields(\n variety: UserInfo\n privacy: All\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n slug\n name\n }\n }\n\n positionsCustomFields: customFields(\n variety: Position\n privacy: All\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n slug\n name\n }\n }\n }\n\n event(id: $eventId) {\n key\n\n formsCustomsFields {\n slug\n name\n }\n\n positionsCategories {\n id\n name\n\n positions {\n id\n name\n }\n }\n\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n acronym\n accreditationDisplay\n index\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n }\n }\n }\n}\n",{organizationId:t,eventId:n},[]);return a||(0,i.jsxs)(nb,{children:[(0,i.jsx)(tb,{children:(0,i.jsx)(ka,{font:"gray900 displayXs medium",children:"API"})}),(0,i.jsxs)(Qv,{children:[(0,i.jsx)(zd,{alertStyle:"primary",children:(0,i.jsx)(Pd,{children:e("l_api_permet_de_66672",$c)})}),(0,i.jsx)(md,{height:"7"}),s(Ae.Api)?(0,i.jsx)(AH,{data:r}):(0,i.jsx)(rd,{align:"center",css:{flex:"1"},height:1,justify:"center",width:1,children:(0,i.jsx)(kx,{icon:"code-branch"})})]})]})},kH=[pt.Eid,pt.FirstName,pt.LastName,pt.Picture,pt.Population],wH=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=bd(),{event:o}=dv();Zc(`${o.name} Weezevent`);const{data:s}=Oi("query WeezeventV2Infos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, privacy: All, variety: UserInfo) {\n nodes {\n slug\n name\n }\n }\n\n weezaccessEvents {\n id\n name\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 Di("mutation EventWeezeventUpdate($eventId: EventId!, $weezevent: EventWeezeventInput!) {\n eventWeezeventUpdate(eventId: $eventId, weezevent: $weezevent) {\n id\n }\n}\n",e)}(),a=(0,V.useMemo)(()=>(0,cm.A)(s.organization?.customFields.nodes??[],e=>m(e.name)).filter(e=>!kH.includes(e.slug)).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),[s]),l=(0,V.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,V.useMemo)(()=>(0,cm.A)(s.event?.accreditationsCategories??[],e=>m(e.name)).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,cm.A)(e.accreditations,e=>m(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[s]),c=(0,V.useMemo)(()=>(0,cm.A)(s.organization?.weezaccessEvents??[],e=>m(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[s]);return(0,i.jsxs)(nb,{children:[(0,i.jsx)(tb,{children:(0,i.jsx)(ka,{font:"gray900 displayXs medium",children:"Weezevent"})}),(0,i.jsx)(Qv,{children:(0,i.jsx)(Vd,{initialValues:{accreditationsIds:s.event?.weezevent?.accreditationsIds||[],customFieldsSlugs:s.event?.weezevent?.customFieldsSlugs||[],segmentsIds:s.event?.weezevent?.segmentsIds||[],weezaccessEventId:s.event?.weezevent?.weezaccessEventId??null},render:({handleSubmit:t,submitting:n})=>(0,i.jsxs)(rd,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(Gp,{isSearchVisible:!0,label:e("liste_des_champ_73852"),multiple:!0,name:"customFieldsSlugs",children:a}),(0,i.jsx)(Gp,{isSearchVisible:!0,label:e("liste_des_vues_82829"),multiple:!0,name:"segmentsIds",children:l}),(0,i.jsx)(Gp,{hint:e("toutes_les_accr_55233"),isSearchVisible:!0,label:e("liste_des_accr_50214"),multiple:!0,name:"accreditationsIds",children:d}),(0,i.jsx)(Gp,{isSearchVisible:!0,label:e("id_de_l_v_neme_87336"),name:"weezaccessEventId",children:c}),(0,i.jsx)(Mv,{permissions:Ov.WEEZEVENT_EDIT,children:(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{isLoading:n,onClick:t,children:e("enregistrer_06519")})})})]}),onSubmit:e=>r({eventId:n,weezevent:e})})})]})};let EH=class{positionsCustomFieldInputSchema(){return c.Ik().shape({customFieldId:c.ai().required(),conditionValue:c.gl().required()})}};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,fn._G)()],EH);let TH=class extends ic{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 c.Ik().shape({slot:this.positionsSlotInputSchema()})}positionsSlotInputSchema(){return c.Ik().shape({name:c.Yj(),startDate:Yp.required(this.t("la_date_de_d_bu_05030")).typeError(this.t("la_date_de_d_bu_05030")),startTime:c.Yj().required(this.t("heure_de_d_but_90785")),endDate:Yp.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)=>As.c9.isDateTime(t.parent.startDate)&&t.parent.startDate.isValid&&As.c9.isDateTime(t.parent.endDate)&&t.parent.endDate.isValid&&t.parent.endDate>=t.parent.startDate),endTime:c.Yj().required(this.t("l_heure_de_fin_78626")).test("after-start-time",this.t("la_date_de_fin_00429"),(e,t)=>{const n=As.c9.isDateTime(t.parent.startDate)&&t.parent.startDate.isValid,i=eg(t.parent.startTime),o=As.c9.isDateTime(t.parent.endDate)&&t.parent.endDate.isValid,s=eg(t.parent.endTime);if(n&&i&&o&&s){const[e,n]=tg(t.parent.startTime),[i,o]=tg(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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],TH);let RH=class extends ic{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),{positionCategoryId:r,name:e?.name??"",description:e?.description??"",privateNote:e?.privateNote??"",acronym:e?.acronym??"",color:e?.color??Ia.colors.primary500.value,icon:e?.icon??le.LocationDot,weezeventIsSynchronized:e?.weezeventIsSynchronized??!1,address:e?.address??null,latitude:e?.latitude??i??null,longitude:e?.longitude??o??null,zoom:e?.zoom??Pa,layer:e?.layer??n,tracesIds:e?.tracesIds??[],slots:e?.slots??[this.positionsSlotInputService.positionsSlotInputDefault(s)],conditionsOperator:e?.conditionsOperator??Ie.And,positionsCustomFields:e?.positionsCustomFields??[],tagsIds:e?.tagsIds??[],fields:e?.fields??{},leadersIds:e?.fields??[]}}createUpdatePositionSchema(e){const t=this.positionInputSchema();return c.Ik().shape({position:e?t.shape({fields:e}):t})}positionInputSchema(){return c.Ik().shape({name:c.Yj().required(this.t("le_nom_de_la_mi_74207")),positionCategoryId:c.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:c.Yj(),color:c.Yj().required(this.t("la_couleur_est_95740")),icon:c.Yj().required(this.t("l_ic_ne_est_req_15843")).oneOf(Vn,this.t("l_ic_ne_est_req_15843")),description:c.Yj(),privateNote:c.Yj(),address:c.Yj().nullable(),latitude:c.ai().nullable().typeError(this.t("la_latitude_doi_43118")),longitude:c.ai().nullable().typeError(this.t("la_longitude_do_35170")),traces:c.YO().of(c.ai()),slots:c.YO().of(this.positionsSlotInputService.positionsSlotInputSchema()).required(this.t("vous_devez_avoi_26563")).min(1,this.t("vous_devez_avoi_26563")),positionsCustomFields:c.YO().of(this.positionsCustomFieldInputService.positionsCustomFieldInputSchema()),tagsIds:c.YO().of(c.ai())})}};RH=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[EH,TH,Si])],RH);const OH=e=>{const{mutate:t}=function(e={}){return Di("mutation PositionCategoryCreate($eventId: EventId!, $positionCategory: PositionsCategoryInput!) {\n positionCategoryCreate(eventId: $eventId, positionCategory: $positionCategory) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(iC,{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})},DH=e=>{const{mutate:t}=function(e={}){return Di("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)(iC,{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})},zH=(0,V.memo)(function(e){const{params:{eventId:t},translate:n}=bd(),[o,s]=(0,V.useState)(vj(e.event.positionsCategories)),{hasEventRole:r}=dv(),{canPositionEdit:a}=Dv(),l=r&&a,[d,c]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ec,{label:n("nom_de_la_missi_64605"),name:"position.name"}),(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Gp,{createText:n("cr_er_une_nouve_72722"),isCreateVisible:l,isSearchVisible:!0,label:n("cat_gorie_00291"),name:"position.positionCategoryId",placeholder:n("rechercher_ou_c_16469"),onCreateClick:()=>{c(!0)},children:o.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(ec,{label:(0,i.jsx)(fI,{children:n("Acronym")}),name:"position.acronym"})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(aj,{label:n("Color"),name:"position.color"}),(0,i.jsx)(mj,{label:n("ic_ne_55554"),name:"position.icon"})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(SI,{label:(0,i.jsx)(fI,{children:n("description_58935")}),name:"position.description"}),e.event.isWeezeventConnected&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"4"}),(0,i.jsxs)(rd,{align:"center",gap:"3",children:[(0,i.jsx)(Kp,{name:"position.weezeventIsSynchronized",children:n("WeezeventIsSynchronized")}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{color:"gray800",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(Id,{icon:"circle-info"})})}),(0,i.jsx)(bp,{placement:"top",children:n("cr_er_automatiq_66502")})]})]})]}),d&&(0,i.jsx)(OH,{eventId:t,onClose:()=>{c(!1)},onSuccess:t=>{s(vj([...o,t])),e.change("position.positionCategoryId",t.id)}})]})}),$H=()=>{const e=Ti();return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(SI,{label:(0,i.jsx)(fI,{children:e("note_priv_e_06303")}),name:"position.privateNote"})})},PH=e=>{const t=Ti(),n=Ei(TH);return(0,i.jsx)(Ej,{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,Ta.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)(Ba.Yr,{name:"slot.startDate",children:e=>{e>o.slot.endDate&&n.change("slot.endDate",e)}}),(0,i.jsxs)(rd,{css:{flex:"1",overflowY:"auto"},direction:"column",width:1,children:[(0,i.jsx)(ec,{hint:t("vous_pouvez_per_94218"),label:(0,i.jsx)(fI,{children:t("nom_du_cr_neau_54351")}),name:"slot.name"}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Np,{label:t("date_de_d_but_43380"),max:e.event.endAt,min:e.event.startAt,name:"slot.startDate"}),(0,i.jsx)(wI,{label:t("horaire_de_d_bu_02380"),name:"slot.startTime"})]}),(0,i.jsx)(md,{height:"4"}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(Np,{label:t("date_de_fin_86920"),max:e.event.endAt,min:e.event.startAt,name:"slot.endDate"}),(0,i.jsx)(wI,{label:t("horaire_de_fin_10624"),name:"slot.endTime"})]}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ec,{label:t("nombre_de_membr_08851"),name:"slot.resources",shouldParseAsInt:!0})]})]})})},MH=e=>{const t=Ti(),n=Ei(Cm),o=(0,V.useMemo)(()=>g(e.slot.name)?e.slot.name:t("cr_neau_n_1_80362",e.index+1),[e.slot.name,e.index]),s=(0,V.useMemo)(()=>{const i=n.toLocaleString(e.slot.startDate,zs.DateOnly.WeekdayLongMonthLong),o=n.toLocaleString(e.slot.endDate,zs.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,V.useState)(e.initialIsEditOpen),[l,d]=(0,V.useState)(!1),c=(e.slot.assignedResources??0)>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray800 textSm semiBold",children:o}),(0,i.jsx)(ka,{color:"gray500",children:s})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{a(!0)}})})}),(0,i.jsx)(bp,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"arrows-repeat",size:"sm",onClick:()=>{d(!0)}})})}),(0,i.jsx)(bp,{placement:"top",children:t("r_p_ter_le_cr_n_68038")})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",disabled:c,leftIcon:"trash-can",size:"sm",onClick:()=>{e.remove(e.index)}})})}),(0,i.jsx)(bp,{placement:"top",children:t(c?"des_membres_son_92320":"supprimer_43083")})]})]}),r&&(0,i.jsx)(PH,{event:e.event,slot:e.slot,onClose:()=>{a(!1)},onSuccess:async t=>{e.updateSlots(t,e.index)}}),l&&(0,i.jsx)(IF,{showHours:!0,onClose:()=>{d(!1)},onSubmit:(t,n)=>{e.onRepeat(e.slot,t,n)}})]})},FH=e=>{const t=Ei(TH),[n,o]=(0,V.useState)(-1),s=(0,V.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,V.useCallback)((e,t,n)=>Ts(e).overlaps(n),[]),a=(0,V.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,V.useCallback)((t,n,i)=>{const o=function(e,t,n){const i=tg(e.startTime);let o=e.startDate;i&&(o=o.set({hour:i[0],minute:i[1]}));const s=tg(e.endTime);let r=e.endDate;return s&&(r=r.set({hour:s[0],minute:s[1]})),(0,nm.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,V.useCallback)(t=>{e.change("position.slots",qs(e.values.position.slots,t))},[e.values.position.slots,e.change]);return(0,i.jsx)(xF,{event:e.event,matchDateFilter:r,renderSlot:t=>(0,i.jsx)(MH,{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})},NH=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=bd(),{showNotification:r}=HI(),a=Ei(RH),l=Ei(ld),d=Ei(oj),c=(0,V.useRef)(null),u=(0,V.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.position.name):n("cr_ation_d_une_10675"),[e.isEdit,e.initialValues]);Zc(u);const m=(0,V.useMemo)(()=>Bs(e.initialValues.position.tracesIds)||g(e.initialValues.position.address)||"number"==typeof e.initialValues.position.latitude||"number"==typeof e.initialValues.position.longitude,[e.isEdit,e.initialValues]),h=(0,V.useMemo)(()=>!!e.isEdit&&Bs(e.initialValues.position.positionsCustomFields),[e.isEdit,e.initialValues]),p=(0,V.useMemo)(()=>!!e.isEdit&&Bs(Object.keys(e.initialValues.position.fields)),[e.isEdit,e.initialValues]),f=(0,V.useMemo)(()=>!!e.isEdit&&g(e.initialValues.position.privateNote),[e.isEdit,e.initialValues]),_=(0,V.useMemo)(()=>!!e.isEdit&&Bs(e.initialValues.position.tagsIds),[e.isEdit,e.initialValues]),x=(0,V.useCallback)(t=>l.validateForForm(a.createUpdatePositionSchema(d.changedFieldsSchema(e.positionCustomFields,e.initialValues.position.fields,t.position.fields)))(t),[e.positionCustomFields,e.initialValues]);return(0,i.jsx)(Vd,{customErrorRef:c,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:r,submitting:a,values:l})=>(0,i.jsx)(zp,{button:e.isEdit&&(0,i.jsx)(kd,{isLoading:a,onClick:r,children:n("mettre_jour_l_19061")}),category:u,color:"dark",fallbackClosePath:Jo.POSITIONS({organizationId:o,eventId:s}),heading:e.isEdit?e.initialValues.position.name:n("nouvelle_missio_60727"),children:(0,i.jsxs)(Op,{ref:c,children:[(0,i.jsx)(Nd,{}),(0,i.jsx)(Wp,{heading:n("informations_su_61022"),children:(0,i.jsx)(zH,{change:t.change,event:e.event})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:n("cr_neaux_horair_62996"),subtitle:n("ajouter_les_dif_22779"),children:(0,i.jsx)(FH,{change:t.change,event:e.event,values:l})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:n("localisation_38416"),initialIsOpen:m,isToggleable:!0,subtitle:n("localiser_le_li_46319"),onToggle:n=>{n||(t.change("position.layer",e.event.layer),t.change("position.zoom",Pa),t.change("position.tracesIds",[]),t.change("position.address",null),t.change("position.latitude",null),t.change("position.longitude",null))},children:(0,i.jsx)(TF,{center:e.event,layer:l.position.layer,name:"position.",point:l.position,traces:e.event.traces,tracesIds:l.position.tracesIds})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:n("conditions_77756"),initialIsOpen:h,isToggleable:!0,subtitle:n("ajouter_des_con_75357"),onToggle:e=>{e||t.change("position.positionsCustomFields",[])},children:(0,i.jsx)(hF,{change:t.change,conditionsOperator:l.position.conditionsOperator,customFields:e.conditionsCustomFields,customFieldsValues:l.position.positionsCustomFields,name:"position.positionsCustomFields",prefix:"position."})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:n("champs_de_formu_64126"),initialIsOpen:p,isToggleable:!0,subtitle:n("ajouter_des_inf_14340"),onToggle:e=>{e||t.change("position.fields",{})},children:(0,i.jsx)(SM,{change:t.change,customFields:e.positionCustomFields,formCustomFields:[],formCustomFieldsValues:[],prefix:"position.",showFormCustomFields:!1})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:n("note_priv_e_06303"),initialIsOpen:f,isToggleable:!0,subtitle:n("ajouter_une_not_81707"),onToggle:e=>{e||t.change("position.privateNote","")},children:(0,i.jsx)($H,{})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:n("tags_79499"),initialIsOpen:_,isToggleable:!0,subtitle:n("ajouter_des_tag_64526"),onToggle:e=>{e||t.change("position.tagsIds",[])},children:(0,i.jsx)(Rj,{change:t.change,name:"position.",organizationId:o,tags:e.tags,tagsIds:l.position.tagsIds})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)($p,{children:(0,i.jsx)(kd,{isLoading:a,textAlign:"center",onClick:r,children:e.isEdit?n("mettre_jour_l_19061"):n("cr_er_la_missio_82644")})})]})}),validate:x,width:1,onSubmit:async i=>{const a=await e.mutate({eventId:s,position:{...i.position,slots:i.position.slots.map(e=>(0,ma.A)(e,["index"]))}});r(e.isEdit?n("la_mission_a_t_79916"):n("la_mission_a_t_14808")),e.isEdit?t.goBack(Jo.POSITION({organizationId:o,eventId:s,positionId:a})):t.replace(Jo.POSITION({organizationId:o,eventId:s,positionId:a}))}})},LH=()=>{const e=Ei(RH),{organizationId:t,eventId:n,options:o}=zi(),{data:s,loader:r}=Oi("query PositionEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...CreatePositionTags\n\n positionCustomFields: customFields(eventId: $eventId, 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},[js.ConditionsCustomFieldsFragment,js.CreatePositionTagsFragment,js.AttachCustomFieldFragment,js.CreatePositionEventFragment]),{mutate:a}=function(e={}){return Di("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 g(t)&&g(n)?{latitude:parseFloat(t),longitude:parseFloat(n)}:g(e)?{positionCategoryId:parseInt(e,10)}:{}})(o);return r||(0,i.jsx)(NH,{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})},BH=()=>{const{organizationId:e,eventId:t,positionId:n}=zi(),{data:o,loader:s}=Oi("query PositionToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $positionId: PositionId!\n) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...CreatePositionTags\n\n positionCustomFields: customFields(eventId: $eventId, 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 weezeventIsSynchronized\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},[js.ConditionsCustomFieldsFragment,js.CreatePositionTagsFragment,js.AttachCustomFieldFragment,js.CreatePositionEventFragment]),r=Ei(RH),{mutate:a}=function(e={}){return Di("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)(NH,{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 VH;let UH=class extends hD{static{VH=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...hD.IMPORT_COLUMNS_DEFAULT,PositionName:"positionName",PositionCategoryName:"positionCategoryName",SlotStart:"slotStart",SlotEnd:"slotEnd",MaxResources:"slotMaxResources",SlotName:"slotName",Acronym:"acronym",Color:"color",Icon:"icon",Description:"description",ConditionsOperator:"conditionsOperator",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===jt.Update?[VH.IMPORT_COLUMNS_DEFAULT.Id]:[],VH.IMPORT_COLUMNS_DEFAULT.SlotStart,VH.IMPORT_COLUMNS_DEFAULT.SlotEnd,VH.IMPORT_COLUMNS_DEFAULT.MaxResources,VH.IMPORT_COLUMNS_DEFAULT.PositionName,VH.IMPORT_COLUMNS_DEFAULT.PositionCategoryName];constructor(e,t){super(e,t),this.csvInputService=e}};UH=VH=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[cD,Si])],UH);const WH=()=>{const{params:{organizationId:e,eventId:t},translate:n}=bd(),{mutate:o}=function(e={}){return Di("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}=HI(),{data:r,loader:a}=sl({organizationId:e,variety:Te.Position});return a||(0,i.jsx)(aD,{alertDescriptionKey:"to_add_a_task_62291",children:(0,i.jsx)(zD,{ImportInputService:UH,checkImport:s,closePath:Jo.POSITIONS({organizationId:e,eventId:t}),customFields:r.organization.customFields.nodes,heading:n("importing_tasks_31757"),importTagPrefix:"positions",localStorageKeyPrefix:"POSITIONS_IMPORT",mutate:o,returnLink:(0,i.jsx)(bm,{to:Jo.POSITIONS({organizationId:e,eventId:t}),children:n("revenir_aux_mis_73428")})})})};var GH;function qH(e,t){return t===jg.Map?{includeCheckedInRate:!1,includeCheckedOutRate:!1,includeConditions:!1,includeCreatedBy:!1,includeDescription:!1,includeLeaders:!1,includePositionTraces:!1,includeTags:!1,includeTraces:!0}:t===jg.SlotsList?{includeCheckedInRate:e.includes(GH.CheckedInRate),includeCheckedOutRate:e.includes(GH.CheckedOutRate),includeConditions:e.includes(GH.Conditions),includeCreatedBy:e.includes(GH.CreatedBy),includeDescription:e.includes(GH.Description),includeLeaders:e.includes(GH.Leaders)||e.includes(GH.CategoryLeaders),includePositionTraces:e.includes(GH.Traces),includeTags:e.includes(GH.Tags)}:{includeCheckedInRate:e.includes(GH.CheckedInRate),includeCheckedOutRate:e.includes(GH.CheckedOutRate),includeConditions:e.includes(GH.Conditions),includeCreatedBy:e.includes(GH.CreatedBy),includeDescription:e.includes(GH.Description),includeLeaders:e.includes(GH.Leaders)||e.includes(GH.CategoryLeaders),includePositionTraces:e.includes(GH.Traces),includeTags:e.includes(GH.Tags),includeTraces:!1}}!function(e){e.Acronym="acronym",e.Address="address",e.Category="category",e.CategoryLeaders="categoryLeaders",e.CheckedInRate="checkedInRate",e.CheckedOutRate="checkedOutRate",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.Layer="layer",e.Leaders="leaders",e.Longitude="longitude",e.Name="name",e.PrivateNote="privateNote",e.MaxResources="resources",e.AssignedResources="assignedResources",e.Slot="slot",e.SlotName="slotName",e.State="state",e.Tags="tags",e.Traces="traces",e.WeezeventChecklistId="weezeventChecklistId",e.WeezeventIsSynchronized="weezeventIsSynchronized",e.Zoom="zoom"}(GH||(GH={}));let HH=class extends Um{constructor(e,t,n){super(e,t,n)}getPositionsFilters(e,t){return(0,hd.A)([{slug:GH.Name,name:this.t("nom_de_la_missi_64605"),category:this.t("missions_63972"),fieldType:Zt.Text,hideEmpty:!0},{slug:"position",name:this.t("Position"),category:this.t("missions_63972"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:GH.Description,name:this.t("Description"),category:this.t("missions_63972"),fieldType:Zt.Text},{slug:GH.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("missions_63972"),fieldType:Zt.Text},Bs(e.positionsCategories)?{slug:"positionCategory",name:this.t("cat_gorie_00291"),category:this.t("missions_63972"),fieldType:Zt.Select,values:(0,cm.A)(e.positionsCategories,e=>m(e.name)),hideEmpty:!0}:null,{slug:"positionSlot",name:this.t("cr_neau_11117"),category:this.t("missions_63972"),fieldType:Zt.DateTimeRange,startAt:e.startAt,endAt:e.endAt},{slug:"positionSlotName",name:this.t("nom_du_cr_neau_54351"),category:this.t("missions_63972"),fieldType:Zt.Text},{slug:"tag",name:this.t("Tag"),category:this.t("missions_63972"),fieldType:Zt.Select,needLoading:!0,organizationId:e.organizationId,eventId:e.id,tagContext:Fe.Positions},{slug:"positionCustomField",name:this.t("condition_61066"),category:this.t("missions_63972"),fieldType:Zt.Select,needLoading:!0,organizationId:e.organizationId},Bs(e.traces)?{slug:GH.Traces,name:this.t("Traces"),category:this.t("missions_63972"),fieldType:Zt.Select,values:(0,cm.A)(e.traces,e=>m(e.name))}:null,{slug:"acronym",name:this.t("Acronym"),category:this.t("missions_63972"),fieldType:Zt.Text},{slug:"color",name:this.t("Color"),category:this.t("missions_63972"),fieldType:Zt.Text,hideEmpty:!0},{slug:"icon",name:this.t("ic_ne_55554"),category:this.t("missions_63972"),fieldType:Zt.Select,values:Vn.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"address",name:this.t("Address"),category:this.t("missions_63972"),fieldType:Zt.Text},{slug:"latitude",name:this.t("Latitude"),category:this.t("missions_63972"),fieldType:Zt.Number},{slug:"longitude",name:this.t("Longitude"),category:this.t("missions_63972"),fieldType:Zt.Number},{slug:"state",name:this.t("statut_des_ress_73550"),category:this.t("missions_63972"),fieldType:Zt.Select,hideEmpty:!0,values:ei.map(e=>({id:e,name:this.t(e)}))},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("missions_63972"),fieldType:Zt.Number,hideEmpty:!0},{slug:GH.CheckedInRate,name:this.t("taux_de_pointag_87285"),category:this.t("missions_63972"),fieldType:Zt.Number,hideEmpty:!0},{slug:GH.CheckedOutRate,name:this.t("taux_de_d_point_88315"),category:this.t("missions_63972"),fieldType:Zt.Number,hideEmpty:!0},{slug:GH.Leaders,name:this.t("nombre_de_respo_19772"),category:this.t("missions_63972"),fieldType:Zt.Number,hideEmpty:!0},{slug:GH.CategoryLeaders,name:this.t("nombre_de_respo_01994"),category:this.t("missions_63972"),fieldType:Zt.Number,hideEmpty:!0},{slug:GH.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("missions_63972"),fieldType:Zt.Select,hideEmpty:!0,needLoading:!0,organizationId:e.organizationId,eventId:e.id},{slug:GH.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("missions_63972"),fieldType:Zt.Datetime,hideEmpty:!0},...this.customFieldsToFilters(t)])}getPositionsPossibleColumns(e,{isWeezeventConnected:t}){const n=[{slug:GH.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:tn.Id,width:100},{slug:GH.Name,name:this.t("nom_de_la_missi_64605"),isSearchable:!0,isSortable:!0,sortAttribute:tn.Name,minWidth:120},{slug:GH.Acronym,name:this.t("acronymes_11499"),isSearchable:!0,isSortable:!0,sortAttribute:tn.Acronym,minWidth:120},{slug:GH.Description,name:this.t("Description"),minWidth:320},{slug:GH.Category,name:this.t("cat_gorie_00291"),isSearchable:!0,isSortable:!0,sortAttribute:tn.Category,minWidth:240},{slug:GH.SlotName,name:this.t("nom_du_cr_neau_54351"),isSearchable:!0,minWidth:180},{slug:GH.Slot,name:this.t("cr_neau_11117"),isSortable:!0,sortAttribute:tn.Slot,minWidth:240},{slug:GH.MaxResources,name:this.t("membres_n_cessa_55227"),minWidth:320},{slug:GH.AssignedResources,name:this.t("membres_11310"),minWidth:320},{slug:"numberOfMinutesRequired",name:this.t("nombre_de_membr_60320_plural"),minWidth:320},{slug:"numberOfMinutesAssigned",name:this.t("nombre_de_membr_87779_plural"),minWidth:320},{slug:GH.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:GH.Conditions,name:this.t("conditions_77756"),minWidth:320},{slug:GH.Address,name:this.t("Address"),isSearchable:!0,minWidth:240},{slug:GH.Layer,name:this.t("Layer"),minWidth:180},{slug:GH.Traces,name:this.t("Traces"),minWidth:240},{slug:GH.Zoom,name:this.t("Zoom"),isSearchable:!0,minWidth:180},{slug:GH.Latitude,name:this.t("latitude_46176"),isSearchable:!0,minWidth:180},{slug:GH.Longitude,name:this.t("longitude_01695"),isSearchable:!0,minWidth:180},{slug:GH.Acronym,name:this.t("Acronym"),isSearchable:!0,minWidth:180},{slug:GH.Color,name:this.t("Color"),isSearchable:!0,width:80},{slug:GH.Icon,name:this.t("ic_ne_55554"),width:80},{slug:GH.IconColor,name:this.t("ic_ne_et_couleu_54485"),width:80},{slug:GH.State,name:this.t("statut_des_ress_73550"),minWidth:240},{slug:GH.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:GH.CheckedInRate,name:this.t("taux_de_pointag_87285"),minWidth:240},{slug:GH.CheckedOutRate,name:this.t("taux_de_d_point_88315"),minWidth:240},{slug:GH.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:GH.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:tn.CreatedAt,minWidth:180},{slug:GH.Leaders,name:this.t("responsables_de_54941"),isSearchable:!0,minWidth:320},{slug:GH.CategoryLeaders,name:this.t("responsables_de_22220"),isSearchable:!0,minWidth:320}];return t&&n.push({slug:GH.WeezeventIsSynchronized,name:this.t("WeezeventIsSynchronized"),minWidth:180},{slug:GH.WeezeventChecklistId,name:this.t("WeezeventChecklistId"),minWidth:180}),n.concat(this.customFieldsToPossibleColumns(e))}};HH=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mm,Cm,Si])],HH);function KH(e){return e===Pt.StartDate||e===Pt.EndDate}function YH(e){return e===Pt.StartTime||e===Pt.EndTime}let ZH=class extends ic{constructor(e){super(e)}positionsSlotsMassEditSchema(){return c.Ik().shape({massEdit:this.positionsSlotsMassEditInputSchema()})}positionsSlotsMassEditInputSchema(){return c.Ik().shape({selecteds:c.Ik().required(),property:c.Yj().required().oneOf(Jn),strategy:c.Yj().required().oneOf(Qn).when("property",{is:KH,then:e=>e.oneOf([Mt.Replace])}),value:c.gl().test("valid-value",(e,t)=>{const{property:n,strategy:i}=t.parent;return KH(n)?As.c9.isDateTime(e)&&e.isValid||"string"==typeof e&&As.c9.fromISO(e).isValid||t.createError({message:this.t("la_date_est_req_98470")}):YH(n)&&i===Mt.Replace?eg(e)||t.createError({message:this.t("l_heure_est_req_51396")}):YH(n)?Da(e)||t.createError({message:this.t("le_nombre_de_mi_02803")}):Da(e)||t.createError({message:this.t("le_nombre_de_me_04870")})})})}};ZH=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],ZH);const XH=e=>{const{translate:t}=bd(),n=Ei(ZH),o=t=>KH(t)?e.event.startAt.startOf("day"):YH(t)?"":1,s=(e,t)=>{e.batch(()=>{e.change("massEdit.property",t),e.change("massEdit.strategy",Mt.Replace),e.change("massEdit.value",o(t))})};return(0,i.jsx)(Ej,{buttonText:t("mettre_jour_85141"),icon:"sliders",initialValues:{massEdit:{selecteds:e.selecteds,property:Pt.StartDate,strategy:Mt.Replace,value:o(Pt.StartDate)}},schema:n.positionsSlotsMassEditSchema(),size:"md",title:t("_diter_une_prop_26724"),onClose:e.onClose,onSubmit:async({massEdit:t})=>{const n=await e.mutate({...t,value:KH(t.property)?t.value.toISODate():t.value});e.onSuccess(n),e.onClose()},children:({form:n,values:o})=>(0,i.jsxs)(rd,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Ba.Yr,{name:"massEdit.strategy",children:e=>{YH(o.massEdit.property)&&n.change("massEdit.value",e===Mt.Replace?"":null)}}),(0,i.jsx)(ka,{font:"gray700 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(aA,{isChecked:o.massEdit.property===Pt.StartDate,text:t("modifier_la_dat_77807"),onClick:()=>s(n,Pt.StartDate),children:(0,i.jsx)(Np,{max:e.event.endAt,min:e.event.startAt,name:"massEdit.value"})}),(0,i.jsx)(aA,{isChecked:o.massEdit.property===Pt.StartTime,text:t("modifier_l_hora_50591"),onClick:()=>s(n,Pt.StartTime),children:(0,i.jsx)(JH,{values:o})}),(0,i.jsx)(aA,{isChecked:o.massEdit.property===Pt.EndDate,text:t("modifier_la_dat_16591"),onClick:()=>s(n,Pt.EndDate),children:(0,i.jsx)(Np,{max:e.event.endAt,min:e.event.startAt,name:"massEdit.value"})}),(0,i.jsx)(aA,{isChecked:o.massEdit.property===Pt.EndTime,text:t("modifier_l_hora_56263"),onClick:()=>s(n,Pt.EndTime),children:(0,i.jsx)(JH,{values:o})}),(0,i.jsxs)(aA,{isChecked:o.massEdit.property===Pt.Resources,text:t("modifier_le_nom_22180"),onClick:()=>s(n,Pt.Resources),children:[(0,i.jsx)(QH,{}),(0,i.jsx)(ec,{name:"massEdit.value",shouldParseAsInt:!0})]})]})})},JH=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QH,{}),e.values.massEdit.strategy===Mt.Replace?(0,i.jsx)(wI,{name:"massEdit.value"}):(0,i.jsx)(ec,{name:"massEdit.value",rightText:"min",shouldParseAsInt:!0})]}),QH=()=>{const{translate:e}=bd();return(0,i.jsxs)(Ev,{name:"massEdit.strategy",children:[(0,i.jsx)("option",{value:Mt.Replace,children:e("d_finir_une_nou_83151")}),(0,i.jsx)("option",{value:Mt.Add,children:e("ajouter_97327")}),(0,i.jsx)("option",{value:Mt.Subtract,children:e("retirer_05155")})]})},eK=e=>{const{translate:t}=bd(),{eventId:n,massActions:o,onMassEditSuccess:s,predicates:r}=SC(),{showNotification:a}=HI(),{mutate:l}=function(e={}){return Di("mutation PositionsSlotsMassEdit($eventId: EventId!, $massEdit: PositionsSlotsMassEditInput!) {\n numberOfPositionsSlots: positionsSlotsMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}(),[d,c]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kd,{onClick:()=>c(!0),children:t("_diter_une_prop_26724")}),d&&(0,i.jsx)(XH,{event:e.event,mutate:async e=>(await l({eventId:n,massEdit:e})).numberOfPositionsSlots,selecteds:o.getSelectedsInput(r,null),onClose:()=>c(!1),onSuccess:e=>{a(t("_1_cr_neaux_on_11340",e)),s()}})]})},tK=e=>{const{params:{eventId:t}}=bd(),{mutate:n}=Ar(),o=V.useCallback(async i=>{const o=Ls(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:yt.Replace,value:r}})}},[e.positionId,e.property,n]);return(0,i.jsx)(OC,{column:e.column,initialValue:e.initialValue,mutate:o,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:e.updatable})},nK=e=>{const{translate:t}=bd();return(0,i.jsx)(tK,{column:e.column,initialValue:e.position.acronym||"",positionId:e.position.id,property:Jt.Acronym,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Qd,{label:t("Acronym"),value:e,onChange:n}),renderValue:e.position.acronym||"",updatable:e.updatable})},iK=V.createContext({}),oK=e=>{const[t,n]=V.useState(),o=h$(Tl,{eventId:e.eventId},e=>e.event.positionsCategories),s=h$(Pr,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(iK.Provider,{value:{newPositionLatLng:t,getPositionsCategories:o,getTags:s,setNewPositionLatLng:n},children:e.children})};function sK(){return V.useContext(iK)}const rK=e=>{const t=Ti(),{getPositionsCategories:n}=sK(),{result:o,isLoading:s}=$$(n);return s?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zd,{children:t("Category")}),(0,i.jsx)(ju,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(hh,{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))})},aK=e=>{const{params:{organizationId:t,eventId:n}}=bd(),{isEditMode:o}=SC();return(0,i.jsx)(tK,{column:e.column,initialValue:e.positionCategory.id,positionId:e.positionId,property:Jt.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(rK,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(Vz,{isEditMode:o,title:e.positionCategory.name,updatable:e.updatable,children:(0,i.jsx)(bm,{to:Jo.POSITION_CATEGORY({organizationId:t,eventId:n,positionCategoryId:e.positionCategory.id}),children:e.positionCategory.name})}),updatable:e.updatable})},lK=e=>{const{translate:t}=bd();return(0,i.jsx)(tK,{column:e.column,initialValue:e.position.color,positionId:e.position.id,property:Jt.Color,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(rj,{label:t("Color"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(rd,{align:"center",gap:"3",width:1,children:(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{css:{background:e.position.color,borderRadius:"2px",height:"24px",width:"24px"},onClick:()=>{TI(e.position.color)}})}),(0,i.jsx)(bp,{placement:"top",children:e.position.color})]})}),updatable:e.updatable})},dK=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>e.position.positionsCustomFields||[],[e.position]),o=(0,V.useMemo)(()=>n.map((e,n)=>({id:n,color:"gray",icon:null,text:`${e.customField.name} : ${KF(t,e.customField,e.conditionValue)}`})),[n]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:o})})},cK=e=>{const{params:{eventId:t}}=bd(),{mutate:n}=Ar(),o=(0,V.useCallback)(i=>n({eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.position.id]},slug:Jt.Description,strategy:yt.Replace,value:i}}),[t,e.position.id,n]);return(0,i.jsx)(X$,{column:e.column,mutate:o,reload:e.reload,text:e.position.description,updatable:e.updatable})},uK=e=>{const{translate:t}=bd();return(0,i.jsx)(tK,{column:e.column,initialValue:e.position.icon,positionId:e.position.id,property:Jt.Icon,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(uj,{label:t("Icon"),renderOnPortal:!0,value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Id,{icon:xd(e.position.icon)}),updatable:e.updatable})},mK=e=>{const{translate:t}=bd(),n=(0,V.useMemo)(()=>({[Jt.Color]:e.position.color,[Jt.Icon]:e.position.icon}),[e.position]);return(0,i.jsx)(tK,{column:e.column,initialValue:n,positionId:e.position.id,property:[Jt.Color,Jt.Icon],reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(rd,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(rj,{label:t("Color"),value:e[Bt.Color],onChange:t=>{n({...e,[Bt.Color]:t})}}),(0,i.jsx)(uj,{label:t("Icon"),renderOnPortal:!0,value:e[Bt.Icon],onChange:t=>{n({...e,[Bt.Icon]:t})}})]}),renderValue:()=>(0,i.jsx)(Xv,{color:e.position.color,icon:e.position.icon}),updatable:e.updatable})},hK=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{isEditMode:s}=SC();return(0,i.jsx)(tK,{column:e.column,initialValue:e.position.name,positionId:e.position.id,property:Jt.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Qd,{label:t("nom_de_la_missi_64605"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Vz,{isEditMode:s,title:e.position.name,updatable:e.updatable,children:(0,i.jsx)(bm,{to:Jo.POSITION({organizationId:n,eventId:o,positionId:e.position.id}),children:(0,i.jsx)(ka,{css:{clamp:2},title:e.position.name,children:e.position.name})})}),updatable:e.updatable})},gK=e=>{const{translate:t}=bd(),{getTags:n}=sK(),{result:o,isLoading:s}=$$(n);return s?(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zd,{children:t("tags_79499")}),(0,i.jsx)(ju,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Uu,{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))})},pK=e=>{const t=(0,V.useMemo)(()=>e.position.tags||[],[e.position]),n=(0,V.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(tK,{column:e.column,initialValue:t.map(e=>e.id),positionId:e.position.id,property:Jt.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(gK,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(UC,{badges:n}),updatable:e.updatable})},fK=e=>{const t=(0,V.useMemo)(()=>(e.position.traces||[]).map(e=>({id:e.id,color:e.color,icon:null,text:e.name})),[e.position]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:t})})},_K=e=>{const{translate:t,params:{eventId:n}}=bd(),{mutate:o}=Fl(),s=(0,V.useMemo)(()=>g(e.positionSlot.name)?e.positionSlot.name:"-",[e.positionSlot]);return(0,i.jsx)(OC,{column:e.column,initialValue:e.positionSlot.name,mutate:async t=>o({eventId:n,positionId:e.positionSlot.position.id,positionSlotId:e.positionSlot.id,positionSlot:{...(0,Ta.A)(e.positionSlot,["id","startDate","startTime","endDate","endTime","resources"]),name:t}}),reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Qd,{label:t("nom_du_cr_neau_54351"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(ka,{css:{clamp:2},font:"gray900 textSm medium",title:s,width:1,children:s}),updatable:e.updatable})},xK=e=>{if("number"==typeof e.weezeventOrganizationId&&"number"==typeof e.positionSlot.weezeventChecklistId){const t=pf(e.weezeventOrganizationId,e.positionSlot.weezeventChecklistId);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(bm,{to:t,children:e.positionSlot.weezeventChecklistId})})}return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:"-"})},IK=e=>{const{translate:t,params:{eventId:n}}=bd(),{hasEventRole:o}=dv(),{canPositionEdit:s}=Dv(),r=o&&s,a=Ei(Yh),l=Ei(Xb),{mutate:d}=Fl(),c=jC(e.customFields),u=(0,V.useCallback)(()=>{e.reloadPositionSlot(e.positionSlot.id)},[e.positionSlot,e.reloadPositionSlot]),[m,h]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(am,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},children:[s&&(0,i.jsx)(Qu,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:e.state,onClick:(t,n)=>{Gd(n),e.toggleRow(`ps${e.positionSlot.id}`,t,n.shiftKey)}})}),e.columns.map(n=>{const o=c.get(n.slug);return n.slug===GH.Id?(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.id},n.slug):n.slug===GH.Category?(0,i.jsx)(aK,{column:n,positionCategory:e.positionSlot.positionCategory,positionId:e.positionSlot.position.id,reload:u,updatable:r},n.slug):n.slug===GH.Name?(0,i.jsx)(hK,{column:n,position:e.positionSlot.position,reload:u,updatable:s},n.slug):n.slug===GH.Description?(0,i.jsx)(cK,{column:n,position:e.positionSlot.position,reload:u,updatable:s},n.slug):n.slug===GH.Slot?(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:a.toDisplayString(e.positionSlot.range)},n.slug):n.slug===GH.SlotName?(0,i.jsx)(_K,{column:n,positionSlot:e.positionSlot,reload:u,updatable:s},n.slug):n.slug===GH.MaxResources||n.slug===GH.AssignedResources?(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:(0,i.jsx)(O$,{assignedResources:e.positionSlot.assignedResources,resources:e.positionSlot.resources})},n.slug):n.slug===GH.Tags?(0,i.jsx)(pK,{column:n,position:e.positionSlot.position,reload:u,updatable:s},n.slug):n.slug===GH.Conditions?(0,i.jsx)(dK,{column:n,position:e.positionSlot.position},n.slug):n.slug===GH.Address?(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.position.address},n.slug):n.slug===GH.Traces?(0,i.jsx)(fK,{column:n,position:e.positionSlot.position},n.slug):n.slug===GH.Latitude?(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.position.latitude},n.slug):n.slug===GH.Longitude?(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.position.longitude},n.slug):n.slug===GH.Acronym?(0,i.jsx)(nK,{column:n,position:e.positionSlot.position,reload:u,updatable:s},n.slug):n.slug===GH.Color?(0,i.jsx)(lK,{column:n,position:e.positionSlot.position,reload:u,updatable:s},n.slug):n.slug===GH.Icon?(0,i.jsx)(uK,{column:n,position:e.positionSlot.position,reload:u,updatable:s},n.slug):n.slug===GH.IconColor?(0,i.jsx)(mK,{column:n,position:e.positionSlot.position,reload:u,updatable:s},n.slug):n.slug===GH.State?(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.state===at.Full?(0,i.jsx)(vu,{color:"success",children:t(e.positionSlot.state)}):(0,i.jsx)(vu,{color:"warning",children:t(e.positionSlot.state)})},n.slug):n.slug===GH.FillingRate?(0,i.jsxs)(Qu,{minWidth:n.minWidth,width:n.width,children:[e.positionSlot.fillingRate,"%"]},n.slug):n.slug==GH.CheckedInRate?(0,i.jsxs)(Qu,{minWidth:n.minWidth,width:n.width,children:[e.positionSlot.checkedInRate||0,"%"]},n.slug):n.slug==GH.CheckedOutRate?(0,i.jsxs)(Qu,{minWidth:n.minWidth,width:n.width,children:[e.positionSlot.checkedOutRate||0,"%"]},n.slug):n.slug===GH.CreatedAt?(0,i.jsx)(Fz,{column:n,insertedAt:e.positionSlot.insertedAt}):n.slug===GH.CreatedBy?(0,i.jsx)(Nz,{column:n,createdBy:e.positionSlot.position.createdBy},n.slug):n.slug===GH.WeezeventIsSynchronized?(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.position.weezeventIsSynchronized?t("oui_54361"):t("non_33516")},n.slug):n.slug===GH.WeezeventChecklistId?(0,i.jsx)(xK,{column:n,positionSlot:e.positionSlot,weezeventOrganizationId:e.weezeventOrganizationId},n.slug):(0,i.jsx)(Qu,{minWidth:n.minWidth,width:n.width,children:o?l.getValueString(o,e.positionSlot.position.fields,{fileReturnValue:"name"}):""},n.slug)}),(0,i.jsx)(Mv,{permissions:Ov.POSITION_EDIT,children:(0,i.jsx)(jm,{justify:"center",children:(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"pen",onClick:()=>{h(!0)}})})}),(0,i.jsx)(bp,{placement:"top",children:t("_diter_62574")})]})})})]}),m&&(0,i.jsx)(PH,{event:e.event,slot:e.positionSlot,onClose:()=>{h(!1)},onSuccess:async t=>{await d({eventId:n,positionId:e.positionSlot.position.id,positionSlotId:e.positionSlot.id,positionSlot:t}),u()}})]})},vK=e=>{const{params:{eventId:t}}=bd(),{canPositionEdit:n}=Dv(),{columns:o,columnsSearch:s,limit:r,massActions:a,nameDebounced:l,offset:d,possibleColumns:c,predicates:u,reloadKey:m,rendering:h,setLimit:p,setOffset:f,setSort:_,sort:x}=SC(),I=(0,V.useMemo)(()=>qH(o,h),[o,h]),{data:v,isLoading:b,reload:j}=Oi("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 $includeCheckedOutRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeLeaders: Boolean!\n $includePositionTraces: 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",{...I,eventId:t,name:g(l)?l:null,columnsSearch:Bs(s)?s:null,predicates:u,limit:r,offset:d,sort:x},[js.PositionsPositionSlotFragment]);const C=(0,V.useMemo)(()=>o.flatMap(e=>(0,hd.A)([c.find(t=>t.slug===e)])),[c,o]),{numberOfPages:y,totalCount:A}=ah(v.event?.positionsSlots),[S,k]=(0,V.useState)([]),[w,E]=(0,V.useState)({}),T=(0,V.useCallback)(async e=>{E(t=>({...t,[e]:!0}));const{event:{positionSlot:n}}=await function(e,t){return Js("query PositionsPositionSlot(\n $eventId: EventId!\n $id: PositionsSlotId!\n $includeCheckedInRate: Boolean!\n $includeCheckedOutRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeLeaders: Boolean!\n $includePositionTraces: 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:[js.PositionsPositionSlotFragment]})}({...I,eventId:t,id:e},await X());k(t=>t.map(t=>t.id===e?n:t)),E(t=>({...t,[e]:!1}))},[I,E,k]);return(0,V.useEffect)(()=>{k(v.event?.positionsSlots.nodes??[])},[v.event]),(0,V.useEffect)(()=>{m>1&&j()},[m]),(0,V.useEffect)(()=>{a.setStates(Object.fromEntries((v.event?.positionsSlots.nodes??[]).map(e=>[`ps${e.id}`,{id:e.id,state:"unchecked"}])))},[v.event,a.setStates]),(0,i.jsx)(rd,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(_p,{"aria-busy":b,headerRow:(0,i.jsxs)(Wu,{children:[n&&(0,i.jsx)(pm,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:a.selectAllState,onClick:a.toggleSelectAll})}),C.map(e=>e.isSortable?(0,i.jsx)(fp,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:_,sort:x,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(pm,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),(0,i.jsx)(Mv,{permissions:Ov.POSITION_EDIT,children:(0,i.jsx)(pm,{width:100})})]}),paginationRow:(0,i.jsx)(lm,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(rm,{limit:r,numberOfPages:y,offset:d,setLimit:p,setOffset:f,showLimits:!0,totalCount:A})}),children:b?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):S.map(t=>w[t.id]?(0,i.jsx)(fm,{},t.id):(0,i.jsx)(IK,{columns:C,customFields:e.customFields,event:v.event,positionSlot:t,reloadPositionSlot:T,state:a.states[`ps${t.id}`]?.state??"unchecked",toggleRow:a.toggleRow,weezeventOrganizationId:e.weezeventOrganizationId},t.id))})})};let bK=class extends ZA{translationService;inputName="massConditions";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField(Yn)}}step2Fields(){return{customFieldId:c.ai().required(this.t("le_champ_person_80074")),value:c.gl().required(this.t("la_valeur_est_r_70136"))}}};bK=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],bK);const jK=()=>{const e=Ti();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{color:"gray900",fontWeight:"medium",children:e("que_souhaitez_v_87607")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(fE,{label:e("ajouter_des_con_91773"),name:"massConditions.strategy",value:$t.Add}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(fE,{label:e("remplacer_les_c_78082"),name:"massConditions.strategy",value:$t.Replace}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(fE,{label:e("supprimer_toute_17358"),name:"massConditions.strategy",value:$t.Reset})]})},CK=e=>{const t=Ti(),{data:n,loader:o}=Oi("query MassConditionsCustomFields($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[js.ConditionsCustomFieldsFragment]);const s=(0,V.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,V.useEffect)(()=>{s?.fieldType===Oe.Checkbox?e.change("massConditions.value",!0):s?.fieldType===Oe.Select&&e.change("massConditions.value",[])},[s]),o||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ev,{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===Oe.Select&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Gp,{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===Oe.Checkbox&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsxs)(Ev,{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")})]})]})]})},yK=e=>{const t=Ti(),n=Ei(bK),o=Ei(ld),{mutate:s}=function(e={}){return Di("mutation PositionsMassConditions($eventId: EventId!, $massConditions: MassConditionsInput!) {\n numberOfPositions: positionsMassConditions(eventId: $eventId, massConditions: $massConditions)\n}\n",e)}(),[r,a]=(0,V.useState)(0);return(0,i.jsx)(Om,{size:"md",onClose:e.onClose,children:(0,i.jsx)(cd.lV,{initialValues:{massConditions:{customFieldId:-1,selecteds:e.selecteds,strategy:$t.Add,value:""}},initialValuesEqual:La.A,render:({form:n,handleSubmit:o,values:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(wj,{color:"primary",icon:"lock"})}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("_diter_les_cond_95618")}),(0,i.jsx)(md,{height:"7"}),0===r?(0,i.jsx)(jK,{}):(0,i.jsx)(CK,{change:n.change,eventId:e.eventId,organizationId:e.organizationId,values:s}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",children:[0!==r&&(0,i.jsx)(kd,{color:"white",leftIcon:"arrow-left",onClick:()=>{a(Math.max(0,r-1))},children:t("retour_92202")}),(0,i.jsx)(ka,{css:{flex:"1"}}),0===r&&s.massConditions.strategy!==$t.Reset?(0,i.jsx)(kd,{rightIcon:"arrow-right",onClick:o,children:t("suivant_1_2_16815")}):(0,i.jsx)(kd,{onClick:o,children:t("appliquer_05753")})]})]}),validate:e=>0===r?o.validateForForm(n.step1Schema())(e):o.validateForForm(n.step2Schema())(e),onSubmit:async n=>{if(1===r||n.massConditions.strategy===$t.Reset){const i=(await s({eventId:e.eventId,massConditions:n.massConditions})).numberOfPositions;e.onSuccess(t("les_conditions_78548",i)),e.onClose()}else a(r+1)}})})},AK=()=>{const e=Ti(),{roles:t}=_v(),{eventId:n,massActions:o,onMassEditSuccess:s,organizationId:r,predicates:a,segment:l}=SC(),{showNotification:d}=HI(),{mutate:c}=Ar(),{mutate:u}=jl(),{mutate:m}=Rl(),[h,p]=(0,V.useState)(!1),[f,_]=(0,V.useState)(!1),[x,I]=(0,V.useState)(!1),[v,b]=(0,V.useState)(!1),j=o.getSelectedsInput(a,null),C=o.isAllSelected?l.count:o.numberOfSelected,y=(0,V.useCallback)(e=>{g(e)&&d(e),s()},[s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kd,{onClick:()=>{p(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"lock",onClick:()=>{_(!0)},children:e("_diter_les_cond_95618")}),(0,i.jsx)(ru,{icon:"user-gear",onClick:()=>I(!0),children:e("_diter_les_resp_29588")})]}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>{b(!0)},children:e("supprimer_43083")})})]})]}),h&&(0,i.jsx)(VA,{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)(yK,{eventId:n,organizationId:r,selecteds:j,onClose:()=>{_(!1)},onSuccess:y}),x&&(0,i.jsx)(_$,{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)(DA,{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 SK(){const{history:e,params:{organizationId:t,eventId:n}}=bd(),{mutate:i}=function(e={}){return Di("mutation PositionDuplicate($eventId: EventId!, $positionId: PositionId!) {\n positionDuplicate(eventId: $eventId, positionId: $positionId) {\n id\n }\n}\n",e)}();return(0,V.useCallback)(async o=>{const{positionDuplicate:s}=await i({eventId:n,positionId:o});e.push(fs.EDIT_POSITION(t,n,s.id))},[t,n,i])}const kK=e=>{const{translate:t,params:{eventId:n}}=bd(),{showNotification:o}=HI(),{mutate:s}=Rl(),r=[];return e.position.assignedResources>0&&r.push(t("_1_membre_est_66702",e.position.assignedResources)),(0,i.jsx)(DA,{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()}})},wK=e=>{const{params:{organizationId:t,eventId:n},translate:o}=bd(),s=SK(),{hasEventRole:r}=dv(),{canPositionEdit:a}=Dv(),[l,d]=(0,V.useState)(!1),[c,u]=(0,V.useState)(!1),m=r&&a;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{children:[(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"pen",to:fs.EDIT_POSITION(t,n,e.position.id),children:o("_diter_62574")}),(0,i.jsx)(ru,{icon:"clone",onClick:async()=>{await s(e.position.id)},children:o("dupliquer_28256")}),(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:e=>{d(!0),eu(e.target)},children:o("supprimer_43083")})]}),(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"plus",to:fs.CREATE_POSITION(t,n,e.position.category.id),children:o("ajouter_une_mis_99800")}),(0,i.jsx)(ru,{icon:"eye",to:Jo.POSITION_CATEGORY({organizationId:t,eventId:n,positionCategoryId:e.position.category.id}),children:o("voir_1_90465",e.position.category.name)}),m&&(0,i.jsx)(ru,{icon:"pen",onClick:()=>{u(!0)},children:o("renommer_1_40542",e.position.category.name)})]})]}),l&&(0,i.jsx)(kK,{position:e.position,onClose:()=>{d(!1)},onSuccess:e.reload}),c&&(0,i.jsx)(DH,{eventId:n,positionCategoryId:e.position.category.id,positionCategoryName:e.position.category.name,onClose:()=>{u(!1)},onSuccess:e.reload})]})},EK=e=>{const t=(0,V.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)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:t})})},TK=e=>{const t=(0,V.useMemo)(()=>(e.position?.leaders??[]).map(e=>({id:e.userInfo.id,color:"gray",icon:null,text:e.userInfo.nameOrEmail})),[e.position]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(UC,{badges:t})})},RK=e=>{const{translate:t}=bd();return(0,i.jsx)(tK,{column:e.column,initialValue:e.position.weezeventIsSynchronized,positionId:e.position.id,property:Jt.WeezeventIsSynchronized,reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(hh,{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.position.weezeventIsSynchronized?t("oui_54361"):t("non_33516"),updatable:e.updatable})},OK=e=>{const{translate:t}=bd(),n=Ei(Cm),{mutate:o}=Ar(),s=(0,V.useCallback)((t,n)=>o({eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:n,strategy:yt.Replace,value:t}}),[e.row,o]),r=(0,V.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,zs.DateOnly.MonthShort):`${n.toLocaleString(t,zs.DateOnly.MonthShort)} → ${n.toLocaleString(i,zs.DateOnly.MonthShort)}`}return"-"},[e.row]),{hasEventRole:a}=dv(),{canPositionEdit:l}=Dv(),d=a&&l;return e.column.slug==GH.Id?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===GH.Category?(0,i.jsx)(aK,{column:e.column,positionCategory:e.row.category,positionId:e.row.id,reload:e.reloadRow,updatable:d}):e.column.slug===GH.Name?(0,i.jsx)(hK,{column:e.column,position:e.row,reload:e.reloadRow,updatable:l}):e.column.slug===GH.Description?(0,i.jsx)(cK,{column:e.column,position:e.row,reload:e.reloadRow,updatable:l}):e.column.slug===GH.Slot?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(rd,{css:{overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(ka,{font:"gray900 textSm medium",children:r}),(0,i.jsx)(ka,{color:"gray500",children:t("creneau",e.row.numberOfSlots)})]})}):e.column.slug===GH.SlotName?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===GH.MaxResources||e.column.slug===GH.AssignedResources?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(O$,{assignedResources:e.row.assignedResources,resources:e.row.resources})}):e.column.slug===GH.Tags?(0,i.jsx)(pK,{column:e.column,position:e.row,reload:e.reloadRow,updatable:l}):e.column.slug===GH.Conditions?(0,i.jsx)(dK,{column:e.column,position:e.row}):e.column.slug===GH.Address?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.address}):e.column.slug===GH.Layer?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.layer===de.Google?"Plan":e.row.layer===de.GoogleSatellite?"Satellite":"IGN Plan"}):e.column.slug===GH.Traces?(0,i.jsx)(fK,{column:e.column,position:e.row}):e.column.slug===GH.Zoom?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.zoom}):e.column.slug===GH.Latitude?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.latitude}):e.column.slug===GH.Longitude?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.longitude}):"isVisible"===e.column.slug?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(rd,{align:"center",gap:"3",width:1,children:e.row.isVisible?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"square-check"})}),(0,i.jsx)(ka,{children:t("visible_27909")})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"square"})}),(0,i.jsx)(ka,{children:t("non_visible_30040")})]})})}):e.column.slug===GH.Acronym?(0,i.jsx)(nK,{column:e.column,position:e.row,reload:e.reloadRow,updatable:l}):e.column.slug===GH.Color?(0,i.jsx)(lK,{column:e.column,position:e.row,reload:e.reloadRow,updatable:l}):e.column.slug===GH.Icon?(0,i.jsx)(uK,{column:e.column,position:e.row,reload:e.reloadRow,updatable:l}):e.column.slug===GH.IconColor?(0,i.jsx)(mK,{column:e.column,position:e.row,reload:e.reloadRow,updatable:l}):e.column.slug===GH.State?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.state===at.Full?(0,i.jsx)(vu,{color:"success",children:t(e.row.state)}):(0,i.jsx)(vu,{color:"warning",children:t(e.row.state)})}):e.column.slug===GH.FillingRate?(0,i.jsxs)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===GH.CheckedInRate?(0,i.jsxs)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.checkedInRate||0,"%"]}):e.column.slug===GH.CheckedOutRate?(0,i.jsxs)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.checkedOutRate||0,"%"]}):e.column.slug===GH.CreatedAt?(0,i.jsx)(Fz,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===GH.CreatedBy?(0,i.jsx)(Nz,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===GH.Leaders?(0,i.jsx)(TK,{column:e.column,position:e.row}):e.column.slug===GH.CategoryLeaders?(0,i.jsx)(EK,{column:e.column,position:e.row}):e.column.slug===GH.WeezeventIsSynchronized?(0,i.jsx)(RK,{column:e.column,position:e.row,reload:e.reloadRow,updatable:l}):e.column.slug===GH.WeezeventChecklistId?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):(0,i.jsx)(KC,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:s,reload:e.reloadRow,updatable:l})},DK=e=>{const{params:{organizationId:t,eventId:n},translate:o}=bd(),{hasPermission:s}=dv(),r=s(Ov.POSITION_EDIT,{eventId:"ANY"}),a=jC(e.customFields),l=(0,V.useCallback)(()=>{e.reloadPosition(e.position.id)},[e.position,e.reloadPosition]);return(0,i.jsxs)(am,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},onMouseLeave:e=>{eu(e.target)},children:[r&&(0,i.jsx)(Qu,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:e.state,onClick:(t,n)=>{Gd(n),e.toggleRow(`p${e.position.id}`,t,n.shiftKey)}})}),e.columns.map(t=>{const o=a.get(t.slug);return(0,i.jsx)(OK,{column:t,customField:o,eventId:n,reloadRow:l,row:e.position},t.slug)}),(0,i.jsx)(Mv,{permissions:Ov.POSITION_EDIT,children:(0,i.jsx)(jm,{justify:"center",children:(0,i.jsxs)(Mv,{permissions:Ov.POSITION_EDIT,scope:{positionCategoryId:e.position.category.id},children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"pen",to:fs.EDIT_POSITION(t,n,e.position.id)})})}),(0,i.jsx)(bp,{placement:"top",children:o("_diter_62574")})]}),(0,i.jsx)(wK,{position:e.position,reload:e.reload})]})})})]})},zK=e=>{const{params:{eventId:t}}=bd(),{hasPermission:n}=dv(),o=n(Ov.POSITION_EDIT,{eventId:"ANY"}),{columns:s,columnsSearch:r,limit:a,massActions:l,nameDebounced:d,offset:c,possibleColumns:u,predicates:m,reloadKey:h,rendering:p,setLimit:f,setOffset:_,setSort:x,sort:I}=SC(),v=(0,V.useMemo)(()=>qH(s,p),[s,p]),{data:b,isLoading:j,reload:C}=Ol({...v,eventId:t,name:g(d)?d:null,columnsSearch:Bs(r)?r:null,predicates:m,limit:a,offset:c,sort:I}),y=(0,V.useMemo)(()=>s.flatMap(e=>(0,hd.A)([u.find(t=>t.slug===e)])),[u,s]),{numberOfPages:A,totalCount:S}=ah(b.data?.rows),[k,w]=(0,V.useState)([]),[E,T]=(0,V.useState)({}),R=(0,V.useCallback)(async e=>{T(t=>({...t,[e]:!0}));const{data:{row:n}}=await(i={...v,eventId:t,id:e},o=await X(),Js("query PositionsPosition(\n $eventId: EventId!\n $id: PositionId!\n $includeCheckedInRate: Boolean!\n $includeCheckedOutRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includePositionTraces: 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:[js.PositionsPositionFragment]}));var i,o;w(t=>t.map(t=>t.id===e?n:t)),T(t=>({...t,[e]:!1}))},[v,T,w]);return(0,V.useEffect)(()=>{w(b.data?.rows.nodes??[])},[b.data]),(0,V.useEffect)(()=>{h>1&&C()},[h]),(0,V.useEffect)(()=>{l.setStates(Object.fromEntries((b.data?.rows.nodes??[]).map(e=>[`p${e.id}`,{id:e.id,state:"unchecked"}])))},[b.data,l.setStates]),(0,i.jsx)(rd,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(_p,{"aria-busy":j,headerRow:(0,i.jsxs)(Wu,{children:[o&&(0,i.jsx)(pm,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:l.selectAllState,onClick:l.toggleSelectAll})}),y.map(e=>e.isSortable?(0,i.jsx)(fp,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:x,sort:I,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(pm,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),(0,i.jsx)(Mv,{permissions:Ov.POSITION_EDIT,children:(0,i.jsx)(pm,{width:100})})]}),paginationRow:(0,i.jsx)(lm,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(rm,{limit:a,numberOfPages:A,offset:c,setLimit:f,setOffset:_,showLimits:!0,totalCount:S})}),children:j?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):k.map(t=>E[t.id]?(0,i.jsx)(fm,{},t.id):(0,i.jsx)(DK,{columns:y,customFields:e.customFields,position:t,reload:C,reloadPosition:R,state:l.states[`p${t.id}`]?.state??"unchecked",toggleRow:l.toggleRow},t.id))})})},$K=e=>{const t=Ti();return Jc(e.onClose),Xc(e.onClose),(0,i.jsxs)(rd,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsxs)(rd,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onChange("acronym")},children:[(0,i.jsx)(ka,{fontSize:"textMd",children:(0,i.jsx)(Id,{icon:"text"})}),(0,i.jsx)(ka,{color:"gray800",css:{flex:"1"},children:t("acronymes_11499")}),"acronym"===e.selectedAcronymIcon&&(0,i.jsx)(rd,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(Id,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:Ia.colors.primary600.value})})]}),(0,i.jsxs)(rd,{align:"center",css:{cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onChange("icon")},children:[(0,i.jsx)(ka,{fontSize:"textMd",children:(0,i.jsx)(Id,{icon:"location-dot"})}),(0,i.jsx)(ka,{color:"gray800",css:{flex:"1"},children:t("ic_nes_16022")}),"icon"===e.selectedAcronymIcon&&(0,i.jsx)(rd,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(Id,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:Ia.colors.primary600.value})})]})]})},PK=e=>(Jc(e.onClose),Xc(e.onClose),(0,i.jsxs)(rd,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsx)(rd,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onExport("a3")},children:(0,i.jsx)(ka,{color:"gray800",css:{flex:"1"},children:"A3 (420 x 297 mm)"})}),(0,i.jsx)(rd,{align:"center",css:{cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onExport("a4")},children:(0,i.jsx)(ka,{color:"gray800",css:{flex:"1"},children:"A4 (297 x 210 mm)"})})]})),MK=e=>(0,i.jsxs)(rd,{align:"center",css:{cursor:"pointer",py:"$2","&:not(:last-child)":{borderBottom:"1px solid $gray200"}},gap:"2",onClick:e.onClick,children:[(0,i.jsx)(ka,{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)(ka,{css:{flex:"1"},children:e.name}),e.isSelected&&(0,i.jsx)(rd,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(Id,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:Ia.colors.primary600.value})})]}),FK=e=>{const t=Ti();return Jc(e.onClose),Xc(e.onClose),(0,i.jsxs)(rd,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsx)(MK,{imageSrc:wc.Maps.GooglePlan,isSelected:e.selectedLayer===de.Google,name:"Plan",onClick:()=>{e.onChange(de.Google)}}),(0,i.jsx)(MK,{imageSrc:wc.Maps.GoogleSatellite,isSelected:e.selectedLayer===de.GoogleSatellite,name:t("satellite_82253"),onClick:()=>{e.onChange(de.GoogleSatellite)}}),(0,i.jsx)(MK,{imageSrc:wc.Maps.IgnPlan,isSelected:e.selectedLayer===de.IgnPlan,name:"IGN Plan",onClick:()=>{e.onChange(de.IgnPlan)}})]})},NK=e=>(0,i.jsxs)(rd,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$md",cursor:"pointer",height:"48px",minWidth:"180px",padding:"$2 $3",userSelect:"none"},gap:"3",onClick:t=>{Gd(t),e.onClick()},children:[e.children,(0,i.jsx)(ka,{color:"gray700",children:e.isOpen?(0,i.jsx)(Id,{icon:"chevron-up"}):(0,i.jsx)(Id,{icon:"chevron-down"})})]});let LK=class extends ic{constructor(e){super(e)}traceInputDefault(e){return{name:e?.name??"",color:e?.color??Ia.colors.primary500.value,points:e?.points??[],direction:e?.direction??ce.None,startAt:e?.startAt??null,firstRunnerPace:e?.firstRunnerPace??null,lastRunnerPace:e?.lastRunnerPace??null}}traceInputSchema(e){return c.Ik().shape({name:c.Yj().required(this.t("le_nom_du_trac_39859")),color:c.Yj().required(this.t("la_couleur_du_t_36646")),points:c.YO().required(this.t("le_trac_doit_c_20895")).min(2,this.t("le_trac_doit_c_20895")),startAt:c.gl().nullable().test("start-at-during-event",this.t("l_heure_de_d_pa_04968"),t=>!As.c9.isDateTime(t)||!t.isValid||t>=e.startAt&&t<=e.endAt.endOf("day")),firstRunnerPace:this.paceSchema(),lastRunnerPace:this.paceSchema()})}paceSchema(){return c.ai().nullable().typeError(this.t("l_allure_doit_06495")).integer(this.t("l_allure_doit_06495")).positive(this.t("l_allure_doit_06495"))}createTraceSchema(e){return c.Ik().shape({trace:this.traceInputSchema(e)})}updateNameSchema(){return c.Ik().shape({name:c.Yj().required(this.t("le_nom_du_trac_39859"))})}};LK=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],LK);const BK=yS,VK=jS,UK=vS,WK=bS,GK=({fieldProps:e,hint:t,state:n,...o})=>{const[s,r]=(0,V.useState)(()=>{return"number"==typeof(t=e.input.value)&&Number.isFinite(t)?`${Math.floor(t/60)}:${(t%60).toString().padStart(2,"0")}`:"";var t}),a=Wd(e.meta);return(0,i.jsx)(Qd,{hint:a?e.meta.error:t,placeholder:"5:30",rightText:"min/km",state:a?"error":n,value:s,onBlur:e.input.onBlur,onChange:t=>{r(t),e.input.onChange(function(e){if(g(e)){const t=tg(e.trim());return t&&t[1]<60?60*t[0]+t[1]:NaN}return null}(t))},onFocus:e.input.onFocus,...o})},qK=({name:e,...t})=>(0,i.jsx)(cd.D0,{name:e,render:e=>(0,i.jsx)(GK,{fieldProps:e,...t})});function HK(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 KK=e=>{const t=parseFloat(e.getAttribute("lat")),n=parseFloat(e.getAttribute("lon")),i=parseFloat(e.querySelector("ele")?.textContent??"");return isNaN(t)||isNaN(n)?[]:isNaN(i)?[[t,n]]:[[t,n,i]]},YK=e=>{const t=Ti(),n=Ei(LK),o=Ei(ld),[s,r]=(0,V.useState)({name:e.trace?`${h(e.trace.name)}.gpx`:"",content:""}),{mutate:a,isLoading:l}=function(e={}){return Di("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 Di("mutation TraceUpdate($eventId: EventId!, $traceId: TraceId!, $trace: TraceInput!) {\n traceUpdate(eventId: $eventId, traceId: $traceId, trace: $trace) {\n id\n }\n}\n",e)}(),{descId:u,labelId:m}=Hd();return(0,i.jsx)(Vd,{hideDefaultErrors:!0,initialValues:{trace:n.traceInputDefault(e.trace)},render:({form:n,handleSubmit:o})=>(0,i.jsxs)(BK,{descId:u,isOpen:!0,labelId:m,setIsOpen:t=>{t||e.onClose()},size:"md",children:[(0,i.jsx)(VK,{heading:(0,i.jsx)(Dd,{id:m,children:e.traceId?t("modifier_le_tra_68754"):t("ajouter_un_trac_05425")}),leftIcon:"route",leftIconBorder:"gray200",leftIconColor:"gray800",setIsOpen:e.onClose}),(0,i.jsx)(UK,{id:u,children:(0,i.jsxs)(rd,{css:{inlineSize:"100%"},direction:"column",gap:"4",children:[(0,i.jsx)(Nd,{}),(0,i.jsx)(ec,{label:t("nom_du_trac_16379"),name:"trace.name",placeholder:t("nom_du_trac_16379")}),(0,i.jsx)(gG,{accept:Vx.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=HK(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(KK):i.length>0?i.flatMap(KK):o.flatMap(KK)}(e.content))}}),(0,i.jsx)(aj,{label:t("couleur_du_trac_28854"),name:"trace.color"}),(0,i.jsxs)(Ev,{label:t("sens_du_trac_49290"),name:"trace.direction",children:[(0,i.jsx)("option",{value:ce.None,children:t("aucun_93456")}),(0,i.jsx)("option",{value:ce.Forward,children:t("en_avant_17614")}),(0,i.jsx)("option",{value:ce.Backward,children:t("en_arri_re_24636")})]}),(0,i.jsx)(lj,{label:(0,i.jsx)(fI,{children:t("heure_de_d_part_43498")}),max:e.event.endAt.endOf("day"),min:e.event.startAt,name:"trace.startAt"}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(qK,{label:(0,i.jsx)(fI,{children:t("allure_du_premi_20993")}),name:"trace.firstRunnerPace"}),(0,i.jsx)(qK,{label:(0,i.jsx)(fI,{children:t("allure_du_derni_15048")}),name:"trace.lastRunnerPace"})]})]})}),(0,i.jsx)(WK,{handleSubmit:o,isLoading:l||c,setIsOpen:e.onClose,submitText:e.traceId?t("mettre_jour_85141"):t("ajouter_97327")})]}),validate:o.validateForForm(n.createTraceSchema(e.event)),onSubmit:async t=>{const n={...t.trace,startAt:t.trace.startAt?.isValid?t.trace.startAt:null};e.traceId?await d({eventId:e.eventId,traceId:e.traceId,trace:n}):await a({eventId:e.eventId,trace:n}),e.onClose(),e.reload()}})},ZK=e=>{const t=Ti(),{mutate:n}=function(e={}){return Di("mutation TraceDelete($eventId: EventId!, $traceId: TraceId!) {\n traceDelete(eventId: $eventId, traceId: $traceId) {\n id\n }\n}\n",e)}(),[o,s]=(0,V.useState)(!1),[r,a]=(0,V.useState)(!1);return(0,i.jsxs)(rd,{align:"center",css:{py:"$2","&:not(:last-child)":{borderBottom:"1px solid $gray200"}},gap:"2",children:[(0,i.jsx)(ka,{css:{background:e.trace.color,borderRadius:"$1",height:"16px",width:"16px"}}),(0,i.jsx)(ka,{color:"gray900",css:{flex:"1",ellipsis:!0},children:e.trace.name}),(0,i.jsx)(ka,{color:"gray700",css:{cursor:"pointer"},onClick:()=>{e.toggleVisible(e.trace.id)},children:(0,i.jsx)(Id,{icon:e.isHidden?"eye-slash":"eye"})}),(0,i.jsx)(ka,{color:"gray700",css:{cursor:"pointer"},onClick:()=>a(!0),children:(0,i.jsx)(Id,{icon:"pen"})}),(0,i.jsx)(ka,{color:"gray700",css:{cursor:"pointer"},onClick:()=>s(!0),children:(0,i.jsx)(Id,{icon:"xmark"})}),o&&(0,i.jsx)(DA,{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)(YK,{event:e.event,eventId:e.eventId,reload:e.reload,trace:e.trace,traceId:e.trace.id,onClose:()=>a(!1)})]})},XK=e=>{const t=Ti();return Jc(e.onClose),Xc(e.onClose),(0,i.jsxs)(rd,{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)(ZK,{event:e.event,eventId:e.eventId,isHidden:e.hiddenTracesIds.includes(t.id),reload:e.reload,toggleVisible:e.toggleVisible,trace:t},t.id)),(0,i.jsx)(ka,{color:"primary500",css:{cursor:"pointer",py:"$2"},onClick:()=>{e.onAddTrace(),e.onClose()},children:t("ajouter_un_trac_05425")})]})},JK=e=>{const{translate:t,params:{eventId:n}}=bd(),[o,s]=(0,V.useState)(!1),[r,a]=(0,V.useState)(!1),[l,d]=(0,V.useState)(!1),[c,u]=(0,V.useState)(!1),[m,h]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{css:{bottom:"12px",left:"12px",position:"absolute",zIndex:10},gap:"2",children:[(0,i.jsx)(rd,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$md",cursor:"pointer",fontSize:"$textLg"},height:48,justify:"center",width:48,onClick:()=>{e.onFullscreen()},children:(0,i.jsx)(Id,{icon:"expand"})}),(0,i.jsxs)(NK,{isOpen:o,onClick:()=>{s(e=>!e),a(()=>!1),d(()=>!1),u(()=>!1)},children:[(0,i.jsx)(ka,{css:{borderRadius:"$1",height:"32px",overflow:"hidden",width:"32px"},children:(0,i.jsx)("img",{alt:"Layer",height:"32px",src:e.layer===de.Google?wc.Maps.GooglePlan:e.layer===de.GoogleSatellite?wc.Maps.GoogleSatellite:wc.Maps.IgnPlan,width:"32px"})}),(0,i.jsx)(ka,{color:"gray900",css:{flex:"1"},children:e.layer===de.Google?"Plan":e.layer===de.GoogleSatellite?t("satellite_82253"):"IGN Plan"})]}),(0,i.jsx)(NK,{isOpen:r,onClick:()=>{s(()=>!1),a(e=>!e),d(()=>!1),u(()=>!1)},children:(0,i.jsxs)(rd,{align:"center",css:{flex:"1"},gap:"1",children:[(0,i.jsx)(ka,{color:"gray900",children:t("Traces")}),(0,i.jsx)(md,{width:"1"}),e.traces.map(e=>(0,i.jsx)(ka,{css:{background:e.color,borderRadius:"$1",height:"16px",width:"16px"}},e.id))]})}),e.showAcronymIcon&&(0,i.jsx)(NK,{isOpen:l,onClick:()=>{s(()=>!1),a(()=>!1),d(e=>!e),u(()=>!1)},children:(0,i.jsxs)(rd,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(ka,{fontSize:"textMd",children:(0,i.jsx)(Id,{icon:"acronym"===e.acronymIcon?"text":"location-dot"})}),(0,i.jsx)(ka,{color:"gray900",children:"acronym"===e.acronymIcon?t("acronymes_11499"):t("ic_nes_16022")})]})}),e.showExport&&(0,i.jsx)(NK,{isOpen:c,onClick:()=>{s(()=>!1),a(()=>!1),d(()=>!1),u(e=>!e)},children:(0,i.jsxs)(rd,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(ka,{fontSize:"textMd",children:(0,i.jsx)(Id,{icon:"file-export"})}),(0,i.jsx)(ka,{color:"gray900",children:t("exporter_59120")})]})})]}),o&&(0,i.jsx)(ka,{css:{bottom:"64px",left:"68px",position:"absolute",zIndex:10},children:(0,i.jsx)(FK,{selectedLayer:e.layer,onChange:e.setLayer,onClose:()=>s(!1)})}),r&&(0,i.jsx)(ka,{css:{bottom:"64px",left:"256px",position:"absolute",zIndex:10},children:(0,i.jsx)(XK,{event:e.event,eventId:n,hiddenTracesIds:e.hiddenTracesIds,reload:e.reload,toggleVisible:t=>{e.setHiddenTracesIds(Ws(e.hiddenTracesIds,t))},traces:e.traces,onAddTrace:()=>{h(!0)},onClose:()=>{a(!1)}})}),m&&(0,i.jsx)(YK,{event:e.event,eventId:n,reload:e.reload,onClose:()=>{h(!1)}}),l&&(0,i.jsx)(ka,{css:{bottom:"64px",left:"444px",position:"absolute",zIndex:10},children:(0,i.jsx)($K,{selectedAcronymIcon:e.acronymIcon,onChange:e.setAcronymIcon,onClose:()=>d(!1)})}),c&&(0,i.jsx)(ka,{css:{bottom:"64px",left:"632px",position:"absolute",zIndex:10},children:(0,i.jsx)(PK,{onClose:()=>u(!1),onExport:e.onExport})})]})};function QK(e,t,n,i){n.current.forEach(e=>e.setMap(null)),n.current=e.map(e=>{const n=e.points.map(([e,t])=>({lat:e,lng:t})),o=e.direction===ce.None?[]:[{icon:{path:e.direction===ce.Backward?google.maps.SymbolPath.BACKWARD_OPEN_ARROW:google.maps.SymbolPath.FORWARD_OPEN_ARROW,scale:4,strokeColor:e.color},offset:"0%",repeat:"200px"}],s=new google.maps.Polyline({path:n,geodesic:!0,strokeColor:e.color,strokeOpacity:1,strokeWeight:4,visible:!t.includes(e.id),icons:o});return s.setMap(i.current),s})}const eY=(0,V.memo)(e=>{const t=(0,V.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??{},...Ma(e.initialCenter,e.initialZoom,e.layer)}),n.current.mapTypes.set(de.IgnPlan,Va()),o.current=new google.maps.OverlayView,o.current.draw=hc.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(),QK(e.traces,e.hiddenTracesIds,a,n))},[]),n=(0,V.useRef)(null),o=(0,V.useRef)(null),s=(0,V.useRef)(null),r=(0,V.useRef)([]),a=(0,V.useRef)([]),l=()=>{r.current.forEach(e=>e.setMap(null)),r.current=e.positions.map(t=>{const i=za(Fa(t)),s=new google.maps.Marker({position:i,map:n.current,icon:"acronym"===e.acronymIcon?`${F.HEAVENT_API_URL}/icons/acronym.svg?color=${encodeURIComponent(t.color)}&text=${t.acronym}`:`${F.HEAVENT_API_URL}/icons/${xd(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})};return(0,V.useEffect)(()=>{l()},[JSON.stringify(e.positions),e.acronymIcon]),(0,V.useEffect)(()=>{n.current?.setMapTypeId(Na(e.layer))},[e.layer]),(0,V.useEffect)(()=>{QK(e.traces,e.hiddenTracesIds,a,n)},[JSON.stringify(e.traces),e.hiddenTracesIds]),(0,i.jsx)(ka,{ref:t,height:1,width:1})},La.A);eY.displayName="PositionsMap";const tY=e=>{const{organizationId:t,eventId:n}=zi(),o=Ei(Yh);return(0,i.jsx)(rd,{align:"center",css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",height:70,children:(0,i.jsxs)(_d,{to:Jo.POSITION({organizationId:t,eventId:n,positionId:e.position.id}),children:[(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{color:"gray800",children:e.position.name}),(0,i.jsx)(ka,{color:"gray500",fontSize:"textXs",children:e.position.range?o.toDisplayString(e.position.range):"-"})]}),(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"chevron-right"})})]})})},nY=e=>{const{translate:t,params:{eventId:n,segmentId:o}}=bd(),{event:s,localEvent:r,updateLocalEvent:a}=dv(),{canPositionEdit:l}=Dv(),{mutate:d}=_r(),{setNewPositionLatLng:c}=sK(),[u,m]=(0,V.useState)(e.layer),[h,g]=(0,V.useState)([]),[p,f]=(0,V.useState)(null),[_,x]=ZR("positionsMap.center",e.center),[I,v]=ZR("positionsMap.zoom",Pa),[b,j]=ZR("positionsMap.acronymIcon","icon"),[C,y]=(0,V.useState)(r?.isPositionsMapAlertVisible??!0),A=(0,V.useRef)(null),S=(0,V.useCallback)(e=>{const t=_?`${_.lat},${_.lng}`:"",i=new URLSearchParams;i.set("format",e),i.set("hiddenTracesIds",h.join(",")),i.set("center",t),i.set("acronymIcon",b),i.set("zoom",I.toString(10)),window.open(`${F.HEAVENT_API_URL}/image/event/${n}/positions/${o}/map.png?${i.toString()}`)},[_,I,h,b]);return(0,i.jsxs)(rd,{css:{flex:"1",position:"relative"},direction:"column",width:1,children:[l&&C&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zd,{alertStyle:"primary",onClose:async()=>{await a({isPositionsMapAlertVisible:!1}),y(!1)},children:(0,i.jsx)(Pd,{children:t("pour_cr_er_une_11133")})}),(0,i.jsx)(md,{height:"6"})]}),(0,i.jsx)(ka,{ref:A,css:{flex:"1",borderRadius:"$1"},width:1,children:(0,i.jsx)(eY,{acronymIcon:b,hiddenTracesIds:h,initialCenter:_,initialZoom:I,layer:u,positions:e.positions,showMarker:l,traces:e.traces,onMapCenterChanged:x,onMapDrag:()=>f(null),onMapZoomchanged:e=>{f(null),v(e)},onMarkerDragEnd:(e,t)=>c({latitude:e,longitude:t}),onPositionClick:(e,t)=>f({position:e,left:t.x,top:t.y})})}),l&&(0,i.jsx)(JK,{acronymIcon:b,event:s,hiddenTracesIds:h,layer:u,reload:e.reload,setAcronymIcon:j,setHiddenTracesIds:g,setLayer:async e=>{m(e),await d({eventId:n,layer:e})},showAcronymIcon:!0,showExport:!0,traces:e.traces,onExport:S,onFullscreen:()=>{A.current?.requestFullscreen()}}),A.current&&p&&(0,pn.createPortal)((0,i.jsx)(ka,{css:{left:`${p.left+32}px`,position:"absolute",top:p.top-35-16+"px",zIndex:10},children:(0,i.jsx)(tY,{position:p.position})}),A.current)]})},iY=e=>{const{params:{eventId:t}}=bd(),{columns:n,rendering:o}=SC(),s=(0,V.useMemo)(()=>qH(n,o),[n,o]),{data:r,loader:a,reload:l}=Ol({...s,eventId:t,name:g(e.name)?e.name:null,predicates:e.predicates,hasCoordinates:!0});return a?(0,i.jsx)(rd,{css:{flex:"1"},children:a}):(0,i.jsx)(nY,{center:A_(r.data),layer:r.data.layer,positions:r.data.rows.nodes,reload:l,traces:r.data.traces||[]})},oY=e=>{const t=V.useMemo(()=>e.startOfDay.plus({day:1}).minus({second:1}),[e.startOfDay]),n=V.useMemo(()=>As.IX.fromDateTimes(e.startOfDay,t).overlaps(e.slot.range),[e.startOfDay,t,e.slot]),o=V.useMemo(()=>n?As.IX.fromDateTimes(As.c9.max(e.startOfDay,e.slot.range.start),As.c9.min(t,e.slot.range.end)):e.slot.range,[n,e.startOfDay,t,e.slot]),s=V.useMemo(()=>{const t=o.start.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*t.hours+t.minutes)},[e.startOfDay,o]),r=V.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)(rd,{css:{gridColumnStart:s,gridColumnEnd:r},height:32,children:e.renderSlot(e.slot,e.row)},o.toISO()):null},sY=e=>{const[t,n]=V.useState(null),o=V.useCallback(e=>{e&&n(e.getBoundingClientRect())},[]),[s,r]=V.useState(!1),[a,l]=V.useState(1),d=V.useMemo(()=>e.date.startOf("day").set({hour:e.startHour}),[e.date,e.startHour]),c=V.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=V.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)(rd,{className:"h-planning-data-row",css:{borderBottom:"1px solid $gray200"},width:1,children:[(0,i.jsx)(rd,{css:{borderRight:"1px solid $gray200",width:"calc(2 * $cellWidth)"},children:e.renderLeftCell(e.row)}),(0,i.jsxs)(rd,{css:{flex:"1",py:"$3",position:"relative"},children:[(0,i.jsx)(yc,{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)(oY,{renderSlot:e.renderSlot,row:e.row,slot:t,startOfDay:d},n))}),e.showPlus&&(0,i.jsx)(yc,{css:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:5},gridtemplatecolumns:"repeat(1440, 1fr)",children:s&&(0,i.jsx)(rd,{align:"center",css:{gridColumn:`${a} / span 60`,padding:"$1"},height:1,justify:"center",children:(0,i.jsx)(rd,{align:"center",css:{background:"$gray100",borderRadius:"$1",color:"$gray800",cursor:"pointer",fontSize:"$textMd"},height:1,justify:"center",width:1,children:(0,i.jsx)(Id,{icon:"plus"})})})}),(0,i.jsx)(yc,{css:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:1},gridtemplatecolumns:"repeat(1440, 1fr)",children:(0,nm.A)(0,23).map(e=>(0,i.jsx)(ka,{css:{borderRightColor:"$gray200",borderInlineEndStyle:"dashed",borderInlineEndWidth:"1px","&:nth-child(2n)":{borderInlineEndStyle:"solid"},gridColumn:`${60*e+1} / ${60*e+61}`}},e))})]})]})},rY=e=>{const t=Ei(Cm),n=e.date.startOf("day").equals(e.minDate.startOf("day")),o=e.date.endOf("day").equals(e.maxDate.endOf("day"));return(0,i.jsxs)(rd,{css:{border:"1px solid $gray200",...e.css},direction:"column",width:1,children:[(0,i.jsxs)(rd,{css:{borderBottom:"1px solid $gray200"},height:52,width:1,children:[(0,i.jsxs)(rd,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:"calc(2 * $cellWidth)"},gap:"3",height:1,children:[(0,i.jsx)(Ih,{max:e.maxDate,min:e.minDate,value:e.date,onChange:e.onChange}),e.renderFilters?.()]}),(0,i.jsxs)(rd,{align:"center",css:{flex:"1",px:"$2"},gap:"3",children:[(0,i.jsx)(kd,{color:"white",disabled:n,leftIcon:"chevron-left",onClick:()=>{e.onChange(e.date.minus({day:1}))}}),(0,i.jsx)(ka,{css:{flex:"1",textTransform:"capitalize"},font:"gray800 textSm medium",textAlign:"center",children:t.toLocaleString(e.date,zs.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(kd,{color:"white",disabled:o,leftIcon:"chevron-right",onClick:()=>{e.onChange(e.date.plus({day:1}))}})]})]}),(0,i.jsxs)(rd,{css:{background:"$gray50",borderBottom:"1px solid $gray200"},height:24,width:1,children:[(0,i.jsx)(rd,{css:{borderRight:"1px solid $gray200",width:"calc(2 * $cellWidth)"}}),(0,i.jsx)(rd,{css:{flex:"1"},children:(0,i.jsxs)(yc,{gridtemplatecolumns:"repeat(1440, 1fr)",height:1,width:1,children:[(0,i.jsx)(ka,{css:{gridColumn:"span 60"}}),(0,nm.A)(e.startHour+2,e.startHour+24,2).map(e=>(0,i.jsxs)(rd,{align:"center",css:{fontSize:"$textXs",gridColumn:"span 120"},justify:"center",children:[(0,RG.A)((e>=24?e-24:e).toString(10),2,"0"),":00"]},e))]})})]}),e.data.map(t=>(0,i.jsx)(sY,{date:e.date,renderLeftCell:e.renderLeftCell,renderSlot:e.renderSlot,row:t,showPlus:e.showPlus,startHour:e.startHour,onPlus:e.onPlus},t.id.toString(10)))]})},aY=e=>{const{params:{organizationId:t,eventId:n}}=bd(),o=g(e.position.acronym)?e.position.acronym:e.position.name;return(0,i.jsxs)(rd,{css:{padding:"$1 $4"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(bm,{css:{overflow:"hidden",width:"100%"},to:Jo.POSITION({organizationId:t,eventId:n,positionId:e.position.id}),children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:o,width:1,children:o})}),(0,i.jsx)(ka,{color:"gray500",css:{ellipsis:!0},title:e.position.category.name,width:1,children:e.position.category.name})]})},lY=({shouldShowAssignButton:e=!0,...t})=>{const{translate:n,params:{organizationId:o,eventId:s}}=bd(),r=Ei(Yh),a="number"==typeof t.slot.assignedResources&&"number"==typeof t.slot.fillingRate&&"number"==typeof t.slot.resources;return(0,i.jsxs)(rd,{direction:"column",width:1,children:[(0,i.jsxs)(rd,{css:{borderBottom:"1px solid $gray200",padding:"$4 $3 $3 $6"},gap:"4",children:[(0,i.jsx)(Xv,{color:t.position.color,icon:t.position.icon}),(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(bm,{to:Jo.POSITION({organizationId:o,eventId:s,positionId:t.position.id}),children:(0,i.jsx)(ka,{css:{ellipsis:!0},width:1,children:t.position.name})}),(0,i.jsx)(ka,{color:"gray500",children:t.category.name})]})]}),(0,i.jsxs)(rd,{css:{padding:"$5 $6 $4 $6"},direction:"column",gap:"6",children:[(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{color:"gray500",children:n("nom_du_cr_neau_54351")}),(0,i.jsx)(ka,{font:"gray800 textSm medium",children:g(t.slot.name)?t.slot.name:"-"})]}),(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsx)(ka,{color:"gray500",children:n("cr_neau_horaire_28150")}),(0,i.jsx)(ka,{css:{textTransform:"capitalize"},font:"gray800 textSm medium",children:r.toDisplayString(t.slot.range,{formats:{displayWeekday:!0}})})]}),a&&(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsxs)(rd,{justify:"between",children:[(0,i.jsx)(ka,{color:"gray500",children:n("membres_11310")}),(0,i.jsxs)(ka,{color:"gray500",children:[t.slot.assignedResources,"/",t.slot.resources]})]}),(0,i.jsx)(ka,{css:{textTransform:"capitalize"},font:"gray800 textSm medium",children:(0,i.jsx)(u$,{percent:t.slot.fillingRate/100})})]})]}),e&&(0,i.jsx)(rd,{css:{padding:"$4"},gap:"4",justify:"end",children:(0,i.jsx)(kd,{to:fs.POSITION_SLOT_ASSIGN_VOLUNTEERS(o,s,t.position.id,t.slot.id),children:n("affecter_sur_le_19590")})})]})},dY=e=>{const t=ng(Ei(Yh),e.slot,"",{interval:{options:{hideDate:!0}},slot:{includeRange:!0}});return(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(rd,{align:"center",css:{background:xu(e.slot.fillingRate/100),borderRadius:"$1",cursor:"pointer",px:"$2",userSelect:"none"},height:1,width:1,children:(0,i.jsx)(ka,{css:{ellipsis:!0},font:"white textXs medium",title:t,width:1,children:t})})}),(0,i.jsx)(lu,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:460,children:(0,i.jsx)(lY,{category:e.position.category,position:e.position,slot:e.slot})})]})},cY=e=>{const{params:{eventId:t}}=bd(),n=Ei(TH),{infos:o,isEditMode:s,limit:r,nameDebounced:a,offset:l,predicates:d,setInfos:c,setLimit:u,setOffset:m}=SC(),{mutate:h}=function(e={}){return Di("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}=Oi("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:g(a)?a:void 0,predicates:d,limit:r,offset:l},[js.PositionPlanningFragment]);const{numberOfPages:_,totalCount:x}=ah(p.data?.rows),[I,v]=(0,V.useState)([]),b=(0,V.useMemo)(()=>As.c9.isDateTime(o.positionsPlanningStartAt)&&o.positionsPlanningStartAt?.isValid?o.positionsPlanningStartAt:As.c9.fromISO(o.positionsPlanningStartAt)?.isValid?As.c9.fromISO(o.positionsPlanningStartAt,{zone:"utc"}):As.IX.fromDateTimes(e.startAt.startOf("day"),e.endAt.endOf("day")).contains(As.c9.utc())?As.c9.utc():e.startAt,[e.startAt,e.endAt,o]),j=(0,V.useCallback)(t=>{c({...o,positionsPlanningStartAt:t?.toISO()??e.startAt.toISO()})},[e.startAt,o,c]),[C,y]=(0,V.useState)(!1),[A,S]=(0,V.useState)(e.startAt),[k,w]=(0,V.useState)(-1),E=(0,V.useMemo)(()=>{const t=tg(e.dayStartTime);return t?.[0]??0},[e.dayStartTime]),T=(0,V.useCallback)(async e=>{const{data:{row:n}}=await function(e,t){return Js("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:[js.PositionPlanningFragment]})}({eventId:t,positionId:e},await X());v(t=>t.map(t=>t.id===e?n:t))},[t]);return(0,V.useEffect)(()=>{v(p.data?.rows.nodes??[])},[p.data]),f||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",width:1,children:[(0,i.jsx)(rd,{css:{background:"white",flex:"1"},children:(0,i.jsx)(rY,{data:I,date:b,maxDate:e.endAt,minDate:e.startAt,renderLeftCell:e=>(0,i.jsx)(aY,{position:e}),renderSlot:(e,t)=>(0,i.jsx)(dY,{position:t,slot:e}),showPlus:s,startHour:E,onChange:j,onPlus:(e,t)=>{S(e),y(!0),w(t.id)}})}),(0,i.jsx)(lm,{children:(0,i.jsx)(rm,{limit:r,numberOfPages:_,offset:l,setLimit:u,setOffset:m,showLimits:!0,totalCount:x})})]}),C&&(0,i.jsx)(PH,{event:{endAt:e.endAt,startAt:e.startAt},slot:n.positionsSlotInputDefault(A),onClose:()=>{y(!1)},onSuccess:async e=>(await h({eventId:t,positionId:k,positionSlot:e}),T(k))})]})};function uY(e,t,n,i){const o=HK(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(),privateNote:"",color:o[`${e.querySelector("styleUrl")?.textContent||""}-normal`]||Ia.colors.primary500.value,icon:le.LocationDot,weezeventIsSynchronized:!1,layer:n,latitude:parseFloat(r),longitude:parseFloat(s),tracesIds:[],slots:[{startDate:i,startTime:"08:00",endDate:i,endTime:"09:00",resources:1}],conditionsOperator:Ie.And,positionsCustomFields:[],tagsIds:[],fields:{},leadersIds:[]}})(e,t,n,i,s))}const mY=e=>{const t=Ti(),{data:n,loader:o}=Oi("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 Di("mutation PositionsCreate($eventId: EventId!, $positions: [PositionInput!]!) {\n positionsCreate(eventId: $eventId, positions: $positions) {\n id\n }\n}\n",e)}(),[a,l]=(0,V.useState)(),[d,c]=(0,V.useState)(-1),u=g(a?.content)&&-1!==d;return(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(ka,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(Id,{icon:"cloud-arrow-up"})}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",textAlign:"center",children:t("importer_des_mi_32264")}),(0,i.jsx)(md,{height:"7"}),o||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(gG,{accept:Vx.Kml,format:"string",label:t("fichier_kml_55657"),placeholder:t("s_lectionnez_un_75984"),value:a,onChange:e=>{l(e)}}),(0,i.jsx)(md,{height:"4"}),(0,i.jsxs)(hh,{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)(md,{height:"7"}),(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[(0,i.jsx)(kd,{disabled:!u,isLoading:r,onClick:async()=>{a&&(await s({eventId:e.eventId,positions:uY(a.content,d,n.event.layer,n.event.startAt)}),window.location.reload())},children:t("importer_90688")}),(0,i.jsx)(kd,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},hY=({name:e,numberOfCategories:t,segment:n})=>{const{history:o,params:{organizationId:s,eventId:r},translate:a}=bd(),{columns:l}=SC(),{user:d}=Li(),{hasFeature:c}=_v(),{hasPermission:u}=dv(),{newPositionLatLng:m}=sK(),{data:h,isLoading:g}=Oi("query PositionsHeader($eventId: EventId!, $segmentId: SegmentId!) {\n event(id: $eventId) {\n key\n\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{mutate:p}=function(e={}){return Di("mutation PositionsExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $segmentId: SegmentId!\n $format: ExportFormat!\n $columns: [String!]!\n) {\n jobId: positionsExport(\n organizationId: $organizationId\n eventId: $eventId\n segmentId: $segmentId\n format: $format\n columns: $columns\n )\n}\n",e)}(),[f,_]=(0,V.useState)(!1),[x,I]=(0,V.useState)(!1),[v,b]=(0,V.useState)(!1),{checkExport:j}=HI(),[C,y]=(0,V.useState)(!1),[A,S]=(0,V.useState)(!1),k=u(Ov.POSITION_EDIT,{eventId:"ANY"}),w=u(Ov.POSITION_EDIT,{positionCategoryId:"ANY"}),E=(0,V.useMemo)(()=>{let e;return m&&(e=`${m.latitude},${m.longitude}`),fs.CREATE_POSITION(s,r,e)},[m]);return(0,i.jsxs)(zz,{name:(0,i.jsxs)(rd,{align:"center",css:{flex:"1",overflow:"hidden",position:"relative"},gap:"2",children:[(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray900 displaySm semiBold",title:e,children:e}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{color:"gray500",children:(0,i.jsx)(Id,{icon:"circle-exclamation"})})}),(0,i.jsxs)(bp,{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:[k?(0,i.jsx)(dE,{menu:(0,i.jsxs)(i.Fragment,{children:[c(Ae.KmlImport)&&(0,i.jsx)(ru,{color:0===t?"disabled":"default",icon:"file-import",onClick:()=>{_(!1),S(!0)},children:a("importer_des_mi_32264")}),(0,i.jsx)(ru,{icon:"file-import",to:Jo.POSITION_IMPORT_CSV({organizationId:s,eventId:r}),children:a("import_tasks_fr_52548")})]}),path:E,children:a("cr_er_une_missi_66818")}):w?(0,i.jsx)(kd,{onClick:()=>{o.push(E)},children:a("cr_er_une_missi_66818")}):null,k&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(nu,{isOpen:f,onStateChange:_,children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{icon:"plus",onClick:()=>{_(!1),y(!0)},children:a("cr_er_une_cat_g_20051")})}),(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"calendar",to:gf(h.event?.segment.links.positionsPlanningLink,"html"),children:a("voir_le_plannin_85187")}),(0,i.jsx)(ru,{icon:"calendar",to:gf(h.event?.segment.links.positionsVolunteersPlanningLink,"html"),children:a("voir_le_plannin_47650")}),(0,i.jsxs)(Mv,{permissions:Ov.POSITION_EDIT,children:[(0,i.jsx)(ru,{icon:"plug-circle-bolt",onClick:e=>{eu(e.target),I(!0)},children:a("exporter_via_l_09843")}),(0,i.jsx)(ru,{icon:"file-xls",onClick:e=>{eu(e.target),b(!0)},children:a("exporter_en_exc_51862")})]}),(0,i.jsx)(ru,{download:`${n.name}-positions-planning`,icon:"arrow-down-to-bracket",to:gf(h.event?.segment.links.positionsPlanningLink,"pdf"),children:a("t_l_charger_le_06050")}),(0,i.jsx)(ru,{download:`${n.name}-positions-volunteers-planning`,icon:"arrow-down-to-bracket",to:gf(h.event?.segment.links.positionsVolunteersPlanningLink,"pdf"),children:a("t_l_charger_le_02952")})]})]})]}),C&&(0,i.jsx)(OH,{eventId:r,onClose:()=>{y(!1)},onSuccess:({id:e})=>{o.push(Jo.POSITION_CATEGORY({organizationId:s,eventId:r,positionCategoryId:e}))}}),A&&(0,i.jsx)(mY,{eventId:r,onClose:()=>{S(!1)}}),!g&&(0,i.jsx)(bP,{isOpen:x,link:hf({organizationId:s,eventId:r,lang:d?.language,pathComponent:"positions",key:h.event.key}),onClose:()=>{I(!1)}}),!g&&(0,i.jsx)(jP,{isOpen:v,requestExport:async e=>{const{jobId:t}=await p({organizationId:s,eventId:r,segmentId:n.id,format:e,columns:l});j(t,s,r)},showIncludeFiles:!1,onClose:()=>{b(!1)}})]})]})},gY=e=>{const t=Ti(),n=Pi(),{hasPermission:o,updateLocalEvent:s}=dv(),{limit:r,nameDebounced:a,predicates:l,rendering:d,segment:c}=SC(),u=o(Ov.SEGMENT_EDIT)&&(d===jg.List||d===jg.SlotsList),m=o(Ov.POSITION_EDIT,{eventId:"ANY"})&&(d===jg.Calendar||d===jg.List||d===jg.SlotsList);return(0,V.useEffect)(()=>{s({positionBackPath:n.pathname,positionCategoryBackPath:n.pathname})},[c]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hY,{name:c.name,numberOfCategories:e.event.positionsCategories.length,segment:c}),0===e.event.numberOfPositions&&d!==jg.Map?(0,i.jsx)(Qv,{css:{overflow:"hidden"},children:(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(pA,{subtitle:t("plus_besoin_de_08254"),title:t("vous_n_avez_pas_08610")})})}):(0,i.jsxs)(Qv,{children:[(0,i.jsx)(Oz,{searchRow:(0,i.jsx)(Tz,{actions:d===jg.SlotsList?(0,i.jsx)(eK,{event:e.event}):(0,i.jsx)(AK,{}),searchPlaceholder:t("rechercher_une_69998"),showActions:o(Ov.POSITION_EDIT),showEditColumns:u,showEditMode:m,showSearchColumns:o(Ov.SEGMENT_EDIT)}),selectSegment:d===jg.SlotsList?(0,i.jsx)(wz,{pageSelectedText:t("les_1_cr_neau_31538",r),segmentSelectedText:t("les_1_cr_neau_33428",c.count,c.name)}):(0,i.jsx)(wz,{pageSelectedText:t("les_1_mission_95719",r),segmentSelectedText:t("les_1_mission_38484",c.count,c.name)})}),d===jg.List?(0,i.jsx)(zK,{customFields:e.customFields}):d===jg.Map?(0,i.jsx)(iY,{name:a,predicates:l}):d==jg.SlotsList?(0,i.jsx)(vK,{customFields:e.customFields,weezeventOrganizationId:e.weezeventOrganizationId}):(0,i.jsx)(cY,{dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,startAt:e.event.startAt})]})]})},pY=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,segmentId:r}}=bd(),{hasPermission:a,localEvent:l,updateLocalEvent:d}=dv(),c=Ei(HH),u=(0,V.useMemo)(()=>c.getPositionsFilters(e.event,e.customFields),[e.event,e.customFields]),m=(0,V.useMemo)(()=>c.getPositionsPossibleColumns(e.customFields,{isWeezeventConnected:e.event.isWeezeventConnected}),[e.customFields,e.event]);return(0,i.jsx)(oK,{eventId:s,organizationId:o,children:(0,i.jsx)(kz,{canSegmentEdit:a(Ov.SEGMENT_EDIT),eventId:s,filters:u,filtersButtonText:n("filtrer_les_mis_43681"),filtersSubtitle:n("appliquer_des_f_16037"),getSegmentPath:e=>fs.POSITIONS_SEGMENT(o,s,e),hideSegments:0===e.event.numberOfPositions,initialLimit:l?.positionsLimit??em,initialSegmentsOpen:l?.arePositionsSegmentsOpen??!0,organizationId:o,possibleColumns:m,possibleRenderings:[jg.List,jg.Calendar,jg.Map,jg.SlotsList],reload:e.reload,segmentId:r,segmentType:Me.Positions,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{d({positionsLimit:e})},onSegmentClick:e=>{d({positionsSegmentId:e})},onSegmentDelete:async()=>{await d({positionsSegmentId:null}),t.push(Jo.POSITIONS({organizationId:o,eventId:s}))},onSegmentsToggle:async e=>{await d({arePositionsSegmentsOpen:e})},children:(0,i.jsx)(gY,{customFields:e.customFields,event:e.event,weezeventOrganizationId:e.organization.weezeventOrganizationId})})})},fY=(0,V.memo)(function(){const{params:{organizationId:e,eventId:t},translate:n}=bd(),{event:{name:o},localEvent:s}=dv();Zc(`${o} ${n("missions_63972")}`);const{data:r,loader:a,reload:l}=Oi("query PositionsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(eventId: $eventId, 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 isWeezeventConnected\n\n positionsCategories {\n id\n name\n\n leaders {\n ...LeaderInfos\n }\n }\n\n traces {\n id\n name\n }\n\n segmentsFolders(segmentType: Positions) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,eventId:t},[js.SegmentCustomFieldFragment,js.LeaderInfosFragment,js.SegmentsFoldersSegmentsFragment]),d=(0,V.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:fs.POSITIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(pY,{customFields:r.organization.customFields.nodes,event:r.event,organization:r.organization,reload:l})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:fs.POSITIONS_SEGMENT(e,t,s?.positionsSegmentId&&d.includes(s.positionsSegmentId)?s?.positionsSegmentId:d[0]),replace:!0})})]})}),_Y=xa("div",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontWeight:"$regular"}}),xY=xa("div",{color:"$gray500","@tablet":{color:"$gray800",fontWeight:"$medium"}}),IY=e=>{const{translate:t}=bd();return(0,i.jsx)($k,{title:t("param_tres_78420"),children:(0,i.jsx)(rd,{direction:"column",gap:"4",width:1,children:Bs(e.customFields)?(0,i.jsx)(KN,{children:e.customFields.map(({customField:t,conditionValue:n})=>(0,i.jsx)(V.Fragment,{children:(0,i.jsxs)(rd,{direction:"column",gap:"1",justify:"between",children:[(0,i.jsx)(_Y,{children:t.name}),(0,i.jsx)(xY,{children:e.renderValue(t,n)})]})},t.slug))}):(0,i.jsx)(ka,{color:"gray500",textAlign:"center",width:1,children:t("aucune_conditio_36491")})})})};n(7411);const vY=(0,V.forwardRef)((e,t)=>{const n=(0,V.useRef)(null),o=(0,V.useMemo)(()=>e.max===1/0?1:0===e.max?1/0:e.value/e.max,[e.max,e.value]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n circle-progress::part(base) {\n width: 70px;\n height: auto;\n }\n\n circle-progress::part(value) {\n stroke-width: 8;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke: ${xu(o)};\n }\n\n circle-progress::part(text) {\n font-family: var(--fonts-grafik);\n fill: var(--colors-gray800);\n font-size: var(--fontSizes-textXs);\n font-size: 24px; /* For some reason the above rule applies the correct size value, but the text renders smaller. */\n font-weight: var(--fontWeights-medium);\n }\n `}}),(0,i.jsx)("circle-progress",{ref:e=>{n.current=e,"function"==typeof t?t(e):t&&(t.current=e)},max:e.max,"text-format":e.textFormat,value:e.value})]})});vY.displayName="ProgressCircle";const bY=e=>{const{translate:t}=bd(),n=om();return(0,i.jsx)($k,{css:{flex:"1 1 auto",inlineSize:"unset"},title:e.title,children:(0,i.jsxs)(rd,{direction:"column",...n?{gap:"9"}:{gap:"7"},gap:"1",width:1,children:[(0,i.jsxs)(rd,{gap:"4",height:78,children:[(0,i.jsx)(vY,{"aria-label":e.title,max:e.position.resources,textFormat:"percent",value:e.position.assignedResources}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",justify:"center",children:[(0,i.jsxs)(Od,{css:{fontSize:"$textXl",lineHeight:"122.222%","& > .numerator":{fontSize:"$displayMd",fontWeight:"$semiBold",letterSpacing:"-0.72px"}},children:[(0,i.jsx)("span",{className:"numerator",children:e.position.assignedResources}),"/",(0,i.jsx)("span",{className:"denominator",children:e.position.resources})]}),e.position.numberOfSlots&&(0,i.jsx)(Od,{css:{fontSize:"$textXs"},textStyle:"subtitle",children:t("spread_over_1_54650",e.position.numberOfSlots)})]})]}),(0,i.jsx)(rd,{children:(0,i.jsx)(vu,{color:"orange",leftIcon:"user-group",children:t("_1_membre_pr_32812",e.position.preassignedResources)})})]})})},jY=e=>(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",justify:"center",children:[(0,i.jsx)(Od,{css:{fontSize:"$displayMd",fontWeight:"$semiBold"},children:e.value}),(0,i.jsx)(Od,{textStyle:"subtitle",children:e.description})]}),CY=e=>{const{params:{eventId:t,positionId:n},translate:o}=bd(),{data:s,isLoading:r}=Oi("query PositionKpis($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n position(id: $positionId) {\n slots {\n fillingRate\n }\n }\n }\n}\n",{eventId:t,positionId:n},[]),a=(0,V.useMemo)(()=>s.event?{below25:s.event.position.slots.filter(e=>e.fillingRate<25).length,between25and50:s.event.position.slots.filter(e=>e.fillingRate>=25&&e.fillingRate<50).length,between50and75:s.event.position.slots.filter(e=>e.fillingRate>=50&&e.fillingRate<75).length,above75:s.event.position.slots.filter(e=>e.fillingRate>=75&&e.fillingRate<100).length,complete:s.event.position.slots.filter(e=>100===e.fillingRate).length,overquota:s.event.position.slots.filter(e=>e.fillingRate>100).length}:{below25:1/0,between25and50:1/0,between50and75:1/0,above75:1/0,complete:1/0,overquota:1/0},[s.event?.position?.slots]);return(0,i.jsx)($k,{css:{flex:"2 1 auto",inlineSize:"unset"},title:e.title,children:r?(0,i.jsx)(fm,{}):(0,i.jsxs)(rd,{gap:"4",width:1,children:[(0,i.jsx)(jY,{description:o("below_25_26800"),value:a.below25}),(0,i.jsx)(jY,{description:o("between_25_and_61597"),value:a.between25and50}),(0,i.jsx)(jY,{description:o("between_50_and_79860"),value:a.between50and75}),(0,i.jsx)(jY,{description:o("over_75_74073"),value:a.above75}),(0,i.jsx)(jY,{description:o("complet_51600"),value:a.complete}),(0,i.jsx)(jY,{description:o("au_dessus_du_qu_60828"),value:a.overquota})]})})},yY=e=>{const t=Ti(),{hasPermission:n}=dv(),o=n(Ov.MEMBER_ASSIGN,{positionCategoryId:e.positionSlot.positionCategoryId,positionId:e.positionSlot.positionId}),{mutate:s}=Dr(),{mutate:r}=Qr(),[a,l]=(0,V.useState)(!1),d=e.volunteerRegistration.positionSlotUserInfo;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{children:[d.state===lt.Waiting&&(0,i.jsx)(ru,{icon:"clock",onClick:async()=>{await s({eventId:e.eventId,checkIn:{strategy:At.CheckIn,positionsSlotsUsersInfosIds:[d.id]}}),e.reload()},children:t("pointer_1_57919",e.volunteerRegistration.userInfo.name)}),d.state===lt.CheckedIn&&(0,i.jsx)(ru,{icon:"clock",onClick:async()=>{await s({eventId:e.eventId,checkIn:{strategy:At.CheckOut,positionsSlotsUsersInfosIds:[d.id]}}),e.reload()},children:t("d_pointer_1_08337",e.volunteerRegistration.userInfo.name)}),(0,i.jsx)(ru,{icon:"circle-check",onClick:()=>l(!0),children:t("mettre_jour_l_00128")}),d.state!==lt.Waiting&&(0,i.jsx)(ru,{icon:"arrows-rotate",onClick:async()=>{await s({eventId:e.eventId,checkIn:{strategy:At.Reset,positionsSlotsUsersInfosIds:[d.id]}}),e.reload()},children:t("remettre_z_ro_11572")}),o&&(0,i.jsx)(ru,{color:"red",icon:"user-xmark",onClick:async()=>{await r({eventId:e.eventId,massAssign:{positionsSlotsIds:[e.positionSlot.id],selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:yt.Delete}}),e.reload()},children:t("d_saffecter_du_47122")})]}),(0,i.jsx)(lA,{isOpen:a,positionSlotUserInfo:d,onClose:()=>{e.reload(),l(!1)}})]})},AY=e=>{const{translate:t,params:{eventId:n}}=bd(),o=Ei(Cm),s=Ei(CC);return(0,i.jsxs)(am,{css:{"&:hover":{background:"$gray100"}},children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(ub,{userInfo:e.volunteerRegistration.userInfo})}),(0,i.jsx)(Qu,{children:e.volunteerRegistration.positionSlotUserInfo.state===lt.CheckedOut?(0,i.jsx)(vu,{leftIcon:"clock",children:t("temps_total_79448",s.minutesToHoursMinutesString(e.volunteerRegistration.positionSlotUserInfo.timeDifferenceMinutes))}):e.volunteerRegistration.positionSlotUserInfo.state===lt.CheckedIn?(0,i.jsx)(vu,{color:"success",leftIcon:"circle",leftIconStyle:"solid",size:"sm",children:t("point_le_1_63576",o.toLocaleString(e.volunteerRegistration.positionSlotUserInfo.checkInAt.toLocal(),zs.DateTime))}):(0,i.jsx)(vu,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",size:"sm",children:t("non_point_42145")})}),(0,i.jsx)(jm,{justify:"end",children:(0,i.jsx)(yY,{eventId:n,positionSlot:e.positionSlot,reload:e.reload,volunteerRegistration:e.volunteerRegistration})})]})},SY=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,positionId:s,positionSlotId:r}}=bd(),a=Ei(Yh),[l,d]=(0,V.useState)(0),[c,u]=(0,V.useState)({direction:re.Asc,attribute:rn.Name}),{data:m,isLoading:h,reload:g}=Oi("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 breakTime\n checkInAt\n checkOutAt\n eventId\n id\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}=ah(m.event?.volunteersRegistrations),_=(0,V.useMemo)(()=>m.event?.positionSlot?m.event.positionSlot.resources-m.event.positionSlot.assignedResources:0,[m.event?.positionSlot]),{hasPermissions:x}=dv(),[I]=h?[!1]:x([Ov.MEMBER_ASSIGN],{positionCategoryId:m.event.positionSlot.positionCategoryId,positionId:s});return(0,i.jsxs)(Jm,{returnToFallback:Jo.POSITION({organizationId:n,eventId:o,positionId:s}),size:"md",children:[(0,i.jsx)(yb,{children:(0,i.jsx)(rd,{direction:"column",gap:"1",width:1,children:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ju,{borderRadius:"$1",height:28,width:1}),(0,i.jsx)(ju,{borderRadius:"$1",height:20,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{children:m.event.positionSlot.name||"-"}),(0,i.jsx)(ka,{font:"gray500 textSm regular",children:a.toDisplayString(m.event.positionSlot.range)})]})})}),(0,i.jsxs)(Qm,{children:[(0,i.jsx)(md,{height:"5"}),(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{children:t("liste_des_membr_89037")}),m.event?_>0?(0,i.jsx)(vu,{color:"warning",children:t("_1_membre_manq_31014",_)}):(0,i.jsx)(vu,{color:"success",children:t("complet_51600")}):null]}),(0,i.jsx)(md,{height:"2"}),(0,i.jsxs)(Hu,{children:[(0,i.jsxs)(Wu,{children:[(0,i.jsx)(fp,{attribute:rn.Name,setSort:e=>{d(0),u(e)},sort:c,children:t("nom_08311")}),(0,i.jsx)(pm,{children:t("State")}),(0,i.jsx)(pm,{width:100})]}),h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):m.event.volunteersRegistrations.nodes.map(e=>(0,i.jsx)(AY,{positionSlot:m.event.positionSlot,reload:g,volunteerRegistration:e},e.id)),(0,i.jsx)(lm,{children:(0,i.jsx)(rm,{numberOfPages:p,offset:l,setOffset:d,totalCount:f})})]}),(0,i.jsx)(md,{height:"5"})]}),(0,i.jsx)(eh,{children:(0,i.jsxs)(rd,{gap:"3",justify:"end",children:[I&&(0,i.jsx)(kd,{onClick:()=>{e.push(fs.POSITION_SLOT_ASSIGN_VOLUNTEERS(n,o,s,r))},children:t("affecter_des_me_30349")}),(0,i.jsx)(kd,{color:"white",onClick:()=>e.goBack(Jo.POSITION_SLOT({organizationId:n,eventId:o,positionId:s,positionSlotId:r})),children:t("fermer_62479")})]})})]})},kY=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=bd(),r=Ei(Yh),{hasPermissions:a}=dv(),l=Ei(TH),{mutate:d}=Fl(),{mutate:c}=Dr(),{mutate:u}=function(e={}){return Di("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,h]=(0,V.useState)(!1),[p,f]=(0,V.useState)(!1),_=(0,V.useMemo)(()=>r.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}}),[e.slot]),[x,I]=a([Ov.POSITION_EDIT,Ov.MEMBER_ASSIGN],{positionCategoryId:e.slot.positionCategoryId,positionId:e.slot.positionId});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(am,{css:{cursor:"pointer"},onClick:()=>{t.push(fs.POSITION_SLOT_MEMBERS(o,s,e.slot.positionId,e.slot.id))},children:[(0,i.jsx)(Qu,{align:"start",direction:"column",justify:"center",children:(0,i.jsx)(ka,{font:"gray900 textSm medium",children:g(e.slot.name)?e.slot.name:"-"})}),(0,i.jsx)(Qu,{css:{textTransform:"capitalize"},children:_}),(0,i.jsx)(Qu,{children:(0,i.jsx)(O$,{assignedResources:e.slot.assignedResources,resources:e.slot.resources})}),(0,i.jsx)(jm,{justify:"end",children:(0,i.jsxs)(vm,{children:[I&&(0,i.jsx)(ru,{icon:"wand-magic-sparkles",to:fs.POSITION_SLOT_ASSIGN_VOLUNTEERS(o,s,e.slot.positionId,e.slot.id),children:n("affecter_des_me_30349")}),x&&(0,i.jsx)(ru,{icon:"pen",onClick:()=>{h(!0)},children:n("_diter_62574")}),x&&(0,i.jsx)(ru,{color:e.slot.assignedResources>0?"disabled":"red",icon:"trash-can",onClick:()=>{f(!0)},children:n("supprimer_43083")}),(0,i.jsx)(ru,{icon:"clock",onClick:async()=>{await c({eventId:s,checkIn:{strategy:At.CheckIn,positionsSlotsIds:[e.slot.id]}})},children:n("pointer_les_mem_50347")}),(0,i.jsx)(ru,{icon:"clock",onClick:async()=>{await c({eventId:s,checkIn:{strategy:At.CheckOut,positionsSlotsIds:[e.slot.id]}})},children:n("d_pointer_les_m_17150")})]})})]}),m&&(0,i.jsx)(PH,{event:e.event,slot:l.positionsSlotInputDefault(e.event.startAt,e.slot),onClose:()=>{h(!1)},onSuccess:async t=>{await d({eventId:s,positionId:e.slot.positionId,positionSlotId:e.slot.id,positionSlot:t}),e.reload()}}),p&&(0,i.jsx)(DA,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_48876")],text:n("suppression_de_73669",_),onClose:()=>{f(!1)},onDelete:async()=>{await u({eventId:s,positionId:e.slot.positionId,positionSlotId:e.slot.id}),e.reload()}})]})},wY=()=>{const{translate:e,params:{eventId:t,positionId:n}}=bd(),[o,s,r]=gm(""),[a,l]=ZR("position.slots.date",As.c9.invalid("Invalid"),gp),[d,c]=(0,V.useState)(0),[u,m]=ZR("position.slots.sort",null),{data:h,isLoading:p,reload:f}=Oi("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:g(s)?s:void 0,date:a.isValid?a:void 0,offset:d,sort:u},[js.PositionPositionSlotFragment]);const{numberOfPages:_,totalCount:x}=ah(h.event?.positionsSlots),I=(0,V.useCallback)(e=>{m(e),c(0)},[m,c]);return(0,i.jsx)(dm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:o,onChange:r})}),(0,i.jsx)(ka,{width:200,children:(0,i.jsx)(Ih,{max:h.event?.endAt,min:h.event?.startAt,value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fp,{attribute:en.Name,setSort:I,sort:u,children:e("nom_du_cr_neau_54351")}),(0,i.jsx)(fp,{attribute:en.Range,setSort:I,sort:u,children:e("cr_neau_11117")}),(0,i.jsx)(pm,{children:e("remplissage_75916")}),(0,i.jsx)(pm,{width:100})]}),numberOfPages:_,offset:d,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:h.event.positionsSlots.nodes.map(e=>(0,i.jsx)(kY,{event:h.event,reload:f,slot:e},e.id))}),setOffset:c,title:e("liste_des_cr_ne_86148"),totalCount:x})},EY=()=>{const{params:{organizationId:e,eventId:t,positionId:n},translate:o}=bd(),s=Ei(Yh),{roles:r}=_v(),{hasPermission:a}=dv(),{data:l,loader:d,reload:c}=Pl({organizationId:e,eventId:t,positionId:n}),{mutate:u}=jl(),{mutate:m}=Ar(),h=a(Ov.POSITION_EDIT,{positionCategoryId:l.event?.position.positionCategoryId,positionId:n}),g=(0,V.useMemo)(()=>l?.event?.position?.slots?.filter(e=>e.fillingRate>100),[l?.event?.position?.slots]),p=Ri();return d||(0,i.jsx)(Qv,{gap:"4",children:(0,i.jsxs)(Zu.Provider,{value:{designSystem:Yu},children:[Bs(g)&&(0,i.jsxs)(zd,{alertStyle:"warning",children:[(0,i.jsx)($d,{children:o("certains_cr_nea_52758")}),(0,i.jsx)(Pd,{children:[...p(o("les_cr_neaux_su_69909","{1}"),(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:g.map(e=>(0,i.jsx)("li",{children:ng(s,e,l.event.position.name,{slot:{includeRange:!0}})},e.id))}))]})]}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(bY,{position:l.event.position,title:o("remplissage_de_52564")}),(0,i.jsx)(CY,{position:l.event.position,title:o("taux_de_remplis_12961")})]}),Bs(l.organization.customFields.nodes)&&(0,i.jsx)(IY,{customFields:l.organization.customFields.nodes.map(e=>({customField:e,conditionValue:null})),renderValue:e=>(0,i.jsx)(nA,{field:e,fields:l.event.position.fields})}),(0,i.jsx)(wY,{}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsxs)(rd,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Aw,{leaders:l.event.position.leaders,reload:c,roles:r.positionRoles,onSave:e=>u({eventId:t,massLeaders:{leaders:e,selecteds:{ids:[n]},strategy:yt.Replace}})}),(0,i.jsx)(IY,{customFields:l.event.position.customFields,renderValue:(e,t)=>KF(o,e,t)}),(0,i.jsx)(Kk,{modalSubtitle:o("ajouter_des_tag_64526"),reload:c,tags:l.event.position.tags,...h?{associateTags:e=>m({eventId:t,massEdit:{reset:!1,selecteds:{ids:[n]},slug:Jt.Tag,strategy:yt.Replace,value:e}})}:{}})]}),(0,i.jsxs)(rd,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Uk,{description:l.event.position.description}),(0,i.jsx)(eL,{location:l.event.position}),(0,i.jsx)(Wk,{privateNote:l.event.position.privateNote})]})]}),(0,i.jsx)(Ea.qh,{path:fs.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(SY,{})})]})})},TY=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),s=Ei(Fg),{canCustomFieldRead:r,canMemberAccredit:a,canMemberAssign:l,canMemberEdit:d}=Dv(),[c,u]=ZR("positionMembers.columns",[Pg.Name,Pg.Positions]),[m,h]=ZR("positionMembers.limit",em),[g,p]=ZR("positionMembers.predicates",[]),[f,_]=ZR("positionMembers.sort",null),{data:x}=na({organizationId:n,eventId:o,privacy:r&&d?Re.All:Re.Public,loadCustomDocuments:!1,loadForms:!1,loadSegments:!1}),I=(0,V.useMemo)(()=>x.organization?.customFields.nodes??[],[x.organization]),v=jC(I),b=(0,V.useMemo)(()=>x.event?s.getPositionMembersFilters(n,o,I,x.event):[],[o,I,x.event]),j=(0,V.useMemo)(()=>s.getPositionMembersPossibleColumns(I),[I]),C=(0,V.useMemo)(()=>({positionCategoryId:e.positionCategoryId,positionId:e.positionId,preassignedPositionCategoryId:e.preassignedPositionCategoryId,preassignedPositionId:e.preassignedPositionId}),[e.positionCategoryId,e.positionId,e.preassignedPositionCategoryId,e.preassignedPositionId]);return(0,i.jsx)(Qv,{children:(0,i.jsx)(up,{columns:c,columnsSearch:[],columnsToIncludes:Mg,eventId:o,filters:b,getMassActionId:e=>e.userInfo.id,limit:m,loadDataList:aa,loadDataListParams:{includeCanRegistrationStateUpdate:!0,includeIsEditable:!0,positionCategoryId:e.positionCategoryId,positionId:e.positionId,preassignedPositionCategoryId:e.preassignedPositionCategoryId,preassignedPositionId:e.preassignedPositionId},loadRow:sa,loadRowParams:{includeCanRegistrationStateUpdate:!0,includeIsEditable:!0},organizationId:n,possibleColumns:j,predicates:g,renderActions:(e,t,n)=>(0,i.jsx)(zL,{massActions:e,predicates:g,scope:C,showOnlyMassEdit:!0,sort:f,totalNumberOfMembers:t,onMassEditSuccess:n}),renderAllSelectedText:e=>t("les_1_membres_31409",e),renderPageSelectedText:e=>t("les_1_membres_00895",e),renderSelectAllText:e=>t("s_lectionner_le_34300",e),rendering:Cg.List,setColumns:u,setLimit:h,setPredicates:p,setSort:_,showEditColumns:d,showEditMode:d,showFilters:!0,showMassActions:d,showPredicatesBadges:!0,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,showSelectAll:!0,sort:f,children:(0,i.jsx)(yp,{renderCell:(e,t,n)=>(0,i.jsx)(Uy,{canChangeDelegation:d,canMemberAccredit:a,canMemberAssign:l,column:e,customField:v.get(e.slug),eventId:o,reloadRow:n,row:t})})})})},RY=e=>(0,i.jsx)(rd,{align:"center",css:{padding:"$2 $4"},direction:"column",height:1,justify:"center",width:1,children:(0,i.jsx)(ub,{size:32,userInfo:e.vr.userInfo})}),OY=()=>{const{translate:e}=bd();return(0,i.jsx)(rd,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",px:"$2"},height:1,width:1,children:(0,i.jsx)(ka,{css:{ellipsis:!0},font:"gray800 textXs medium",textAlign:"center",width:1,children:e("disponible_69523")})})},DY=e=>{const t=Ei(Yh),n=(0,V.useMemo)(()=>pu(e.slot.position.color),[e.slot]),o=(0,V.useMemo)(()=>ng(t,e.slot.positionSlot,e.slot.position.name,{position:{includeName:e.shouldShowPositionName??!0},slot:{includeRange:!0}}),[e.slot]);return(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(rd,{align:"center",css:{background:n[50],border:`1px solid ${n[500]}`,borderRadius:"$1",color:n[700],cursor:"pointer",px:"$2"},height:1,width:1,children:(0,i.jsx)(ka,{css:{ellipsis:!0},fontSize:"textXs",fontWeight:"medium",textAlign:"center",title:o,width:1,children:o})})}),(0,i.jsx)(lu,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:460,children:(0,i.jsx)(lY,{category:e.slot.positionCategory,position:e.slot.position,shouldShowAssignButton:e.shouldShowAssignButton,slot:e.slot.positionSlot})})]})},zY=e=>"assignment"===e.slot.type?(0,i.jsx)(DY,{shouldShowAssignButton:e.shouldShowAssignButton,shouldShowPositionName:e.shouldShowPositionName,slot:e.slot}):(0,i.jsx)(OY,{}),$Y=e=>{const{params:{organizationId:t,eventId:n,positionId:o},translate:s}=bd(),[r,a]=(0,V.useState)(null),[l,d]=(0,V.useState)(0),[c,u,m]=gm(""),h=Ei(Fg),[p,f]=ZR("positionMembers.columns",[Pg.Name,Pg.Positions]),[_,x]=ZR("positionMembers.limit",em),[I,v]=ZR("positionMembers.predicates",[]),[b,j]=ZR("positionMembers.sort",null),{data:C,loader:y}=Hl({eventId:n,positionId:o,predicates:I,name:g(u)?u:void 0,limit:_,offset:l}),[A,S]=(0,V.useState)(!0),k=(0,V.useMemo)(()=>e.customFields.nodes??[],[e.customFields]),w=(0,V.useMemo)(()=>C.data?h.getPositionMembersFilters(t,n,k,C.data):[],[n,k,C.data]),E=(0,V.useMemo)(()=>h.getPositionMembersPossibleColumns(k),[k]),T=(0,V.useMemo)(()=>As.c9.isDateTime(r)&&r?.isValid?r:As.c9.fromISO(r)?.isValid?As.c9.fromISO(r,{zone:"utc"}):As.IX.fromDateTimes(e.startAt.startOf("day"),e.endAt.endOf("day")).contains(As.c9.utc())?As.c9.utc():e.startAt,[e.startAt,e.endAt,r]),R=(0,V.useCallback)(t=>{a(t?.toISO()??e.startAt.toISO())},[e.startAt,a]),O=(0,V.useMemo)(()=>{const t=tg(e.dayStartTime);return t?.[0]??0},[e.dayStartTime]),D=(0,V.useMemo)(()=>(C.data?.rows.nodes??[]).map(e=>({...e,slots:e.slots.flatMap(e=>A?[{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})))})),[C.data,A]);return y||(0,i.jsx)(Qv,{children:(0,i.jsxs)(up,{columns:p,columnsSearch:[],columnsToIncludes:Mg,eventId:n,filters:w,limit:_,loadDataList:Kl,loadDataListParams:{level:n?ke.Event:ke.Organization},loadRow:Ml,name:c,organizationId:t,possibleColumns:E,predicates:I,rendering:bg.List,setColumns:f,setLimit:x,setName:m,setPredicates:v,setSort:j,showEditColumns:!1,showEditMode:!1,showFilters:!0,showMassActions:!1,showPredicatesBadges:!0,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,sort:b,children:[(0,i.jsx)(rd,{css:{background:"white",flex:"1"},children:(0,i.jsx)(rY,{data:D,date:T,maxDate:e.endAt,minDate:e.startAt,renderFilters:()=>(0,i.jsx)(ka,{width:40,children:(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(kd,{color:"white",leftIcon:A?"eye":"eye-slash",onClick:()=>S(!A)})}),(0,i.jsx)(bp,{placement:"top",children:s(A?"masquer_les_dis_82263":"afficher_les_di_01534")})]})}),renderLeftCell:e=>(0,i.jsx)(RY,{vr:e}),renderSlot:e=>(0,i.jsx)(zY,{shouldShowAssignButton:!1,shouldShowPositionName:!1,slot:e}),showPlus:!1,startHour:O,onChange:R})}),(0,i.jsx)(lm,{children:(0,i.jsx)(rm,{itemName:s("membres_67337"),limit:_,numberOfPages:C.data.rows.numberOfPages,offset:l,setLimit:x,setOffset:d,showLimits:!0,totalCount:C.data.rows.totalCount})})]})})},PY=e=>{const{params:{organizationId:t,eventId:n}}=bd(),{data:o,loader:s}=Oi("query OrganizationCustomFields($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n ...OrganizationCustomFields\n }\n}\n",{organizationId:t,eventId:n},[js.OrganizationCustomFieldsFragment]);return s||(0,i.jsx)($Y,{customFields:o.organization.customFields,...e})},MY=e=>{const{params:{organizationId:t,eventId:n,positionId:o},translate:s}=bd();return(0,i.jsxs)(Jk,{children:[(0,i.jsx)(Xk,{to:Jo.POSITIONS({organizationId:t,eventId:n}),children:s("missions_63972")}),(0,i.jsx)(Xk,{to:Jo.POSITION_CATEGORY({organizationId:t,eventId:n,positionCategoryId:e.position.positionCategoryId}),children:e.position.positionCategoryName}),(0,i.jsx)(Xk,{isCurrent:!0,to:Jo.POSITION({organizationId:t,eventId:n,positionId:o}),children:e.position.name})]})},FY=()=>{const{history:e,params:{organizationId:t,eventId:n,positionId:o},translate:s}=bd(),{user:r}=Li(),{data:a,isLoading:l}=Oi("query PositionHeader($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n position(id: $positionId) {\n id\n name\n acronym\n icon\n color\n positionCategoryId\n positionCategoryName\n range\n assignedResources\n\n links {\n positionPlanningLink\n positionSheetLink\n }\n }\n }\n}\n",{eventId:n,positionId:o},[]),{hasPermission:d}=dv(),c=!l&&d(Ov.POSITION_EDIT,{positionCategoryId:a.event.position.positionCategoryId}),u=Ei(Yh),m=SK(),h=MN(),[g,p]=(0,V.useState)(!1),f=(0,V.useMemo)(()=>a.event?.position,[a.event]);return(0,i.jsx)(eb,{acronym:f?.acronym,breadcrumbs:f&&(0,i.jsx)(MY,{position:f}),buttons:f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kd,{color:"white",download:`${f.name}-position-sheet`,to:gf(f.links.positionSheetLink,"pdf",{lang:r?.language}),children:s("t_l_charger_la_16259")}),(0,i.jsx)(Mv,{permissions:Ov.POSITION_EDIT,scope:{positionCategoryId:f.positionCategoryId,positionId:f.id},children:(0,i.jsx)(kd,{to:fs.EDIT_POSITION(t,n,f.id),children:s("_diter_la_missi_90442")})}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{download:`${f.name}-position-planning`,icon:"arrow-down-to-bracket",target:"_blank",to:gf(f.links.positionPlanningLink,"pdf",{lang:r?.language}),children:s("t_l_charger_le_06050")}),(0,i.jsx)(ru,{icon:"arrow-down-to-bracket",onClick:()=>h(wN,{positionId:o}),children:s("exporter_les_me_63676")}),c&&(0,i.jsx)(ru,{icon:"clone",onClick:async()=>await m(f.id),children:s("dupliquer_28256")})]}),(0,i.jsx)(MA,{children:c&&(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:async()=>p(!0),children:s("supprimer_43083")})})]})]}),g&&(0,i.jsx)(kK,{position:f,onClose:()=>p(!1),onSuccess:()=>e.replace(Jo.POSITIONS({organizationId:t,eventId:n}))})]}),color:f?.color,icon:f?.icon,isLoading:l,name:f?.name,subtext:f?.range&&u.toComponents(f.range,{hideTime:!0,formats:{separator:" → ",localeFormat:zs.DateOnly.MonthShort}})})},NY=e=>{const{params:{organizationId:t,eventId:n,positionId:o},translate:s}=bd();Zc(e.event.position.name);const r=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":n,positionId:e?":positionId":o});return(0,i.jsxs)(nb,{children:[(0,i.jsx)(FY,{}),(0,i.jsxs)(rb,{css:{flex:"1"},children:[(0,i.jsxs)(ob,{css:{px:"$7"},children:[(0,i.jsx)(ib,{path:Jo.POSITION_DASHBOARD(r(!1)),children:s("tableau_de_bord_24627")}),(0,i.jsx)(ib,{path:Jo.POSITION_MEMBERS(r(!1)),children:s("membres_125561",e.event.volunteersRegistrations.totalCount)}),(0,i.jsx)(ib,{path:Jo.POSITION_PREASSIGNED_MEMBERS(r(!1)),children:s("membres_pr_aff_93093",e.event.position.preassignedResources)}),(0,i.jsx)(ib,{path:Jo.POSITION_PLANNING(r(!1)),children:s("planning_63989")})]}),(0,i.jsx)(sb,{path:[Jo.POSITION_DASHBOARD(r(!0)),fs.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId")],children:(0,i.jsx)(EY,{})}),(0,i.jsx)(sb,{path:Jo.POSITION_MEMBERS(r(!0)),children:(0,i.jsx)(TY,{positionId:o})}),(0,i.jsx)(sb,{path:Jo.POSITION_PREASSIGNED_MEMBERS(r(!0)),children:(0,i.jsx)(TY,{preassignedPositionId:o})}),(0,i.jsx)(sb,{path:Jo.POSITION_PLANNING(r(!0)),children:(0,i.jsx)(PY,{dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,startAt:e.event.startAt})})]})]})},LY=()=>{const{params:{organizationId:e,eventId:t,positionId:n}}=bd(),{data:o,loader:s}=Oi("query Position($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n dayStartTime\n startAt\n endAt\n\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)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{exact:!0,path:Jo.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(Fi,{path:Jo.POSITION_DASHBOARD({organizationId:e,eventId:t,positionId:n}),replace:!0})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(NY,{event:o.event})})]})},BY=e=>{const t=Ti(),{mutate:n}=function(e={}){return Di("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)(Ej,{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)(ka,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(SI,{label:t("description_58935"),name:"positionCategory.description"})})})},VY=e=>{const t=Ti(),{hasPermission:n}=dv(),o=n(Ov.POSITION_EDIT,{positionCategoryId:e.category.id}),[s,r]=(0,V.useState)(!1),a=g(e.category.description);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($k,{rightIcon:o?a?"pen":"plus":void 0,rightIconClick:()=>{r(!0)},title:t("description_58935"),children:a?(0,i.jsx)(jf,{text:e.category.description}):(0,i.jsx)(ka,{color:"gray500",textAlign:"center",width:1,children:t("aucune_descript_25737")})}),o&&s&&(0,i.jsx)(BY,{eventId:e.eventId,positionCategory:e.category,reload:e.reload,onClose:()=>{r(!1)}})]})},UY=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=bd(),r=Ei(Yh),a=(0,V.useMemo)(()=>e.position.resources-e.position.assignedResources,[e.position]);return(0,i.jsxs)(am,{onClick:()=>{t.push(Jo.POSITION({organizationId:o,eventId:s,positionId:e.position.id}))},children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(bm,{to:Jo.POSITION({organizationId:o,eventId:s,positionId:e.position.id}),children:e.position.name})}),(0,i.jsx)(Qu,{children:(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{font:"gray900 textSm medium",children:e.position.range?r.toLocaleString(e.position.range,void 0,{day:"numeric",month:"short",year:"numeric"}):"-"}),(0,i.jsx)(ka,{font:"gray500 textSm regular",children:n("creneau",e.position.numberOfSlots)})]})}),(0,i.jsx)(Qu,{children:a>0?(0,i.jsx)(vu,{color:"warning",children:n("_1_membre_manq_31014",a)}):(0,i.jsx)(vu,{color:"success",children:n("complet_51600")})}),(0,i.jsx)(jm,{justify:"end",children:(0,i.jsxs)(vm,{children:[(0,i.jsx)(ru,{icon:"eye",to:Jo.POSITION({organizationId:o,eventId:s,positionId:e.position.id}),children:n("voir_la_mission_68087")}),(0,i.jsx)(ru,{icon:"pen",onClick:()=>{t.push(fs.EDIT_POSITION(o,s,e.position.id))},children:n("_diter_la_missi_90442")})]})})]})},WY=()=>{const{translate:e,params:{eventId:t,positionCategoryId:n}}=bd(),[o,s,r]=gm(""),[a,l]=ZR("positionCategory.positions.date",As.c9.invalid("Invalid"),gp),[d,c]=(0,V.useState)(0),[u,m]=ZR("positionCategory.positions.sort",null),{data:h,isLoading:p}=Oi("query PositionCategoryPositions(\n $eventId: EventId!\n $positionCategoryId: PositionsCategoryId!\n $name: String\n $date: Date\n $offset: Int\n $sort: PositionsSort\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 sort: $sort\n ) {\n nodes {\n ...PositionCategoryPosition\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:t,positionCategoryId:n,name:g(s)?s:void 0,date:a.isValid?a:void 0,offset:d,sort:u},[js.PositionCategoryPositionFragment]);const{numberOfPages:f,totalCount:_}=ah(h.event?.positions),x=(0,V.useCallback)(e=>{m(e),c(0)},[m,c]);return(0,i.jsx)(dm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:o,onChange:r})}),(0,i.jsx)(ka,{width:200,children:(0,i.jsx)(Ih,{max:h.event?.endAt,min:h.event?.startAt,value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fp,{attribute:tn.Name,setSort:x,sort:u,children:e("nom_de_la_missi_64605")}),(0,i.jsx)(fp,{attribute:tn.Slot,setSort:x,sort:u,children:e("Date")}),(0,i.jsx)(pm,{children:e("State")}),(0,i.jsx)(pm,{width:100})]}),numberOfPages:f,offset:d,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:h.event.positions.nodes.map(e=>(0,i.jsx)(UY,{position:e},e.id))}),setOffset:c,title:e("liste_des_missi_40241"),totalCount:_})},GY=e=>{const{translate:t,params:{eventId:n,positionCategoryId:o}}=bd(),{roles:s}=_v(),r=Ei(Yh),{mutate:a}=function(e={}){return Di("mutation PositionsCategoriesMassLeadersEdit($eventId: EventId!, $massLeaders: MassLeadersInput!) {\n positionsCategoriesMassLeadersAssign(eventId: $eventId, massLeaders: $massLeaders)\n}\n",e)}();return(0,i.jsx)(Qv,{children:(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[(0,i.jsxs)(rd,{gap:"6",width:1,children:[(0,i.jsx)(Iw,{iconColor:"primary",text:t("nombre_de_missi_56719"),value:e.positionCategory.numberOfPositions}),(0,i.jsx)(Iw,{iconColor:"primary",text:t("number_of_membe_24698"),value:e.positionCategory.assignedResources}),(0,i.jsx)(Iw,{iconColor:"primary",text:t("nombre_de_membr_74699"),value:e.positionCategory.preassignedResources}),(0,i.jsx)(Iw,{iconColor:"primary",text:t("Date"),value:e.positionCategory.range?r.toLocaleString(e.positionCategory.range,void 0,{day:"numeric",month:"short",year:"numeric"}):"-"})]}),(0,i.jsxs)(rd,{gap:"7",children:[(0,i.jsxs)(rd,{direction:"column",gap:"6",width:470,children:[(0,i.jsx)(Aw,{leaders:e.positionCategory.leaders,reload:e.reload,roles:s.positionRoles,onSave:e=>a({eventId:n,massLeaders:{leaders:e,selecteds:{ids:[o]},strategy:yt.Replace}})}),(0,i.jsx)(VY,{category:e.positionCategory,eventId:n,reload:e.reload})]}),(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(WY,{})})]})]})})},qY=e=>{const t=Ti(),{mutate:n}=function(e={}){return Di("mutation PositionCategoryDelete($eventId: EventId!, $positionCategoryId: PositionsCategoryId!) {\n positionCategoryDelete(eventId: $eventId, positionCategoryId: $positionCategoryId) {\n id\n }\n}\n",e)}();return(0,i.jsx)(DA,{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()}})},HY=e=>{const{params:{organizationId:t,eventId:n},translate:o}=bd();return(0,i.jsxs)(Jk,{children:[(0,i.jsx)(Xk,{to:Jo.POSITIONS({organizationId:t,eventId:n}),children:o("missions_63972")}),(0,i.jsx)(Xk,{isCurrent:!0,to:Jo.POSITION_CATEGORY({organizationId:t,eventId:n,positionCategoryId:e.category.id}),children:e.category.name})]})},KY=({category:e,reload:t})=>{const{translate:n,history:o,params:{organizationId:s,eventId:r}}=bd(),{hasPermission:a}=dv(),l=a(Ov.POSITION_EDIT,{eventId:r}),d=MN(),{mutate:c}=function(e={}){return Di("mutation PositionCategoryDuplicate($eventId: EventId!, $positionCategoryId: PositionsCategoryId!) {\n positionCategoryDuplicate(eventId: $eventId, positionCategoryId: $positionCategoryId) {\n id\n }\n}\n",e)}(),[u,m]=(0,V.useState)(!1),[h,g]=(0,V.useState)(!1);return(0,i.jsx)(eb,{breadcrumbs:(0,i.jsx)(HY,{category:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Mv,{permissions:Ov.POSITION_EDIT,scope:{positionCategoryId:e.id},children:[(0,i.jsx)(kd,{color:"white",onClick:()=>g(!0),children:n("_diter_62574")}),(0,i.jsx)(kd,{onClick:()=>{o.push(fs.CREATE_POSITION(s,r,e.id))},children:n("ajouter_une_mis_99800")})]}),l&&(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"arrow-down-to-bracket",onClick:()=>d(wN,{positionCategoryId:e.id}),children:n("exporter_les_me_63676")}),(0,i.jsx)(ru,{icon:"copy",onClick:async()=>{const{positionCategoryDuplicate:{id:t}}=await c({eventId:r,positionCategoryId:e.id});o.push(Jo.POSITION_CATEGORY({organizationId:s,eventId:r,positionCategoryId:t}))},children:n("dupliquer_28256")})]}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>{m(!0)},children:n("supprimer_43083")})})]})]}),h&&(0,i.jsx)(DH,{eventId:r,positionCategoryId:e.id,positionCategoryName:e.name,onClose:()=>{g(!1)},onSuccess:t}),u&&(0,i.jsx)(qY,{eventId:r,positionCategory:e,onClose:()=>{m(!1)},onSuccess:()=>{o.replace(Jo.POSITIONS({organizationId:s,eventId:r}))}})]}),name:e.name,subtext:n("_1_mission_33169",e.numberOfPositions)})},YY=({event:e,reload:t})=>{const{translate:n,params:{organizationId:o,eventId:s,positionCategoryId:r}}=bd(),a=Pi(),{updateLocalEvent:l}=dv();Zc(e.positionCategory.name),(0,V.useEffect)(()=>{l({positionBackPath:a.pathname})},[]);const d=e=>({organizationId:e?":organizationId":o,eventId:e?":eventId":s,positionCategoryId:e?":positionCategoryId":r});return(0,i.jsxs)(nb,{children:[(0,i.jsx)(KY,{category:e.positionCategory,reload:t}),(0,i.jsxs)(rb,{css:{flex:"1"},children:[(0,i.jsxs)(ob,{css:{px:"$7"},children:[(0,i.jsx)(ib,{path:Jo.POSITION_CATEGORY_DASHBOARD(d(!1)),children:n("tableau_de_bord_24627")}),(0,i.jsx)(ib,{path:Jo.POSITION_CATEGORY_MEMBERS(d(!1)),children:n("membres_125561",e.volunteersRegistrations.totalCount)}),(0,i.jsx)(ib,{path:Jo.POSITION_CATEGORY_PREASSIGNED_MEMBERS(d(!1)),children:n("membres_pr_aff_93093",e.positionCategory.preassignedResources)})]}),(0,i.jsx)(sb,{path:Jo.POSITION_CATEGORY_DASHBOARD(d(!0)),children:(0,i.jsx)(GY,{positionCategory:e.positionCategory,reload:t})}),(0,i.jsx)(sb,{path:Jo.POSITION_CATEGORY_MEMBERS(d(!0)),children:(0,i.jsx)(TY,{positionCategoryId:r})}),(0,i.jsx)(sb,{path:Jo.POSITION_CATEGORY_PREASSIGNED_MEMBERS(d(!0)),children:(0,i.jsx)(TY,{preassignedPositionCategoryId:r})})]})]})},ZY=()=>{const{params:{organizationId:e,eventId:t,positionCategoryId:n}}=bd(),{data:o,loader:s,reload:r}=Oi("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},[js.LeaderInfosFragment]);return s||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{exact:!0,path:Jo.POSITION_CATEGORY({organizationId:":organizationId",eventId:":eventId",positionCategoryId:":positionCategoryId"}),children:(0,i.jsx)(Fi,{path:Jo.POSITION_CATEGORY_DASHBOARD({organizationId:e,eventId:t,positionCategoryId:n}),replace:!0})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(YY,{event:o.event,reload:r})})]})},XY=e=>(0,i.jsx)(zp,{category:e.popup.category,fallbackClosePath:e.closePath,heading:e.popup.title,children:(0,i.jsxs)(rd,{css:{overflow:"hidden"},direction:"column",height:1,width:1,children:[(0,i.jsx)(rd,{css:{background:"$gray50",flex:"1",overflow:"auto",py:"$9"},justify:"center",children:(0,i.jsx)(rd,{css:{height:"fit-content",overflow:"hidden"},direction:"column",width:1170,children:e.children})}),(0,i.jsx)(rd,{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})]})}),JY=()=>{const{params:{organizationId:e,eventId:t,positionId:n,positionSlotId:o},translate:s}=bd(),r=Ei(Cm),[a,l]=ZR("positionsSlotsAssignVolunteers.filterAvailabilities",!0),[d,c]=ZR("positionsSlotsAssignVolunteers.filterPositions",!1),[u,m]=ZR("positionsSlotsAssignVolunteers.applyConditions",!0),[h,p]=(0,V.useState)(null),{data:f,isLoading:_}=Oi("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:t,positionSlotId:o,filterAvailabilities:a,filterPositions:d,applyConditions:u,sort:h},[]),{mutate:x,isLoading:I}=Qr(),[v,b]=(0,V.useState)(""),j=(0,V.useMemo)(()=>{const e=f.event?.positionSlot.availableVolunteersRegistrations??[];return g(v)?e.filter(e=>e.userInfo.name.toLowerCase().includes(v.toLowerCase())||e.userInfo.email.includes(v.toLowerCase())):e},[f.event,v]),{numberOfSelected:C,selectAllState:y,states:A,setStates:S,toggleRow:k,toggleSelectAll:w}=rh({}),E=(0,V.useMemo)(()=>(u?1:0)+(a?1:0)+(d?1:0),[u,a,d]);return(0,V.useEffect)(()=>{S(Object.fromEntries((f.event?.positionSlot.availableVolunteersRegistrations??[]).map(e=>[`ui${e.userInfo.id}`,{id:e.userInfo.id,state:e.isAssignedTo?"checked":"unchecked"}])))},[f.event]),(0,i.jsx)(XY,{button:(0,i.jsx)(kd,{isLoading:I,to:Jo.POSITION({organizationId:e,eventId:t,positionId:n}),onClick:async()=>{const e=(f.event?.positionSlot.availableVolunteersRegistrations??[]).flatMap(e=>e.isAssignedTo?[e.userInfo.id]:[]),n=Object.values(A).filter(({state:e})=>"checked"===e).map(({id:e})=>e),i=(0,yu.A)(n,e),s=(0,yu.A)(e,n);Bs(i)&&await x({eventId:t,massAssign:{positionsSlotsIds:[o],selecteds:{ids:i},strategy:yt.Add}}),Bs(s)&&await x({eventId:t,massAssign:{positionsSlotsIds:[o],selecteds:{ids:s},strategy:yt.Delete}})},children:0===C?s("ne_pas_affecter_05756"):s("affecter_1_me_46721",C)}),closePath:Jo.POSITION({organizationId:e,eventId:t,positionId:n}),popup:{category:s("affectation_u_96975",f.event?.positionSlot.positionName??""),title:f.event?.positionSlot.nameOrRange??""},children:(0,i.jsx)(dm,{filters:(0,i.jsxs)(rd,{gap:"3",children:[(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:s("rechercher_un_m_05904"),value:v,onChange:b})}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"gray",leftIcon:"sliders",children:s("filtres_1_41774",E)})}),(0,i.jsx)(lu,{css:{padding:"0"},placement:"bottom-end",children:(0,i.jsxs)(rd,{css:{padding:"$4 $6"},direction:"column",width:440,children:[(0,i.jsx)(ka,{font:"gray800 textMd medium",children:s("liste_des_filtr_75605")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(ka,{font:"gray800 textSm medium",children:s("disponibilit_s_49923")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(zu,{state:a?"unchecked":"checked",onClick:e=>{l("checked"!==e)},children:s("afficher_tous_l_44338")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:a?"checked":"unchecked",onClick:e=>{l("checked"===e)},children:s("filtrer_selon_l_35857")}),(0,i.jsx)(Dh,{height:"4"}),(0,i.jsx)(ka,{font:"gray800 textSm medium",children:s("missions_63972")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(zu,{state:d?"unchecked":"checked",onClick:e=>{c("checked"!==e)},children:s("afficher_tous_l_44338")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:d?"checked":"unchecked",onClick:e=>{c("checked"===e)},children:s("filtrer_selon_l_42798")}),(0,i.jsx)(Dh,{height:"4"}),(0,i.jsx)(ka,{font:"gray800 textSm medium",children:s("conditions_77756")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(zu,{state:u?"unchecked":"checked",onClick:e=>{m("checked"!==e)},children:s("afficher_tous_l_44338")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:u?"checked":"unchecked",onClick:e=>{m("checked"===e)},children:s("filtrer_selon_l_59697")})]})})]})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{css:{paddingRight:0},width:48,children:(0,i.jsx)(wu,{state:y,onClick:w})}),(0,i.jsx)(fp,{attribute:rn.Name,css:{paddingLeft:"$2",flexGrow:2},setSort:p,sort:h,children:s("nom_du_membre_69353")}),(0,i.jsx)(pm,{children:s("nombre_d_affect_31455")}),(0,i.jsx)(fp,{attribute:rn.InsertedAt,setSort:p,sort:h,children:s("date_d_inscript_31369")})]}),limit:j.length,numberOfPages:1,offset:0,rows:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):j.map(e=>(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{css:{paddingRight:0},width:48,children:(0,i.jsx)(wu,{state:A[`ui${e.userInfo.id}`]?.state??"unchecked",onClick:(t,n)=>{Gd(n),k(`ui${e.userInfo.id}`,t,n.shiftKey)}})}),(0,i.jsx)(Qu,{css:{paddingLeft:"$2",flexGrow:2},children:(0,i.jsx)(ub,{userInfo:e.userInfo})}),(0,i.jsx)(Qu,{children:e.numberOfAssignments}),(0,i.jsx)(Qu,{children:r.toLocaleString(e.insertedAt.toLocal(),zs.DateTime)})]},e.id)),setOffset:hc.A,title:s("liste_des_membr_42505"),totalCount:j.length})})},QY=e=>{const{params:{organizationId:t,eventId:n,userInfoId:o},translate:s}=bd(),r=e.userInfo.volunteerRegistration?.delegation,a=(0,V.useMemo)(()=>e.forms.map(e=>({...e,showFullAccreditation:!0,slotDisplay:Qe.Hide,accreditationFilter:nt.None})),[e.forms]),l=(0,V.useMemo)(()=>e.forms.map(t=>{const n=e.userInfo.formsUsersInfos.find(e=>e.formId===t.id);return{profileId:n?.accreditationProfileId??null,slotsIds:n?.accreditationsSlotsIds??[]}}),[e.forms,e.userInfo.formsUsersInfos]);return(0,i.jsx)(QO,{forms:e.forms,getTabPath:e=>fs.EDIT_USER_ACCREDITATIONS_FORM(t,n,o,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:fs.VOLUNTEERS(t,n),title:s("mise_jour_des_60902",e.userInfo.nameOrEmail),children:e.forms.map((s,d)=>(0,i.jsxs)(sb,{path:fs.EDIT_USER_ACCREDITATIONS_FORM(t,n,o,s.id),children:[(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(sR,{accreditationProfileId:e.values.userInfo.accreditations[d].accreditationProfileId,accreditationsSlotsIds:e.values.userInfo.accreditations[d].accreditationsSlotsIds,alreadyAssignedProfileId:l[d].profileId,alreadyAssignedSlotsIds:l[d].slotsIds,change:e.change,delegationAccreditationsProfiles:r?.formId===s.id?r.accreditationsProfiles:Ns,delegationAccreditationsSlots:r?.formId===s.id?r.accreditationsSlots:Ns,displayFormCustomFields:!1,event:e.event,options:a[d],prefix:`userInfo.accreditations[${d}].`,scannedSlotsIds:Ns,showAutoAccredit:!1,slots:Ns,userInfosFields:e.userInfo.fields})]},s.id))})},eZ=e=>{const{history:t,params:{organizationId:n,eventId:o,userInfoId:s}}=bd(),r=Ei(WT),{mutate:a,isLoading:l}=function(e={}){return Di("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,V.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)(Vd,{direction:"column",height:1,initialValues:{userInfo:{accreditations:d}},render:({form:t,handleSubmit:n,values:o})=>(0,i.jsx)(QY,{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(fs.VOLUNTEERS(n,o))}})},tZ=()=>{const{organizationId:e,eventId:t,userInfoId:n}=zi(),{data:o,loader:s}=Oi("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 accreditationsProfiles {\n ...DelegationAccreditationProfile\n }\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 accreditationsProfilesCategories {\n ...FormRegisterAccreditationProfileCategory\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:n,loadDelegation:!0},[js.MemberRegistrationUserInfoFragment,js.FormsUsersInfosWishedFragment,js.DelegationAccreditationProfileFragment,js.DelegationAccreditationSlotFragment,js.FormMemberRegistrationFragment,js.FormRegisterAccreditationCategoryFragment,js.FormRegisterAccreditationProfileCategoryFragment]),r=(0,V.useMemo)(()=>{if(o.organization&&o.event){const e=o.organization.userInfo.volunteerRegistration;return o.event.forms.nodes.filter(t=>t.accreditationDisplay!==ot.None||e.delegation?.formId===t.id&&Bs(e.delegation.accreditationsSlots))}return[]},[o.organization,o.event]);return s||(Bs(r)?(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:fs.EDIT_USER_ACCREDITATIONS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(eZ,{event:o.event,forms:r,userInfo:o.organization.userInfo})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:fs.EDIT_USER_ACCREDITATIONS_FORM(e,t,n,r[0].id),replace:!0})})]}):(0,i.jsx)(Fi,{}))},nZ=e=>{const{params:{organizationId:t,eventId:n,userInfoId:o},translate:s}=bd();return(0,i.jsx)(QO,{forms:e.forms,getTabPath:e=>fs.EDIT_USER_MISSIONS_FORM(t,n,o,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:fs.VOLUNTEERS(t,n),title:s("mise_jour_des_02859",e.userInfo.nameOrEmail),children:e.forms.map((s,r)=>(0,i.jsxs)(sb,{path:fs.EDIT_USER_MISSIONS_FORM(t,n,o,s.id),children:[(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(vR,{change:e.change,event:e.event,options:{...s,showFullPosition:!0,slotDisplay:Qe.Hide,positionFilter:nt.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))})},iZ=e=>{const{history:t,params:{organizationId:n,eventId:o,userInfoId:s}}=bd(),r=Ei(WT),{mutate:a,isLoading:l}=function(e={}){return Di("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,V.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)(Vd,{direction:"column",height:1,initialValues:{userInfo:{missions:d}},render:({form:t,handleSubmit:n,values:o})=>(0,i.jsx)(nZ,{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(fs.VOLUNTEERS(n,o))}})},oZ=()=>{const{organizationId:e,eventId:t,userInfoId:n}=zi(),{data:o,loader:s}=Oi("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},[js.MemberRegistrationUserInfoFragment,js.FormsUsersInfosWishedFragment,js.FormMemberRegistrationFragment,js.FormRegisterCategoryFragment]),r=(0,V.useMemo)(()=>(o.event?.forms.nodes??[]).filter(e=>e.positionDisplay!==tt.None),[o.event]);return s||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:fs.EDIT_USER_MISSIONS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(iZ,{event:o.event,forms:r,userInfo:o.organization.userInfo})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:fs.EDIT_USER_MISSIONS_FORM(e,t,n,r[0].id),replace:!0})})]})},sZ=e=>{const{translate:t,params:{organizationId:n,eventId:o,userInfoId:s}}=bd();return(0,i.jsx)(QO,{forms:e.forms,getTabPath:e=>fs.EDIT_USER_SLOTS_FORM(n,o,s,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:fs.VOLUNTEERS(n,o),title:t("mise_jour_des_28904",e.userInfo.nameOrEmail),children:e.forms.map((t,r)=>(0,i.jsxs)(sb,{path:fs.EDIT_USER_SLOTS_FORM(n,o,s,t.id),children:[(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(RR,{change:e.change,currentSlots:e.values.userInfo.slots[r].slots,customSlotsPeriods:t.customSlotsPeriods,daysDisplay:t.daysDisplay,elements:t.elements,event:e.event,prefix:`userInfo.slots[${r}].`,slotDisplay:t.slotDisplay,userInfoFields:e.userInfo.fields})]},t.id))})},rZ=e=>{const{history:t,params:{organizationId:n,eventId:o,userInfoId:s}}=bd(),r=Ei(WT),{mutate:a,isLoading:l}=function(e={}){return Di("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,V.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)(Vd,{direction:"column",height:1,initialValues:{userInfo:{slots:d}},render:({form:t,handleSubmit:n,values:o})=>(0,i.jsx)(sZ,{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(fs.VOLUNTEERS(n,o))}})},aZ=()=>{const{organizationId:e,eventId:t,userInfoId:n}=zi(),{data:o,loader:s}=Oi("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 dayStartTime\n ranges\n\n forms {\n nodes {\n ...FormMemberRegistration\n }\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:n},[js.MemberRegistrationUserInfoFragment,js.FormsUsersInfosWishedFragment,js.FormMemberRegistrationFragment]),r=(0,V.useMemo)(()=>(o.event?.forms.nodes??[]).filter(e=>e.slotDisplay!==Qe.Hide),[o.organization,o.event]),{permissions:[a],isLoading:l}=Ry(Sy({eventId:t,userInfoId:n})),d=$i();return l||a||d.push(fs.DASHBOARD(e,t)),s||l?s:(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:fs.EDIT_USER_SLOTS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(rZ,{event:o.event,forms:r,userInfo:o.organization.userInfo})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:fs.EDIT_USER_SLOTS_FORM(e,t,n,r[0].id),replace:!0})})]})},lZ=()=>{const{params:{eventId:e}}=bd(),{canMemberAccredit:t}=Dv(),{columns:n,columnsSearch:o,infos:s,isEditMode:r,limit:a,nameDebounced:l,offset:d,predicates:c,rendering:u,setInfos:m,setLimit:h,setOffset:p}=SC(),f=(0,V.useMemo)(()=>({...Mg(n,u),includeCanRegistrationStateUpdate:!1,includeIsEditable:!1}),[n,u]),{mutate:_}=hr(),{mutate:x}=ur(),{data:I,isLoading:v}=Oi("query VolunteersAccreditationsMatrix($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfiles {\n nodes {\n ...AccreditationProfileMatrix\n }\n }\n\n accreditationsSlots(includeHidden: true) {\n nodes {\n ...AccreditationSlotMatrix\n }\n }\n }\n}\n",{eventId:e},[js.AccreditationProfileMatrixFragment,js.AccreditationSlotMatrixFragment]),{data:b,isLoading:j}=ra({...f,eventId:e,predicates:c,name:g(l)?l:null,columnsSearch:Bs(o)?o:void 0,limit:a,offset:d}),{numberOfPages:C,totalCount:y}=ah(b.data?.rows),[A,S]=(0,V.useState)([]),[k,w]=(0,V.useState)({}),E=(0,V.useMemo)(()=>s.volunteersMatrixRendering||xg.Category,[s]),T=(0,V.useCallback)(e=>m(t=>({...t,volunteersMatrixRendering:e})),[s,m]),R=(0,V.useMemo)(()=>s.volunteersMatrixSelectedSlotsIds||[],[s]),O=(0,V.useCallback)(e=>m(t=>({...t,volunteersMatrixSelectedSlotsIds:e})),[s,m]),D=(0,V.useMemo)(()=>s.volunteersMatrixSelectedProfilesIds||[],[s]),z=(0,V.useCallback)(e=>m(t=>({...t,volunteersMatrixSelectedProfilesIds:e})),[s,m]),$=(0,V.useMemo)(()=>s.volunteersMatrixShowAccreditations??!0,[s]),P=(0,V.useCallback)(e=>m(t=>({...t,volunteersMatrixShowAccreditations:e})),[m]),M=(0,V.useMemo)(()=>s.volunteersMatrixShowProfiles??!0,[s]),F=(0,V.useCallback)(e=>m(t=>({...t,volunteersMatrixShowProfiles:e})),[m]),N=(0,V.useMemo)(()=>s.volunteersMatrixShowQuota??!1,[s]),L=(0,V.useCallback)(e=>{m(t=>({...t,volunteersMatrixShowQuota:e}))},[s,m]),B=(0,V.useCallback)(async t=>{w(e=>({...e,[t]:!0}));const{data:{row:n}}=await sa({...f,eventId:e,id:t},await X());S(e=>e.map(e=>e.id===t?n:e)),w(e=>({...e,[t]:!1}))},[f,w,S]),U=(0,V.useCallback)(e=>k[e]??!1,[k]),W=(0,V.useCallback)((t,n)=>x({eventId:e,massProfileUpdate:{accreditationProfileId:n,selecteds:{ids:[t]},strategy:yt.Add}}),[e,x]),G=(0,V.useCallback)((t,n)=>_({eventId:e,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[t]},strategy:yt.Add}}),[e,_]),q=(0,V.useCallback)((t,n)=>x({eventId:e,massProfileUpdate:{accreditationProfileId:n,selecteds:{ids:[t]},strategy:yt.Delete}}),[e,x]),H=(0,V.useCallback)((t,n)=>_({eventId:e,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[t]},strategy:yt.Delete}}),[e,_]);return(0,V.useEffect)(()=>{S(b.data?.rows.nodes??[])},[b.data]),(0,i.jsx)(BS,{addAccreditationProfile:W,addAccreditationSlot:G,allAccreditationsProfiles:I.event?.accreditationsProfiles.nodes??[],allAccreditationsSlots:I.event?.accreditationsSlots.nodes??[],canDeleteCheckedIn:t,deleteAccreditationProfile:q,deleteAccreditationSlot:H,editMode:"assigned",isEditMode:r,isLoading:j||v,isRowLoading:U,limit:a,members:A,numberOfPages:C,offset:d,reloadRow:B,rendering:E,selectedProfilesIds:D,selectedSlotsIds:R,setLimit:h,setOffset:p,setRendering:T,setSelectedProfilesIds:z,setSelectedSlotsIds:O,setShowAccreditations:P,setShowProfiles:F,setShowQuota:L,showAccreditations:$,showProfiles:M,showQuota:N,totalCount:y})},dZ=({eventId:e,organizationId:t,reload:n,reloadRow:o,volunteerRegistration:s})=>{const{history:r,translate:a}=bd(),{hasFeature:l}=_v(),{event:d,hasEventRole:c}=dv(),{canMemberAccredit:u,canMemberAssign:m,canMemberAssignmentStateEdit:h,canMemberCreate:g,canMemberDelete:p,canMemberEdit:f}=Dv(),{showNotification:_}=HI(),x=s.state,I=s.accreditationState,{mutate:v,isLoading:b}=ta(),{mutate:j,isLoading:C}=Jr(),{mutate:y,isLoading:A}=Xr(),{mutate:S}=Rr(),{mutate:k}=Mr(),w=h&&x!==ve.WaitingAssignment,E=h&&x!==ve.Refused,T=h&&(x===ve.WaitingAssignment||x===ve.Assigned),R=m&&x===ve.Assigned,O=m&&x===ve.PreAssigned,D=m&&x===ve.WaitingAssignment,z=u&&I!==We.WaitingAccreditation,$=u&&I!==We.Refused,P=u&&(I===We.WaitingAccreditation||I===We.Accredited||I===We.AutoAccredited),M=u&&(I===We.Accredited||I===We.AutoAccredited),F=u&&I===We.WaitingAccreditation,[N,L]=(0,V.useState)(!1),[B,U]=(0,V.useState)(!1),[W,G]=(0,V.useState)(!1),q=c&&f&&d.useDelegations&&l(Ae.Delegation)&&s.delegation,H=g,K=p&&s.canDelete;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{children:[(0,i.jsxs)(MA,{children:[w&&(0,i.jsx)(ru,{icon:"arrow-right-arrow-left",onClick:async()=>{b||(await v({eventId:e,massStateUpdate:{selecteds:{ids:[s.userInfo.id]},state:ve.WaitingAssignment}}),o())},children:a("changer_le_stat_90266")}),E&&(0,i.jsx)(ru,{icon:"arrow-right-arrow-left",onClick:async()=>{b||(await v({eventId:e,massStateUpdate:{selecteds:{ids:[s.userInfo.id]},state:ve.Refused}}),o())},children:a("changer_le_stat_68392")}),T&&(0,i.jsx)(ru,{icon:"arrow-right-arrow-left",onClick:async()=>{b||(await v({eventId:e,massStateUpdate:{selecteds:{ids:[s.userInfo.id]},state:ve.NotApplicable}}),o())},children:a("changer_le_stat_62507")}),R&&(0,i.jsx)(ru,{icon:"pen",onClick:()=>{b||r.push(fs.EDIT_ASSIGNMENT(t,e,s.userInfo.id))},children:a("_diter_les_affe_42283")}),O&&(0,i.jsx)(ru,{icon:"pen",onClick:()=>{b||r.push(fs.PRE_ASSIGNMENT(t,e,s.userInfo.id))},children:a("_diter_les_pr_10213")}),D&&(0,i.jsx)(ru,{icon:"wand-magic-sparkles",onClick:()=>{b||r.push(fs.ASSIGNMENT(t,e,s.userInfo.id))},children:a("affecter_94255")})]}),(0,i.jsxs)(MA,{children:[z&&(0,i.jsx)(ru,{icon:"arrow-right-arrow-left",onClick:async()=>{C||(await j({eventId:e,massStateUpdate:{selecteds:{ids:[s.userInfo.id]},state:We.WaitingAccreditation}}),o())},children:a("changer_le_stat_20528")}),$&&(0,i.jsx)(ru,{icon:"arrow-right-arrow-left",onClick:async()=>{C||(await j({eventId:e,massStateUpdate:{selecteds:{ids:[s.userInfo.id]},state:We.Refused}}),o())},children:a("changer_le_stat_68392")}),P&&(0,i.jsx)(ru,{icon:"arrow-right-arrow-left",onClick:async()=>{C||(await j({eventId:e,massStateUpdate:{selecteds:{ids:[s.userInfo.id]},state:We.NotApplicable}}),o())},children:a("changer_le_stat_62507")}),M&&(0,i.jsx)(ru,{icon:"pen",onClick:()=>{C||r.push(fs.EDIT_ACCREDIT(t,e,s.userInfo.id))},children:a("_diter_les_accr_86042")}),F&&(0,i.jsx)(ru,{icon:"check",onClick:async()=>{A||(await y({eventId:e,selecteds:{ids:[s.userInfo.id]}}),o())},children:a("valider_les_acc_80801")}),F&&(0,i.jsx)(ru,{icon:"badge-check",onClick:()=>{C||r.push(fs.ACCREDIT(t,e,s.userInfo.id))},children:a("accr_diter_70543")})]}),(0,i.jsxs)(MA,{children:[H&&(0,i.jsx)(ru,{icon:"clone",onClick:()=>L(!0),children:a("dupliquer_28256")}),q&&(0,i.jsx)(ru,{color:"red",icon:"minus",onClick:()=>U(!0),children:a("retirer_de_la_d_64963")}),K&&(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>G(!0),children:a("d_sinscrire_de_06416")})]})]}),H&&N&&(0,i.jsx)(FA,{name:s.userInfo.nameOrEmail,reload:n,userInfoId:s.userInfo.id,onClose:()=>L(!1)}),q&&B&&(0,i.jsx)(DA,{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:()=>{U(!1)},onDelete:async()=>{await S({organizationId:t,eventId:e,delegationId:s.delegation.id,selecteds:{ids:[s.userInfo.id]}}),_(a("_1_a_t_retir_36729",s.userInfo.name,s.delegation.name)),o()}}),p&&W&&(0,i.jsx)(DA,{buttonText:a("d_sinscrire_de_06416"),subtext:[a("_tes_vous_sur_d_79932")],text:a("suppression_de_73669",s.userInfo.name),onClose:()=>{G(!1)},onDelete:async()=>{await k({eventId:e,selecteds:{ids:[s.userInfo.id]}}),_(a("_1_a_t_d_sin_66177",s.userInfo.name)),n()}})]})},cZ=({columns:e,customFields:t,eventId:n,organizationId:o,reload:s,reloadVolunteer:r,segmentId:a,state:l,toggleRow:d,volunteerRegistration:c})=>{const{translate:u}=bd(),{hasEventRole:m,hasPermission:h}=dv(),{canMemberAccredit:g,canMemberAssign:p,canMemberAssignmentStateEdit:f,canMemberCreate:_,canMemberDelete:x,canMemberEdit:I}=Dv(),v=jC(t),b=(0,V.useCallback)(()=>{r(c.id)},[c,r]),j=m&&I,C=I||p||g,y=_||x||g||p||f,A=c.userInfo,S=fs.VOLUNTEERS_LIST_USER_PANEL_ACCREDITATIONS(o,n,a,A.id),k=fs.VOLUNTEERS_LIST_USER_PANEL_AVAILABILITIES(o,n,a,A.id),w=fs.VOLUNTEERS_LIST_USER_PANEL_POSITIONS(o,n,a,A.id),E=(c.teams||[]).map(e=>fs.VOLUNTEERS_LIST_USER_PANEL_TEAM(o,n,a,A.id,e.teamCode));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(am,{css:{background:"checked"===l?"$primary100":"white","&:hover":{background:"checked"===l?"$primary100":"$gray100"}},onMouseLeave:e=>eu(e.target),children:[C&&(0,i.jsx)(Qu,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:l,onClick:(e,t)=>{Gd(t),d(`ui${A.id}`,e,t.shiftKey)}})}),e.map(e=>{const t=v.get(e.slug);return(0,i.jsx)(Uy,{accreditationsPanelPath:S,availabilitiesPanelPath:k,canChangeDelegation:j,canMemberAccredit:g,canMemberAssign:p,column:e,customField:t,eventId:n,positionsPanelPath:w,reloadRow:b,row:c},e.slug)}),y&&(0,i.jsxs)(jm,{justify:"center",children:[(A.isEditable??!0)&&(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"pen",to:fs.EDIT_USER(o,n,c.userInfo.id)})})}),(0,i.jsx)(bp,{placement:"top",children:u("_diter_62574")})]}),(0,i.jsx)(dZ,{eventId:n,organizationId:o,reload:s,reloadRow:b,volunteerRegistration:c})]})]}),(0,i.jsx)(OA,{accreditationsPanelPath:S,availabilitiesPanelPath:k,canCheckIn:(e,t)=>h(Ov.POSITION_READ,{positionCategoryId:e,positionId:t}),canDeleteCheckedIn:g,canDeletePosition:(e,t)=>h(Ov.MEMBER_ASSIGN,{positionCategoryId:e,positionId:t}),canMemberAccredit:g,canWishedAccreditationsEdit:!1,defaultHiddenAccreditationsSlotsIds:[],eventId:n,organizationId:o,positionsPanelPath:w,reloadRow:b,returnPathFallback:fs.VOLUNTEERS(o,n),teamsPanelsPath:E,volunteerRegistration:c})]})},uZ=(0,V.memo)(function(e){const{params:{organizationId:t,eventId:n,segmentId:o}}=bd(),{hasPermission:s}=dv(),r=s(Ov.MEMBER_ASSIGNMENT_STATE_EDIT,{eventId:n}),a=s(Ov.MEMBER_EDIT,{eventId:n}),{canMemberAccredit:l,canMemberAssign:d,canMemberAssignmentStateEdit:c,canMemberCreate:u,canMemberDelete:m,canMemberEdit:h}=Dv(),{columns:p,columnsSearch:f,limit:_,massActions:x,nameDebounced:I,offset:v,possibleColumns:b,predicates:j,reloadKey:C,rendering:y,setLimit:A,setOffset:S,setSort:k,sort:w}=SC(),E=(0,V.useMemo)(()=>({...Mg(p,y,{includeWeezeventUrls:!0}),includeCanRegistrationStateUpdate:!r,includeIsEditable:!a}),[p,y]),{data:T,isLoading:R,reload:O}=ra({...E,eventId:n,predicates:j,name:g(I)?I:null,columnsSearch:Bs(f)?f:null,limit:_,offset:v,sort:w}),{numberOfPages:D,totalCount:z}=ah(T.data?.rows);(0,V.useEffect)(()=>{C>1&&O()},[C]);const $=(0,V.useMemo)(()=>p.flatMap(e=>(0,hd.A)([b.find(t=>t.slug===e)])),[b,p]),[P,M]=(0,V.useState)([]),[F,N]=(0,V.useState)({}),L=(0,V.useCallback)(async e=>{N(t=>({...t,[e]:!0}));const{data:{row:t}}=await sa({...E,eventId:n,id:e},await X());M(n=>n.map(n=>n.id===e?t:n)),N(t=>({...t,[e]:!1}))},[E,N,M]),B=h||d||l,U=u||m||l||d||c;return(0,V.useEffect)(()=>{M(T.data?.rows.nodes??[])},[T.data]),(0,V.useEffect)(()=>{x.setStates(Object.fromEntries((T.data?.rows.nodes??[]).map(({userInfo:e})=>[`ui${e.id}`,{id:e.id,state:"unchecked"}])))},[T.data,x.setStates]),(0,i.jsx)(rd,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(_p,{"aria-busy":R,headerRow:(0,i.jsxs)(Wu,{children:[B&&(0,i.jsx)(pm,{justify:"center",width:48,children:(0,i.jsx)(wu,{state:x.selectAllState,onClick:x.toggleSelectAll})}),$.map(e=>e.isSortable?(0,i.jsx)(fp,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:k,sort:w,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(pm,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),U&&(0,i.jsx)(pm,{width:100})]}),paginationRow:(0,i.jsx)(lm,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(rm,{limit:_,numberOfPages:D,offset:v,setLimit:A,setOffset:S,showLimits:!0,totalCount:z})}),children:R?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{}),(0,i.jsx)(fm,{})]}):P.map(s=>F[s.id]?(0,i.jsx)(fm,{},s.id):(0,i.jsx)(cZ,{columns:$,customFields:e.customFields,eventId:n,organizationId:t,reload:O,reloadVolunteer:L,segmentId:o,state:x.states[`ui${s.userInfo.id}`]?.state??"unchecked",toggleRow:x.toggleRow,volunteerRegistration:s},s.id))})})}),mZ=(0,V.memo)(e=>{const t=(0,V.useCallback)(t=>{t&&(n.current&&(o.current?.setMap(null),n.current=null),n.current=new google.maps.Map(t,{...Ma(e.initialCenter,e.initialZoom,e.layer)}),n.current.mapTypes.set(de.IgnPlan,Va()),o.current=new google.maps.OverlayView,o.current.draw=hc.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("tilesloaded",()=>{setTimeout(()=>{e.onMapTilesloaded?.()},1e3)}),a(),QK(e.traces,e.hiddenTracesIds,r,n))},[]),n=(0,V.useRef)(null),o=(0,V.useRef)(null),s=(0,V.useRef)([]),r=(0,V.useRef)([]),a=(0,V.useCallback)(()=>{s.current.forEach(e=>e.setMap(null)),s.current=e.users.map(t=>{const i=za(t),s=Bf(t.name,t.email),r=new google.maps.Marker({position:i,map:n.current,icon:`${F.HEAVENT_API_URL}/icons/acronym.svg?color=${encodeURIComponent("#0284fe")}&text=${s}`});return r.addListener("click",()=>{const n=o.current?.getProjection()?.fromLatLngToContainerPixel(new google.maps.LatLng(i.lat,i.lng));n&&e.onUserClick?.(t,n)}),r})},[e.users]);return(0,V.useEffect)(()=>{a()},[JSON.stringify(e.users)]),(0,V.useEffect)(()=>{n.current?.setMapTypeId(Na(e.layer))},[e.layer]),(0,V.useEffect)(()=>{QK(e.traces,e.hiddenTracesIds,r,n)},[JSON.stringify(e.traces),e.hiddenTracesIds]),(0,i.jsx)(ka,{ref:t,height:1,width:1})},La.A);mZ.displayName="UsersMap";const hZ=e=>{const{params:{organizationId:t,eventId:n}}=bd();return(0,i.jsx)(rd,{align:"center",css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",height:50,children:(0,i.jsxs)(_d,{to:bx.MEMBER_INFORMATION({organizationId:t,eventId:n,userInfoId:e.user.id}),children:[(0,i.jsx)(ka,{color:"gray800",children:e.user.name}),(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"chevron-right"})})]})})},gZ=e=>{const{params:{eventId:t}}=bd(),{event:n,hasPermission:o}=dv(),s=o(Ov.MEMBER_EDIT,{eventId:t}),{mutate:r}=_r(),[a,l]=(0,V.useState)(e.layer),[d,c]=(0,V.useState)(null),[u,m]=(0,V.useState)([]),[h,g]=ZR("volunteerssMap.center",e.center),[p,f]=ZR("volunteerssMap.zoom",Pa),_=(0,V.useRef)(null);return(0,i.jsxs)(rd,{css:{flex:"1",position:"relative"},direction:"column",width:1,children:[(0,i.jsx)(ka,{ref:_,css:{flex:"1"},width:1,children:(0,i.jsx)(mZ,{hiddenTracesIds:u,initialCenter:h,initialZoom:p,layer:a,traces:e.traces,users:e.users,onMapCenterChanged:g,onMapDrag:()=>c(null),onMapZoomchanged:f,onUserClick:(e,t)=>c({user:e,left:t.x,top:t.y})})}),s&&(0,i.jsx)(JK,{acronymIcon:"icon",event:n,hiddenTracesIds:u,layer:a,reload:e.reload,setAcronymIcon:hc.A,setHiddenTracesIds:m,setLayer:async e=>{l(e),await r({eventId:t,layer:e})},showAcronymIcon:!1,showExport:!1,traces:e.traces,onExport:hc.A,onFullscreen:()=>{_.current?.requestFullscreen()}}),_.current&&d&&(0,pn.createPortal)((0,i.jsx)(ka,{css:{left:`${d.left+32}px`,position:"absolute",top:d.top-25-16+"px",zIndex:10},children:(0,i.jsx)(hZ,{user:d.user})}),_.current)]})},pZ=()=>{const{params:{eventId:e}}=bd(),{columns:t,columnsSearch:n,nameDebounced:o,predicates:s,rendering:r}=SC(),a=(0,V.useMemo)(()=>({...Mg(t,r),includeCanRegistrationStateUpdate:!1,includeIsEditable:!1}),[t,r]),{data:l,loader:d,reload:c}=ra({...a,eventId:e,predicates:s,hasCoordinates:!0,name:g(o)?o:null,columnsSearch:Bs(n)?n:void 0,limit:250}),u=(0,V.useMemo)(()=>(l.data?.rows.nodes??[]).flatMap(e=>"number"==typeof e.userInfo.fields.latitude&&"number"==typeof e.userInfo.fields.longitude?[{id:e.userInfo.id,email:e.userInfo.email,latitude:e.userInfo.fields.latitude,longitude:e.userInfo.fields.longitude,name:e.userInfo.name}]:[]),[l.data]);return d||(0,i.jsx)(gZ,{center:A_(l.data),layer:l.data.layer,reload:c,traces:l.data.traces||[],users:u})},fZ=e=>{const{translate:t,params:{eventId:n}}=bd(),{infos:o,limit:s,nameDebounced:r,offset:a,predicates:l,setInfos:d,setLimit:c,setOffset:u}=SC(),{data:m,loader:h}=Hl({eventId:n,predicates:l,name:g(r)?r:void 0,limit:s,offset:a}),{numberOfPages:p,totalCount:f}=ah(m.data?.rows),_=(0,V.useMemo)(()=>o?.volunteersPlanningshowAvailabilities??!0,[o]),x=(0,V.useCallback)(e=>{d({...o,volunteersPlanningshowAvailabilities:e})},[o,d]),I=(0,V.useMemo)(()=>(m.data?.rows.nodes??[]).map(e=>({...e,slots:e.slots.flatMap(e=>_?[{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,_]),v=(0,V.useMemo)(()=>As.c9.isDateTime(o.volunteersPlanningStartAt)&&o.volunteersPlanningStartAt?.isValid?o.volunteersPlanningStartAt:As.c9.fromISO(o.volunteersPlanningStartAt)?.isValid?As.c9.fromISO(o.volunteersPlanningStartAt,{zone:"utc"}):As.IX.fromDateTimes(e.startAt.startOf("day"),e.endAt.endOf("day")).contains(As.c9.utc())?As.c9.utc():e.startAt,[e.startAt,e.endAt,o]),b=(0,V.useCallback)(t=>{d({...o,volunteersPlanningStartAt:t?.toISO()??e.startAt.toISO()})},[e.startAt,o,d]),j=(0,V.useMemo)(()=>{const t=tg(e.dayStartTime);return t?.[0]??0},[e.dayStartTime]);return h||(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",width:1,children:[(0,i.jsx)(rd,{css:{background:"white",flex:"1"},children:(0,i.jsx)(rY,{data:I,date:v,maxDate:e.endAt,minDate:e.startAt,renderFilters:()=>(0,i.jsx)(ka,{width:40,children:(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(kd,{color:"white",leftIcon:_?"eye":"eye-slash",onClick:()=>x(!_)})}),(0,i.jsx)(bp,{placement:"top",children:t(_?"masquer_les_dis_82263":"afficher_les_di_01534")})]})}),renderLeftCell:e=>(0,i.jsx)(RY,{vr:e}),renderSlot:e=>(0,i.jsx)(zY,{slot:e}),showPlus:!1,startHour:j,onChange:b})}),(0,i.jsx)(lm,{children:(0,i.jsx)(rm,{limit:s,numberOfPages:p,offset:a,setLimit:c,setOffset:u,showLimits:!0,totalCount:f})})]})},_Z=()=>(0,i.jsxs)(rd,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$3",userSelect:"none",width:"100%","&:last-child":{border:"none"}},children:[(0,i.jsx)(wu,{shouldPreventDefault:!1,state:"unchecked",onClick:hc.A}),(0,i.jsx)(md,{width:"3"}),(0,i.jsx)(ju,{size:40,variant:"circular"}),(0,i.jsx)(md,{width:"4"}),(0,i.jsxs)(rd,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(ju,{borderRadius:"$1",height:12,width:1}),(0,i.jsx)(ju,{borderRadius:"$1",height:12,width:1})]})]}),xZ=e=>{const{data:t,isLoading:n}=Gl({organizationId:e.organizationId,excludedEventId:e.eventId,name:g(e.nameOrEmail)?e.nameOrEmail:null});return n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_Z,{}),(0,i.jsx)(_Z,{}),(0,i.jsx)(_Z,{})]}):(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)(tw,{state:n,userInfo:t,onClick:()=>{e.select(t.id)}},t.id)})})},IZ=e=>{const t=Ti(),n=Ei(WT),o=Ei(ld),[s,r,a]=gm(""),{mutate:l,isLoading:d}=ql();return(0,i.jsx)(Vd,{hideDefaultErrors:!0,initialValues:{usersInfosIds:[],sendVolunteerRegistrationEmail:!1},render:({form:n,handleSubmit:o,values:l})=>(0,i.jsxs)(Om,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(ka,{color:"gray800",css:{height:"56px",textAlign:"center"},children:(0,i.jsx)("img",{alt:"Avatars",height:"100%",src:wc.AvatarGroup})}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("ajouter_un_memb_33261")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:t("ajouter_un_ou_d_44771")}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),value:s,onChange:a}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Nd,{}),(0,i.jsx)(rd,{css:{flex:"1",overflowY:"auto"},direction:"column",children:(0,i.jsx)(xZ,{eventId:e.eventId,nameOrEmail:r,organizationId:e.organizationId,select:e=>{n.change("usersInfosIds",Ws(l.usersInfosIds,e))},usersInfosIds:l.usersInfosIds})}),(0,i.jsx)(md,{height:"7"}),(0,i.jsxs)(rd,{align:"center",gap:"3",justify:"end",children:[(0,i.jsx)(Fp,{name:"sendVolunteerRegistrationEmail",children:t("envoyer_l_e_mai_35622")}),(0,i.jsx)(kd,{isLoading:d,onClick:o,children:t("ajouter_97327")}),(0,i.jsx)(kd,{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()}})},vZ=({reload:e})=>{const{params:{organizationId:t,eventId:n,segmentId:o},translate:s}=bd(),{user:r}=Li(),{hasFeature:a}=_v(),{hasEventRole:l}=dv(),{canMemberCreate:d}=Dv(),{segment:c,columns:u}=SC(),{mutate:m}=function(e={}){return Di("mutation VolunteersCriblageExport($eventId: EventId!, $segmentId: SegmentId!) {\n jobId: volunteersCriblageExport(eventId: $eventId, segmentId: $segmentId)\n}\n",e)}(),{mutate:h}=function(e={}){return Di("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:g,isLoading:p}=Oi("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:n,segmentId:o},[]),[f,_]=(0,V.useState)(!1),[x,I]=(0,V.useState)(!1),[v,b]=(0,V.useState)(!1),{checkExport:j}=HI();return(0,i.jsxs)(zz,{children:[d&&(0,i.jsx)(dE,{menu:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ru,{icon:"user-group",onClick:e=>{eu(e.target),_(!0)},children:s("ajouter_des_mem_06922")}),(0,i.jsx)(ru,{icon:"file-import",to:fs.EVENT_VOLUNTEERS_IMPORT(t,n),onClick:e=>eu(e.target),children:s("importer_via_un_61623")})]}),path:bx.CREATE({organizationId:t,eventId:n}),children:s("ajouter_un_memb_33261")}),(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[l&&(0,i.jsx)(ru,{icon:"plug-circle-bolt",onClick:e=>{eu(e.target),I(!0)},children:s("exporter_via_l_09843")}),(0,i.jsx)(ru,{icon:"file-xls",onClick:e=>{eu(e.target),b(!0)},children:s("exporter_en_exc_51862")}),a(Ae.Criblage)&&(0,i.jsx)(ru,{icon:"arrow-down-to-bracket",onClick:async e=>{eu(e.target);const{jobId:i}=await m({eventId:n,segmentId:c.id});j(i,t,n)},children:s("exporter_pour_l_97136")}),(0,i.jsx)(ru,{download:`${c.name}-users-listing`,icon:"arrow-down-to-bracket",to:gf(g.event?.segment.links.usersListingLink,"pdf",{lang:r?.language}),children:s("t_l_charger_en_59616")}),(0,i.jsx)(Mv,{permissions:Ov.MEMBER_CREATE,children:(0,i.jsx)(ru,{icon:"file-import",to:fs.EVENT_FILES_IMPORT(t,n),children:s("importer_des_do_55420")})})]})]}),f&&(0,i.jsx)(IZ,{eventId:n,organizationId:t,reload:e,onClose:()=>_(!1)}),!p&&(0,i.jsx)(bP,{isOpen:x,link:hf({organizationId:t,eventId:n,lang:r?.language,pathComponent:`volunteers/${o}`,key:g.event.key}),onClose:()=>I(!1)}),(0,i.jsx)(jP,{isOpen:v,requestExport:async(e,i)=>{const{jobId:o}=await h({eventId:n,segmentId:c.id,format:e,includeFiles:i,columns:u});j(o,t,n)},showIncludeFiles:!0,onClose:()=>b(!1)})]})},bZ=(0,V.memo)(function(e){const t=Ti(),{canAccreditationRead:n,canMemberAccredit:o,canMemberAssign:s,canMemberEdit:r,canSegmentEdit:a}=Dv(),{limit:l,massActions:d,onMassEditSuccess:c,predicates:u,reloadKey:m,rendering:h,segment:g,setReloadKey:p,sort:f}=SC(),_=r||s||o,x=a&&h===Cg.List,I=r&&h===Cg.List||o&&h===Cg.AccreditationsMatrix;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vZ,{reload:()=>{p(m+1)}}),(0,i.jsxs)(Qv,{children:[(0,i.jsx)(Oz,{searchRow:(0,i.jsx)(Tz,{actions:(0,i.jsx)(zL,{massActions:d,predicates:u,scope:null,showOnlyMassEdit:!1,sort:f,totalNumberOfMembers:g.count,onMassEditSuccess:c}),searchPlaceholder:t("rechercher_un_m_05904"),showActions:_,showEditColumns:x,showEditMode:I,showSearchColumns:a}),selectSegment:(0,i.jsx)(wz,{pageSelectedText:t("les_1_membres_00895",l),segmentSelectedText:t("les_1_membres_56748",g.count,g.name)})}),n&&h===Cg.AccreditationsMatrix?(0,i.jsx)(lZ,{}):h===Cg.Calendar?(0,i.jsx)(fZ,{dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,startAt:e.event.startAt}):h===Cg.Map?(0,i.jsx)(pZ,{}):(0,i.jsx)(uZ,{customFields:e.customFields})]})]})}),jZ=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s,segmentId:r}}=bd(),{event:a,hasEventRole:l,localEvent:d,updateLocalEvent:c}=dv(),{canAccreditationRead:u,canCampaignRead:m,canDocumentRead:h,canDelegationRead:g,canFormRead:p,canPositionRead:f,canSegmentEdit:_}=Dv(),x=Ei(Fg),I=(0,V.useMemo)(()=>x.getVolunteersFilters(o,s,r,e.organization.customFields.nodes,e.event,{hasAccreditations:u,hasCampaigns:m,hasDelegations:g,hasForms:p,hasPositions:f,isWeezeventConnected:e.event.isWeezeventConnected}),[s,r,e.organization,e.event]),v=(0,V.useMemo)(()=>x.getVolunteersPossibleColumns(o,e.organization.customFields.nodes,e.event.forms.nodes,e.event.customDocuments,{hasAccreditations:u,hasCampaigns:m,hasCustomDocuments:h,hasDelegations:g,hasForms:p,hasPositions:f,isWeezeventConnected:e.event.isWeezeventConnected}),[o,a,e.organization,e.event]);return(0,i.jsx)(kz,{canSegmentEdit:_,eventId:s,filters:I,filtersButtonText:n("filtrer_les_mem_47149"),filtersSubtitle:n("appliquer_des_f_48814"),getSegmentPath:e=>fs.VOLUNTEERS_SEGMENT(o,s,e),initialLimit:d?.volunteersLimit??em,initialSegmentsOpen:d?.areVolunteersSegmentsOpen??!0,organizationId:o,possibleColumns:v,possibleRenderings:l?[Cg.List,Cg.Calendar,Cg.AccreditationsMatrix,Cg.Map]:[Cg.List,Cg.Calendar],reload:e.reload,segmentId:r,segmentType:Me.Volunteers,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{c({volunteersLimit:e})},onSegmentClick:e=>{c({volunteersSegmentId:e})},onSegmentDelete:async()=>{await c({volunteersSegmentId:null}),t.replace(fs.VOLUNTEERS(o,s))},onSegmentsToggle:async e=>{await c({areVolunteersSegmentsOpen:e})},children:(0,i.jsx)(bZ,{customFields:e.organization.customFields.nodes,event:e.event})})},CZ=(0,V.memo)(function(){const{params:{organizationId:e,eventId:t},translate:n}=bd(),{event:{name:o},localEvent:s}=dv();Zc(`${o} ${n("membres_11310")}`);const{data:r,loader:a,reload:l}=na({organizationId:e,eventId:t,privacy:Re.All,loadCustomDocuments:!0,loadForms:!0,loadSegments:!0}),d=(0,V.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:fs.VOLUNTEERS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(jZ,{event:r.event,organization:r.organization,reload:l})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:fs.VOLUNTEERS_SEGMENT(e,t,s?.volunteersSegmentId&&d.includes(s?.volunteersSegmentId)?s.volunteersSegmentId:d[0]),replace:!0})})]})}),yZ=e=>{const{params:{organizationId:t,eventId:n},translate:o}=bd(),{data:s,loader:r}=rl({organizationId:t,eventId:n,includeIntro:!1,spaceType:ye.DelegationSpace}),a=Ei(XE);return r||(0,i.jsx)(Vd,{direction:"column",initialValues:{design:a.designInputDefault(s.organization.spaceDesign,s.organization.event?.spaceDesign)},render:({handleSubmit:e,submitting:t})=>(0,i.jsxs)(Wp,{footerActions:(0,i.jsx)(Mv,{permissions:Ov.DELEGATIONS_SPACE_PARAM_EDIT,children:(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{isLoading:t,onClick:e,children:o("enregistrer_06519")})})}),heading:o("design_15043"),hideHeader:!0,children:[(0,i.jsx)(QE,{heading:o("images_de_votre_51694"),showLogo:!0}),(0,i.jsx)(JE,{initialValues:n?s.organization.spaceDesign?.colors:void 0})]}),onSubmit:async i=>await e.mutate({organizationId:t,eventId:n,spaceDesign:i.design,spaceType:ye.DelegationSpace})})},AZ=()=>{const{mutate:e}=function(e={}){return Di("mutation EventSpaceDesignUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $spaceDesign: DesignInput!\n $settings: EventsShowcaseSettingsDesignInput\n $spaceType: SpaceType!\n) {\n eventSpaceDesignUpdate(\n organizationId: $organizationId\n eventId: $eventId\n spaceDesign: $spaceDesign\n settings: $settings\n spaceType: $spaceType\n ) {\n id\n }\n}\n",e)}();return(0,i.jsx)(yZ,{mutate:async t=>(await e(t)).eventSpaceDesignUpdate.id})},SZ=()=>{const{mutate:e}=Sl();return(0,i.jsx)(yZ,{mutate:async t=>(await e(t)).organizationSpaceDesignUpdate.id})},kZ=e=>{const{history:t,translate:n,params:{organizationId:o,eventId:s}}=bd(),{showNotification:r}=HI(),{canDelegationsSpaceParamEdit:a}=Dv(),{mutate:l}=function(e={}){return Di("mutation DelegationsSpaceLayoutDelete(\n $eventId: EventId!\n $delegationsSpaceLayoutId: DelegationsSpaceLayoutId!\n) {\n delegationsSpaceLayoutDelete(\n eventId: $eventId\n delegationsSpaceLayoutId: $delegationsSpaceLayoutId\n ) {\n id\n }\n}\n",e)}(),{mutate:d}=function(e={}){return Di("mutation DelegationsSpaceLayoutDuplicate(\n $eventId: EventId!\n $delegationsSpaceLayoutId: DelegationsSpaceLayoutId!\n) {\n delegationsSpaceLayoutDuplicate(\n eventId: $eventId\n delegationsSpaceLayoutId: $delegationsSpaceLayoutId\n ) {\n id\n }\n}\n",e)}(),[c,u]=(0,V.useState)(!1),m=Vk.DELEGATIONS_SPACE_LAYOUTS_UPDATE({organizationId:o,eventId:s,delegationsSpaceLayoutId:e.layout.id});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:e.layout.name}),a&&(0,i.jsx)(jm,{justify:"center",children:(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"pen",to:m})})}),(0,i.jsxs)(vm,{children:[(0,i.jsxs)(MA,{children:[(0,i.jsx)(ru,{icon:"pen",to:m,children:n("_diter_62574")}),(0,i.jsx)(ru,{icon:"clone",onClick:async()=>{const{delegationsSpaceLayoutDuplicate:{id:n}}=await d({eventId:s,delegationsSpaceLayoutId:e.layout.id});t.push(Vk.DELEGATIONS_SPACE_LAYOUTS_UPDATE({organizationId:o,eventId:s,delegationsSpaceLayoutId:n}))},children:n("dupliquer_28256")})]}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:async()=>u(!0),children:n("supprimer_43083")})})]})]})})]}),c&&(0,i.jsx)(DA,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_86738"),text:n("suppression_de_73669",e.layout.name),onClose:()=>u(!1),onDelete:async()=>{await l({eventId:s,delegationsSpaceLayoutId:e.layout.id}),r(n("le_layout_1_51514",e.layout.name)),e.reload()}})]})},wZ=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o}}=bd(),{canDelegationsSpaceParamEdit:s}=Dv(),[r,a,l]=gm(""),{data:d,isLoading:c,reload:u}=Oi("query DelegationsSpaceLayouts($eventId: EventId!, $name: String) {\n event(id: $eventId) {\n delegationsSpaceLayouts(name: $name) {\n id\n name\n }\n }\n}\n",{eventId:o,name:g(a)?a:void 0},[]);return(0,i.jsx)(dm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_un_l_04356"),value:r,onChange:l})}),(0,i.jsx)(Mv,{permissions:Ov.DELEGATIONS_SPACE_PARAM_EDIT,children:(0,i.jsx)(kd,{onClick:()=>{e.push(Vk.DELEGATIONS_SPACE_LAYOUTS_CREATE({organizationId:n,eventId:o}))},children:t("cr_er_un_layout_13164")})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:t("nom_du_layout_81794")}),s&&(0,i.jsx)(pm,{width:100})]}),rows:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:d.event.delegationsSpaceLayouts.map(e=>(0,i.jsx)(kZ,{layout:e,reload:u},e.id))}),title:t("liste_des_layou_11323")})},EZ=()=>{const{params:{organizationId:e,eventId:t},translate:n}=bd();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tb,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(Dd,{children:n("espace_d_l_gati_59251")}),(0,i.jsxs)(ob,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(ib,{path:Vk.DELEGATIONS_SPACE_DESIGN({organizationId:e,eventId:t}),children:n("design_15043")}),(0,i.jsx)(ib,{path:Vk.DELEGATIONS_SPACE_LAYOUTS({organizationId:e,eventId:t}),children:n("layouts_27757")})]})]})}),(0,i.jsx)(Qv,{css:{overflowY:"auto"},children:(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(sb,{path:Vk.DELEGATIONS_SPACE_DESIGN({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(AZ,{})}),(0,i.jsx)(sb,{path:Vk.DELEGATIONS_SPACE_LAYOUTS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(wZ,{})})]})})]})},TZ=xa(rd,{variants:{active:{true:{color:"$blue600"}}}}),RZ=({children:e,path:t,text:n,eventId:o})=>{const s=Pi(),r=null!==(0,Ea.B6)(s.pathname,{path:t}),a=zi(),l=$i();return(0,i.jsxs)(TZ,{active:r,align:"center",direction:"column",onClick:()=>{!1===r&&l.push((0,Ea.tW)(t,{...a,eventId:a.eventId||o}))},children:[(0,i.jsx)(ka,{children:e(r)}),(0,i.jsx)(ka,{fontSize:"textXs",children:n})]})},OZ=xa("i",{fontSize:"18px"}),DZ=({active:e,className:t})=>(0,i.jsx)(OZ,{className:`${e?"fa-solid":"fa-regular"} ${t}`}),zZ=xa(rd,{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)"}),$Z=({user:e,eventId:t})=>{const n=Ti();return(0,i.jsxs)(zZ,{justify:"evenly",children:[(0,i.jsx)(RZ,{eventId:t,path:fs.DASHBOARD(":organizationId",":eventId"),text:n("accueil_70474"),children:e=>(0,i.jsx)(DZ,{active:e,className:"fa-house"})}),(0,i.jsx)(RZ,{eventId:t,path:fs.VOLUNTEERS(":organizationId",":eventId"),text:n("membres_11310"),children:e=>(0,i.jsx)(DZ,{active:e,className:"fa-user-group"})}),(0,i.jsx)(RZ,{eventId:t,path:Jo.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),text:n("missions_63972"),children:e=>(0,i.jsx)(DZ,{active:e,className:"fa-sitemap"})}),(0,i.jsx)(RZ,{eventId:t,path:fs.ORGANIZATION_PARAMETERS(":organizationId"),text:n("profil_14444"),children:()=>(0,i.jsx)(Gf,{email:e.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:24})})]})},PZ=({children:e,user:t,eventId:n})=>(0,i.jsxs)(rd,{css:{height:"100%"},direction:"column",children:[(0,i.jsx)(ka,{css:{flex:1,overflow:"auto"},children:e}),(0,i.jsx)($Z,{eventId:n,user:t})]}),MZ=({header:e,value:t})=>(0,i.jsxs)(rd,{css:{bd:!0,padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(ka,{color:"gray500",fontSize:"textSm",fontWeight:"medium",children:e}),(0,i.jsx)(ka,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:t})]}),FZ=({position:e})=>{const{history:t,params:{organizationId:n,eventId:o},translate:s}=bd();return(0,i.jsx)(am,{css:{cursor:"pointer"},onClick:()=>{t.push(Jo.POSITION({organizationId:n,eventId:o,positionId:e.id}))},children:(0,i.jsx)(Qu,{children:(0,i.jsxs)(rd,{direction:"column",gap:"2",width:1,children:[(0,i.jsxs)(rd,{gap:"3",children:[(0,i.jsx)(ka,{color:"gray700",css:{flex:"1"},children:e.name}),(0,i.jsx)(ka,{color:"gray700",children:s("_1_2_membres_04485",e.assignedResources,e.resources)})]}),(0,i.jsx)(ka,{width:1,children:(0,i.jsx)(u$,{percent:e.assignedResources/e.resources})})]})})},e.id)},NZ=xa("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),LZ=xa(Id,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),BZ=xa("h2",{fontSize:"$textMd",fontWeight:"$semiBold",margin:0}),VZ=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o}}=bd(),s=Ei(CC),{hasEventRole:r,hasPermission:a}=dv(),{data:l,loader:d}=Oi("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,V.useMemo)(()=>l.event?(0,cm.A)(l.event.positionsCategories,e=>e.name.toLowerCase()):[],[l.event]),u=()=>{e.push(fs.DASHBOARD_EVENT_SWITCH(n,o))};if(d)return d;{const e=r||c.some(e=>a(Ov.POSITION_READ,{positionCategoryId:e.id}));return(0,i.jsxs)(rd,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(rd,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(NZ,{children:t("accueil_70474")}),(0,i.jsx)(LZ,{icon:"arrow-down-arrow-up",onClick:u})]}),(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(BZ,{children:l.event.name}),(0,i.jsx)(MZ,{header:t("nombre_de_membr_60320",l.event.resources),value:l.event.resources}),(0,i.jsx)(MZ,{header:t("nombre_de_missi_67304",l.event.positions.totalCount),value:l.event.positions.totalCount}),(0,i.jsx)(MZ,{header:t("nombre_de_membr_87779",l.event.assigned.totalCount),value:l.event.assigned.totalCount}),(0,i.jsx)(MZ,{header:t("nombre_de_membr_63555",l.event.waitingAssignment.totalCount),value:l.event.waitingAssignment.totalCount}),(0,i.jsx)(MZ,{header:t("taux_de_remplis_11913"),value:`${0===l.event.resources?"0":Math.round(l.event.assignedResources/l.event.resources*100)}%`}),(0,i.jsx)(MZ,{header:t("temps_de_b_n_vo_87924"),value:s.minutesToHoursMinutesString(l.event.volunteerMinutesNeeded)}),(0,i.jsx)(MZ,{header:t("temps_de_b_n_vo_60725"),value:s.minutesToHoursMinutesString(l.event.volunteerMinutesAssigned)}),(0,i.jsx)(ka,{css:{boxShadow:"$xs"},children:e?(0,i.jsx)(dm,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(pm,{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)(rU,{category:e,clickable:!1,eventId:o,organizationId:n},e.id)):(0,i.jsx)(Wy,{subtitle:t("vous_n_avez_pas_59681"),title:t("aucune_cat_gori_21347")})}),setOffset:hc.A,title:t("liste_des_membr_59735"),totalCount:0}):(0,i.jsx)(dm,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(pm,{children:t("missions_63972")}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:l.event.positions.nodes.map(e=>(0,i.jsx)(FZ,{position:e},e.id))}),setOffset:hc.A,title:t("liste_des_membr_57353"),totalCount:0})})]})]})}},UZ=xa("div",{alignSelf:"flex-end",cursor:"pointer",padding:"$4 $6 $3 $6",i:{color:"$gray500"}}),WZ=({onClose:e})=>(0,i.jsx)(UZ,{onClick:e,children:(0,i.jsx)("i",{className:"fa-regular fa-xmark"})}),GZ=xa(rd,{overflowX:"hidden",overflowY:"auto"}),qZ=xa(rd,{background:"rgba(0, 0, 0, 0.7)",position:"absolute",left:"0",right:"0",top:"0",bottom:"0"}),HZ=xa(rd,{background:"white",borderRadius:"20px 20px 0 0",marginTop:"44px",flex:"1",overflow:"auto"}),KZ=({children:e,onClose:t})=>{const n=(0,Ea.W6)(),o=t??n.goBack;return Jc(o),(0,i.jsx)(qZ,{"data-testid":"overlay-backdrop",direction:"column",onClick:o,children:(0,i.jsxs)(HZ,{"data-testid":"overlay-body",direction:"column",onClick:e=>e.stopPropagation(),children:[(0,i.jsx)(WZ,{onClose:o}),(0,i.jsx)(GZ,{direction:"column",children:e})]})})},YZ=({event:e})=>{const t=Ei(Cm);return(0,i.jsx)(ka,{children:(0,i.jsxs)(rd,{align:"center",css:{color:"$gray500"},children:[(0,i.jsx)(ka,{width:25,children:(0,i.jsx)(Id,{icon:"calendar"})}),(0,i.jsx)(ka,{css:{flex:"1",ellipsis:!0},children:S_(t,e.startAt,e.endAt)})]})})},ZZ=({event:e})=>{const t=Ti();return(0,i.jsxs)(rd,{align:"start",direction:"column",gap:"2",children:[(0,i.jsx)(vu,{color:e.state===oe.Ongoing?"success":"error",children:t(e.state)}),(0,i.jsx)(ka,{color:"gray800",fontSize:"textLg",fontWeight:"medium",width:1,children:e.name}),(0,i.jsx)(YZ,{event:e})]})},XZ=({events:e})=>{const{organizationId:t,eventId:n}=zi(),[o,s]=(0,V.useState)(n),r=$i(),a=Ti();return(0,i.jsxs)(rd,{css:{margin:"0 $4 $7 $4"},direction:"column",children:[(0,i.jsx)(rd,{direction:"column",gap:"4",children:e.map(e=>(0,i.jsx)(pE,{state:e.id===o?"checked":"unchecked",onClick:()=>s(e.id),children:(0,i.jsx)(ZZ,{event:e})},e.id))}),(0,i.jsx)(md,{height:7}),(0,i.jsx)(kd,{onClick:()=>{r.push(fs.DASHBOARD(t,o))},children:a("s_lectionner_l_77300")})]})},JZ=xa("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),QZ=()=>{const{organizationId:e,eventId:t}=zi(),{loader:n,data:o}=Il({organizationId:e,includeCreatedBy:!1,includeDescription:!1,includeNumberOfMembers:!1}),s=$i(),r=Ti();return(0,i.jsxs)(KZ,{onClose:()=>{s.push(fs.DASHBOARD(e,t))},children:[(0,i.jsx)(JZ,{children:r("liste_de_vos_v_44993")}),n||(0,i.jsx)(XZ,{events:o.data.rows.nodes})]})},eX=xa("div",{display:"flex",flex:1,flexDirection:"column",margin:"0 $3"}),tX=xa(rd,{margin:"0 $3",padding:"$3 $4"}),nX=({back:e,children:t})=>(0,i.jsxs)(rd,{align:"center",css:{padding:"10px 0",borderBottom:"1px solid $gray100"},children:[(0,i.jsx)(tX,{color:"gray700",onClick:e,children:(0,i.jsx)(Id,{icon:"chevron-left"})}),t]}),iX=xa("div",{display:"flex",flexDirection:"column",height:"100%",overflow:"auto"}),oX=xa("i",{fontSize:"$textXl"}),sX=({replaySearch:e})=>{const{eventId:t}=zi(),{data:n,loader:o}=Oi("query RecentPositionsSearchesMobile($eventId: EventId!) {\n event(id: $eventId) {\n recentPositionsRegistrationsSearches\n }\n}\n",{eventId:t},[]),s=Ti();if(o)return o;{const t=n.event.recentPositionsRegistrationsSearches;return(0,i.jsxs)(rd,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(ka,{fontSize:"textMd",fontWeight:"semiBold",children:s("recherches_r_ce_82891",t.length)}),t.map((t,n)=>(0,i.jsxs)(rd,{align:"center",gap:"2",onClick:()=>{e(t)},children:[(0,i.jsx)(oX,{className:"fa-regular fa-clock"}),(0,i.jsx)(ka,{children:t})]},n))]})}},rX=e=>{const t=Ti(),n=g(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_slots_limit_reached"===t?.[0]?[e("la_limite_sur_l_75773")]:"delegation_accreditations_limit_reached"===t?.[0]?[e("la_limite_sur_l_43036")]:"delegation_categories_limit_reached"===t?.[0]?[e("la_limite_sur_l_49480")]:"delegation_profiles_limit_reached"===t?.[0]?[e("la_limite_sur_l_56747")]:"can_not_delete_paired"===t?.[0]?[e("ce_membre_est_d_53903")]:Bs(t)?t.map(e):[e("une_erreur_est_92333")])(t,e.content);return(0,i.jsx)(Av,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(yv,{children:[(0,i.jsx)(Cv,{icon:"triangle-exclamation",iconColor:"$error700",children:n}),(0,i.jsx)(jv,{css:{color:"$gray500"},hideBorder:!0,children:(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[e.content?o.join(" "):e.children,g(e.requestUuid)&&(0,i.jsx)(Od,{css:{color:"$gray400",fontSize:"$textXs",userSelect:"text",wordBreak:"break-all"},children:t("r_f_rence_1_92505",e.requestUuid)})]})}),(0,i.jsx)(bv,{hideBorder:!0,hideCancelButton:!0,children:(0,i.jsx)(kd,{color:"error",onClick:e.onClose,children:t("fermer_62479")})})]})})},aX=(0,V.createContext)({}),lX=e=>{const[t,n]=(0,V.useState)(!1),[o,s]=(0,V.useState)([]),[r,a]=(0,V.useState)(void 0),l=(0,V.useCallback)((e,t)=>{e&&void 0!==t&&Vi(t),n(e),s((Array.isArray(t)?t:[]).flatMap(e=>e.isHeaventError?e.message.split("\n"):e.message?.startsWith("db::")?[e.message.substring(4).split(" ")[0]]:[])),a(function(e){const t=e?.[Ys];return"string"==typeof t?t:void 0}(t))},[n,s,a]),d=(0,V.useCallback)(()=>{n(!1),s([]),a(void 0)},[n,s,a]);return(0,i.jsxs)(aX.Provider,{value:{isError:t,setIsError:l},children:[e.children,t&&(0,i.jsx)(rX,{content:o,requestUuid:r,onClose:d})]})},dX=(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 cX(e,t,n){const[o,s]=(0,V.useReducer)(dX,{isLoading:!0,data:void 0,xs:void 0,offset:t.offset}),{setIsError:r}=(0,V.useContext)(aX);(0,V.useEffect)(()=>{let i=!1;return s({type:"FIRST_PAGE_INIT"}),X().then(n=>e(t,n||null)).then(e=>{!1===i&&s({type:"FIRST_PAGE_SUCCESS",data:e,xs:n(e),offset:t.offset})},e=>{!1===i&&r(!0,e)}),()=>{i=!0}},[e,JSON.stringify(t),n]);const a=()=>{s({type:"LOAD_MORE_INIT"});const i=o.offset+t.limit;X().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})},e=>{r(!0,e)})};return(e=>e.isLoading&&void 0===e.data)(o)?{data:o.data,loader:(0,i.jsx)(Cd,{}),loadMore:a,xs:o.xs}:{data:o.data,loader:o.isLoading?(0,i.jsx)(Cd,{}):void 0,loadMore:a,xs:o.xs}}const uX=xa(ka,{display:"flex",flexDirection:"column",[`${kd} + .load-more-status`]:{paddingTop:"12px"}}),mX=({loadMore:e,pageInfo:t,isLoading:n,buttonText:o,statusText:s})=>!1===t.hasNextPage&&!1===t.hasPreviousPage?null:(0,i.jsxs)(uX,{children:[t.hasNextPage&&(0,i.jsx)(kd,{isLoading:n,textAlign:"center",onClick:e,children:o}),(0,i.jsx)(ka,{className:"load-more-status",fontSize:"textSm",textAlign:"center",children:s})]});var hX=n(2872);const gX=xa(rd,{bd:!0,padding:"$4 $3"}),pX=({children:e,...t})=>(0,i.jsxs)(gX,{align:"center",...t,children:[(0,i.jsx)(ka,{css:{flex:1},children:e}),(0,i.jsx)(ka,{color:"gray700",css:{padding:"0 10px 0 $4"},children:(0,i.jsx)(Id,{icon:"chevron-right"})})]}),fX=({open:e,position:t})=>{const n=Ti(),o=Ei(Yh);return(0,i.jsxs)(pX,{onClick:()=>{e(t.id)},children:[(0,i.jsxs)(rd,{gap:"2",children:[t.assignedResources>=t.resources?(0,i.jsx)(vu,{color:"success",children:n("complet_51600")}):(0,i.jsx)(vu,{color:"warning",children:n("incomplet_45915")}),!t.isVisible&&(0,i.jsx)(vu,{color:"gray",children:n("Private")})]}),(0,i.jsx)(ka,{color:"gray800",css:{marginTop:"$2"},fontWeight:"semiBold",children:t.name}),(0,i.jsx)(ka,{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)(ka,{css:{marginTop:"$3"},children:(0,i.jsx)(u$,{percent:t.assignedResources/t.resources})})]})},_X=xa("div",{color:"$gray800",fontWeight:"$semiBold",lineHeight:"24px"}),xX=xa("div",{color:"$gray400",fontSize:"$textSm"}),IX=xa("span",{color:"$gray800"}),vX=({category:e})=>{const t=Ti();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_X,{children:e.name}),Bs(e.leaders)&&(0,i.jsxs)(xX,{children:[`${t("responsable_category",e.leaders.length)} `,(0,i.jsx)(IX,{children:e.leaders.map(({userInfo:e})=>e.name).join(", ")})]})]})},bX=({open:e,positions:t})=>{const n=(0,V.useMemo)(()=>(0,cm.A)((0,hX.A)((0,Vu.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)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(vX,{category:t[0].category}),t.map((t,n)=>(0,i.jsx)(fX,{open:e,position:t},n))]},n))})},jX=()=>{const e=Ti();return(0,i.jsx)(pA,{css:{flex:1,padding:"0 $4"},title:e("d_sol_il_n_y_46236")})},CX=e=>e.event.positions.nodes,yX=({search:e})=>{const t=Ti(),{organizationId:n,eventId:o}=zi(),s={eventId:o,predicates:[],limit:em,offset:0,name:e},{data:r,loader:a,loadMore:l,xs:d}=cX(Dl,s,CX),c=$i();return a&&void 0===r?a:0===d.length?(0,i.jsx)(jX,{}):(0,i.jsxs)(rd,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(ka,{fontSize:"textMd",fontWeight:"semiBold",children:t("r_sultat_de_la_64686",d.length)}),(0,i.jsx)(bX,{open:t=>{c.push(fs.POSITION_SETTINGS(n,o,t),{from:"SEARCH_MOBILE",search:e})},positions:d}),(0,i.jsx)(mX,{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)})]})},AX=xa(rd,{color:"$blue600"}),SX=()=>{const{organizationId:e,eventId:t}=zi(),n=$i(),o=Ti(),s=Pi(),[r,a]=(0,V.useState)(s.state?.search||""),[l,d]=(0,V.useState)(s.state?.search||"");return(0,i.jsxs)(iX,{children:[(0,i.jsx)(nX,{back:()=>{n.push(Jo.POSITIONS({organizationId:e,eventId:t}))},children:(0,i.jsxs)(rd,{align:"center",css:{marginRight:"$4",flexGrow:1},gap:"3",children:[(0,i.jsx)(Qd,{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)(AX,{onClick:()=>{a(""),d("")},children:o("annuler_48254")})]})}),(0,i.jsx)(eX,{children:l?(0,i.jsx)(yX,{search:l}):(0,i.jsx)(sX,{replaySearch:e=>{a(e),d(e)}})})]})},kX=({folders:e,segmentId:t,...n})=>(0,i.jsx)(hh,{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 wX=n(473);const EX=()=>{const e=Ti();return(0,i.jsx)(pA,{css:{flex:1,padding:"0 $4"},subtitle:e("cr_ez_de_nouvel_87003"),title:e("il_n_y_a_pas_de_55837")})},TX=e=>e.event.positions.nodes,RX=({segment:e})=>{const t=Ti(),{organizationId:n,eventId:o}=zi(),s={eventId:o,predicates:e.predicates,limit:em,offset:0},{data:r,loader:a,loadMore:l,xs:d}=cX(Dl,s,TX),c=$i();return a&&void 0===r?a:0===d.length?(0,i.jsx)(EX,{}):(0,i.jsxs)(rd,{direction:"column",gap:"7",children:[(0,i.jsx)(bX,{open:e=>{c.push(fs.POSITION_SETTINGS(n,o,e))},positions:d}),(0,i.jsx)(mX,{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)})]})},OX=xa("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),DX=xa(Id,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),zX=({event:e})=>{const{organizationId:t,eventId:n,segmentId:o}=zi(),s=$i(),r=Ti(),a=(0,wX.A)(e.segmentsFolders.flatMap(e=>e.segments),{id:o});return(0,i.jsxs)(rd,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(rd,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(OX,{children:r("missions_63972")}),(0,i.jsx)(DX,{icon:"search",onClick:()=>{s.push(fs.POSITIONS_SEARCH(t,n))}})]}),(0,i.jsx)(ka,{children:(0,i.jsx)(kX,{folders:e.segmentsFolders,segmentId:o,onChange:e=>s.push(fs.POSITIONS_SEGMENT(t,n,e))})}),(0,i.jsx)(rd,{css:{flex:1},direction:"column",children:(0,i.jsx)(RX,{segment:a})})]})},$X=()=>{const{organizationId:e,eventId:t}=zi(),{data:n,loader:o}=Oi("query PositionsSegmentsMobile($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Positions) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{eventId:t},[js.SegmentsFoldersSegmentsFragment]);return o||(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:fs.POSITIONS_SEARCH(":organizationId",":eventId"),children:(0,i.jsx)(SX,{})}),(0,i.jsx)(Ea.qh,{path:fs.POSITIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(zX,{event:n.event})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:fs.POSITIONS_SEGMENT(e,t,n.event.segmentsFolders[0].segments[0].id)})})]})},PX=xa(rd,{backgroundColor:"$gray100",borderRadius:"$1",padding:"2px"}),MX=({children:e,...t})=>(0,i.jsx)(PX,{...t,children:e}),FX=xa(rd,{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"}}}}),NX=({children:e,path:t})=>{const n=$i(),o=Pi().pathname===t;return(0,i.jsx)(FX,{isSelected:o,justify:"center",onClick:()=>{n.push(t)},children:e})},LX=({children:e,css:t,...n})=>(0,i.jsx)(rd,{align:"center",css:{flex:1,marginRight:"66px",...t},direction:"column",...n,children:e}),BX=({back:e,position:t})=>(0,i.jsx)(nX,{back:e,children:(0,i.jsxs)(LX,{css:{minHeight:"40px"},children:[(0,i.jsx)(ka,{color:"gray900",fontWeight:"medium",textAlign:"center",children:t.name}),(0,i.jsx)(ka,{color:"gray500",fontSize:"textXs",textAlign:"center",children:t.positionCategoryName})]})}),VX=e=>{const{translate:t}=bd(),n=om();return(0,i.jsx)($k,{title:e.title,children:(0,i.jsxs)(rd,{align:"center",direction:"column",...n?{gap:"9"}:{gap:"7"},gap:"4",width:1,children:[(0,i.jsx)(Ok,{count:e.category.assignedResources,total:e.category.resources}),(0,i.jsx)(vu,{leftIcon:"user",children:t("_1_membre_pr_32812",e.category.preassignedResources)})]})})},UX=({position:e})=>(0,i.jsx)(ka,{color:"gray800",css:{background:e.color,borderRadius:"20px",height:"20px",width:"20px"}}),WX=({customFields:e,position:t})=>{const{translate:n}=bd(),o=Ei(Yh);return(0,i.jsx)($k,{title:n("param_tres_78420"),children:(0,i.jsx)(rd,{direction:"column",gap:"4",width:1,children:(0,i.jsxs)(KN,{children:[(0,i.jsxs)(qN,{children:[(0,i.jsx)(VN,{children:n("cat_gorie_00291")}),(0,i.jsx)(WN,{children:t.positionCategoryName})]}),(0,i.jsx)(LN,{direction:"horizontal"}),(0,i.jsxs)(qN,{children:[(0,i.jsx)(VN,{children:n("Color")}),(0,i.jsx)(WN,{children:(0,i.jsx)(UX,{position:t})})]}),(0,i.jsx)(LN,{direction:"horizontal"}),(0,i.jsxs)(qN,{children:[(0,i.jsx)(VN,{children:n("ic_ne_55554")}),(0,i.jsx)(WN,{children:(0,i.jsx)(Id,{icon:xd(t.icon)})})]}),(0,i.jsx)(LN,{direction:"horizontal"}),(0,i.jsxs)(qN,{children:[(0,i.jsx)(VN,{children:n("Date")}),(0,i.jsx)(WN,{children:t.range?o.toLocaleString(t.range,void 0,{year:"numeric",month:"long",day:"numeric"}):"-"})]}),e.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsxs)(rd,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(ka,{color:"gray500",css:{flex:"1"},children:e.name}),(0,i.jsx)(rd,{justify:"end",width:300,children:(0,i.jsx)(nA,{field:e,fields:t.fields})})]})]},e.slug))]})})})},GX=({customFields:e,position:t})=>{const n=Ti(),{roles:o}=_v();return(0,i.jsxs)(rd,{css:{marginBottom:"$7"},direction:"column",gap:"7",children:[(0,i.jsx)(VX,{category:t,title:n("remplissage_des_84383")}),(0,i.jsx)(Aw,{leaders:t.leaders,roles:o.positionRoles}),(0,i.jsx)(WX,{customFields:e,position:t}),(0,i.jsx)(Uk,{description:t.description}),(0,i.jsx)(eL,{location:t}),(0,i.jsx)(JN,{customFields:t.customFields}),(0,i.jsx)(Kk,{modalSubtitle:n("ajouter_des_tag_64526"),tags:t.tags}),(0,i.jsx)(Wk,{privateNote:t.privateNote})]})},qX=(e,t)=>e.name||t.toLocaleString(e.range,void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"}),HX=({open:e,slot:t})=>{const n=Ti(),o=Ei(Yh);return(0,i.jsxs)(pX,{onClick:()=>{e(t.id)},children:[(0,i.jsx)(rd,{gap:"2",children:t.assignedResources>=t.resources?(0,i.jsx)(vu,{color:"success",children:n("complet_51600")}):(0,i.jsx)(vu,{color:"warning",children:n("_1_membre_manq_31014",t.resources-t.assignedResources)})}),(0,i.jsx)(ka,{color:"gray800",css:{marginTop:"$2"},fontWeight:"semiBold",children:t.name}),(0,i.jsx)(ka,{color:"gray500",css:{marginTop:"$1"},fontSize:"textSm",children:qX(t,o)}),(0,i.jsx)(ka,{css:{marginTop:"$3"},children:(0,i.jsx)(u$,{percent:t.assignedResources/t.resources})})]})},KX=({open:e,slots:t})=>{const n=Ti();return(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(ka,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:n("liste_des_cr_ne_94056")}),t.map((t,n)=>(0,i.jsx)(HX,{open:e,slot:t},n))]})},YX=e=>e.event.positionsSlots.nodes,ZX=({open:e,eventId:t,positionId:n})=>{const o={eventId:t,positionId:n,limit:em,offset:0},{data:s,loader:r,loadMore:a,xs:l}=cX($l,o,YX);return r&&void 0===s?r:(0,i.jsxs)(rd,{css:{marginBottom:"$7"},direction:"column",gap:"7",children:[(0,i.jsx)(KX,{open:e,slots:l}),(0,i.jsx)(mX,{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`})]})},XX=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:o,positionId:s}}=bd(),{data:r,loader:a}=Pl({organizationId:n,eventId:o,positionId:s}),l=Pi(),[d]=(0,V.useState)(l.state);if(l.pathname===Jo.POSITION({organizationId:n,eventId:o,positionId:s}))return(0,i.jsx)(Fi,{path:fs.POSITION_SETTINGS(n,o,s)});const c={settings:fs.POSITION_SETTINGS(n,o,s),slots:Jo.POSITION_SLOTS({organizationId:n,eventId:o,positionId:s})};return a||(0,i.jsxs)(iX,{children:[(0,i.jsx)(BX,{back:()=>{"SEARCH_MOBILE"===d?.from?e.push(fs.POSITIONS_SEARCH(n,o),{search:d?.search}):e.push(Jo.POSITIONS({organizationId:n,eventId:o}))},position:r.event.position}),(0,i.jsx)(eX,{children:(0,i.jsxs)(rb,{children:[(0,i.jsxs)(MX,{css:{margin:"$6 0"},children:[(0,i.jsx)(NX,{path:c.settings,children:t("param_tres_78420")}),(0,i.jsx)(NX,{path:c.slots,children:t("cr_neaux_33401")})]}),(0,i.jsx)(sb,{path:c.settings,children:(0,i.jsx)(GX,{customFields:r.organization.customFields.nodes,position:r.event.position})}),(0,i.jsx)(sb,{path:c.slots,children:(0,i.jsx)(ZX,{eventId:o,open:t=>{e.push(fs.POSITION_SLOT_MEMBERS(n,o,s,t))},positionId:r.event.position.id})})]})})]})},JX=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:o}=zi(),s=$i(),r=Ti();return(0,i.jsx)(KZ,{onClose:()=>{s.push(fs.POSITION_SLOT_MEMBERS(e,t,n,o))},children:(0,i.jsxs)(rd,{css:{margin:"$3"},direction:"column",gap:"3",children:[(0,i.jsx)(kd,{onClick:()=>{s.push(fs.POSITION_SLOT_CHECK_MEMBERS_CHECK_IN(e,t,n,o))},children:r("pointer_des_mem_09244")}),(0,i.jsx)(kd,{onClick:()=>{s.push(fs.POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT(e,t,n,o))},children:r("d_pointer_des_m_31557")}),(0,i.jsx)(kd,{onClick:()=>{s.push(fs.POSITION_SLOT_CHECK_MEMBERS_RESET(e,t,n,o))},children:r("remettre_z_ro_65589")})]})})},QX=xa(rd,{fontSize:"$textSm",color:"$blue600"}),eJ=({onSubmit:e,children:t,data:n,loader:o,loadMore:s,xs:r,disabled:a})=>{const l=Ti(),[d,c]=(0,V.useState)(r);(0,V.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)(rd,{direction:"column",height:"100%",width:"100%",children:[(0,i.jsxs)(rd,{css:{flex:1,overflow:"auto",padding:"$6 $4 $3 $4"},direction:"column",gap:"5",children:[(0,i.jsxs)(rd,{justify:"between",children:[(0,i.jsx)(ka,{fontSize:"textMd",fontWeight:"semiBold",children:l("liste_des_membr_86405",r.length)}),(0,i.jsx)(QX,{onClick:()=>{c(d.map(e=>({...e,state:"checked"})))},children:l("tout_s_l_ctionn_18234")})]}),(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[d.map((e,t)=>(0,i.jsx)(Eu,{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)(mX,{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)(rd,{css:{boxShadow:"$mdReverse",padding:"$6 $4"},direction:"column",children:(0,V.isValidElement)(t)?(0,V.cloneElement)(t,{onClick:()=>e(u),disabled:0===u.length}):t})]})},tJ=e=>e.event.volunteersRegistrations.nodes,nJ=()=>{const{eventId:e,positionSlotId:t}=zi(),n=Ti(),o={eventId:e,positionSlotId:t,predicates:[{operator:we.IsNot,value:[lt.CheckedIn],value2:[t],slug:"checkInStatePositionSlot"}],limit:50,offset:0},{data:s,loader:r,loadMore:a,xs:l}=cX(zl,o,tJ),{isLoading:d,mutate:c}=Dr(),[u,m]=(0,V.useState)([]);if(r&&void 0===s)return r;{const t=async t=>{await c({eventId:e,checkIn:{strategy:At.CheckIn,positionsSlotsUsersInfosIds:t}}),m([...u,...t])};return(0,i.jsx)(eJ,{data:s,disabled:u,loadMore:a,loader:r,xs:l,onSubmit:t,children:(0,i.jsx)(kd,{isLoading:d,textAlign:"center",children:n("pointer_80927")})})}},iJ=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:o}=zi(),s=$i(),r=Ti();return(0,i.jsxs)(iX,{children:[(0,i.jsx)(nX,{back:()=>{s.push(fs.POSITION_SLOT_MEMBERS(e,t,n,o))},children:(0,i.jsx)(LX,{children:r("pointer_des_mem_09244")})}),(0,i.jsx)(eX,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(nJ,{})})]})},oJ=e=>e.event.volunteersRegistrations.nodes,sJ=()=>{const{eventId:e,positionSlotId:t}=zi(),n=Ti(),o={eventId:e,positionSlotId:t,predicates:[{operator:we.IsNot,value:[lt.CheckedOut],value2:[t],slug:"checkInStatePositionSlot"}],limit:50,offset:0},{data:s,loader:r,loadMore:a,xs:l}=cX(zl,o,oJ),{isLoading:d,mutate:c}=Dr(),[u,m]=(0,V.useState)([]);if(r&&void 0===s)return r;{const t=async t=>{await c({eventId:e,checkIn:{strategy:At.CheckOut,positionsSlotsUsersInfosIds:t}}),m([...u,...t])};return(0,i.jsx)(eJ,{data:s,disabled:u,loadMore:a,loader:r,xs:l,onSubmit:t,children:(0,i.jsx)(kd,{isLoading:d,textAlign:"center",children:n("d_pointer_25328")})})}},rJ=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:o}=zi(),s=$i(),r=Ti();return(0,i.jsxs)(iX,{children:[(0,i.jsx)(nX,{back:()=>{s.push(fs.POSITION_SLOT_MEMBERS(e,t,n,o))},children:(0,i.jsx)(LX,{children:r("d_pointer_des_m_31557")})}),(0,i.jsx)(eX,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(sJ,{})})]})},aJ=e=>e.event.volunteersRegistrations.nodes,lJ=()=>{const{eventId:e,positionSlotId:t}=zi(),n=Ti(),o={eventId:e,positionSlotId:t,predicates:[{operator:we.IsNot,value:[lt.Waiting],value2:[t],slug:"checkInStatePositionSlot"}],limit:50,offset:0},{data:s,loader:r,loadMore:a,xs:l}=cX(zl,o,aJ),{isLoading:d,mutate:c}=Dr(),[u,m]=(0,V.useState)([]);if(r&&void 0===s)return r;{const t=async t=>{await c({eventId:e,checkIn:{strategy:At.Reset,positionsSlotsUsersInfosIds:t}}),m([...u,...t])};return(0,i.jsx)(eJ,{data:s,disabled:u,loadMore:a,loader:r,xs:l,onSubmit:t,children:(0,i.jsx)(kd,{isLoading:d,textAlign:"center",children:n("remettre_z_ro_82376")})})}},dJ=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:o}=zi(),s=$i(),r=Ti();return(0,i.jsxs)(iX,{children:[(0,i.jsx)(nX,{back:()=>{s.push(fs.POSITION_SLOT_MEMBERS(e,t,n,o))},children:(0,i.jsx)(LX,{children:r("remettre_z_ro_11572")})}),(0,i.jsx)(eX,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(lJ,{})})]})},cJ=e=>{let t,n,o;return"registrationState"in e?(({color:t,leftIcon:o}=fb(e.registrationState)),n=`${t}100`):(t=function(e){switch(e){case lt.CheckedIn:case lt.CheckedOut:return"success";case lt.Waiting:return"warning"}}(e.checkInState),n=`${t}500`),(0,i.jsx)(rd,{align:"center",css:{background:Ia.colors[n].value,border:"2px solid white",borderRadius:`${e.size}px`,bottom:"0",color:Ia.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)(Id,{icon:o})})},uJ=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}},mJ=xa("div",{position:"relative"}),hJ=e=>{let t,n;if("registrationState"in e){t={registrationState:e.registrationState,size:uJ(e.size)};const{registrationState:i,...o}=e;n=o}else{t={checkInState:e.checkInState,size:uJ(e.size)};const{checkInState:i,...o}=e;n=o}return(0,i.jsxs)(mJ,{children:[(0,i.jsx)(Gf,{...n}),(0,i.jsx)(cJ,{...t})]})},gJ=xa(rd,{overflow:"hidden"}),pJ=xa("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"}}}}}),fJ=({userInfo:e,size:t,...n})=>(0,i.jsxs)(gJ,{direction:"column",...n,children:[g(e.name)&&(0,i.jsx)(pJ,{size:t,children:e.name}),(0,i.jsx)(pJ,{size:t,children:e.email})]}),_J=e=>{const t={name:e.userInfo.name,email:e.userInfo.email,image:e.userInfo.picture?.url};return(0,i.jsxs)(rd,{align:"center",onClick:e.openVolunteer,children:["registrationState"in e?(0,i.jsx)(hJ,{...t,registrationState:e.registrationState,size:40}):"checkInState"in e?(0,i.jsx)(hJ,{...t,checkInState:e.checkInState,size:40}):(0,i.jsx)(Gf,{...t,size:40}),(0,i.jsx)(fJ,{css:{marginLeft:"$3"},size:40,userInfo:e.userInfo})]})},xJ=()=>{const e=Ti();return(0,i.jsxs)(rd,{align:"center",css:{flex:1},direction:"column",gap:"4",justify:"center",children:[(0,i.jsx)(wj,{color:"primary",icon:"user-group"}),(0,i.jsx)(ka,{color:"gray500",children:e("aucun_b_n_vole_19616")})]})},IJ=xa("h1",{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}),vJ=xa(Id,{color:"$gray800",margin:"0 $3",padding:"$3 $4"}),bJ=({back:e,slot:t})=>{const{organizationId:n,eventId:o,positionId:s,positionSlotId:r}=zi(),a=Ei(Yh),l=$i(),{hasPermission:d}=dv(),c=d(Ov.POSITION_READ,{positionCategoryId:t.positionCategoryId,positionId:s});return(0,i.jsxs)(nX,{back:e,children:[(0,i.jsx)(LX,{css:{minHeight:"40px",marginRight:"0"},children:(0,i.jsx)(IJ,{children:qX(t,a)})}),c&&(0,i.jsx)(vJ,{icon:"list-check",onClick:()=>{l.push(fs.POSITION_SLOT_MEMBERS_CHECK_OPTIONS(n,o,s,r))}})]})},jJ=e=>e.event.volunteersRegistrations.nodes,CJ=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:o}=zi(),s=Ti(),r=$i(),a={eventId:t,positionSlotId:o,predicates:[],limit:em,offset:0},{data:l,loader:d,loadMore:c,xs:u}=cX(zl,a,jJ);return d&&void 0===l?d:(0,i.jsxs)(iX,{children:[(0,i.jsx)(bJ,{back:()=>{r.push(Jo.POSITION_SLOTS({organizationId:e,eventId:t,positionId:n}))},slot:l.event.positionSlot}),(0,i.jsx)(eX,{children:(0,i.jsx)(rd,{css:{flex:1,margin:"$7 0"},direction:"column",gap:"7",children:0===u.length?(0,i.jsx)(xJ,{}):(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[u.map(s=>(0,i.jsx)(_J,{checkInState:s.positionSlotUserInfo.state,openVolunteer:()=>{r.push(fs.POSITION_SLOT_MEMBERS_USER_INFORMATIONS(e,t,n,o,s.userInfo.id))},userInfo:s.userInfo},s.id)),(0,i.jsx)(mX,{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)})]})})})]})},yJ=xa("div",{minHeight:"$space$5","@tablet":{minHeight:"$space$6"}}),AJ=e=>(0,i.jsx)(ka,{color:"gray800",css:{fontSize:"$textLg","@tablet":{fontSize:"$textMd"},...e.css},fontWeight:"semiBold",children:e.children}),SJ=e=>{const t=om(),n=Ti(),o=e.fieldsToDisplay.filter(e=>!["picture","firstName","lastName"].includes(e.fieldProperty)),s=o.length,r=e.privateCustomFields.length;return(0,i.jsxs)(rd,{direction:"column",children:[s>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(AJ,{children:n("informations_pe_37892")}),(0,i.jsx)(md,{height:"3"}),o.map(t=>Qb(t,e.userInfo.fields,o)&&(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(oA,{field:t,fields:e.userInfo.fields}),(0,i.jsx)(yJ,{})]},t.id)),!1===t&&(0,i.jsx)(ka,{css:{borderBottom:"1px solid $gray200"},width:1})]}),r>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:t?5:6}),(0,i.jsxs)(rd,{gap:"3",children:[(0,i.jsx)(AJ,{children:(0,i.jsx)(Id,{icon:"lock"})}),(0,i.jsx)(AJ,{children:n("informations_pr_15873")})]}),(0,i.jsx)(md,{height:"3"}),e.privateCustomFields.map(t=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(oA,{field:t,fields:e.userInfo.fields}),(0,i.jsx)(yJ,{})]},t.id)),!1===t&&(0,i.jsx)(ka,{css:{borderBottom:"1px solid $gray200"},width:1})]}),!1===t&&e.editButton,!1===t&&(0,i.jsx)(md,{height:"6"})]})},kJ=e=>{const t=$i(),n=om(),o=g(e.path);return(0,i.jsxs)(rd,{css:{cursor:o?"pointer":"initial"},direction:"column",onClick:()=>{o&&t.push(e.path)},children:[(0,i.jsx)(ka,{color:"gray800",css:{fontSize:"$textSm",overflow:"hidden",textOverflow:"ellipsis"},fontWeight:"medium",children:e.text}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:e.subtext}),(0,i.jsx)(md,{height:n?5:6})]})},wJ=e=>{const t=Ti(),{hasPermission:n}=dv(),o=Ei(Cm),s=Ei(CC),r=Ei(Yh),a=om(),l=n(Ov.MEMBER_ASSIGN),d=(0,cm.A)(e.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),c=(0,cm.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)(rd,{direction:"column",children:[(0,i.jsx)(md,{height:"6"}),Bs(d)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(AJ,{children:t("affectation_plural")}),(0,i.jsx)(md,{height:"3"}),d.map((t,o)=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(cA,{canCheckIn:n(Ov.POSITION_READ,{positionCategoryId:t.positionCategoryId,positionId:t.position.id}),canDelete:l,positionSlotUserInfo:t,reloadCheckIn:e.reload,onDelete:e.reload}),(0,i.jsx)(md,{height:a?2:3})]},o)),(0,i.jsx)(md,{height:"3"}),!1===a&&(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(md,{height:a?5:6})]}),Bs(c)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(AJ,{children:t("missions_et_cat_88954")}),(0,i.jsx)(md,{height:"3"}),c.map((t,n)=>(0,i.jsx)(kJ,{path:t.isPosition?Jo.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:t.id}):Jo.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)(Oh,{direction:"horizontal"}),(0,i.jsx)(md,{height:a?5:6})]}),(Bs(e.volunteerRegistration.positionsCategories)||Bs(e.volunteerRegistration.positions)||Bs(e.volunteerRegistration.positionsSlots))&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(AJ,{children:t("missions_souhai_23225")}),(0,i.jsx)(md,{height:"3"}),(0,cm.A)(e.volunteerRegistration.positionsCategories,e=>e.range?.start?.toMillis()??0).map((t,n)=>(0,i.jsx)(kJ,{path:Jo.POSITION_CATEGORY({organizationId:e.organizationId,eventId:e.eventId,positionCategoryId:t.id}),subtext:t.range?r.toDisplayString(t.range):"-",text:t.name},n)),(0,cm.A)(e.volunteerRegistration.positions,e=>e.range?.start?.toMillis()??0).map((t,n)=>(0,i.jsx)(kJ,{path:Jo.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:t.id}),subtext:t.range?r.toDisplayString(t.range):"-",text:t.name},n)),(0,cm.A)(e.volunteerRegistration.positionsSlots,e=>e.range.start.toMillis()).map((t,n)=>(0,i.jsx)(kJ,{path:Jo.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:t.position.id}),subtext:t.nameOrRange,text:t.position.name},n)),!1===a&&(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(md,{height:a?5:6})]}),Bs(e.volunteerRegistration.slots)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(AJ,{children:t("disponibilit_s_49923")}),(0,i.jsx)(md,{height:"3"}),e.volunteerRegistration.slots.map((e,n)=>(0,i.jsx)(kJ,{subtext:r.toDisplayString(e.range),text:t("disponibilit_n_50484",n+1)},n)),!1===a&&(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(md,{height:a?5:6})]}),e.volunteerRegistration.state===ve.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(AJ,{children:t("statistiques_98073")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(kJ,{subtext:s.minutesToHoursMinutesString(e.volunteerRegistration.volunteerMinutes),text:t("nombre_d_heures_36999")}),!1===a&&(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(md,{height:a?5:6})]}),(0,i.jsx)(AJ,{children:t("inscription_48144")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(kJ,{subtext:o.toLocaleString(e.volunteerRegistration.insertedAt.toLocal(),zs.DateTime),text:t("date_d_inscript_31369")})]})},EJ=xa(ka,{lineHeight:"28px",marginTop:"$3",maxWidth:"100%",ellipsis:""}),TJ=xa(ka,{lineHeight:"20px",maxWidth:"100%",ellipsis:""}),RJ=({registration:e})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hJ,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,registrationState:e.state,size:64}),(0,i.jsx)(EJ,{color:"gray800",fontSize:"textLg",fontWeight:"semiBold",children:e.userInfo.name}),(0,i.jsx)(TJ,{color:"gray500",fontSize:"textSm",children:e.userInfo.email})]}),OJ=({basePath:e,data:t,reload:n})=>{const o=Ti(),{organizationId:s,eventId:r}=zi(),a=t.event.volunteerRegistration,l={informations:`${e}/${Hi.INFORMATION}`,registration:`${e}/${Hi.REGISTRATION}`};return(0,i.jsxs)(rd,{align:"center",css:{alignSelf:"center",padding:"0 $4"},direction:"column",width:1,children:[(0,i.jsx)(RJ,{registration:a}),(0,i.jsxs)(rb,{css:{marginTop:"$5"},children:[(0,i.jsxs)(MX,{children:[(0,i.jsx)(NX,{path:l.informations,children:o("informations_22954")}),(0,i.jsx)(NX,{path:l.registration,children:o("missions_63972")})]}),(0,i.jsx)(sb,{path:l.informations,children:(0,i.jsx)(SJ,{fieldsToDisplay:t.event.formsCustomsFields,privateCustomFields:t.organization.customFields.nodes,userInfo:a.userInfo})}),(0,i.jsx)(sb,{path:l.registration,children:(0,i.jsx)(wJ,{eventId:r,organizationId:s,reload:n,volunteerRegistration:a})})]})]})},DJ=({basePath:e,onClose:t})=>{const{organizationId:n,eventId:o,userInfoId:s}=zi(),{data:r,loader:a,reload:l}=Oi("query UserInfoMobile(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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},[js.CustomFieldWithConditionFragment,js.UserInfoOverlayFragment,js.UserPositionSlotUserInfoFragment]);return(0,i.jsx)(KZ,{onClose:t,children:a||(0,i.jsx)(OJ,{basePath:e,data:r,reload:l})})},zJ=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:o,userInfoId:s}=zi(),r=$i(),a=fs.POSITION_SLOT_MEMBERS_USER(e,t,n,o,s);return(0,i.jsx)(DJ,{basePath:a,onClose:()=>{r.push(fs.POSITION_SLOT_MEMBERS(e,t,n,o))}})},$J=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:fs.POSITION_SLOT_CHECK_MEMBERS_CHECK_IN(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(iJ,{})}),(0,i.jsx)(Ea.qh,{path:fs.POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(rJ,{})}),(0,i.jsx)(Ea.qh,{path:fs.POSITION_SLOT_CHECK_MEMBERS_RESET(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(dJ,{})}),(0,i.jsx)(Ea.qh,{path:fs.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(CJ,{})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(XX,{})})]}),(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:fs.POSITION_SLOT_MEMBERS_CHECK_OPTIONS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(JX,{})}),(0,i.jsx)(Ea.qh,{path:fs.POSITION_SLOT_MEMBERS_USER(":organizationId",":eventId",":positionId",":positionSlotId",":userInfoId"),children:(0,i.jsx)(zJ,{})})]})]}),PJ=xa("i",{fontSize:"$textXl"}),MJ=({replaySearch:e})=>{const{eventId:t}=zi(),{data:n,loader:o}=Oi("query RecentVolunteersSearchesMobile($eventId: EventId!) {\n event(id: $eventId) {\n recentVolunteersRegistrationsSearches\n }\n}\n",{eventId:t},[]),s=Ti();if(o)return o;{const t=n.event.recentVolunteersRegistrationsSearches;return(0,i.jsxs)(rd,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(ka,{fontSize:"textMd",fontWeight:"semiBold",children:s("recherches_r_ce_82891",t.length)}),t.map((t,n)=>(0,i.jsxs)(rd,{align:"center",gap:"2",onClick:()=>{e(t)},children:[(0,i.jsx)(PJ,{className:"fa-regular fa-clock"}),(0,i.jsx)(ka,{children:t})]},n))]})}},FJ=()=>{const e=Ti();return(0,i.jsx)(pA,{css:{flex:1,padding:"0 $4"},title:e("d_sol_il_n_y_46236")})},NJ=e=>e.event.volunteersRegistrations.nodes,LJ=({search:e})=>{const t=Ti(),{organizationId:n,eventId:o}=zi(),s={eventId:o,predicates:[],limit:em,offset:0,name:e},{data:r,loader:a,loadMore:l,xs:d}=cX(Xl,s,NJ),c=$i();return a&&void 0===r?a:0===d.length?(0,i.jsx)(FJ,{}):(0,i.jsxs)(rd,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(ka,{fontSize:"textMd",fontWeight:"semiBold",children:t("r_sultat_de_la_64686",d.length)}),d.map((e,t)=>(0,i.jsx)(_J,{openVolunteer:()=>{c.push(fs.VOLUNTEERS_SEARCH_USER_INFORMATIONS(n,o,e.userInfo.id))},registrationState:e.state,userInfo:e.userInfo},t)),(0,i.jsx)(mX,{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)})]})},BJ=xa(rd,{color:"$blue600"}),VJ=()=>{const{organizationId:e,eventId:t}=zi(),n=$i(),o=Ti(),[s,r]=(0,V.useState)(""),[a,l]=(0,V.useState)("");return(0,i.jsxs)(iX,{children:[(0,i.jsx)(nX,{back:()=>{n.push(fs.VOLUNTEERS(e,t))},children:(0,i.jsxs)(rd,{align:"center",css:{marginRight:"$4",flexGrow:1},gap:"3",children:[(0,i.jsx)(Qd,{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)(BJ,{onClick:()=>{r(""),l("")},children:o("annuler_48254")})]})}),(0,i.jsx)(eX,{children:a?(0,i.jsx)(LJ,{search:a}):(0,i.jsx)(MJ,{replaySearch:e=>{r(e),l(e)}})})]})},UJ=()=>{const{organizationId:e,eventId:t,userInfoId:n}=zi(),o=$i(),s=fs.VOLUNTEERS_SEARCH_USER(e,t,n);return(0,i.jsx)(DJ,{basePath:s,onClose:()=>{o.push(fs.VOLUNTEERS_SEARCH(e,t))}})},WJ=()=>{const e=Ti();return(0,i.jsx)(pA,{css:{flex:1,padding:"0 $4"},subtitle:e("diffusez_le_for_36054"),title:e("il_n_y_a_pas_de_22623")})},GJ=e=>e.event.volunteersRegistrations.nodes,qJ=({segment:e})=>{const t=Ti(),{organizationId:n,eventId:o,segmentId:s}=zi(),r={eventId:o,predicates:e.predicates,limit:em,offset:0},{data:a,loader:l,loadMore:d,xs:c}=cX(Xl,r,GJ),u=$i();return l&&void 0===a?l:0===c.length?(0,i.jsx)(WJ,{}):(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[c.map((e,t)=>(0,i.jsx)(_J,{openVolunteer:()=>{u.push(fs.VOLUNTEERS_LIST_USER_INFORMATIONS(n,o,s,e.userInfo.id))},registrationState:e.state,userInfo:e.userInfo},t)),(0,i.jsx)(mX,{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)})]})},HJ=xa("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),KJ=xa(Id,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),YJ=({event:e})=>{const{organizationId:t,eventId:n,segmentId:o}=zi(),s=$i(),r=Ti(),a=(0,wX.A)(e.segmentsFolders.flatMap(e=>e.segments),{id:o});return(0,i.jsxs)(rd,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(rd,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(HJ,{children:r("membres_11310")}),(0,i.jsx)(KJ,{icon:"search",onClick:()=>{s.push(fs.VOLUNTEERS_SEARCH(t,n))}})]}),(0,i.jsx)(ka,{children:(0,i.jsx)(kX,{folders:e.segmentsFolders,segmentId:o,onChange:e=>s.push(fs.VOLUNTEERS_SEGMENT(t,n,e))})}),(0,i.jsx)(rd,{css:{flex:1},direction:"column",children:(0,i.jsx)(qJ,{segment:a})})]})},ZJ=()=>{const{organizationId:e,eventId:t,segmentId:n,userInfoId:o}=zi(),s=$i(),r=fs.VOLUNTEERS_LIST_USER(e,t,n,o);return(0,i.jsx)(DJ,{basePath:r,onClose:()=>{s.push(fs.VOLUNTEERS_SEGMENT(e,t,n))}})},XJ=()=>{const{organizationId:e,eventId:t}=zi(),{data:n,loader:o}=Oi("query VolunteersSegmentsMobile($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Volunteers) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{eventId:t},[js.SegmentsFoldersSegmentsFragment]);return o||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:fs.VOLUNTEERS_SEARCH(":organizationId",":eventId"),children:(0,i.jsx)(VJ,{})}),(0,i.jsx)(Ea.qh,{path:fs.VOLUNTEERS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(YJ,{event:n.event})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:fs.VOLUNTEERS_SEGMENT(e,t,n.event.segmentsFolders[0].segments[0].id)})})]}),(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:fs.VOLUNTEERS_SEARCH_USER(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(UJ,{})}),(0,i.jsx)(Ea.qh,{path:fs.VOLUNTEERS_LIST_USER(":organizationId",":eventId",":segmentId",":userInfoId"),children:(0,i.jsx)(ZJ,{})})]})]})},JJ=()=>{const{organizationId:e,eventId:t}=zi(),{user:n}=_v();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:fs.DASHBOARD(":organizationId",":eventId"),children:(0,i.jsx)(PZ,{eventId:t,user:n,children:(0,i.jsx)(VZ,{})})}),(0,i.jsx)(Ea.qh,{path:fs.VOLUNTEERS(":organizationId",":eventId"),children:(0,i.jsx)(PZ,{eventId:t,user:n,children:(0,i.jsx)(XJ,{})})}),(0,i.jsx)(Ea.qh,{path:Jo.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(PZ,{eventId:t,user:n,children:(0,i.jsx)($X,{})})}),(0,i.jsx)(Ea.qh,{path:Jo.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)($J,{})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:fs.DASHBOARD(e,t)})})]}),(0,i.jsx)(Ea.dO,{children:(0,i.jsx)(Ea.qh,{path:fs.DASHBOARD_EVENT_SWITCH(":organizationId",":eventId"),children:(0,i.jsx)(QZ,{})})})]})},QJ=e=>{const t=e.isActive?e.isActive(location.pathname):location.pathname===e.to,[n,o]=V.useState(t),s=!!e.children&&(!e.isMenuOpen||n),r=()=>(0,i.jsxs)(rd,{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:"$primary500"}},gap:"3",height:e.isMenuOpen?void 0:40,width:1,onClick:()=>{e.isMenuOpen&&o(!n)},children:[(0,i.jsx)(Id,{icon:e.icon}),e.isMenuOpen&&(0,i.jsx)(ka,{css:{flex:"1"},fontWeight:"medium",children:e.title}),e.isMenuOpen&&e.children&&(0,i.jsx)(ka,{fontSize:"textXs",children:(0,i.jsx)(Id,{icon:n?"chevron-up":"chevron-down"})})]});return(0,i.jsxs)(rd,{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)(_d,{to:e.to,children:r()}),s&&(0,i.jsx)(rd,{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)(rd,{css:e.isMenuOpen?{}:{background:"white",bd:"gray200 2 md",py:"$2",width:"100%"},direction:"column",children:[!e.isMenuOpen&&(0,i.jsx)(ka,{css:{padding:"$2 $3"},font:"gray900 textSm semiBold",children:e.title}),e.children]})})]})},eQ=e=>{const t=e.isActive(location.pathname);return(0,i.jsx)(_d,{"aria-label":e.children,"aria-selected":t,role:"menuitem",to:e.to,onClick:async()=>await(e.onClick?.()),children:(0,i.jsx)(rd,{className:t?"h-event-menu-item-active":"",css:{color:"$gray800",cursor:"pointer",padding:"6px $3","&:hover, &.h-event-menu-item-active":{color:"$primary500"}},children:e.children})})},tQ=e=>{const{translate:t,params:{organizationId:n,eventId:o}}=bd(),{hasFeature:s}=_v(),{hasEventRole:r,numberOfWaitingAccreditations:a,numberOfWaitingAssigments:l,updateLocalEvent:d}=dv(),{canAccreditationRead:c,canCampaignRead:u,canCustomFieldRead:m,canDelegationRead:h,canDelegationsSpaceParamRead:g,canDocumentRead:p,canEmailEdit:f,canFormRead:_,canMemberAccredit:x,canMemberAssign:I,canPositionRead:v,canWeezeventRead:b,canWorkflowRead:j}=Dv(),C=sp(),y=(0,V.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")),[]),A=(0,V.useCallback)(e=>(null!==e.match(/\/delegations\/\d+/)||null!==e.match(/\/delegation\/\d+/)||null!==e.match(/\/delegation-category\/\d+/))&&!e.includes("/documents/"),[]),S=(0,V.useCallback)(e=>y(e)||A(e),[y,A]),k=(0,V.useCallback)(e=>(null!==e.match(/\/positions\/\d+/)||null!==e.match(/\/position\/\d+/)||null!==e.match(/\/position-category\/\d+/))&&!e.includes("documents"),[]),w=(0,V.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+/),[]),E=(0,V.useCallback)(e=>k(e)||w(e),[k,w]),T=(0,V.useCallback)(e=>null!==e.match(/\/accreditations\/\d+/)||null!==e.match(/\/accreditation\/\d+/)||null!==e.match(/\/accreditation-category\/\d+/),[]),R=(0,V.useCallback)(e=>e.endsWith("/accreditations-assignments")||null!==e.match(/\/accredit\/\d+/)||null!==e.match(/\/edit-accredit\/\d+/),[]),O=(0,V.useCallback)(e=>null!==e.match(/accreditation-profiles\/\d+/)||null!==e.match(/\/accreditation-profile\/\d+/)||null!==e.match(/\/accreditation-profile-category\/\d+/),[]),D=(0,V.useCallback)(e=>T(e)||R(e)||O(e),[T,R,O]),z=(0,V.useCallback)(e=>(e.endsWith("/forms")||e.endsWith("/forms/create"))&&!e.endsWith("/history/forms"),[]),$=(0,V.useCallback)(e=>e.endsWith("/campaigns")&&!e.endsWith("/history/campaigns")||null!==e.match(/\/campaign\/\d+/),[]),P=(0,V.useCallback)(e=>null!==e.match(/\/delegations-space\//),[]),M=(0,V.useCallback)(e=>e.endsWith("/emails/parameters")||e.endsWith("/emails/templates")||e.endsWith("/emails/dns"),[]),F=(0,V.useCallback)(e=>e.endsWith("/documents")||null!==e.match(/\/documents\//),[]),N=(0,V.useCallback)(e=>z(e)||$(e)||P(e)||M(e)||F(e),[z,$,P,M,F]),L=(0,V.useCallback)(e=>e.endsWith("/options/api"),[]),B=(0,V.useCallback)(e=>e.endsWith("options/weezevent-v2"),[]),U=(0,V.useCallback)(e=>null!==e.match(/workflows\/\d+/),[]),W=(0,V.useCallback)(e=>null!==e.match(/custom-fields\/\d+/),[]),G=(0,V.useCallback)(e=>L(e)||B(e)||U(e)||W(e),[L,B,U,W]),q=r,H=s(Ae.Api)&&r,K=b,Y=H||K||j||m,Z=_||u||f||p||g;return(0,i.jsxs)(rd,{css:{overflowY:e.isOpen?"auto":void 0,paddingTop:"$5",px:"$3"},direction:"column",gap:"5",width:1,children:[(0,i.jsxs)(rd,{align:"center","aria-keyshortcuts":(C?"Meta":"Control")+"+K",css:{bd:"gray300 1",cursor:"pointer",padding:"$2 $3"},gap:"2",onClick:e=>{Gd(e),e.target.dispatchEvent(new CustomEvent(bT,{bubbles:!0}))},children:[(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"sparkles"})}),e.isOpen&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{color:"gray800",css:{flex:"1"},children:t("action_rapide_97952")}),(0,i.jsxs)(rd,{align:"center",css:{background:"$gray50",bd:"gray200 1",padding:"2px $1"},justify:"center",children:[C?"⌘":"Ctrl","+k"]})]})]}),(0,i.jsxs)(rd,{direction:"column",gap:"1",width:1,children:[q&&(0,i.jsx)(QJ,{icon:"objects-column",isMenuOpen:e.isOpen,title:t("tableau_de_bord_24627"),to:fs.DASHBOARD(n,o)}),(0,i.jsxs)(QJ,{icon:"user-group",isActive:S,isMenuOpen:e.isOpen,title:t("population_38615"),to:fs.VOLUNTEERS(n,o),children:[(0,i.jsx)(eQ,{isActive:y,to:fs.VOLUNTEERS(n,o),onClick:()=>d({volunteersSegmentId:null}),children:t("membres_11310")}),h&&(0,i.jsx)(eQ,{isActive:A,to:qo.DELEGATIONS({organizationId:n,eventId:o}),onClick:()=>d({delegationsSegmentId:null}),children:t("d_l_gations_78318")})]}),v&&(0,i.jsxs)(QJ,{icon:"sitemap",isActive:E,isMenuOpen:e.isOpen,title:t("missions_63972"),to:Jo.POSITIONS({organizationId:n,eventId:o}),children:[(0,i.jsx)(eQ,{isActive:k,to:Jo.POSITIONS({organizationId:n,eventId:o}),onClick:()=>d({positionsSegmentId:null}),children:t("missions_63972")}),I&&(0,i.jsx)(eQ,{isActive:w,to:fs.ASSIGNMENTS(n,o),children:`${t("affectation_plural")} (${l})`})]}),c&&(0,i.jsxs)(QJ,{icon:"badge-check",isActive:D,isMenuOpen:e.isOpen,title:t("accr_ditations_39450"),to:Mo.ACCREDITATIONS({organizationId:n,eventId:o}),children:[(0,i.jsx)(eQ,{isActive:T,to:Mo.ACCREDITATIONS({organizationId:n,eventId:o}),onClick:()=>d({accreditationsSegmentId:null}),children:t("accr_ditations_39450")}),(0,i.jsx)(eQ,{isActive:O,to:gT.ACCREDITATIONS_PROFILES({organizationId:n,eventId:o}),children:t("profils_d_accr_27825")}),x&&(0,i.jsx)(eQ,{isActive:R,to:fs.ACCREDITATIONS_ASSIGNMENTS(n,o),children:`${t("mod_ration_09947")} (${a})`})]}),Z&&(0,i.jsxs)(QJ,{icon:"message",isActive:N,isMenuOpen:e.isOpen,title:t("communication_05277"),to:jo.FORMS({organizationId:n,eventId:o}),children:[_&&(0,i.jsx)(eQ,{isActive:z,to:jo.FORMS({organizationId:n,eventId:o}),children:t("Form_plural")}),u&&(0,i.jsx)(eQ,{isActive:$,to:Tx.CAMPAIGNS({organizationId:n,eventId:o}),children:t("Campaigns")}),f&&(0,i.jsx)(eQ,{isActive:e=>e.endsWith("/emails/parameters")||e.endsWith("/emails/templates")||e.endsWith("/emails/dns"),to:fs.EVENT_EMAILS_PARAMETERS(n,o),children:t("e_mails_09850")}),p&&(0,i.jsx)(eQ,{isActive:F,to:fs.DOCUMENTS(n,o),children:t("Documents")}),g&&(0,i.jsx)(eQ,{isActive:P,to:Vk.DELEGATIONS_SPACE({organizationId:n,eventId:o}),children:t("espace_d_l_gati_59251")})]}),Y&&(0,i.jsxs)(QJ,{icon:"sliders-up",isActive:G,isMenuOpen:e.isOpen,title:t("options_53186"),to:fs.OPTIONS_API(n,o),children:[H&&(0,i.jsx)(eQ,{isActive:L,to:fs.OPTIONS_API(n,o),children:"API"}),K&&(0,i.jsx)(eQ,{isActive:B,to:fs.OPTIONS_WEEZEVENT_V2(n,o),children:"Weezevent"}),j&&(0,i.jsx)(eQ,{isActive:U,to:Dx.WORKFLOWS({organizationId:n,eventId:o}),children:t("automatisations_60045")}),m&&(0,i.jsx)(eQ,{isActive:W,to:tx.CUSTOM_FIELDS({organizationId:n,eventId:o}),children:t("champs_de_formu_64126")})]})]})]})},nQ=e=>{const{translate:t}=bd();return(0,i.jsx)(rd,{align:"center",css:{px:"$4"},height:48,justify:"end",children:(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(kd,{color:"white",css:{border:"none"},leftIcon:"sidebar",size:"sm",onClick:e.onToggle})}),(0,i.jsx)(bp,{placement:"top",children:e.isOpen?t("masquer_le_menu_29008"):t("afficher_le_men_91936")})]})})},iQ=()=>{const{params:{organizationId:e,eventId:t},translate:n}=bd(),{event:o,hasEventRole:s,hasPermission:r}=dv(),a=r(Ov.MEMBER_ASSIGN,{eventId:t}),{canAccreditationRead:l,canCampaignRead:d,canCustomFieldRead:c,canDelegationRead:u,canDelegationsSpaceParamRead:m,canDocumentEdit:h,canDocumentRead:g,canEmailEdit:p,canFormEdit:f,canFormRead:_,canMemberAccredit:x,canMemberAssign:I,canMemberEdit:v,canPositionRead:b,canWeezeventRead:j,canWorkflowRead:C}=Dv();Zc(o.name);const[y,A]=vC(e,"isEventMenuOpen",!1);return(0,i.jsxs)(rd,{height:1,width:1,children:[(0,i.jsxs)(rd,{"aria-label":n("menu_de_l_v_ne_05526"),as:id.Nav,css:{borderRight:"1px solid $gray200"},direction:"column",width:y?240:64,children:[(0,i.jsx)(rd,{css:{flex:"1",overflowY:y?"hidden":void 0},width:1,children:(0,i.jsx)(tQ,{isOpen:y})}),(0,i.jsx)(nQ,{isOpen:y,onToggle:()=>{A(!y)}})]}),(0,i.jsx)(ka,{css:{flex:"1",height:"100%",overflowX:"hidden"},tabIndex:-1,children:(0,i.jsxs)(Ea.dO,{children:[s&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DASHBOARD(":organizationId",":eventId"),children:(0,i.jsx)(lU,{})}),b&&(0,i.jsx)(Ea.qh,{path:Jo.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(fY,{})}),b&&(0,i.jsx)(Ea.qh,{path:Jo.POSITION_CATEGORY({organizationId:":organizationId",eventId:":eventId",positionCategoryId:":positionCategoryId"}),children:(0,i.jsx)(ZY,{})}),b&&(0,i.jsx)(Ea.qh,{path:Jo.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(LY,{})}),(0,i.jsx)(Ea.qh,{path:fs.VOLUNTEERS(":organizationId",":eventId"),children:(0,i.jsx)(CZ,{})}),v&&(0,i.jsx)(Ea.qh,{path:fs.EDIT_USER(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(oD,{})}),x&&(0,i.jsx)(Ea.qh,{path:fs.EDIT_USER_ACCREDITATIONS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(tZ,{})}),I&&(0,i.jsx)(Ea.qh,{path:fs.EDIT_USER_MISSIONS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(oZ,{})}),(0,i.jsx)(Ea.qh,{path:fs.EDIT_USER_SLOTS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(aZ,{})}),u&&(0,i.jsx)(Ea.qh,{path:qo.DELEGATIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(SU,{})}),(0,i.jsx)(Ea.qh,{path:bx.MEMBER({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(WO,{})}),u&&(0,i.jsx)(Ea.qh,{path:qo.DELEGATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(Dw,{isEvent:!0})}),u&&(0,i.jsx)(Ea.qh,{path:qo.DELEGATION({organizationId:":organizationId",eventId:":eventId",delegationId:":delegationId"}),children:(0,i.jsx)(xw,{})}),(s||I)&&(0,i.jsx)(Ea.qh,{path:fs.ASSIGNMENTS(":organizationId",":eventId"),children:(0,i.jsx)(XV,{})}),I&&(0,i.jsx)(Ea.qh,{path:fs.ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(qV,{isEdit:!1})}),I&&(0,i.jsx)(Ea.qh,{path:fs.EDIT_ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(qV,{isEdit:!0})}),a&&(0,i.jsx)(Ea.qh,{path:fs.TEAM_ASSIGNMENT(":organizationId",":eventId",":teamCode"),children:(0,i.jsx)(oU,{})}),I&&(0,i.jsx)(Ea.qh,{path:fs.PRE_ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(qV,{isEdit:!1})}),x&&(0,i.jsx)(Ea.qh,{path:fs.ACCREDITATIONS_ASSIGNMENTS(":organizationId",":eventId"),children:(0,i.jsx)(xB,{})}),x&&(0,i.jsx)(Ea.qh,{path:fs.ACCREDIT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(uB,{isEdit:!1})}),x&&(0,i.jsx)(Ea.qh,{path:fs.EDIT_ACCREDIT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(uB,{isEdit:!0})}),f&&(0,i.jsx)(Ea.qh,{path:jo.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(Yw,{isCreateOpen:!0})}),_&&(0,i.jsx)(Ea.qh,{path:jo.FORMS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(Yw,{isCreateOpen:!1})}),d&&(0,i.jsx)(Ea.qh,{path:Tx.CAMPAIGNS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(sU,{})}),d&&(0,i.jsx)(Ea.qh,{path:Tx.CAMPAIGN({organizationId:":organizationId",eventId:":eventId",campaignId:":campaignId"}),children:(0,i.jsx)(Ob,{})}),m&&(0,i.jsx)(Ea.rd,{exact:!0,from:Vk.DELEGATIONS_SPACE({organizationId:":organizationId",eventId:":eventId"}),push:!1,to:Vk.DELEGATIONS_SPACE_DESIGN({organizationId:e,eventId:t})}),m&&(0,i.jsx)(Ea.qh,{path:Vk.DELEGATIONS_SPACE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(nb,{children:(0,i.jsx)(EZ,{})})}),(s||p)&&(0,i.jsx)(Ea.qh,{path:fs.EVENT_EMAILS(":organizationId",":eventId"),children:(0,i.jsx)(iH,{})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS_USER_PLANNING(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(Vq,{})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS_USER_PLANNING_LIST(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(Kq,{})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS_USER_PLANNING_DAYS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)($q,{})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS_ASSIGNMENTS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(cq,{})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS_VOLUNTEERS_LISTING(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(Xq,{})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS_BADGE(":organizationId",":eventId",":userInfoId","generic"),children:(0,i.jsx)(hq,{})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS_BADGE(":organizationId",":eventId",":userInfoId",":badgeType"),children:(0,i.jsx)(xq,{})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS_CERTIFICATE(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(fq,{})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS_DELEGATION_CALENDAR(":organizationId",":eventId",":delegationId"),children:(0,i.jsx)(EG,{})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS_ASO_PAX_MANIFEST(":organizationId",":eventId",":accreditationSlotId"),children:(0,i.jsx)(cG,{})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS_HOURS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(Rq,{})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS_POSITION_PLANNING(":organizationId",":eventId",":positionId"),children:(0,i.jsx)(FG,{})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(oq,{})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS_POSITION(":organizationId",":eventId",":positionId"),children:(0,i.jsx)(qG,{})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS_PLANNING(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(XG,{})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS_USERS_PICTURES(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(tH,{})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS_USER_CUSTOM_DOCUMENT(":organizationId",":eventId",":userInfoId",":customDocumentId"),children:(0,i.jsx)(Sq,{})}),h&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.CREATE_CUSTOM_DOCUMENT(":organizationId",":eventId"),children:(0,i.jsx)(oG,{isCreateOpen:!0})}),g&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.DOCUMENTS(":organizationId",":eventId"),children:(0,i.jsx)(oG,{isCreateOpen:!1})}),j&&(0,i.jsx)(Ea.qh,{path:fs.OPTIONS_WEEZEVENT_V2(":organizationId",":eventId"),children:(0,i.jsx)(wH,{})}),C&&(0,i.jsx)(Ea.qh,{path:Dx.WORKFLOWS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(Xz,{})}),c&&(0,i.jsx)(Ea.qh,{path:tx.CUSTOM_FIELDS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(fM,{})}),s&&(0,i.jsx)(Ea.qh,{path:fs.OPTIONS_API(":organizationId",":eventId"),children:(0,i.jsx)(SH,{})}),l&&(0,i.jsx)(Ea.qh,{path:gT.ACCREDITATIONS_PROFILES({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(hV,{})}),l&&(0,i.jsx)(Ea.qh,{path:gT.ACCREDITATIONS_PROFILE({organizationId:":organizationId",eventId:":eventId",accreditationProfileId:":accreditationProfileId"}),children:(0,i.jsx)(xV,{})}),l&&(0,i.jsx)(Ea.qh,{path:gT.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationProfileCategoryId:":accreditationProfileCategoryId"}),children:(0,i.jsx)(yV,{})}),l&&(0,i.jsx)(Ea.qh,{path:Mo.ACCREDITATIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(CN,{})}),l&&(0,i.jsx)(Ea.qh,{path:Mo.ACCREDITATION_SLOT({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId",accreditationSlotId:":accreditationSlotId"}),children:(0,i.jsx)(EV,{})}),l&&(0,i.jsx)(Ea.qh,{path:Mo.ACCREDITATION({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId"}),children:(0,i.jsx)(ML,{})}),l&&(0,i.jsx)(Ea.qh,{path:Mo.ACCREDITATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationCategoryId:":accreditationCategoryId"}),children:(0,i.jsx)(wB,{})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:fs.VOLUNTEERS(e,t),replace:!0})})]})}),(0,i.jsx)(jT,{level:"event"})]})},oQ=()=>{const{hasFeature:e}=_v(),{event:t,hasPermission:n}=dv(),o=n(Ov.CAMPAIGN_SEND,{eventId:t.id}),s=n(Ov.DELEGATION_EDIT,{eventId:t.id}),{canAccreditationEdit:r,canCampaignSend:a,canCustomFieldEdit:l,canDelegationEdit:d,canDelegationsSpaceParamEdit:c,canDocumentEdit:u,canFormRead:m,canMemberAssign:h,canMemberCreate:g,canMemberEdit:p,canPositionEdit:f,canWorkflowEdit:_}=Dv();return(0,i.jsxs)(Ea.dO,{children:[t.usePositions&&f&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.CREATE_POSITION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(LH,{})}),t.usePositions&&f&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.EDIT_POSITION(":organizationId",":eventId",":positionId"),children:(0,i.jsx)(BH,{})}),t.usePositions&&h&&(0,i.jsx)(Ea.qh,{path:fs.POSITION_SLOT_ASSIGN_VOLUNTEERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(JY,{})}),o&&(0,i.jsx)(Ea.qh,{exact:!0,path:Tx.CREATE_TEMPLATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(qv,{isTemplate:!0})}),a&&(0,i.jsx)(Ea.qh,{exact:!0,path:Tx.CREATE({organizationId:":organizationId",eventId:":eventId",options:":options?"}),children:(0,i.jsx)(qv,{isTemplate:!1})}),a&&(0,i.jsx)(Ea.qh,{exact:!0,path:Tx.UPDATE({organizationId:":organizationId",eventId:":eventId",campaignId:":campaignId"}),children:(0,i.jsx)(Hv,{})}),r&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.CREATE_ACCREDITATION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(OF,{})}),r&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.EDIT_ACCREDITATION(":organizationId",":eventId",":accreditationId"),children:(0,i.jsx)(DF,{})}),r&&(0,i.jsx)(Ea.qh,{exact:!0,path:[gT.ACCREDITATIONS_PROFILE_CREATE({organizationId:":organizationId",eventId:":eventId",accreditationProfileCategoryId:":accreditationProfileCategoryId"}),gT.ACCREDITATIONS_PROFILE_CREATE({organizationId:":organizationId",eventId:":eventId"})],children:(0,i.jsx)(FB,{})}),r&&(0,i.jsx)(Ea.qh,{exact:!0,path:gT.ACCREDITATIONS_PROFILE_EDIT({organizationId:":organizationId",eventId:":eventId",accreditationProfileId:":accreditationProfileId"}),children:(0,i.jsx)(NB,{})}),r&&(0,i.jsx)(Ea.qh,{exact:!0,path:Mo.ACCREDITATIONS_IMPORT({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(PF,{})}),r&&(0,i.jsx)(Ea.qh,{exact:!0,path:gT.ACCREDITATIONS_PROFILES_IMPORT({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(UB,{})}),u&&(0,i.jsx)(Ea.qh,{path:fs.EDIT_CUSTOM_DOCUMENT(":organizationId",":eventId",":customDocumentId"),children:(0,i.jsx)(GW,{})}),d&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.CREATE_DELEGATION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(fC,{})}),c&&(0,i.jsx)(Ea.qh,{exact:!0,path:Vk.DELEGATIONS_SPACE_LAYOUTS_CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(OU,{})}),c&&(0,i.jsx)(Ea.qh,{exact:!0,path:Vk.DELEGATIONS_SPACE_LAYOUTS_UPDATE({organizationId:":organizationId",eventId:":eventId",delegationsSpaceLayoutId:":delegationsSpaceLayoutId"}),children:(0,i.jsx)(DU,{})}),d&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.EDIT_DELEGATION(":organizationId",":eventId",":delegationId"),children:(0,i.jsx)(xC,{})}),s&&(0,i.jsx)(Ea.qh,{exact:!0,path:qo.DELEGATION_CATEGORY_UPDATE({organizationId:":organizationId",eventId:":eventId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(bM,{})}),m&&(0,i.jsx)(Ea.qh,{path:jo.FORM_ELEMENTS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)($E,{})}),m&&(0,i.jsx)(Ea.qh,{path:jo.FORM_PARAMETERS_GENERAL({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(rT,{})}),m&&(0,i.jsx)(Ea.qh,{path:jo.FORM_PARAMETERS_DESIGN({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(nT,{})}),m&&(0,i.jsx)(Ea.qh,{path:jo.FORM_PARAMETERS_AVAILABILITIES({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(fH,{})}),t.usePositions&&m&&(0,i.jsx)(Ea.qh,{path:jo.FORM_PARAMETERS_MISSIONS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(jH,{})}),t.useAccreditations&&m&&e(Ae.Accreditation)&&(0,i.jsx)(Ea.qh,{path:jo.FORM_PARAMETERS_ACCREDITATIONS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(lH,{})}),m&&(0,i.jsx)(Ea.qh,{path:jo.FORM_PARAMETERS_BROADCAST({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(KE,{})}),m&&(0,i.jsx)(Ea.qh,{path:jo.FORM_PARAMETERS_STATE({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(dT,{})}),m&&(0,i.jsx)(Ea.qh,{path:jo.FORM_INTEGRATION({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(oE,{})}),m&&(0,i.jsx)(Ea.qh,{path:jo.FORM_EMAILS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(NE,{})}),m&&(0,i.jsx)(Ea.qh,{path:jo.FORM_PREVIEW({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(sE,{})}),d&&(0,i.jsx)(Ea.qh,{path:fs.EVENT_DELEGATIONS_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(uU,{})}),p&&(0,i.jsx)(Ea.qh,{path:fs.EVENT_VOLUNTEERS_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(ND,{})}),f&&(0,i.jsx)(Ea.qh,{path:Jo.POSITION_IMPORT_CSV({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(WH,{})}),g&&(0,i.jsx)(Ea.qh,{path:fs.EVENT_FILES_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(Bw,{})}),g&&(0,i.jsx)(Ea.qh,{path:[bx.CREATE({organizationId:":organizationId",eventId:":eventId",delegationId:":delegationId"}),bx.CREATE({organizationId:":organizationId",eventId:":eventId"})],children:(0,i.jsx)(MR,{})}),_&&(0,i.jsx)(Ea.qh,{path:Dx.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(dz,{})}),_&&(0,i.jsx)(Ea.qh,{path:Dx.UPDATE({organizationId:":organizationId",eventId:":eventId",workflowId:":workflowId"}),children:(0,i.jsx)(cz,{})}),l&&(0,i.jsx)(Ea.qh,{path:tx.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(CE,{})}),l&&(0,i.jsx)(Ea.qh,{path:tx.UPDATE({organizationId:":organizationId",eventId:":eventId",customFieldId:":customFieldId"}),children:(0,i.jsx)(yE,{})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(BT,{children:(0,i.jsx)(iQ,{})})})]})},sQ=()=>{const{organizationId:e,eventId:t}=zi(),{data:n,loader:o}=Oi("query Event($organizationId: OrganizationId!, $eventId: EventId!) {\n event(id: $eventId) {\n id\n organizationId\n name\n startAt\n endAt\n languages\n usePositions\n useAccreditations\n useDelegations\n useForms\n useCampaigns\n useDocuments\n useWorkflows\n isWeezeventSynchronized\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},[js.UserPermissionsFragment]),{setSelectedEventId:s}=_v(),r=om(),a=(n.user?.roles??[]).some(e=>e.accessLevel===je.Organization||e.accessLevel===je.Event);if((0,V.useEffect)(()=>(s(t),()=>{s()}),[t]),o)return o;{const e=n.event.assignmentsStats;return(0,i.jsx)(tv,{userPermissions:n.user,children:(0,i.jsx)(lv,{event:n.event,numberOfWaitingAccreditations:n.event.accreditationsStats.numberOfWaitingAccreditation,numberOfWaitingAssigments:a?e.numberOfWaitingAssignment+e.numberOfPreAssigned:e.numberOfPreAssigned,children:r?(0,i.jsx)(JJ,{}):(0,i.jsx)(oQ,{})})})}};var rQ;!function(e){e.Delegation="delegation",e.Event="event",e.Id="id",e.Name="name",e.TicketId="ticket_id"}(rQ||(rQ={}));const aQ="custom_field_value_",lQ={slug:"cf80691",valueId:61410},dQ={slug:"cf80691",valueId:61409},cQ=[lQ,dQ];function uQ({slug:e,valueId:t}){return`${aQ}${e}_${t}`}function mQ(e){return{includeCustomDocuments:e.some(Dg)}}let hQ=class extends Um{constructor(e,t,n){super(e,t,n)}getPossibleColumns(e,t){return[{slug:rQ.Id,name:this.t("id_51738"),isSortable:!0,sortAttribute:rn.Id,width:100},{slug:rQ.Name,name:this.t("nom_08311"),isSortable:!0,sortAttribute:rn.Name,minWidth:280},{slug:rQ.Event,name:this.t("_v_nement_22345"),minWidth:240},{slug:rQ.TicketId,name:this.t("TicketId"),width:200},...this.getCustomDocumentsColumns(t),...this.getCustomFieldsValuesColumns(e),...this.customFieldsToPossibleColumns(e)]}getCustomFieldsValuesColumns(e){return cQ.flatMap(({slug:t,valueId:n})=>{const i=e.find(e=>e.slug===t),o=i?.values.find(e=>e.id===n);return i&&o?[{slug:uQ({slug:t,valueId:n}),name:o.value,label:i.name,customField:i,width:200}]:[]})}getCustomDocumentsColumns(e){return(0,cm.A)(Object.entries((0,Vu.A)(e,e=>e.slug)).map(([e,t])=>({slug:Og(e),name:this.t("imprimer_1_75795",(0,Bh.A)(t,e=>e.id).name),label:e,minWidth:240})),e=>m(e.name))}};hQ=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mm,Cm,Si])],hQ);const gQ=(0,V.createContext)({active:!1,enable:hc.A,disable:hc.A});function pQ(){return(0,V.useContext)(gQ)}const fQ=()=>{const{user:e}=Li(),t=om(),n=Mi(),{active:i}=pQ();return(0,V.useEffect)(()=>{if(F.USE_HUBSPOT&&g(e?.hubspotToken)){window.hsConversationsSettings={identificationEmail:e.email,identificationToken:e.hubspotToken};try{if(t||"true"===n.getItem(tc.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},_Q=e=>{const{clearNameCursors:t,name:n}=ip();return(0,i.jsx)(my,{column:e.column,customDocument:e.customDocument,eventId:e.row.event.id,reload:e.reload,search:{name:n,clearName:t},volunteerRegistration:e.row})},xQ=e=>{const{params:{organizationId:t}}=bd(),{mutate:n}=Nr(),{slug:o,valueId:s}=(0,V.useMemo)(()=>function(e){const t=e.substring(19),n=t.lastIndexOf("_");return{slug:t.substring(0,n),valueId:parseInt(t.substring(n+1),10)}}(e.column.slug),[e.column.slug]),[r,a]=(0,V.useState)(!1),l=(0,V.useCallback)(async()=>{a(!0);try{await n({organizationId:t,userInfoId:e.row.userInfo.id,slug:o,value:e.column.customField?.canSelectMultiple?[s]:s})}finally{a(!1),e.reload()}},[t,e.column.customField,e.row.userInfo.id,e.reload,o,n,s]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(kd,{color:"white",css:{overflow:"hidden","& .h-button-content":{overflow:"hidden"}},isLoading:r,size:"sm",onClick:l,children:(0,i.jsx)(ka,{css:{ellipsis:!0},title:e.column.name,width:1,children:e.column.name})})})},IQ=e=>{const t=Ei(Yh),n=(0,V.useMemo)(()=>(e.row.positionsSlotsUsersInfos||[]).map(({positionSlot:e,position:n})=>ng(t,e,n.name,{slot:{includeRange:!0},position:{includeNameAtEnd:!0}})).join(", "),[t,e.row.positionsSlotsUsersInfos]);return(0,i.jsx)(Qu,{minWidth:e.column.minWidth,width:e.column.width,children:n})},vQ=()=>Promise.resolve(),bQ=e=>{const{params:{organizationId:t}}=bd();if(Dg(e.column.slug)){const t=e.column.slug.substring(16),s=(e.eventIdToCustomDocuments[e.row.event.id]??[]).filter(e=>e.slug===t);return(0,i.jsx)(_Q,{column:e.column,customDocument:(n=s,o=e.row.userInfo.fields?.population,n.length>1?n.find(e=>zg(e.populationsIds,o))??n[0]:n[0]),reload:e.reload,row:e.row})}var n,o;return e.column.slug.startsWith(aQ)?(0,i.jsx)(xQ,{column:e.column,reload:e.reload,row:e.row}):e.column.slug===rQ.Id?(0,i.jsx)(Qu,{width:e.column.width,children:e.row.userInfo.id}):e.column.slug===rQ.Name?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,children:(0,i.jsx)(ub,{isClickDisabled:!0,userInfo:e.row.userInfo})}):e.column.slug===rQ.Event?(0,i.jsx)(Qu,{minWidth:e.column.minWidth,children:(0,i.jsx)(vu,{ellipsis:!0,title:e.row.event.name,children:e.row.event.name})}):e.column.slug===rQ.Delegation?(0,i.jsx)(Qu,{width:e.column.width,children:e.row.delegation?.name??""}):e.column.slug===rQ.TicketId?(0,i.jsx)(Qu,{width:e.column.width,children:e.row.ticketId}):"position"===e.column.slug?(0,i.jsx)(IQ,{column:e.column,row:e.row}):(0,i.jsx)(KC,{avatarUser:e.row.userInfo,clickPath:bx.MEMBER_INFORMATION({organizationId:t,eventId:e.row.event.id,userInfoId:e.row.userInfo.id}),column:e.column,customField:e.customField,fields:e.row.userInfo.fields??{},mutate:vQ,reload:e.reload,updatable:!1})},jQ=()=>{const{translate:e,params:{organizationId:t}}=bd();Zc(e("membres_11310"));const n=Ei(hQ),{disable:o}=pQ(),{data:s,loader:r}=Oi("query OrganizationMembersInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: All) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n customDocuments {\n ...OrganizationMemberCustomDocument\n }\n }\n}\n",{organizationId:t},[js.SegmentCustomFieldFragment,js.OrganizationMemberCustomDocumentFragment]),a=(0,V.useMemo)(()=>s.organization?.customFields.nodes??[],[s.organization]),l=jC(a),d=(0,V.useMemo)(()=>s.organization?.customDocuments??[],[s.organization]),c=(0,V.useMemo)(()=>n.getPossibleColumns(a,d),[a,d,n]),u=(0,V.useMemo)(()=>(0,Vu.A)(d,e=>e.eventId),[d]),m=(0,V.useMemo)(()=>uv(t)?[rQ.Name,"population",rQ.Delegation,"cf80676",rQ.TicketId,Og("badgesimple"),"cf80691",uQ(lQ),uQ(dQ),rQ.Event]:function(e){return 306===e}(t)?[rQ.Name,rQ.Event]:[],[t]),h=(0,V.useMemo)(()=>uv(t)?[Pg.Email,Pg.Id,Pg.LocalId,Pg.Name,Pg.WeezeventBarcodeVersion,Pg.Delegations,"cf80676"]:[],[t]),[g,p,f]=vC(t,"organizationMembers.limit",em),[_,x,I]=vC(t,"organizationMembers.sort",null),v=f||I;return(0,V.useEffect)(()=>{o()},[]),(0,i.jsxs)(nb,{children:[(0,i.jsx)(tb,{children:(0,i.jsx)(ka,{font:"gray900 displayXs medium",children:e("membres_11310")})}),(0,i.jsx)(Qv,{css:{overflowY:"auto"},children:r||v?(0,i.jsx)(Cd,{}):(0,i.jsx)(up,{columns:m,columnsSearch:h,columnsToIncludes:mQ,eventId:null,filters:[],limit:g,loadDataList:Al,loadRow:yl,organizationId:t,possibleColumns:c,predicates:[],rendering:Cg.List,setColumns:hc.A,setLimit:p,setSort:x,showEditColumns:!1,showEditMode:!1,showFilters:!1,showMassActions:!1,showPredicatesBadges:!1,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,sort:_,children:(0,i.jsx)(yp,{renderCell:(e,t,n)=>(0,i.jsx)(bQ,{column:e,customField:l.get(e.slug),eventIdToCustomDocuments:u,reload:n,row:t})})})})]})};let CQ=class extends ic{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 c.Ik().shape({header:this.documentInputService.documentInputSchemaNotRequired(),picture:this.documentInputService.documentInputSchemaNotRequired(),signature:c.Yj(),name:c.Yj().required(this.t("le_label_est_re_86986")),fromEmail:c.Yj().required(this.t("l_e_mail_de_l_56279")),fromName:c.Yj().required(this.t("le_nom_de_l_me_01331")),replyTo:c.Yj()})}createUpdateEmailSenderSchema(){return c.Ik().shape({emailSender:this.emailSenderInputSchema()})}};CQ=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si,tj])],CQ);const yQ=e=>{const{history:t,translate:n,params:{organizationId:o}}=bd(),{showNotification:s}=HI(),r=Ei(CQ),a=(0,V.useRef)(null),[l,d]=(0,V.useState)(e.initialValues.emailSender.isOrganizationDefault||Bs(e.initialValues.emailSender.eventsIds)),[c,u]=(0,V.useState)(e.initialValues.emailSender.eventsIds.concat(e.initialValues.emailSender.isOrganizationDefault?["community"]:[]));return(0,i.jsx)(Vd,{customErrorRef:a,height:1,initialValues:e.initialValues,render:({handleSubmit:t,submitting:s,values:r})=>{return(0,i.jsx)(zp,{button:e.isEdit&&(0,i.jsx)(kd,{isLoading:s,onClick:t,children:n("mettre_jour_l_14264")}),category:n("_metteur_d_e_ma_51878"),fallbackClosePath:fs.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(o),heading:e.isEdit?(m=e.initialValues.emailSender,g(m.fromName)?`${m.fromName} (${m.fromEmail})`:m.fromEmail):n("nouvel_metteur_58381"),children:(0,i.jsxs)(Op,{ref:a,children:[(0,i.jsx)(Nd,{}),(0,i.jsx)(Wp,{heading:n("informations_su_10889"),children:(0,i.jsxs)(rd,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(ec,{label:"Label",name:"emailSender.name"}),(0,i.jsx)(ec,{hint:n("les_e_mails_ser_70662"),label:n("nom_de_l_mette_49412"),name:"emailSender.fromName"}),(0,i.jsx)(ec,{hint:n("les_e_mails_ser_62925"),isEmail:!0,label:n("e_mail_de_l_me_98374"),name:"emailSender.fromEmail"}),(0,i.jsx)(ec,{hint:n("cette_adresse_r_36038",r.emailSender.fromEmail),isEmail:!0,label:(0,i.jsx)(fI,{children:n("adresse_de_r_po_86181")}),name:"emailSender.replyTo"}),(0,i.jsx)(dj,{accept:Vx.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)(fj,{label:n("photo_de_profil_08618"),organizationId:o,prefix:"emailSender.picture."}),(0,i.jsx)(SI,{label:n("signature_67521"),name:"emailSender.signature"}),(0,i.jsx)(dj,{accept:Vx.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)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(Eu,{state:l?"checked":"unchecked",onClick:e=>{d("checked"===e)},children:n("utiliser_cet_m_47949")}),l&&(0,i.jsxs)(rd,{children:[(0,i.jsx)(md,{width:"6"}),(0,i.jsxs)(Uu,{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)(md,{height:"5"}),(0,i.jsx)($p,{children:(0,i.jsx)(kd,{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(fs.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(o))}})},AQ=()=>{const{params:{organizationId:e}}=bd(),{data:t,loader:n}=Er({organizationId:e}),o=Ei(CQ),{mutate:s}=function(e={}){return Di("mutation EmailSenderCreate($organizationId: OrganizationId!, $emailSender: EmailsSenderInput!) {\n emailSenderCreate(organizationId: $organizationId, emailSender: $emailSender) {\n id\n }\n}\n",e)}();return n||(0,i.jsx)(yQ,{events:t.organization.events.nodes,initialValues:{emailSender:o.emailSenderInputDefault()},isEdit:!1,mutate:t=>s({organizationId:e,emailSender:t})})},SQ=()=>{const{params:{organizationId:e,emailSenderId:t}}=bd(),n=Ei(CQ),{data:o,loader:s}=Oi("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 Di("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)(yQ,{events:o.organization.events.nodes,initialValues:{emailSender:n.emailSenderInputDefault(o.organization.emailSender)},isEdit:!0,mutate:n=>r({organizationId:e,emailSenderId:t,emailSender:n})})},kQ=()=>{const{translate:e,params:{organizationId:t,emailSenderId:n}}=bd(),{data:o,loader:s}=Oi("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,V.useMemo)(()=>o.organization?o.organization.emailSender.from:"-",[o.organization]);return(0,i.jsx)(zp,{category:e("aper_u_d_un_me_46930"),fallbackClosePath:fs.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t),heading:r,children:s||(0,i.jsx)(ka,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsx)(Ib,{content:o.organization.emailSender.preview,from:o.organization.emailSender.from,subject:e("e_mail_test_me_23293")})})})};let wQ=class extends ic{constructor(e){super(e)}default(e){return{name:e?.name??"",description:e?.description??"",usersInfosIds:(e?.members??[]).map(({id:e})=>e),eventsAccesses:(e?.accesses??[]).filter(e=>e.scope===je.Event&&e.eventId).map(e=>({eventId:e.eventId,roleId:e.roleId}))}}eventAccessDefault(){return{eventId:null,roleId:null}}schema(){return c.Ik().shape({group:c.Ik().shape({name:c.Yj().required(this.t("le_nom_est_requ_61536")),description:c.Yj(),usersInfosIds:c.YO().of(c.ai()).required(),eventsAccesses:c.YO().of(c.Ik().shape({eventId:c.ai().nullable().required(this.t("vous_devez_s_le_61092")),roleId:c.ai().nullable().required(this.t("vous_devez_s_le_18837"))})).required()}).required()}).required()}};wQ=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],wQ);const EQ=e=>{const{history:t,translate:n,params:{organizationId:o}}=bd(),s=Ei(wQ),{organization:r}=_v(),a=(0,V.useMemo)(()=>(0,cm.A)(r.events.nodes,e=>m(e.name)),[r.events]),l=(0,V.useCallback)(t=>{const n=e.eventsAccesses.filter((e,n)=>n!==t&&e.eventId).map(({eventId:e})=>e);return a.filter(e=>!n.includes(e.id)).map(e=>(0,i.jsx)("option",{value:e.id,children:`${e.name} (${e.id})`},e.id))},[a,e.eventsAccesses]),d=(0,V.useMemo)(()=>(0,cm.A)(r.roles.filter(e=>e.accessLevel===je.Event),e=>m(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[r.roles]);return 0===d.length?(0,i.jsxs)(rd,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$7"},direction:"column",children:[(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:n("vous_n_avez_pas_57236")}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",children:n("pour_donner_acc_85410")}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(kd,{color:"white",onClick:()=>{t.push(fs.ORGANIZATION_PARAMETERS_ROLES(o))},children:n("cr_er_un_r_le_99947")})]}):(0,i.jsxs)(rd,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$6 $4"},direction:"column",gap:"3",width:1,children:[e.eventsAccesses.map((t,o)=>(0,i.jsxs)(rd,{css:{background:"white",bd:!0,padding:"$3 $4"},direction:"column",gap:"4",children:[(0,i.jsx)(ka,{css:{textTransform:"uppercase"},font:"gray800 textXs semiBold",children:n("acc_s_n_1_17158",o+1)}),(0,i.jsxs)(rd,{align:"center",gap:"4",children:[(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Gp,{isSearchVisible:!0,label:n("_v_nement_22345"),menuWidth:1042,name:`group.eventsAccesses[${o}].eventId`,renderOnPortal:!0,shouldParseAsInt:!0,children:l(o)})}),(0,i.jsx)(ka,{color:"gray500",css:{paddingTop:"$6"},fontSize:"textMd",children:(0,i.jsx)(Id,{icon:"arrow-right"})}),(0,i.jsx)(ka,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Gp,{label:n("r_le_59302"),name:`group.eventsAccesses[${o}].roleId`,renderOnPortal:!0,shouldParseAsInt:!0,children:d})}),(0,i.jsx)(ka,{css:{paddingTop:"$6"},children:(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.change("group.eventsAccesses",qs(e.eventsAccesses,o))}})})]})]},o)),(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{color:"invisible",leftIcon:"plus",onClick:()=>{e.change("group.eventsAccesses",e.eventsAccesses.concat([s.eventAccessDefault()]))},children:n("ajouter_un_v_n_49943")})})]})},TQ=e=>{const{translate:t,params:{organizationId:n}}=bd(),[o,s,r]=gm(""),{usersInfosOptions:a,isLoading:l}=Lv({organizationId:n,eventId:null,hasSelected:Bs(e.usersInfosIds),nameDebounced:s,userInfoIds:e.usersInfosIds});return(0,i.jsx)(Gp,{isSearchLoading:l,isSearchVisible:!0,label:t("s_lectionnez_le_38252"),multiple:!0,name:"group.usersInfosIds",placeholder:t("ajouter_des_mem_15816"),searchElement:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),state:"search",value:o,onChange:r}),children:a})},RQ=e=>{const{history:t,params:{organizationId:n},translate:o}=bd(),{showNotification:s}=HI(),r=Ei(wQ),a=(0,V.useRef)(null),l=(0,V.useMemo)(()=>e.isEdit?o("mise_jour_de_17055",e.initialValues.group.name):o("cr_ation_d_un_g_97053"),[e.isEdit,e.initialValues]);return Zc(l),(0,i.jsx)(Vd,{customErrorRef:a,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:s,submitting:r,values:d})=>(0,i.jsx)(zp,{button:e.isEdit?(0,i.jsx)(kd,{isLoading:r,onClick:s,children:o("mettre_jour_l_46926")}):null,category:l,color:"dark",fallbackClosePath:fs.ORGANIZATION_PARAMETERS_GROUPS(n),heading:e.isEdit?e.initialValues.group.name:o("nouveau_groupe_17697"),children:(0,i.jsxs)(Op,{ref:a,children:[(0,i.jsx)(Nd,{}),(0,i.jsx)(Wp,{heading:o("informations_g_79325"),children:(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[(0,i.jsx)(ec,{label:o("nom_du_groupe_77088"),name:"group.name"}),(0,i.jsx)(Hp,{label:o("Description"),name:"group.description"})]})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:o("membres_11310"),subtitle:o("les_membres_du_17237"),children:(0,i.jsx)(TQ,{usersInfosIds:d.group.usersInfosIds})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:o("acc_s_aux_v_ne_33282"),subtitle:o("chaque_membre_d_91767"),children:(0,i.jsx)(EQ,{change:t.change,eventsAccesses:d.group.eventsAccesses})}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)($p,{children:(0,i.jsx)(kd,{isLoading:r,onClick:s,children:(0,i.jsx)(ka,{textAlign:"center",children:e.isEdit?o("mettre_jour_l_46926"):o("cr_er_le_groupe_43408")})})})]})}),schema:r.schema(),width:1,onSubmit:async i=>{await e.mutate({group:i.group}),s(e.isEdit?o("le_groupe_a_bie_88132"):o("le_groupe_a_bie_19289")),t.goBack(fs.ORGANIZATION_PARAMETERS_GROUPS(n))}})},OQ=()=>{const{params:{organizationId:e}}=bd(),t=Ei(wQ),{mutate:n}=function(e={}){return Di("mutation GroupCreate($organizationId: OrganizationId!, $group: GroupInput!) {\n groupCreate(organizationId: $organizationId, group: $group) {\n id\n }\n}\n",e)}();return(0,i.jsx)(RQ,{initialValues:{group:t.default(null)},isEdit:!1,mutate:async({group:t})=>(await n({organizationId:e,group:t})).groupCreate.id})},DQ=()=>{const{params:{organizationId:e,groupId:t}}=bd(),n=Ei(wQ),{data:o,loader:s}=Oi("query Group($organizationId: OrganizationId!, $groupId: GroupId!) {\n organization(id: $organizationId) {\n group(id: $groupId) {\n id\n name\n description\n\n members {\n id\n }\n\n accesses {\n scope\n eventId\n roleId\n }\n }\n }\n}\n",{organizationId:e,groupId:t},[]),{mutate:r}=function(e={}){return Di("mutation GroupUpdate($organizationId: OrganizationId!, $groupId: GroupId!, $group: GroupInput!) {\n groupUpdate(organizationId: $organizationId, groupId: $groupId, group: $group) {\n id\n }\n}\n",e)}();return s||(0,i.jsx)(RQ,{initialValues:{group:n.default(o.organization.group)},isEdit:!0,mutate:async({group:n})=>(await r({organizationId:e,groupId:t,group:n})).groupUpdate.id})},zQ=xa("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),$Q=xa("button",{background:"none",border:"none",color:"$error700",fontWeight:"$semiBold"}),PQ=()=>{const{organizationId:e}=zi(),t=$i(),{mutate:n}=kl(),o=Ti(),s=()=>{t.push(fs.ORGANIZATION_PARAMETERS(e))};return(0,i.jsx)(KZ,{onClose:s,children:(0,i.jsxs)(rd,{align:"center",direction:"column",children:[(0,i.jsx)(wj,{color:"error",icon:"user-slash"}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(zQ,{children:o("suppression_de_67160")}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:o("souhaitez_vous_30775")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(kd,{onClick:s,children:o("non_je_ne_souh_99960")}),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)($Q,{onClick:async()=>{await n({}),Q()},children:o("oui_je_souhait_87268")})]})})},MQ=({icon:e,children:t,onClick:n})=>(0,i.jsxs)(rd,{align:"center",css:{color:"$gray800",fontWeight:"$medium"},gap:"5",onClick:n,children:[(0,i.jsx)(Id,{icon:e}),(0,i.jsx)("span",{children:t})]}),FQ=xa(rd,{background:"$white",borderRadius:"$2",boxShadow:"$sm",gap:"$6",padding:"$4 $3"}),NQ=xa("h3",{color:"$gray500",fontSize:"$textSm",margin:0}),LQ=xa(rd,{backgroundColor:"$gray50",padding:"$6 $3",height:"100%"}),BQ=xa("h1",{color:"$gray800",fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),VQ=({organization:e,user:t})=>{const{history:n,translate:o}=bd();return(0,i.jsxs)(LQ,{direction:"column",gap:"6",children:[(0,i.jsx)(BQ,{children:o("profil_14444")}),(0,i.jsxs)(rd,{align:"center",gap:"4",children:[(0,i.jsx)(Gf,{email:t.email,image:t.userInfo.picture?.url,name:t.userInfo.name,size:64}),(0,i.jsx)(fJ,{size:64,userInfo:{email:t.email,...t.userInfo}})]}),(0,i.jsx)(FQ,{direction:"column",children:(0,i.jsxs)(rd,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(ka,{css:{color:"$gray800",fontWeight:"$medium"},children:e.name}),(0,i.jsx)(kd,{onClick:()=>{n.push(fs.ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH(e.id))},children:o("changer_74000")})]})}),(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(NQ,{children:o("profil_14444")}),(0,i.jsx)(FQ,{direction:"column",children:(0,i.jsx)(MQ,{icon:"user-gear",onClick:()=>{n.push(fs.ORGANIZATION_PARAMETERS_PROFILE(e.id))},children:o("informations_pe_37892")})})]}),(0,i.jsxs)(rd,{direction:"column",gap:"2",children:[(0,i.jsx)(NQ,{children:o("g_n_ral_64953")}),(0,i.jsxs)(FQ,{direction:"column",children:[(0,i.jsx)(MQ,{icon:"shield",onClick:()=>{window.open(Mc(zc(t?.language,new URL(location.href).searchParams)),"_blank")},children:o("cgu_51460")}),(0,i.jsx)(MQ,{icon:"circle-question",onClick:()=>{window.open(`https://support.${F.WEEZEVENT_DOMAIN}/fr/weezcrew`,"_blank")},children:o("aide_et_support_49790")})]})]}),(0,i.jsxs)(FQ,{direction:"column",children:[(0,i.jsx)(MQ,{icon:"arrow-left-from-line",onClick:Q,children:o("se_d_connecter_74151")}),(0,i.jsx)(MQ,{icon:"user-xmark",onClick:()=>{n.push(fs.ORGANIZATION_PARAMETERS_DELETE_ACCOUNT(e.id))},children:o("supprimer_mon_c_07051")})]})]})},UQ=({organizations:e})=>{const{organizationId:t}=zi(),[n,o]=(0,V.useState)(t),s=Ti(),r=$i();return(0,i.jsxs)(rd,{css:{margin:"0 $4 $7 $4"},direction:"column",children:[(0,i.jsx)(rd,{direction:"column",gap:"4",children:e.map(e=>(0,i.jsx)(pE,{state:e.id===n?"checked":"unchecked",onClick:()=>o(e.id),children:e.name},e.id))}),(0,i.jsx)(md,{height:7}),(0,i.jsx)(kd,{onClick:()=>{r.push(fs.ORGANIZATION_PARAMETERS(n))},children:s("s_lectionner_l_18914")})]})},WQ=xa("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),GQ=()=>{const{loader:e,data:t}=Cl({}),{organization:n}=_v(),o=Ti(),s=$i();return(0,i.jsxs)(KZ,{onClose:()=>{s.push(fs.ORGANIZATION_PARAMETERS(n.id))},children:[(0,i.jsx)(WQ,{children:o("liste_de_vos_or_87919")}),e||(0,i.jsx)(UQ,{organizations:t.organizations})]})},qQ=({inputName:e})=>{const t=Ti(),n=um();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{css:{gap:"$6","@tablet":{gap:"$4","> *":{flexGrow:1,width:"auto"}}},wrap:"wrap",children:[(0,i.jsx)(ec,{autoComplete:"given-name",label:t("pr_nom_66988"),name:`${e}fields.firstName`}),(0,i.jsx)(ec,{autoComplete:"family-name",label:t("last_name"),name:`${e}fields.lastName`})]}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(ec,{autoComplete:"email",isEmail:!0,label:t("e_mail_13869"),name:`${e}email`}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Ev,{autoComplete:"language",label:t("Language"),name:`${e}fields.language`,children:n(Rc)}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(G_,{label:t("Phone"),prefix:`${e}fields.phone.`})]})},HQ=xa(rd,{backgroundColor:"$gray900",height:"110px",marginBottom:"$11","> *":{transform:"translateY(50%)",boxShadow:"$md"}}),KQ=()=>{const{user:e}=_v();return(0,i.jsx)(HQ,{align:"end",justify:"center",children:(0,i.jsx)(Gf,{email:e.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:96})})},YQ=()=>{const{organizationId:e}=zi(),{data:t,loader:n}=Br({organizationId:e}),o=Ei(VT),s=Ei(ld),{user:r}=Li(),{mutate:a,isLoading:l}=Vr(),d=Ti();return n||(0,i.jsx)(Vd,{initialValues:{userInfo:o.userInfoProfileInputDefault(t.user)},render:({handleSubmit:e})=>(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(KQ,{}),(0,i.jsxs)(eX,{children:[(0,i.jsx)(qQ,{inputName:"userInfo."}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(kd,{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?Q():r.language!==i&&location.reload()}})},ZQ=xa("h1",{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}),XQ=()=>{const{organizationId:e}=zi(),t=$i(),n=Ti();return(0,i.jsxs)(iX,{children:[(0,i.jsx)(nX,{back:()=>{t.push(fs.ORGANIZATION_PARAMETERS(e))},children:(0,i.jsx)(LX,{children:(0,i.jsx)(ZQ,{children:n("informations_pe_37892")})})}),(0,i.jsx)(YQ,{})]})},JQ=()=>{const{organization:e,user:t}=_v();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:fs.ORGANIZATION_PARAMETERS_PROFILE(":organizationId"),children:(0,i.jsx)(XQ,{})}),Bs(e.events.nodes)&&(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(PZ,{eventId:e.events.nodes[0].id,user:t,children:(0,i.jsx)(VQ,{organization:e,user:t})})})]}),(0,i.jsx)(Ea.dO,{children:(0,i.jsx)(Ea.qh,{path:fs.ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH(":organizationId"),children:(0,i.jsx)(GQ,{})})}),(0,i.jsx)(Ea.dO,{children:(0,i.jsx)(Ea.qh,{path:fs.ORGANIZATION_PARAMETERS_DELETE_ACCOUNT(":organizationId"),children:(0,i.jsx)(PQ,{})})})]})};var QQ,e0;!function(e){e.AccreditationCategoryCreate="AccreditationCategoryCreate",e.AccreditationCategoryDelete="AccreditationCategoryDelete",e.AccreditationCategoryDuplicate="AccreditationCategoryDuplicate",e.AccreditationCategoryUpdate="AccreditationCategoryUpdate",e.AccreditationCreate="AccreditationCreate",e.AccreditationDuplicate="AccreditationDuplicate",e.AccreditationProfileCategoryCreate="AccreditationProfileCategoryCreate",e.AccreditationProfileCategoryDelete="AccreditationProfileCategoryDelete",e.AccreditationProfileCategoryDuplicate="AccreditationProfileCategoryDuplicate",e.AccreditationProfileCategoryUpdate="AccreditationProfileCategoryUpdate",e.AccreditationProfileCreate="AccreditationProfileCreate",e.AccreditationProfileDuplicate="AccreditationProfileDuplicate",e.AccreditationProfileUpdate="AccreditationProfileUpdate",e.AccreditationSlotDelete="AccreditationSlotDelete",e.AccreditationSlotUpdate="AccreditationSlotUpdate",e.AccreditationUpdate="AccreditationUpdate",e.AccreditationsEmailsEstimate="AccreditationsEmailsEstimate",e.AccreditationsExport="AccreditationsExport",e.AccreditationsImport="AccreditationsImport",e.AccreditationsImportResult="AccreditationsImportResult",e.AccreditationsMassDelete="AccreditationsMassDelete",e.AccreditationsMassEdit="AccreditationsMassEdit",e.AccreditationsProfilesImport="AccreditationsProfilesImport",e.AccreditationsProfilesImportResult="AccreditationsProfilesImportResult",e.AccreditationsProfilesMassAccreditationsEdit="AccreditationsProfilesMassAccreditationsEdit",e.AccreditationsProfilesMassDelete="AccreditationsProfilesMassDelete",e.AccreditationsProfilesMassEdit="AccreditationsProfilesMassEdit",e.AccreditationsSlotsUsersInfosCheckIn="AccreditationsSlotsUsersInfosCheckIn",e.AssignmentsEmailsEstimate="AssignmentsEmailsEstimate",e.BackofficeEventUnarchive="BackofficeEventUnarchive",e.BackofficeInvoiceMarkAsPaid="BackofficeInvoiceMarkAsPaid",e.BackofficeInvoiceMarkAsRefunded="BackofficeInvoiceMarkAsRefunded",e.BackofficeInvoiceMarkAsWrittenOff="BackofficeInvoiceMarkAsWrittenOff",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.CommentUpdate="CommentUpdate",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.CustomFieldUpdate="CustomFieldUpdate",e.CustomFieldsMassDelete="CustomFieldsMassDelete",e.CustomFieldsMassDuplicate="CustomFieldsMassDuplicate",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.DelegationsMassAccreditationsProfilesEdit="DelegationsMassAccreditationsProfilesEdit",e.DelegationsMassAccreditationsSlotsEdit="DelegationsMassAccreditationsSlotsEdit",e.DelegationsMassDelete="DelegationsMassDelete",e.DelegationsMassEdit="DelegationsMassEdit",e.DelegationsMassLeadersEdit="DelegationsMassLeadersEdit",e.DelegationsMassLeadersEmailSend="DelegationsMassLeadersEmailSend",e.DelegationsMassMove="DelegationsMassMove",e.DelegationsSpaceLayoutCreate="DelegationsSpaceLayoutCreate",e.DelegationsSpaceLayoutDelete="DelegationsSpaceLayoutDelete",e.DelegationsSpaceLayoutDuplicate="DelegationsSpaceLayoutDuplicate",e.DelegationsSpaceLayoutUpdate="DelegationsSpaceLayoutUpdate",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.EventSpaceDesignUpdate="EventSpaceDesignUpdate",e.EventUpdate="EventUpdate",e.EventWeezeventUpdate="EventWeezeventUpdate",e.EventsImport="EventsImport",e.EventsImportResult="EventsImportResult",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.GroupCreate="GroupCreate",e.GroupDelete="GroupDelete",e.GroupMemberDelete="GroupMemberDelete",e.GroupUpdate="GroupUpdate",e.LoginCodeEmailCreate="LoginCodeEmailCreate",e.OrganizationCreate="OrganizationCreate",e.OrganizationDelegationSpaceSettingsUpdate="OrganizationDelegationSpaceSettingsUpdate",e.OrganizationEventsShowcaseSettingsUpdate="OrganizationEventsShowcaseSettingsUpdate",e.OrganizationInvite="OrganizationInvite",e.OrganizationMembersSpaceSettingsUpdate="OrganizationMembersSpaceSettingsUpdate",e.OrganizationProfilePrivateFieldsUpdate="OrganizationProfilePrivateFieldsUpdate",e.OrganizationSpaceDesignUpdate="OrganizationSpaceDesignUpdate",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.PositionsExport="PositionsExport",e.PositionsImport="PositionsImport",e.PositionsImportResult="PositionsImportResult",e.PositionsMassConditions="PositionsMassConditions",e.PositionsMassDelete="PositionsMassDelete",e.PositionsMassEdit="PositionsMassEdit",e.PositionsMassLeadersEdit="PositionsMassLeadersEdit",e.PositionsSlotsMassEdit="PositionsSlotsMassEdit",e.PositionsSlotsUsersInfosCheckIn="PositionsSlotsUsersInfosCheckIn",e.RoleCreate="RoleCreate",e.RoleDelete="RoleDelete",e.RoleDuplicate="RoleDuplicate",e.RoleUpdate="RoleUpdate",e.SegmentCreate="SegmentCreate",e.SegmentDelete="SegmentDelete",e.SegmentDuplicate="SegmentDuplicate",e.SegmentFolderCreate="SegmentFolderCreate",e.SegmentFolderDelete="SegmentFolderDelete",e.SegmentFolderDuplicate="SegmentFolderDuplicate",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.UserAccessDelete="UserAccessDelete",e.UserAccessMassCreate="UserAccessMassCreate",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.VolunteerRegistrationCustomDocumentPrint="VolunteerRegistrationCustomDocumentPrint",e.VolunteerRegistrationUpdate="VolunteerRegistrationUpdate",e.VolunteerRegistrationUpdateField="VolunteerRegistrationUpdateField",e.VolunteersCriblageExport="VolunteersCriblageExport",e.VolunteersExport="VolunteersExport",e.VolunteersImport="VolunteersImport",e.VolunteersImportResult="VolunteersImportResult",e.VolunteersRegistrationsAccreditationsValidate="VolunteersRegistrationsAccreditationsValidate",e.VolunteersRegistrationsAdminAdd="VolunteersRegistrationsAdminAdd",e.VolunteersRegistrationsMassAccredit="VolunteersRegistrationsMassAccredit",e.VolunteersRegistrationsMassAccreditationProfileUpdate="VolunteersRegistrationsMassAccreditationProfileUpdate",e.VolunteersRegistrationsMassAccreditationStateUpdate="VolunteersRegistrationsMassAccreditationStateUpdate",e.VolunteersRegistrationsMassAssign="VolunteersRegistrationsMassAssign",e.VolunteersRegistrationsMassAvailabilitiesUpdate="VolunteersRegistrationsMassAvailabilitiesUpdate",e.VolunteersRegistrationsMassDelegationAdd="VolunteersRegistrationsMassDelegationAdd",e.VolunteersRegistrationsMassDelete="VolunteersRegistrationsMassDelete",e.VolunteersRegistrationsMassDuplicate="VolunteersRegistrationsMassDuplicate",e.VolunteersRegistrationsMassFormAdd="VolunteersRegistrationsMassFormAdd",e.VolunteersRegistrationsMassFormRemove="VolunteersRegistrationsMassFormRemove",e.VolunteersRegistrationsMassPreAssign="VolunteersRegistrationsMassPreAssign",e.VolunteersRegistrationsMassPrint="VolunteersRegistrationsMassPrint",e.VolunteersRegistrationsMassStateUpdate="VolunteersRegistrationsMassStateUpdate",e.VolunteersRegistrationsMassTicketIdRegenerate="VolunteersRegistrationsMassTicketIdRegenerate",e.VolunteersRegistrationsMassWishedAccreditationsUpdate="VolunteersRegistrationsMassWishedAccreditationsUpdate",e.VolunteersRegistrationsMassWishedProfileUpdate="VolunteersRegistrationsMassWishedProfileUpdate",e.WorkflowCreate="WorkflowCreate",e.WorkflowDuplicate="WorkflowDuplicate",e.WorkflowUpdate="WorkflowUpdate",e.WorkflowsMassEdit="WorkflowsMassEdit",e.WorkflowsMassExecute="WorkflowsMassExecute",e.WorkflowssMassDelete="WorkflowssMassDelete"}(QQ||(QQ={})),function(e){e.AccreditationsEmailsEstimate="AccreditationsEmailsEstimate",e.AccreditationsProfilesImportResult="AccreditationsProfilesImportResult",e.AssignmentsEmailsEstimate="AssignmentsEmailsEstimate",e.BackofficeEventUnarchive="BackofficeEventUnarchive",e.BackofficeInvoiceMarkAsPaid="BackofficeInvoiceMarkAsPaid",e.BackofficeInvoiceMarkAsRefunded="BackofficeInvoiceMarkAsRefunded",e.BackofficeInvoiceMarkAsWrittenOff="BackofficeInvoiceMarkAsWrittenOff",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.UserProfileUpdate="UserProfileUpdate",e.UsersInfosExport="UsersInfosExport",e.UsersInfosMassDelegationDelete="UsersInfosMassDelegationDelete",e.VolunteersCriblageExport="VolunteersCriblageExport",e.VolunteersExport="VolunteersExport",e.VolunteersImportResult="VolunteersImportResult"}(e0||(e0={}));const t0=e=>{const t=Ei(Cm);return(0,i.jsxs)(am,{children:[(0,i.jsxs)(Qu,{align:"center",gap:"3",children:[(0,i.jsx)(rd,{align:"center",css:{background:"$primary300",borderRadius:"32px",color:"$primary600",height:"32px",width:"32px"},justify:"center",children:(0,i.jsx)(Id,{icon:e.activity.icon})}),(0,i.jsx)(ka,{font:"gray900 textSm medium",children:e.activity.text})]}),(0,i.jsx)(Qu,{children:t.toLocaleString(e.activity.date.toLocal(),zs.DateTime)})]})},n0=()=>{const{translate:e,params:{organizationId:t}}=bd(),[n,o]=(0,V.useState)([]),[s,r]=(0,V.useState)([]),[a,l]=(0,V.useState)(As.c9.invalid("Invalid")),[d,c]=(0,V.useState)(0),{data:u,isLoading:m}=Oi("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:h,totalCount:g}=ah(u.organization?.activities),p=(0,V.useMemo)(()=>{const t=Object.keys(e0);return Object.keys(QQ).filter(e=>!t.includes(e)).map(t=>(0,i.jsx)("option",{value:t,children:e(t)},t))},[]);return(0,i.jsxs)(nb,{css:{overflowY:"auto"},children:[(0,i.jsx)(tb,{children:(0,i.jsx)(ka,{font:"gray900 displayXs semiBold",children:e("activit_95747")})}),(0,i.jsx)(Qv,{children:(0,i.jsx)(dm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Uu,{isSearchVisible:!0,multiple:!0,placeholder:e("op_ration_25453"),values:n,onChange:o,children:p})}),(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Uu,{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)(ka,{width:200,children:(0,i.jsx)(Ih,{value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:e("Description")}),(0,i.jsx)(pm,{children:e("Date")})]}),numberOfPages:h,offset:d,rows:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):u.organization.activities.nodes.map((e,t)=>(0,i.jsx)(t0,{activity:e},t)),setOffset:c,totalCount:g})})]})},i0=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)(!1),[s,r]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{children:[(0,i.jsx)(ru,{icon:"pen",onClick:()=>{o(!0)},children:t("renommer_42135")}),(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(fF,{accreditationCategory:e.accreditationCategory,eventId:e.accreditationCategory.eventId,onClose:()=>{o(!1)},onSuccess:e.reload}),s&&(0,i.jsx)(IB,{accreditationCategory:e.accreditationCategory,eventId:e.accreditationCategory.eventId,onClose:()=>{r(!1)},onSuccess:e.reload})]})},o0=()=>{const{translate:e,params:{organizationId:t}}=bd(),{canOrganizationParamEdit:n}=zv(),[o,s,r]=gm(""),[a,l]=(0,V.useState)(-1),[d,c]=(0,V.useState)(0),{data:u,isLoading:h,reload:p}=Oi("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:g(s)?s:void 0,eventId:-1!==a?a:void 0,offset:d},[]);const{numberOfPages:f,totalCount:_}=ah(u.organization?.accreditationsCategories),x=(0,V.useMemo)(()=>(0,cm.A)(u.organization?.events.nodes??[],e=>m(e.name)),[u.organization]),I=(0,V.useMemo)(()=>Object.fromEntries(x.map(e=>[e.id,e.name])),[x]);return(0,i.jsx)(dm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{width:200,children:(0,i.jsxs)(Uu,{isSearchVisible:!0,menuWidth:300,values:[a],onChange:e=>{Bs(e)&&l(e[0])},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)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:o,onChange:r})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(pm,{children:e("_v_nement_22345")}),(0,i.jsx)(pm,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(pm,{width:100})]}),numberOfPages:f,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):u.organization.accreditationsCategories.nodes.map(e=>(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(bm,{to:Mo.ACCREDITATION_CATEGORY({organizationId:t,eventId:e.eventId,accreditationCategoryId:e.id}),children:e.name})}),(0,i.jsx)(Qu,{children:I[e.eventId]??""}),(0,i.jsx)(Qu,{children:e.numberOfAccreditations}),n&&(0,i.jsx)(jm,{justify:"center",children:(0,i.jsx)(i0,{accreditationCategory:e,reload:p})})]},e.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:_})},s0=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)(!1),[s,r]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{children:[(0,i.jsx)(ru,{icon:"pen",onClick:()=>o(!0),children:t("renommer_42135")}),(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>r(!0),children:t("supprimer_43083")})]}),n&&(0,i.jsx)($B,{accreditationProfileCategory:e.accreditationProfileCategory,eventId:e.accreditationProfileCategory.eventId,onClose:()=>{o(!1)},onSuccess:e.reload}),s&&(0,i.jsx)(IV,{accreditationProfileCategory:e.accreditationProfileCategory,eventId:e.accreditationProfileCategory.eventId,onClose:()=>r(!1),onSuccess:e.reload})]})},r0=()=>{const{translate:e,params:{organizationId:t}}=bd(),{canOrganizationParamEdit:n}=zv(),[o,s,r]=gm(""),[a,l]=(0,V.useState)(-1),[d,c]=(0,V.useState)(0),{data:u,isLoading:h,reload:p}=Oi("query OrganizationCategoriesAccreditationsProfiles(\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 accreditationsProfilesCategories(\n name: $name\n eventId: $eventId\n offset: $offset\n limit: 25\n ) {\n nodes {\n id\n eventId\n name\n numberOfAccreditationsProfiles\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,name:g(s)?s:void 0,eventId:-1!==a?a:void 0,offset:d},[]);const{numberOfPages:f,totalCount:_}=ah(u.organization?.accreditationsProfilesCategories),x=(0,V.useMemo)(()=>(0,cm.A)(u.organization?.events.nodes??[],e=>m(e.name)),[u.organization]),I=(0,V.useMemo)(()=>Object.fromEntries(x.map(e=>[e.id,e.name])),[x]);return(0,i.jsx)(dm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{width:200,children:(0,i.jsxs)(Uu,{isSearchVisible:!0,menuWidth:300,values:[a],onChange:e=>{Bs(e)&&l(e[0])},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)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:o,onChange:r})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(pm,{children:e("_v_nement_22345")}),(0,i.jsx)(pm,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(pm,{width:100})]}),numberOfPages:f,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):u.organization.accreditationsProfilesCategories.nodes.map(e=>(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:e.name}),(0,i.jsx)(Qu,{children:I[e.eventId]??""}),(0,i.jsx)(Qu,{children:e.numberOfAccreditationsProfiles}),n&&(0,i.jsx)(jm,{justify:"center",children:(0,i.jsx)(s0,{accreditationProfileCategory:e,reload:p})})]},e.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:_})},a0=e=>{const t=Ti(),{mutate:n}=function(e={}){return Di("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)(DA,{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()}})},l0=e=>{const{mutate:t}=function(e={}){return Di("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)(iC,{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})},d0=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)(!1),[s,r]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{children:[(0,i.jsx)(ru,{icon:"pen",onClick:()=>{o(!0)},children:t("renommer_42135")}),(0,i.jsx)(ru,{color:0===e.customFieldCategory.numberOfCustomFields?"red":"disabled",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(l0,{customFieldCategory:e.customFieldCategory,organizationId:e.organizationId,onClose:()=>{o(!1)},onSuccess:e.reload}),s&&(0,i.jsx)(a0,{customFieldCategory:e.customFieldCategory,organizationId:e.organizationId,onClose:()=>{r(!1)},onSuccess:e.reload})]})},c0=()=>{const{translate:e,params:{organizationId:t}}=bd(),{canOrganizationParamEdit:n}=zv(),[o,s,r]=gm(""),[a,l]=(0,V.useState)(0),{data:d,isLoading:c,reload:u}=Oi("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:g(s)?s:void 0,offset:a},[]);const{numberOfPages:m,totalCount:h}=ah(d.organization?.customFieldsCategories);return(0,i.jsx)(dm,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:o,onChange:r})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(pm,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(pm,{width:100})]}),numberOfPages:m,offset:a,rows:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):d.organization.customFieldsCategories.nodes.map(e=>(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:e.name}),(0,i.jsx)(Qu,{children:e.numberOfCustomFields}),n&&(0,i.jsx)(jm,{justify:"end",children:(0,i.jsx)(d0,{customFieldCategory:e,organizationId:t,reload:u})})]},e.id)),setOffset:l,title:e("liste_des_cat_g_39450"),totalCount:h})},u0=e=>{const{history:t,translate:n}=bd(),[o,s]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{children:[(0,i.jsx)(ru,{icon:"pen",onClick:()=>t.push(qo.DELEGATION_CATEGORY_UPDATE({organizationId:e.delegationCategory.organizationId,eventId:e.delegationCategory.eventId?e.delegationCategory.eventId:void 0,delegationCategoryId:e.delegationCategory.id})),children:n("renommer_42135")}),(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>s(!0),children:n("supprimer_43083")})]}),o&&(0,i.jsx)(ww,{delegationCategory:e.delegationCategory,eventId:e.delegationCategory.eventId,organizationId:e.delegationCategory.organizationId,onClose:()=>{s(!1)},onSuccess:e.reload})]})},m0=()=>{const{translate:e,params:{organizationId:t}}=bd(),{canOrganizationParamEdit:n}=zv(),[o,s,r]=gm(""),[a,l]=(0,V.useState)(-1),[d,c]=(0,V.useState)(0),{data:u,isLoading:h,reload:p}=Oi("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:g(s)?s:void 0,eventId:-1!==a?a:void 0,offset:d},[]);const{numberOfPages:f,totalCount:_}=ah(u.organization?.delegationsCategories),x=(0,V.useMemo)(()=>(0,cm.A)(u.organization?.events.nodes??[],e=>m(e.name)),[u.organization]),I=(0,V.useMemo)(()=>Object.fromEntries(x.map(e=>[e.id,e.name])),[x]);return(0,i.jsx)(dm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{width:200,children:(0,i.jsxs)(Uu,{isSearchVisible:!0,menuWidth:300,values:[a],onChange:e=>{Bs(e)&&l(e[0])},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)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:o,onChange:r})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(pm,{children:e("_v_nement_22345")}),(0,i.jsx)(pm,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(pm,{width:100})]}),numberOfPages:f,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):u.organization.delegationsCategories.nodes.map(o=>(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(bm,{to:qo.DELEGATION_CATEGORY({organizationId:t,eventId:o.eventId,delegationCategoryId:o.id}),children:o.name})}),(0,i.jsx)(Qu,{children:o.eventId?I[o.eventId]??"":e("communaut_20896")}),(0,i.jsx)(Qu,{children:o.numberOfDelegations}),n&&(0,i.jsx)(jm,{justify:"center",children:(0,i.jsx)(u0,{delegationCategory:o,reload:p})})]},o.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:_})},h0=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)(!1),[s,r]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{children:[(0,i.jsx)(ru,{icon:"pen",onClick:()=>{o(!0)},children:t("renommer_42135")}),(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(DH,{eventId:e.positionCategory.eventId,positionCategoryId:e.positionCategory.id,positionCategoryName:e.positionCategory.name,onClose:()=>{o(!1)},onSuccess:e.reload}),s&&(0,i.jsx)(qY,{eventId:e.positionCategory.eventId,positionCategory:e.positionCategory,onClose:()=>{r(!1)},onSuccess:e.reload})]})},g0=()=>{const{translate:e,params:{organizationId:t}}=bd(),{canOrganizationParamEdit:n}=zv(),[o,s,r]=gm(""),[a,l]=(0,V.useState)(-1),[d,c]=(0,V.useState)(0),{data:u,isLoading:h,reload:p}=Oi("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:g(s)?s:void 0,eventId:-1!==a?a:void 0,offset:d},[]);const{numberOfPages:f,totalCount:_}=ah(u.organization?.positionsCategories),x=(0,V.useMemo)(()=>(0,cm.A)(u.organization?.events.nodes??[],e=>m(e.name)),[u.organization]),I=(0,V.useMemo)(()=>Object.fromEntries(x.map(e=>[e.id,e.name])),[x]);return(0,i.jsx)(dm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{width:200,children:(0,i.jsxs)(Uu,{isSearchVisible:!0,menuWidth:300,values:[a],onChange:e=>{Bs(e)&&l(e[0])},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)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:o,onChange:r})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(pm,{children:e("_v_nement_22345")}),(0,i.jsx)(pm,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(pm,{width:100})]}),numberOfPages:f,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):u.organization.positionsCategories.nodes.map(e=>(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(bm,{to:Jo.POSITION_CATEGORY({organizationId:t,eventId:e.eventId,positionCategoryId:e.id}),children:e.name})}),(0,i.jsx)(Qu,{children:I[e.eventId]??""}),(0,i.jsx)(Qu,{children:e.numberOfPositions}),n&&(0,i.jsx)(jm,{justify:"center",children:(0,i.jsx)(h0,{positionCategory:e,reload:p})})]},e.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:_})},p0=()=>{const{translate:e,params:{organizationId:t}}=bd();return(0,i.jsxs)(nb,{css:{overflowY:"auto"},children:[(0,i.jsx)(tb,{css:{padding:"$6 $7 0 $7"},children:(0,i.jsxs)(rd,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Dd,{children:e("cat_gories_24533")}),(0,i.jsxs)(ob,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(ib,{path:fs.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(t),children:e("champs_de_formu_64126")}),(0,i.jsx)(ib,{path:fs.ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS(t),children:e("missions_63972")}),(0,i.jsx)(ib,{path:fs.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS(t),children:e("accr_ditations_39450")}),(0,i.jsx)(ib,{path:fs.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS_PROFILES(t),children:e("profils_d_accr_27825")}),(0,i.jsx)(ib,{path:fs.ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS(t),children:e("d_l_gations_78318")})]})]})}),(0,i.jsx)(Qv,{children:(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(sb,{path:fs.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(":organizationId"),children:(0,i.jsx)(c0,{})}),(0,i.jsx)(sb,{path:fs.ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS(":organizationId"),children:(0,i.jsx)(g0,{})}),(0,i.jsx)(sb,{path:fs.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS(":organizationId"),children:(0,i.jsx)(o0,{})}),(0,i.jsx)(sb,{path:fs.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS_PROFILES(":organizationId"),children:(0,i.jsx)(r0,{})}),(0,i.jsx)(sb,{path:fs.ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS(":organizationId"),children:(0,i.jsx)(m0,{})})]})})]})},f0=e=>{const{params:{organizationId:t},translate:n}=bd(),o=df(t,e.linkPath),s=rk();return(0,i.jsxs)(rd,{direction:s?void 0:"column",align:"start",gap:"6",children:[(0,i.jsx)($p,{heading:n("DelegationSpaceLink"),children:(0,i.jsx)(Qw,{heading:n("lien_de_l_espac_85081"),link:o,qrCodeDescription:n("facilitez_la_co_59826")})}),(0,i.jsx)($p,{heading:n("iframe_27513"),children:(0,i.jsx)(Jw,{alert:e.alert,heading:e.iframeLabel,iframeLabel:e.iframeLabel,link:o})})]})},_0=()=>{const{params:{organizationId:e},translate:t}=bd(),[n,o]=(0,V.useState)(ze.Code);return(0,i.jsx)($p,{children:(0,i.jsx)(rd,{direction:"column",children:(0,i.jsxs)(rd,{gap:"7",children:[(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"6",children:[(0,i.jsx)(Dd,{children:t("liste_des_e_mai_73508")}),(0,i.jsxs)(Hu,{children:[(0,i.jsx)(Wu,{children:(0,i.jsx)(pm,{children:t("type_d_e_mail_06577")})}),(0,i.jsx)(PE,{isSelected:n===ze.Code,subtitle:t("cet_e_mail_est_80490"),title:t("code_20843"),onClick:()=>o(ze.Code)})]})]}),(0,i.jsx)(ka,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(rd,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(FE,{emailType:n,eventId:null,formId:null,organizationId:e,source:$e.DelegationsSpace})})]})})})},x0=e=>{const t=Ti(),n="badge"===e.type?e.badge:e.customDocument.slug,o=Ei(Cm);return(0,i.jsxs)(rd,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4 $6","&:last-child":{borderBottom:"none"}},gap:"3",children:[(0,i.jsx)(rd,{align:"center",css:{background:"$blueGray100",borderRadius:"12px",color:"$blueGray700"},height:40,justify:"center",width:40,children:(0,i.jsx)(Id,{icon:"file-lines"})}),(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Od,{textStyle:"heading",children:"badge"===e.type?y_(e.badge):`${e.customDocument.event.name} - ${e.customDocument.name}`}),"customDocument"===e.type&&(0,i.jsx)(Od,{textStyle:"subtitle",children:t("ajout_par_1_48224",e.customDocument.createdBy.name,o.toLocaleString(e.customDocument.insertedAt.toLocal(),zs.DateTime))})]}),(0,i.jsx)(Zm,{value:e.delegationsSpaceCustomBadges.includes(n),onChange:t=>{e.change("delegationsSpaceCustomBadges",Us(e.delegationsSpaceCustomBadges,n,t))},children:t("document_t_l_ch_56704")})]})},I0=()=>{const{params:{organizationId:e},translate:t}=bd(),{data:n,loader:o}=Oi("query OrganizationDelegationSpaceSettings($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customBadges\n allowDelegationSpaceDownload\n delegationsSpaceCustomBadges\n\n customDocuments {\n id\n slug\n name\n insertedAt\n\n event {\n id\n name\n }\n\n createdBy {\n ...CreatedBy\n }\n }\n }\n}\n",{organizationId:e},[js.CreatedByFragment]),{mutate:s}=function(e={}){return Di("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,V.useMemo)(()=>(0,cm.A)(n.organization?.customDocuments??[],e=>`${e.event.name} - ${e.name}`.toLowerCase()),[n.organization]);return o||(0,i.jsx)(Vd,{direction:"column",initialValues:{allowDelegationSpaceDownload:n.organization.allowDelegationSpaceDownload,delegationsSpaceCustomBadges:n.organization.delegationsSpaceCustomBadges},render:({form:e,handleSubmit:o,submitting:s,values:a})=>(0,i.jsxs)(Wp,{footerActions:(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(kd,{isLoading:s,onClick:o,children:t("enregistrer_06519")})}),heading:t("Documents"),subtitle:t("personnaliser_l_64606"),children:[(0,i.jsx)(eC,{heading:t("allow_documents_96106"),children:(0,i.jsx)(Kp,{name:"allowDelegationSpaceDownload",children:t("allow_delegatio_08622")})}),a.allowDelegationSpaceDownload&&(0,i.jsx)(eC,{heading:t("documents_dispo_46996"),children:(0,i.jsxs)(rd,{css:{border:"1px solid $gray200",borderRadius:"$2",flex:"1",overflow:"hidden"},direction:"column",children:[n.organization.customBadges.map(t=>(0,i.jsx)(x0,{badge:t,change:e.change,delegationsSpaceCustomBadges:a.delegationsSpaceCustomBadges,type:"badge"},t)),r.map(t=>(0,i.jsx)(x0,{change:e.change,customDocument:t,delegationsSpaceCustomBadges:a.delegationsSpaceCustomBadges,type:"customDocument"},t.id))]})})]}),onSubmit:async t=>{await s({organizationId:e,delegationSpaceSettings:t})}})},v0=()=>{const{params:{organizationId:e},translate:t}=bd();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tb,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(Dd,{children:t("espace_d_l_gati_59251")}),(0,i.jsxs)(ob,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(ib,{path:io.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:e}),children:t("design_15043")}),(0,i.jsx)(ib,{path:io.ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION({organizationId:e}),children:t("int_gration_10662")}),(0,i.jsx)(ib,{path:io.ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES({organizationId:e}),children:t("mod_les_e_mail_91257")}),(0,i.jsx)(ib,{path:io.ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS({organizationId:e}),children:t("param_tres_78420")})]})]})}),(0,i.jsx)(Qv,{css:{overflowY:"auto"},children:(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(sb,{path:io.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(SZ,{})}),(0,i.jsx)(sb,{path:io.ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(f0,{alert:(0,i.jsxs)(zd,{alertStyle:"warning",children:[(0,i.jsx)($d,{children:t("comment_marche_79958")}),(0,i.jsx)(Pd,{children:t("ce_code_va_vous_19546")})]}),iframeLabel:t("code_html_pour_86852"),linkPath:Ki(io.ORGANIZATION_DELEGATIONS({organizationId:e}))})}),(0,i.jsx)(sb,{path:io.ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES({organizationId:":organizationId"}),children:(0,i.jsx)(_0,{})}),(0,i.jsx)(sb,{path:io.ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(I0,{})})]})})]})},b0=e=>{const t=Ti(),{isLoading:n,copy:o}=RI(),{isLoading:s,copy:r}=RI();return(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:(0,i.jsxs)(rd,{align:"center",css:{"& i":{cursor:"pointer"}},children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{width:20,children:n?(0,i.jsx)(Id,{icon:"loader"}):(0,i.jsx)(Id,{icon:"copy",onClick:()=>o(e.name)})})}),(0,i.jsx)(bp,{placement:"top",children:t("copier_75889")})]}),e.name]})}),(0,i.jsx)(Qu,{width:100,children:e.type}),(0,i.jsx)(Qu,{children:(0,i.jsxs)(rd,{align:"center",css:{"& i":{cursor:"pointer"}},gap:"1",children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{width:20,children:s?(0,i.jsx)(Id,{icon:"loader"}):(0,i.jsx)(Id,{icon:"copy",onClick:()=>r(e.value)})})}),(0,i.jsx)(bp,{placement:"top",children:t("copier_75889")})]}),e.value]})})]})},j0=e=>{const t=Ti(),{mutate:n,isLoading:o}=function(e={}){return Di("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)(dm,{filters:(0,i.jsx)(i.Fragment,{children:e.domain.status===he.Failed&&(0,i.jsx)(kd,{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)(pm,{children:t("nom_08311")}),(0,i.jsx)(pm,{width:100,children:t("type_35427")}),(0,i.jsx)(pm,{children:t("valeur_22437")})]}),numberOfPages:0,offset:0,rows:(0,i.jsxs)(i.Fragment,{children:[e.domain.dnsEntries.map((e,t)=>(0,i.jsx)(b0,{name:e.name,type:e.type,value:e.value},t)),(0,i.jsx)(b0,{name:`_dmarc.${e.domain.name}`,type:"TXT",value:"v=DMARC1; p=quarantine; adkim=r;"})]}),setOffset:hc.A,title:(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{font:"gray900 textMd semiBold",children:t("liste_des_entr_35559",e.domain.name)}),e.domain.status===he.Success&&(0,i.jsx)(vu,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:t("vos_entr_es_dns_05106")}),e.domain.status===he.Pending&&(0,i.jsx)(vu,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:t("vos_entr_es_dns_31271")}),e.domain.status===he.Failed&&(0,i.jsx)(vu,{color:"error",leftIcon:"circle",leftIconStyle:"solid",children:t("la_v_rification_65771")})]}),totalCount:0})},C0=`https://support.${F.WEEZEVENT_DOMAIN}/fr/param%C3%A9trer-ladresse-e-mail-de-lexp%C3%A9diteur`,y0=e=>{const{history:t,translate:n}=bd(),{data:o,loader:s,reload:r}=Oi("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.jsx)(i.Fragment,{children:0===o.organization.domains.length?(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{height:250,width:1,children:(0,i.jsx)(pA,{imageSrc:Ec.DnsBlank,subtitle:n("pour_avoir_acc_02742"),title:n("les_entr_es_dns_52899")})}),(0,i.jsxs)(rd,{gap:"3",justify:"center",children:[(0,i.jsx)(kd,{color:"white",onClick:()=>{open(C0)},children:n("lire_la_documen_25597")}),(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(kd,{onClick:()=>{t.push(fs.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:n("ajouter_un_met_38216")})})]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zd,{alertStyle:"gray",children:(0,i.jsx)(Pd,{children:n("les_entr_es_dns_55177")})}),o.organization.domains.map((t,n)=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(j0,{domain:t,organizationId:e.organizationId,reload:r})]},n))]})})},A0=e=>{const{history:t,translate:n}=bd(),{mutate:o}=function(e={}){return Di("mutation EmailSenderDuplicate($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n emailSenderDuplicate(organizationId: $organizationId, emailSenderId: $emailSenderId) {\n id\n }\n}\n",e)}(),{mutate:s}=function(e={}){return Di("mutation EmailSenderDelete($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n emailSenderDelete(organizationId: $organizationId, emailSenderId: $emailSenderId) {\n id\n }\n}\n",e)}(),{mutate:r}=function(e={}){return Di("mutation EmailSenderVerificationResend(\n $organizationId: OrganizationId!\n $emailSenderId: EmailsSenderId!\n) {\n emailSenderVerificationResend(organizationId: $organizationId, emailSenderId: $emailSenderId)\n}\n",e)}(),[a,l]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{align:"center",css:{padding:"$3 $4"},gap:"3",children:[(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(rd,{align:"center",gap:"2",children:[(0,i.jsx)(ka,{color:"gray800",fontWeight:"medium",children:e.emailSender.name}),!e.emailSender.isValidToSendEmail&&(0,i.jsx)(vu,{color:"error",leftIcon:"circle",leftIconStyle:"solid",children:n("e_mail_non_conf_40343")})]}),(0,i.jsx)(ka,{color:"gray500",children:e.emailSender.from})]}),(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(kd,{color:"white",onClick:()=>{t.push(fs.EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId,e.emailSender.id))},children:n("_diter_62574")})}),(0,i.jsx)(kd,{color:"white",onClick:()=>{t.push(fs.ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW(e.organizationId,e.emailSender.id))},children:n("aper_u_25595")}),(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_PARAM_EDIT,children:(0,i.jsxs)(nu,{children:[(0,i.jsx)(du,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(lu,{placement:"bottom-end",children:[(0,i.jsxs)(MA,{children:[!e.emailSender.isValidToSendEmail&&(0,i.jsx)(ru,{icon:"paper-plane",onClick:async()=>{await r({organizationId:e.organizationId,emailSenderId:e.emailSender.id})},children:n("r_envoyer_l_e_91472")}),(0,i.jsx)(ru,{icon:"clone",onClick:async()=>{await o({organizationId:e.organizationId,emailSenderId:e.emailSender.id}),e.reload()},children:n("dupliquer_28256")})]}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:()=>{l(!0)},children:n("supprimer_43083")})})]})]})})]}),a&&(0,i.jsx)(DA,{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()}})]})},S0=e=>{const t=Ti();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{font:"gray900 textLg medium",children:t("liste_des_mett_28960")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(rd,{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)(A0,{emailSender:t,organizationId:e.organizationId,reload:e.reload},t.id))})]})},k0=e=>{const{history:t,translate:n}=bd(),{data:o,loader:s,reload:r}=Oi("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,V.useState)(null),d=(0,V.useMemo)(()=>(o.organization?.emailsSenders??[]).filter(e=>!e.isValidToSendEmail),[o.organization]);return(0,V.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)(rd,{direction:"column",children:[(0,i.jsx)(ka,{height:250,width:1,children:(0,i.jsx)(pA,{subtitle:n("cr_er_des_mett_38995"),title:n("aucun_metteur_96777")})}),(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(rd,{justify:"center",children:(0,i.jsx)(kd,{onClick:()=>{t.push(fs.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:n("cr_er_un_mette_14030")})})})]}):(0,i.jsxs)(i.Fragment,{children:[Bs(d)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(zd,{alertStyle:"error",children:[(0,i.jsx)($d,{children:n("veuillez_confir_10865")}),(0,i.jsx)(Pd,{children:(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:d.map(e=>(0,i.jsx)("li",{children:e.fromEmail},e.id))})})]}),(0,i.jsx)(md,{height:"7"})]}),(0,i.jsx)(S0,{emailsSenders:o.organization.emailsSenders,organizationId:e.organizationId,reload:r})]}))},w0=()=>{const{history:e,translate:t,params:{organizationId:n}}=bd(),o=location.pathname.endsWith("emails/senders");return(0,i.jsxs)(nb,{css:{overflowY:"auto"},children:[(0,i.jsx)(tb,{css:{padding:"$6 $7 0 $7"},children:(0,i.jsxs)(rd,{direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(rd,{align:"center",gap:"6",children:[(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Dd,{children:t("e_mails_09850")}),(0,i.jsx)(ka,{color:"gray500",children:t("param_trer_les_39470")})]}),o&&(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(kd,{onClick:()=>{e.push(fs.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n))},children:t("cr_er_une_nouve_77052")})})]}),(0,i.jsxs)(ob,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(ib,{path:fs.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n),children:t("_metteurs_74545")}),(0,i.jsx)(ib,{path:fs.ORGANIZATION_PARAMETERS_EMAILS_DNS(n),children:t("entr_es_dns_11256")})]})]})}),(0,i.jsx)(Qv,{children:(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(sb,{path:fs.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n),children:(0,i.jsx)(k0,{organizationId:n})}),(0,i.jsx)(sb,{path:fs.ORGANIZATION_PARAMETERS_EMAILS_DNS(n),children:(0,i.jsx)(y0,{organizationId:n})})]})})]})};let E0=class extends ic{constructor(e){super(e)}settingsDesignInputSchema(){return c.Ik().shape({title:c.Yj().required(),intro:c.Yj()})}settingsInputSchema(){return c.Ik().shape({events:c.YO().of(c.Ik().shape({buttonText:c.Yj().required(),descriptionText:c.Yj().max(70,this.t("the_maximum_len_30779",70)),eventId:c.ai().required(),formId:c.ai().nullable()}))})}};E0=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],E0);const T0=()=>{const{translate:e}=bd();return(0,i.jsx)($x,{heading:e("contenu_persona_18596"),subtitle:e("personnaliser_l_09507"),children:(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[(0,i.jsx)(ec,{label:e("titre_de_l_intr_54141"),name:"settings.title"}),(0,i.jsx)(ec,{label:e("contenu_29668"),name:"settings.intro"})]})})},R0=()=>{const{params:{organizationId:e},translate:t}=bd(),{data:n,loader:o}=rl({organizationId:e,includeIntro:!0,spaceType:ye.EventsShowcase}),{mutate:s}=Sl(),r=Ei(ld),a=Ei(XE),l=Ei(E0);return o||(0,i.jsx)(Vd,{direction:"column",initialValues:{design:a.designInputDefault(n.organization.spaceDesign),settings:{title:n.organization.eventsShowcaseSettings.title??t("liste_des_v_ne_29929"),intro:n.organization.eventsShowcaseSettings.intro??t("visualiser_tous_33187")}},render:({handleSubmit:e,submitting:n})=>(0,i.jsxs)(Wp,{footerActions:(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(kd,{isLoading:n,onClick:e,children:t("enregistrer_06519")})}),heading:t("design_15043"),hideHeader:!0,children:[(0,i.jsx)(T0,{}),(0,i.jsx)(QE,{heading:t("images_de_votre_51694"),showLogo:!0}),(0,i.jsx)(JE,{})]}),validate:r.validateForForm(l.settingsInputSchema()),onSubmit:async t=>await s({organizationId:e,settings:t.settings,spaceDesign:t.design,spaceType:ye.EventsShowcase})})},O0=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(VK,{heading:(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(Dd,{id:e.labelId,children:e.heading}),e.subtitle&&(0,i.jsx)(Od,{id:e.descId,textStyle:"subtitle",children:e.subtitle})]}),id:e.labelId,leftIcon:e.leftIcon,leftIconBorder:e.leftIconBorder,leftIconColor:e.leftIconColor,setIsOpen:e.setIsOpen}),(0,i.jsx)(UK,{id:e.descId,children:e.children}),(0,i.jsx)(WK,{handleSubmit:()=>{e.setValue(),e.setIsOpen(!1)},isSubmitDisabled:e.isSubmitDisabled,setIsOpen:e.setIsOpen,submitStyle:e.submitStyle,submitText:e.submitText})]}),D0=({role:e,setShowModal:t,showModal:n,...o})=>{const[s,r]=(0,V.useState)(!1),a=Hd();return(0,V.useEffect)(()=>(r(!(!n||s)),()=>{r(!1)}),[n]),(0,i.jsx)(BK,{descId:a.descId,isOpen:s,labelId:a.labelId,role:e,setIsOpen:r,size:"md",onClose:()=>{t(null)},children:(0,i.jsx)(O0,{descId:a.descId,labelId:a.labelId,setIsOpen:r,...o,children:o.children})})},z0=e=>{const{params:{organizationId:t},translate:n}=bd(),{data:o,loader:s}=Oi("query EventModalFormSelector($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n forms(level: Event, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:t,eventId:e.eventId},[]);return s||(Bs(o.organization.forms.nodes)?(0,i.jsxs)(hh,{label:n("avez_quel_formu_13642"),shouldParseAsInt:!0,value:e.formId??-1,onChange:e.setFormId,children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:-1,children:n("s_lectionner_un_13356")}),o.organization.forms.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}):(0,i.jsx)(pA,{imageSrc:Ec.WeezeventBlankPerson,title:n("you_have_no_for_84347")}))},$0=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)(!!e.linkedFormId);return(0,V.useEffect)(()=>{!n&&e.linkedFormId&&e.setLinkedFormId(null)},[n,e.linkedFormId]),(0,i.jsxs)(rd,{css:{bd:!0,borderRadius:"$1",backgroundColor:"$gray50",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(Dd,{textStyle:"smallcapsheading",children:t("personnalisatio_98369")}),(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(Qd,{hint:t("character_limit_93641",e.descriptionText.length,70),label:t("short_descripti_92906"),value:e.descriptionText,onChange:e.setDescriptionText}),(0,i.jsx)(Qd,{label:t("personnalisatio_58948"),value:e.buttonText,onChange:e.setButtonText}),(0,i.jsx)(Zm,{value:n,onChange:o,children:(0,i.jsx)(ka,{children:t("l_v_nement_est_24339")})}),n&&(0,i.jsx)(z0,{eventId:e.eventId,formId:e.linkedFormId,setFormId:e.setLinkedFormId})]})]})},P0=e=>{const{params:{organizationId:t},translate:n}=bd(),[o,s]=(0,V.useState)(void 0),[r,a]=(0,V.useState)(n("s_inscrire_20304")),[l,d]=(0,V.useState)(""),[c,u]=(0,V.useState)(null),{data:m,loader:h}=Oi("query EventsShowcaseAddEventModal($organizationId: OrganizationId!, $existingEventIds: [EventId]!) {\n organization(id: $organizationId) {\n events(excludedEventIds: $existingEventIds) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:t,existingEventIds:e.eventIds},[]);return(0,i.jsx)(D0,{heading:n("nouvel_v_nemen_99684"),isSubmitDisabled:!o,leftIcon:"building",leftIconBorder:"gray200",leftIconColor:"gray800",setShowModal:e.setShowModal,setValue:()=>e.setValue({buttonText:r,descriptionText:l,eventId:o,formId:c}),showModal:e.showModal,submitText:n("ajouter_97327"),subtitle:n("ajouter_et_pers_06084"),children:e.eventIds&&h||(Bs(m.organization.events.nodes)?(0,i.jsxs)(rd,{css:{inlineSize:"100%"},direction:"column",gap:"4",children:[(0,i.jsxs)(hh,{label:n("quel_v_nement_57240"),shouldParseAsInt:!0,value:o??-1,onChange:s,children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:-1,children:n("s_lectionner_un_57793")}),m.organization.events.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),o&&(0,i.jsx)($0,{buttonText:r,descriptionText:l,eventId:o,linkedFormId:c,setButtonText:a,setDescriptionText:d,setLinkedFormId:u})]}):(0,i.jsx)(pA,{imageSrc:Ec.WeezeventBlankPerson,title:n("you_have_no_oth_58056")}))})},M0=e=>(0,i.jsx)(D0,{...e,leftIcon:"trash-can",leftIconBorder:"gray200",leftIconColor:"gray800",role:"alertdialog",submitStyle:"error"}),F0=e=>{const{translate:t}=bd(),[n,o]=(0,V.useState)(e.event.buttonText),[s,r]=(0,V.useState)(e.event.descriptionText??""),[a,l]=(0,V.useState)(e.event.formId??null);return(0,i.jsx)(D0,{heading:t("mettre_jour_l_28846"),leftIcon:"building",leftIconBorder:"gray800",leftIconColor:"gray200",setShowModal:e.setShowModal,setValue:()=>e.setValue({buttonText:n,descriptionText:s,eventId:e.event.eventId,formId:a}),showModal:e.showModal,submitText:t("ajouter_97327"),subtitle:t("personalise_the_05652"),children:(0,i.jsx)(rd,{css:{inlineSize:"100%"},direction:"column",gap:"4",children:(0,i.jsx)($0,{buttonText:n,descriptionText:s,eventId:e.event.eventId,linkedFormId:a,setButtonText:o,setDescriptionText:r,setLinkedFormId:l})})})},N0=e=>{const{translate:t}=bd(),{setNodeRef:n,style:o,handleProps:s}=Hm(e.showcaseEvent.eventId),[r,a]=(0,V.useState)(null),[l,d]=(0,V.useState)(null),c=(0,V.useMemo)(()=>e.events?.find(t=>t.id===e.showcaseEvent.eventId)?.name??"",[e.showcaseEvent,e.events]),u=(0,V.useMemo)(()=>e.forms?.find(t=>t.id===e.showcaseEvent.formId)?.name??"",[e.showcaseEvent,e.forms]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{ref:n,align:"center",css:{padding:"$4 $6",borderBlockStart:"1px solid $gray200"},gap:"4",style:o,children:[(0,i.jsx)(ka,{color:"gray300",css:{cursor:"pointer"},...s,children:(0,i.jsx)(Id,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsxs)(rd,{direction:"column",gap:"1",children:[(0,i.jsxs)(rd,{css:{alignItems:"center"},gap:"2",children:[(0,i.jsx)(Od,{textStyle:"subheading",children:c}),e.showcaseEvent.formId&&(0,i.jsx)(vu,{leftIcon:"pen",children:t("linked_to_form_64790",u)})]}),g(e.showcaseEvent.descriptionText)&&(0,i.jsx)(Od,{css:{color:"$gray500"},children:e.showcaseEvent.descriptionText})]}),(0,i.jsx)(ka,{css:{flex:"1"}}),(0,i.jsxs)(rd,{gap:"2",children:[(0,i.jsx)(kd,{color:"white",leftIcon:"pen-line",onClick:()=>d(e.showcaseEvent.eventId)}),(0,i.jsx)(kd,{color:"white",leftIcon:"trash-can",onClick:()=>a(e.showcaseEvent.eventId)})]})]}),r&&r===e.showcaseEvent.eventId&&(0,i.jsx)(M0,{heading:t("vous_tes_sur_l_04795"),setShowModal:a,setValue:()=>{e.form.change("events",qs(e.values.events,e.values.events.findIndex(t=>t.eventId===e.showcaseEvent.eventId)))},showModal:!!r,submitText:t("oui_supprimer_57212"),subtitle:t("la_suppression_96669"),children:(0,i.jsx)(Od,{children:t("vous_tes_sur_l_80749",c)})}),l&&l===e.showcaseEvent.eventId&&(0,i.jsx)(F0,{event:e.showcaseEvent,setShowModal:d,setValue:t=>{e.form.change("events",e.values.events.map(n=>n.eventId===e.showcaseEvent.eventId?t:n))},showModal:!!l})]})},L0=e=>{const{translate:t}=bd(),n=(0,V.useCallback)((t,n)=>{e.form.change("events",Gs(e.values.events,t,n))},[e.values.events,e.form]);return(0,i.jsx)(oh,{ids:(e.values.events??[]).map(e=>e.eventId),onReorder:n,children:(0,i.jsx)(rd,{css:{bd:!0,"& > div:first-child":{borderBlockStart:"none !important"}},direction:"column",children:Bs(e.values.events)?e.values.events.map(t=>(0,i.jsx)(N0,{showcaseEvent:t,...e},t.eventId)):(0,i.jsx)(ka,{css:{padding:"$4"},children:(0,i.jsx)(pA,{title:t("no_events_selec_80121")})})})})},B0=()=>{const{params:{organizationId:e},translate:t}=bd(),[n,o]=(0,V.useState)(!1),{data:s,loader:r}=Oi("query OrganizationEventsShowcaseSettings($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n\n forms(level: Event) {\n nodes {\n id\n name\n }\n }\n\n eventsShowcaseSettings {\n title\n intro\n events {\n eventId\n descriptionText\n buttonText\n formId\n }\n }\n }\n}\n",{organizationId:e},[]),{mutate:a}=function(e={}){return Di("mutation OrganizationEventsShowcaseSettingsUpdate(\n $organizationId: OrganizationId!\n $eventsShowcaseSettings: EventsShowcaseSettingsInput!\n) {\n organizationEventsShowcaseSettingsUpdate(\n organizationId: $organizationId\n eventsShowcaseSettings: $eventsShowcaseSettings\n ) {\n id\n }\n}\n",e)}(),l=Ei(ld),d=Ei(E0);return r||(0,i.jsx)(Vd,{direction:"column",initialValues:{events:s.organization.eventsShowcaseSettings.events??[]},mutators:{setValue:([e,t],n,{changeValue:i})=>i(n,e,()=>t)},render:({form:e,handleSubmit:r,submitting:a,values:l})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wp,{footerActions:(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(kd,{isLoading:a,onClick:r,children:t("enregistrer_06519")})}),gap:"7",headerActions:(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(kd,{onClick:()=>o(!0),children:t("ajouter_un_v_n_49943")})}),heading:t("difusion_des_v_78418"),subtitle:t("personnaliser_l_19452"),children:(0,i.jsx)(rd,{direction:"column",gap:"6",children:(0,i.jsx)(L0,{events:s.organization.events.nodes,form:e,forms:s.organization.forms.nodes,values:l})})}),n&&(0,i.jsx)(P0,{eventIds:l.events.map(e=>e.eventId),setShowModal:o,setValue:t=>{e.change("events",[...l.events,t])},showModal:n})]}),validate:l.validateForForm(d.settingsInputSchema()),onSubmit:async t=>{await a({organizationId:e,eventsShowcaseSettings:t})}})},V0=()=>{const{translate:e,params:{organizationId:t}}=bd();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tb,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(Dd,{children:e("site_vitrine_17673")}),(0,i.jsxs)(ob,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(ib,{path:io.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:t}),children:e("design_15043")}),(0,i.jsx)(ib,{path:io.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION({organizationId:t}),children:e("int_gration_10662")}),(0,i.jsx)(ib,{path:io.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS({organizationId:t}),children:e("param_tres_78420")})]})]})}),(0,i.jsx)(Qv,{css:{overflowY:"auto"},children:(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{path:io.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(R0,{})}),(0,i.jsx)(Ea.qh,{path:io.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(f0,{alert:(0,i.jsxs)(zd,{alertStyle:"warning",children:[(0,i.jsx)($d,{children:e("comment_marche_91826")}),(0,i.jsx)(Pd,{children:e("ce_code_va_vous_11261")})]}),iframeLabel:e("code_html_pour_31742"),linkPath:So.EVENTS({organizationId:t})})}),(0,i.jsx)(Ea.qh,{path:io.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(B0,{})})]})})]})},U0=()=>{const{translate:e,params:{organizationId:t}}=bd();return(0,i.jsxs)(tb,{gap:"6",children:[(0,i.jsx)(ka,{css:{flex:"1"},font:"gray900 displayXs medium",children:e("groupes_34813")}),(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(kd,{to:fs.CREATE_ORGANIZATION_PARAMETERS_GROUP(t),children:e("cr_er_un_nouvea_64802")})})]})},W0=e=>{const{history:t,translate:n,params:{organizationId:o}}=bd(),{canOrganizationUserEdit:s}=zv(),{mutate:r}=function(e={}){return Di("mutation GroupDelete($organizationId: OrganizationId!, $groupId: GroupId!) {\n groupDelete(organizationId: $organizationId, groupId: $groupId)\n}\n",e)}(),{showNotification:a}=HI(),[l,d]=(0,V.useState)(!1),c=()=>{t.push(fs.EDIT_ORGANIZATION_PARAMETERS_GROUP(o,e.group.id))};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(am,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},onClick:c,onMouseLeave:e=>{eu(e.target)},children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(ka,{ellipsis:!0,title:e.group.name,children:e.group.name})}),(0,i.jsx)(Qu,{children:(0,i.jsx)(ka,{ellipsis:!0,title:e.group.description,width:1,children:e.group.description})}),(0,i.jsx)(Qu,{width:200,children:e.group.numberOfMembers}),s&&(0,i.jsx)(jm,{justify:"end",children:(0,i.jsxs)(vm,{children:[(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{icon:"pen",onClick:c,children:n("_diter_62574")})}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:e=>{eu(e.target),d(!0)},children:n("supprimer_43083")})})]})})]}),l&&(0,i.jsx)(DA,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_51354"),text:n("suppression_de_73669",e.group.name),onClose:()=>{d(!1)},onDelete:async()=>{await r({organizationId:o,groupId:e.group.id}),a(n("le_groupe_a_bie_29146")),e.reload()}})]})},G0=()=>{const{translate:e,params:{organizationId:t}}=bd(),{canOrganizationUserEdit:n}=zv(),[o,s,r]=gm(""),[a,l]=(0,V.useState)(0),{data:d,isLoading:c,reload:u}=Oi("query Groups($organizationId: OrganizationId!, $name: String, $offset: Int) {\n organization(id: $organizationId) {\n groups(name: $name, offset: $offset, limit: 25) {\n nodes {\n id\n name\n description\n numberOfMembers\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,name:g(s)?s:void 0,offset:a},[]);const{numberOfPages:m,totalCount:h}=ah(d.organization?.groups);return(0,i.jsx)(dm,{filters:(0,i.jsx)(rd,{align:"center",gap:"3",width:1,children:(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:e("Rechercher un groupe"),value:o,onChange:r})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:e("nom_08311")}),(0,i.jsx)(pm,{children:e("Description")}),(0,i.jsx)(pm,{width:200,children:e("nombre_de_membr_08851")}),n&&(0,i.jsx)(pm,{width:100})]}),numberOfPages:m,offset:a,rows:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):d.organization.groups.nodes.map(e=>(0,i.jsx)(W0,{group:e,reload:u},e.id)),setOffset:l,totalCount:h})},q0=()=>{const e=Ti();return(0,i.jsxs)(nb,{css:{overflowY:"auto"},children:[(0,i.jsx)(U0,{}),(0,i.jsxs)(Qv,{gap:"6",children:[(0,i.jsxs)(zd,{alertStyle:"primary",children:[(0,i.jsx)($d,{children:e("regrouper_des_a_43481")}),(0,i.jsx)(Pd,{children:e("un_groupe_porte_92378")})]}),(0,i.jsx)(G0,{})]})]})},H0=e=>{const{history:t,translate:n,params:{organizationId:o}}=bd(),s=Ei(B_),r=Ei(Mm),{mutate:a,isLoading:l}=function(e={}){return Di("mutation OrganizationUpdateInfos(\n $organizationId: OrganizationId!\n $organization: OrganizationInfosInput!\n) {\n organizationUpdateInfos(organizationId: $organizationId, organization: $organization) {\n id\n }\n}\n",e)}(),d=(0,V.useMemo)(()=>({organization:e.initialValues}),[e.initialValues]),c=(0,V.useMemo)(()=>M_.map((e,t)=>(0,i.jsx)("option",{value:e,children:e},t)),[]),u=As.c9.now();return(0,i.jsxs)(nb,{css:{overflowY:"auto"},children:[(0,i.jsx)(tb,{children:(0,i.jsx)(ka,{font:"gray900 displayXs medium",children:n("organisation_71863")})}),(0,i.jsx)(Qv,{children:(0,i.jsx)(Vd,{direction:"column",initialValues:d,render:({form:s,handleSubmit:a,values:d})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(HT,{change:s.change,changeCity:!0,changeCountry:!0,changeLatLng:!1,changePostalCode:!0,name:"place",prefix:"organization."}),(0,i.jsxs)(Wp,{footerActions:(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(kd,{isLoading:l,onClick:a,children:n("enregistrer_les_30411")})}),heading:n("informations_g_79325"),children:[(0,i.jsxs)(eC,{heading:n("_propos_de_l_o_80406"),children:[(0,i.jsx)(ec,{label:n("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(Dj,{addressName:"organization.street",label:n("Address"),placeName:"place"}),(0,i.jsx)(ec,{label:n("code_postal_40328"),name:"organization.postalCode"}),(0,i.jsx)(ec,{label:n("ville_67740"),name:"organization.city"}),(0,i.jsx)(Gp,{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)(Gp,{isSearchVisible:!0,label:n("fuseau_horaire_14654"),name:"organization.timeZone",children:c})]}),(0,i.jsxs)(eC,{heading:n("responsable_de_20624"),children:[(0,i.jsx)(ec,{label:n("nom_du_responsa_44907"),name:"organization.adminName"}),(0,i.jsx)(ec,{isEmail:!0,label:n("e_mail_du_respo_66060"),name:"organization.adminEmail"})]}),(0,i.jsx)(eC,{heading:n("_metteur_de_e_m_77028"),children:(0,i.jsx)(Gp,{isCreateVisible:!0,isSearchVisible:!0,label:n("_metteur_des_e_27849"),name:"organization.emailSenderId",onCreateClick:()=>{t.push(fs.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(o))},children:e.emailsSenders.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsxs)(eC,{heading:n("date_time_for_13370"),children:[(0,i.jsx)(ec,{hint:n("rendu_avec_la_d_41897",u.toFormat(d.organization.dateFormat)),label:n("format_de_date_82059"),name:"organization.dateFormat"}),(0,i.jsx)(ec,{hint:n("rendu_avec_la_d_41897",u.toFormat(d.organization.datetimeFormat)),label:n("format_de_date_24474"),name:"organization.datetimeFormat"}),(0,i.jsx)(ec,{hint:n("rendu_avec_la_d_41897",u.toFormat(d.organization.timeFormat)),label:n("format_d_heure_46798"),name:"organization.timeFormat"})]})]})]}),schema:s.updateOrganizationGeneralSchema(),width:1,onSubmit:async e=>{await a({organizationId:o,organization:e.organization})}})})]})},K0=()=>{const e=Ei(B_),{organizationId:t}=zi(),{data:n,loader:o}=Or({organizationId:t});return o||(0,i.jsx)(H0,{emailsSenders:n.organization.emailsSenders,initialValues:e.organizationInfosInputDefault(n.organization)})},Y0=()=>{const e=Ti(),{organizationId:t}=zi(),{data:n,loader:o}=Oi("query Invoices($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n invoices {\n id\n invoiceNumber\n amountCents\n smsAmountCents\n currency\n paidAt\n url\n insertedAt\n isRefunded\n isWrittenOff\n }\n }\n}\n",{organizationId:t},[]);return o||(0,i.jsxs)(nb,{css:{overflowY:"auto"},children:[(0,i.jsx)(tb,{children:(0,i.jsx)(ka,{font:"gray900 displayXs medium",children:e("factures_03552")})}),(0,i.jsx)(Qv,{children:(0,i.jsx)(dm,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:e("num_ro_de_factu_68150")}),(0,i.jsx)(pm,{children:e("Date")}),(0,i.jsx)(pm,{children:e("montant_55595")}),(0,i.jsx)(pm,{children:e("State")}),(0,i.jsx)(pm,{})]}),numberOfPages:1,offset:0,rows:(0,i.jsx)(i.Fragment,{children:n.organization.invoices.map((e,t)=>(0,i.jsx)(wm,{invoice:e,isBackoffice:!1,showColumn:()=>!0},t))}),setOffset:hc.A,title:e("factures_03552"),totalCount:0})})]})},Z0=()=>{const{params:{organizationId:e},translate:t}=bd(),{data:n,loader:o}=rl({organizationId:e,includeIntro:!1,spaceType:ye.MembersSpace}),{mutate:s}=Sl(),r=Ei(XE);return o||(0,i.jsx)(Vd,{direction:"column",initialValues:{design:r.designInputDefault(n.organization.spaceDesign)},render:({handleSubmit:e,submitting:n})=>(0,i.jsxs)(Wp,{footerActions:(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{isLoading:n,onClick:e,children:t("enregistrer_06519")})})}),heading:t("design_15043"),hideHeader:!0,children:[(0,i.jsx)(QE,{heading:t("images_de_votre_51694"),showLogo:!0}),(0,i.jsx)(JE,{})]}),onSubmit:async t=>await s({organizationId:e,spaceDesign:t.design,spaceType:ye.MembersSpace})})},X0=()=>{const{params:{organizationId:e},translate:t}=bd(),[n,o]=(0,V.useState)(ze.Code);return(0,i.jsx)($p,{children:(0,i.jsx)(rd,{direction:"column",children:(0,i.jsxs)(rd,{gap:"7",children:[(0,i.jsxs)(rd,{css:{flex:"1"},direction:"column",gap:"6",children:[(0,i.jsx)(Dd,{children:t("liste_des_e_mai_73508")}),(0,i.jsxs)(Hu,{children:[(0,i.jsx)(Wu,{children:(0,i.jsx)(pm,{children:t("type_d_e_mail_06577")})}),(0,i.jsx)(PE,{isSelected:n===ze.Code,subtitle:t("cet_e_mail_est_80490"),title:t("code_20843"),onClick:()=>o(ze.Code)})]})]}),(0,i.jsx)(ka,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(rd,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(FE,{emailType:n,eventId:null,formId:null,organizationId:e,source:$e.MembersSpace})})]})})})},J0=()=>{const{params:{organizationId:e},translate:t}=bd(),{data:n,loader:o}=Oi("query OrganizationMembersSpaceSettings($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n hideAssignmentsUntilConfirmationEmailSent\n hideAccreditationsUntilConfirmationEmailSent\n showMembersSpaceCommunity\n\n membersSpaceExcludeAccreditations\n accreditationsCategories {\n nodes {\n id\n name\n\n accreditations {\n id\n name\n }\n }\n }\n }\n}\n",{organizationId:e},[]),{mutate:s}=function(e={}){return Di("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)(Vd,{direction:"column",initialValues:{hideAssignmentsUntilConfirmationEmailSent:n.organization.hideAssignmentsUntilConfirmationEmailSent,hideAccreditationsUntilConfirmationEmailSent:n.organization.hideAccreditationsUntilConfirmationEmailSent,membersSpaceExcludeAccreditations:n.organization.membersSpaceExcludeAccreditations,showMembersSpaceCommunity:n.organization.showMembersSpaceCommunity},render:({form:e,handleSubmit:o,submitting:s,values:r})=>(0,i.jsxs)(Wp,{footerActions:(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(kd,{isLoading:s,onClick:o,children:t("enregistrer_06519")})}),heading:t("param_tres_de_l_83556"),subtitle:t("personnalisez_l_44387"),children:[(0,i.jsx)(eC,{heading:t("community_featu_56458"),children:(0,i.jsx)(Kp,{name:"showMembersSpaceCommunity",children:t("show_community_78811")})}),(0,i.jsx)(eC,{heading:t("diffusion_des_a_83706"),children:(0,i.jsx)(Kp,{name:"hideAssignmentsUntilConfirmationEmailSent",children:t("afficher_les_af_06759")})}),(0,i.jsx)(eC,{heading:t("diffusion_des_a_32535"),children:(0,i.jsx)(Kp,{name:"hideAccreditationsUntilConfirmationEmailSent",children:t("afficher_les_ac_55704")})}),(0,i.jsx)(eC,{heading:t("restriction_de_66151"),children:(0,i.jsxs)($x,{heading:t("quelle_s_accr_53793"),role:"radiogroup",children:[(0,i.jsx)(zu,{css:{"& label > div > div":{fontWeight:"$regular !important"}},state:r.membersSpaceExcludeAccreditations?"unchecked":"checked",onClick:()=>{e.change("membersSpaceExcludeAccreditations",void 0)},children:t("afficher_toutes_12183")}),(0,i.jsx)(zu,{css:{"& label > div > div":{fontWeight:"$regular !important"}},state:r.membersSpaceExcludeAccreditations?"checked":"unchecked",onClick:()=>{e.change("membersSpaceExcludeAccreditations",[])},children:t("seulement_certa_92801")}),r.membersSpaceExcludeAccreditations&&(0,i.jsx)(Gp,{multiple:!0,name:"membersSpaceExcludeAccreditations",placeholder:t("add_accreditati_64170"),children:n.organization.accreditationsCategories.nodes.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.accreditations.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})]})})]}),onSubmit:async t=>{await s({organizationId:e,membersSpaceSettings:t})}})},Q0=()=>{const{translate:e,params:{organizationId:t}}=bd();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tb,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(Dd,{children:e("espace_membres_90896")}),(0,i.jsxs)(ob,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(ib,{path:io.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:t}),children:e("design_15043")}),(0,i.jsx)(ib,{path:io.ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION({organizationId:t}),children:e("int_gration_10662")}),(0,i.jsx)(ib,{path:io.ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES({organizationId:t}),children:e("mod_les_e_mail_91257")}),(0,i.jsx)(ib,{path:io.ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS({organizationId:t}),children:e("param_tres_78420")})]})]})}),(0,i.jsx)(Qv,{css:{overflowY:"auto"},children:(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(sb,{path:io.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(Z0,{})}),(0,i.jsx)(sb,{path:io.ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(f0,{alert:(0,i.jsxs)(zd,{alertStyle:"warning",children:[(0,i.jsx)($d,{children:e("comment_marche_87686")}),(0,i.jsx)(Pd,{children:e("ce_code_va_vous_50849")})]}),iframeLabel:e("code_html_pour_26450"),linkPath:Ki(io.ORGANIZATION({organizationId:t}))})}),(0,i.jsx)(sb,{path:io.ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES({organizationId:":organizationId"}),children:(0,i.jsx)(X0,{})}),(0,i.jsx)(sb,{path:io.ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(J0,{})})]})})]})},e1=e=>{const t=Pi(),n=e.isActive?e.isActive(t.pathname):t.pathname===e.path;return(0,i.jsx)(_d,{to:e.path,children:(0,i.jsxs)(cj,{active:n,css:{gap:"$3",justifyContent:"flex-start",px:"$3",width:"100%"},children:[(0,i.jsx)(ka,{width:20,children:(0,i.jsx)(Id,{icon:e.icon})}),(0,i.jsx)(ka,{children:e.title})]})})},t1=e=>{const{localOrganization:t,updateLocalOrganization:n}=_v(),[o,s]=V.useState(t?.areParametersMenuSectionsOpen?.[e.name]??!0),r=V.useCallback(async i=>{s(i),await n({areParametersMenuSectionsOpen:(0,gd.A)(t?.areParametersMenuSectionsOpen,{[e.name]:i})})},[t,o,s]);return(0,i.jsxs)(rd,{css:{borderBottom:"1px solid $gray200",paddingBottom:"$1",paddingTop:"$4"},direction:"column",children:[(0,i.jsxs)(rd,{align:"center",css:{color:"$gray800",cursor:"pointer",px:"$5"},gap:"3",onClick:async()=>{await r(!o)},children:[(0,i.jsx)(ka,{css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"semiBold",children:e.title}),(0,i.jsx)(ka,{css:{fontSize:"10px"},children:(0,i.jsx)(Id,{icon:o?"chevron-down":"chevron-up"})})]}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(rd,{css:{px:"$3"},direction:"column",children:e.children})]})]})},n1=()=>{const{translate:e,params:{organizationId:t}}=bd();Zc(e("param_tres_78420"));const{hasFeature:n}=_v(),{canOrganizationParamRead:o,canOrganizationUserRead:s}=zv();return(0,i.jsx)(rd,{as:id.Nav,css:{background:"$gray100",overflowY:"auto",py:"$2"},height:1,children:(0,i.jsxs)(rd,{"aria-orientation":"vertical",direction:"column",role:"menubar",width:240,children:[(0,i.jsxs)(t1,{name:"general",title:e("g_n_ral_64953"),children:[(0,i.jsx)(e1,{icon:"user",path:fs.ORGANIZATION_PARAMETERS_PROFILE(t),title:e("mon_profil_48224")}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e1,{icon:"building",path:fs.ORGANIZATION_PARAMETERS_INFOS(t),title:e("organisation_71863")}),(0,i.jsx)(e1,{icon:"wave-pulse",path:fs.ORGANIZATION_PARAMETERS_ACTIVITY(t),title:e("activit_95747")})]})]}),o&&(0,i.jsxs)(t1,{name:"parameters",title:e("param_tres_78420"),children:[(0,i.jsx)(e1,{icon:"star",isActive:e=>e.includes(io.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE({organizationId:t})),path:io.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:t}),title:e("site_vitrine_17673")}),(0,i.jsx)(e1,{icon:"address-card",isActive:e=>e.includes(io.ORGANIZATION_SETTINGS_MEMBERS_SPACE({organizationId:t})),path:io.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:t}),title:e("espace_membres_90896")}),n(Ae.Delegation)&&(0,i.jsx)(e1,{icon:"users",isActive:e=>e.includes(io.ORGANIZATION_SETTINGS_DELEGATION_SPACE({organizationId:t})),path:io.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:t}),title:e("espace_d_l_gati_59251")}),(0,i.jsx)(e1,{icon:"at",isActive:e=>e.includes(fs.ORGANIZATION_PARAMETERS_EMAILS(t)),path:fs.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t),title:e("e_mails_09850")}),(0,i.jsx)(e1,{icon:"layer-group",isActive:e=>e.includes(fs.ORGANIZATION_PARAMETERS_CATEGORIES(t)),path:fs.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(t),title:e("cat_gories_24533")}),(0,i.jsx)(e1,{icon:"tag",path:fs.ORGANIZATION_PARAMETERS_TAGS(t),title:e("tags_79499")}),(0,i.jsx)(e1,{icon:"language",path:fs.ORGANIZATION_PARAMETERS_TRANSLATIONS(t),title:e("traductions_88349")})]}),s&&(0,i.jsxs)(t1,{name:"users",title:e("utilisateurs_04975"),children:[(0,i.jsx)(e1,{icon:"user-group",path:fs.ORGANIZATION_PARAMETERS_TEAM(t),title:e("utilisateurs_04975")}),(0,i.jsx)(e1,{icon:"shield",path:fs.ORGANIZATION_PARAMETERS_ROLES(t),title:e("r_les_et_permis_27853")}),(0,i.jsx)(e1,{icon:"people-group",path:fs.ORGANIZATION_PARAMETERS_GROUPS(t),title:e("groupes_34813")})]}),o&&s&&(0,i.jsx)(t1,{name:"subscription",title:e("abonnement_98940"),children:(0,i.jsx)(e1,{icon:"receipt",path:fs.ORGANIZATION_PARAMETERS_INVOICES(t),title:e("factures_03552")})}),o&&n(Ae.Skidata)&&(0,i.jsx)(t1,{name:"integrations",title:e("int_grations_88619"),children:(0,i.jsx)(e1,{icon:"person-skiing",path:fs.ORGANIZATION_PARAMETERS_SKIDATA(t),title:"Skidata"})})]})})},i1=()=>{const{translate:e,params:{organizationId:t}}=bd(),{data:n,loader:o}=Br({organizationId:t}),s=Ei(VT),r=Ei(ld),{mutate:a,isLoading:l}=Vr(),{mutate:d}=kl(),{user:c}=Li(),{reload:u}=_v(),[m,h]=(0,V.useState)(!1);return o||(0,i.jsxs)(nb,{css:{overflowY:"auto"},children:[(0,i.jsx)(tb,{children:(0,i.jsx)(ka,{font:"gray900 displayXs medium",children:e("mon_profil_48224")})}),(0,i.jsx)(Qv,{children:(0,i.jsx)(Vd,{direction:"column",initialValues:{userInfo:s.userInfoProfileInputDefault(n.user)},render:({handleSubmit:n})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Wp,{footerActions:(0,i.jsx)(kd,{isLoading:l,onClick:n,children:e("enregistrer_les_30411")}),heading:e("informations_pe_37892"),children:[(0,i.jsx)(dj,{accept:Vx.Images,acl:"public-read",allowCrop:!0,label:e("photo_de_profil_08618"),organizationId:t,prefix:"userInfo.fields.picture."}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(qQ,{inputName:"userInfo."})]}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Wp,{heading:e("compte_16579"),children:(0,i.jsx)(ka,{color:"error700",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{h(!0)},children:e("supprimer_mon_c_07051")})}),m&&(0,i.jsx)(DA,{buttonText:"Supprimer",subtext:e("_tes_vous_s_r_d_50084"),text:e("supprimer_mon_c_07051"),onClose:()=>{h(!1)},onDelete:async()=>{await d({}),Q()}})]}),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?Q():u()}})})]})},o1=()=>{const{translate:e,params:{organizationId:t}}=bd();return(0,i.jsxs)(tb,{gap:"6",children:[(0,i.jsx)(ka,{css:{flex:"1"},font:"gray900 displayXs medium",children:e("r_les_et_permis_27853")}),(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(kd,{to:fs.CREATE_ORGANIZATION_PARAMETERS_ROLE(t),children:e("cr_er_un_nouvea_53551")})})]})},s1=({onClose:e,onDelete:t,role:n})=>{const{translate:o,params:{organizationId:s}}=bd(),{mutate:r}=function(e={}){return Di("mutation RoleDelete($organizationId: OrganizationId!, $roleId: RoleId!) {\n roleDelete(organizationId: $organizationId, roleId: $roleId) {\n id\n }\n}\n",e)}();return(0,i.jsx)(DA,{buttonText:o("supprimer_43083"),subtext:0===n.numberOfTimesUsed?o("ce_r_le_n_est_p_61959"):o("ce_r_le_est_uti_35113",n.numberOfTimesUsed),text:o("suppression_de_73669",n.name),onClose:e,onDelete:()=>r({organizationId:s,roleId:n.id}).then(e=>(t(),e))})},r1=({onDelete:e,role:t})=>{const{history:n,translate:o,params:{organizationId:s}}=bd(),{mutate:r}=function(e={}){return Di("mutation RoleDuplicate($organizationId: OrganizationId!, $roleId: RoleId!) {\n roleDuplicate(organizationId: $organizationId, roleId: $roleId) {\n id\n }\n}\n",e)}(),{canOrganizationUserEdit:a}=zv(),[l,d]=(0,V.useState)(!1),c=(0,V.useMemo)(()=>a&&t.type===be.Custom,[a,t]),u=async()=>{const{roleDuplicate:e}=await r({organizationId:s,roleId:t.id});n.push(fs.EDIT_ORGANIZATION_PARAMETERS_ROLE(s,e.id))};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{children:[(0,i.jsxs)(MA,{children:[c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ru,{icon:"pen",onClick:()=>{n.push(fs.EDIT_ORGANIZATION_PARAMETERS_ROLE(s,t.id))},children:o("_diter_62574")}),(0,i.jsx)(ru,{icon:"clone",onClick:u,children:o("dupliquer_28256")})]}),t.type!==be.Custom&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ru,{icon:"eye",onClick:()=>{n.push(fs.EDIT_ORGANIZATION_PARAMETERS_ROLE(s,t.id))},children:o("voir_36533")}),(0,i.jsx)(ru,{icon:"clone",onClick:u,children:o("dupliquer_28256")})]})]}),(0,i.jsx)(MA,{children:c&&(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:e=>{eu(e.target),d(!0)},children:o("supprimer_43083")})})]}),l&&(0,i.jsx)(s1,{role:t,onClose:()=>d(!1),onDelete:e})]})},a1=()=>{const{history:e,translate:t,params:{organizationId:n}}=bd(),{canOrganizationUserEdit:o}=zv(),[s,r,a]=gm(""),[l,d]=(0,V.useState)([]),{data:c,isLoading:u,reload:h}=Oi("query Roles($organizationId: OrganizationId!, $name: String, $levels: [RoleAccessLevel!]) {\n organization(id: $organizationId) {\n roles(name: $name, levels: $levels) {\n id\n name\n description\n accessLevel\n type\n numberOfTimesUsed\n }\n }\n}\n",{organizationId:n,name:g(r)?r:void 0,levels:Bs(l)?l:void 0},[]);const{showNotification:p}=HI(),{reload:f}=_v(),_=(0,V.useMemo)(()=>(0,cm.A)(c.organization?.roles??[],e=>[e.accessLevel===je.Organization?1:e.accessLevel===je.Event?2:e.accessLevel===je.Position?3:4,m(e.name)]),[c.organization]),x=()=>{p({color:"success",text:t("le_r_le_a_bien_53462")}),h(),f()};return(0,i.jsx)(dm,{filters:(0,i.jsxs)(rd,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(ka,{width:300,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:t("rechercher_un_r_39544"),value:s,onChange:a})}),(0,i.jsx)(ka,{css:{flex:"1"}}),(0,i.jsx)(ka,{width:240,children:(0,i.jsxs)(Uu,{isSearchVisible:!0,menuWidth:320,multiple:!0,placeholder:"Niveau d'accès",renderOnPortal:!0,values:l,onChange:d,children:[(0,i.jsx)("option",{value:je.Organization,children:t("organisation_71863")}),(0,i.jsx)("option",{value:je.Event,children:t("_v_nement_22345")}),(0,i.jsx)("option",{value:je.DelegationCategory,children:t("Delegation")}),(0,i.jsx)("option",{value:je.Position,children:t("Position")})]})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:t("nom_du_r_le_38492")}),(0,i.jsx)(pm,{children:t("niveau_d_acc_s_29898")}),(0,i.jsx)(pm,{children:t("description_du_94520")}),(0,i.jsx)(pm,{width:200,children:"nombre_d_utilis_99999"}),o&&(0,i.jsx)(pm,{width:100})]}),rows:u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):_.map(s=>(0,i.jsxs)(am,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},onClick:()=>{e.push(fs.EDIT_ORGANIZATION_PARAMETERS_ROLE(n,s.id))},onMouseLeave:e=>{eu(e.target)},children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(ka,{ellipsis:!0,title:s.name,children:s.name})}),(0,i.jsx)(Qu,{children:s.accessLevel===je.Organization?t("administrateur_10076"):s.accessLevel===je.Event?t("administrateur_99393"):s.accessLevel===je.Position?t("responsable_de_82794"):t("responsable_de_75445")}),(0,i.jsx)(Qu,{children:(0,i.jsx)(ka,{title:s.description,width:1,children:s.description})}),(0,i.jsx)(Qu,{width:200,children:s.numberOfTimesUsed}),o&&(0,i.jsx)(jm,{justify:"end",children:(0,i.jsx)(r1,{role:s,onDelete:x})})]},s.id))})},l1=()=>{const e=Ti();return(0,i.jsxs)(nb,{css:{overflowY:"auto"},children:[(0,i.jsx)(o1,{}),(0,i.jsxs)(Qv,{gap:"6",children:[(0,i.jsxs)(zd,{alertStyle:"primary",children:[(0,i.jsx)($d,{children:e("contr_ler_les_p_50104")}),(0,i.jsx)(Pd,{children:e("les_r_les_aiden_19371")})]}),(0,i.jsx)(a1,{})]})]})};let d1=class extends ic{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??""}}};d1=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],d1);const c1=e=>{const t=Ti(),n=Ei(Cm),{mutate:o}=function(e={}){return Di("mutation SkidataConnectionInfoSeaonEventAdd($organizationId: OrganizationId!, $eventId: EventId!) {\n skidataConnectionInfoSeaonEventAdd(organizationId: $organizationId, eventId: $eventId) {\n organizationId\n }\n}\n",e)}(),{mutate:s}=function(e={}){return Di("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 Di("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 Di("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)(rd,{gap:"3",width:1,children:[(0,i.jsxs)(rd,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(ka,{color:"gray700",fontWeight:"medium",children:e.title}),(0,i.jsx)(ka,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(ka,{width:1,children:(0,i.jsxs)(Hu,{children:[(0,i.jsxs)(Wu,{children:[(0,i.jsx)(pm,{children:t("nom_de_l_v_nem_08711")}),(0,i.jsx)(pm,{children:t("Date")}),"all"===e.eventType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{}),(0,i.jsx)(pm,{})]}),"synchronized"===e.eventType&&(0,i.jsx)(pm,{}),"season"===e.eventType&&(0,i.jsx)(pm,{})]}),Bs(e.events)?e.events.map(l=>(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(ka,{color:"gray800",width:1,children:l.name})}),(0,i.jsx)(Qu,{children:S_(n,l.startAt,l.endAt)}),"all"===e.eventType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qu,{onClick:async()=>{await r({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(ka,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("synchroniser_34754")})}),(0,i.jsx)(Qu,{onClick:async()=>{await o({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(ka,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("_v_nement_saiso_67885")})})]}),"synchronized"===e.eventType&&(0,i.jsx)(Qu,{onClick:async()=>{await a({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(ka,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("supprimer_43083")})}),"season"===e.eventType&&(0,i.jsx)(Qu,{onClick:async()=>{await s({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(ka,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("supprimer_43083")})})]},l.id)):(0,i.jsx)(am,{css:{height:"auto"},children:(0,i.jsx)(Qu,{children:(0,i.jsxs)(rd,{align:"center",css:{padding:"$8"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(wj,{color:"primary",icon:"magnifying-glass"}),(0,i.jsx)(ka,{fontSize:"textMd",fontWeight:"medium",children:t("aucun_v_nement_39620")})]})})})]})})]})},u1=()=>{const e=Ti(),{organizationId:t}=zi(),n=Ei(d1),{data:o,loader:s,reload:r}=Oi("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 Di("mutation SkidataConnectionInfosDelete($organizationId: OrganizationId!) {\n skidataConnectionInfosDelete(organizationId: $organizationId) {\n organizationId\n }\n}\n",e)}(),{mutate:l,isLoading:d}=function(e={}){return Di("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 Di("mutation SkidataSynchronize($organizationId: OrganizationId!) {\n skidataSynchronize(organizationId: $organizationId)\n}\n",e)}(),m=(0,V.useMemo)(()=>o.organization?.events.nodes??[],[o.organization]),h=(0,V.useMemo)(()=>m.map(({id:e})=>e),[m]),g=(0,V.useMemo)(()=>o.organization?.skidataConnectionInfos?.synchronizedEventsIds??[],[o.organization]),p=(0,V.useMemo)(()=>o.organization?.skidataConnectionInfos?.seasonEventsIds??[],[o.organization]),f=(0,V.useMemo)(()=>{const e=(0,yu.A)(h,g.concat(p));return m.filter(t=>e.includes(t.id))},[m,g,p]),_=(0,V.useMemo)(()=>m.filter(e=>g.includes(e.id)),[m]),x=(0,V.useMemo)(()=>m.filter(e=>p.includes(e.id)),[m,p]);return s||(0,i.jsxs)(nb,{css:{overflowY:"auto"},children:[(0,i.jsxs)(tb,{gap:"3",children:[(0,i.jsx)(ka,{css:{flex:"1"},font:"gray900 displayXs medium",children:"Skidata"}),o.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:u?(0,i.jsx)(kd,{color:"white",leftIcon:"loader"}):(0,i.jsx)(kd,{color:"white",leftIcon:"arrows-rotate",onClick:async()=>{await c({organizationId:t})}})})}),(0,i.jsx)(bp,{placement:"top",children:e("synchroniser_34754")})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(kd,{color:"white",leftIcon:"arrow-right-from-bracket",onClick:async()=>{await a({organizationId:t}),r()}})})}),(0,i.jsx)(bp,{placement:"top",children:e("se_d_connecter_74151")})]})]})]}),(0,i.jsxs)(Qv,{children:[(0,i.jsx)(Vd,{direction:"column",initialValues:{connectionInfos:n.connectionInfosInputDefault(o.organization.skidataConnectionInfos)},render:({handleSubmit:t})=>(0,i.jsxs)(Wp,{footerActions:(0,i.jsx)(kd,{isLoading:d,onClick:t,children:o.organization.skidataConnectionInfos?e("enregistrer_06519"):e("se_connecter_63820")}),heading:e("connexion_05887"),children:[(0,i.jsx)(eC,{heading:e("adresse_du_web_92125"),children:(0,i.jsx)(ec,{name:"connectionInfos.url"})}),(0,i.jsx)(eC,{heading:"Issuer",children:(0,i.jsx)(ec,{name:"connectionInfos.issuer"})}),(0,i.jsx)(eC,{heading:"Receiver",children:(0,i.jsx)(ec,{name:"connectionInfos.receiver"})}),(0,i.jsx)(eC,{heading:e("lieu_20541"),children:(0,i.jsx)(ec,{name:"connectionInfos.place"})})]}),width:1,onSubmit:async e=>{await l({organizationId:t,connectionInfos:e.connectionInfos}),r()}}),o.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(Oh,{direction:"horizontal"}),(0,i.jsx)(md,{height:"5"}),(0,i.jsx)(c1,{eventType:"all",events:f,organizationId:t,reload:r,subtitle:"",title:e("liste_des_v_ne_29929")}),(0,i.jsx)(Dh,{height:"5"}),(0,i.jsx)(c1,{eventType:"synchronized",events:_,organizationId:t,reload:r,subtitle:e("ces_v_nements_58722"),title:e("liste_des_v_ne_09741")}),(0,i.jsx)(Dh,{height:"5"}),(0,i.jsx)(c1,{eventType:"season",events:x,organizationId:t,reload:r,subtitle:e("ces_v_nements_24479"),title:e("liste_des_v_ne_73078")})]})]})]})},m1=e=>{const t=Ti(),{mutate:n}=function(e={}){return Di("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)(Ej,{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)(ec,{label:t("nom_du_tag_95054"),name:"name"})})},h1=e=>{const t=Ti(),{canOrganizationParamEdit:n}=zv(),{mutate:o}=function(e={}){return Di("mutation TagDelete($organizationId: OrganizationId!, $tagId: TagId!) {\n tagDelete(organizationId: $organizationId, tagId: $tagId) {\n id\n }\n}\n",e)}(),[s,r]=(0,V.useState)(!1),[a,l]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(am,{css:{"&:hover":{background:"$gray100"}},children:[(0,i.jsx)(Qu,{css:{color:"$gray800"},children:e.tag.name}),(0,i.jsx)(Qu,{children:e.tag.numberOfTimesUsed}),n&&(0,i.jsxs)(jm,{justify:"center",children:[(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{children:(0,i.jsx)(Id,{icon:"pen",onClick:()=>{r(!0)}})})}),(0,i.jsx)(bp,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsxs)(Ip,{children:[(0,i.jsx)(jp,{children:(0,i.jsx)(ka,{color:"error700",children:(0,i.jsx)(Id,{icon:"trash-can",onClick:()=>{l(!0)}})})}),(0,i.jsx)(bp,{placement:"top",children:t("supprimer_02105")})]})]})]}),s&&(0,i.jsx)(m1,{name:e.tag.name,organizationId:e.organizationId,tagId:e.tag.id,onClose:()=>{r(!1)},onSuccess:e.reload}),a&&(0,i.jsx)(DA,{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()}})]})},g1=()=>{const{translate:e,params:{organizationId:t}}=bd(),{canOrganizationParamEdit:n}=zv(),[o,s,r]=gm(""),[a,l]=(0,V.useState)(0),{data:d,isLoading:c,reload:u}=Oi("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:g(s)?s:void 0,offset:a},[]);const{numberOfPages:m,totalCount:h}=ah(d.organization?.tags),[p,f]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(nb,{css:{overflowY:"auto"},children:[(0,i.jsxs)(tb,{gap:"6",children:[(0,i.jsx)(ka,{css:{flex:"1"},font:"gray900 displayXs medium",children:e("tags_79499")}),(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(kd,{onClick:()=>{f(!0)},children:e("cr_er_un_nouvea_56617")})})]}),(0,i.jsx)(Qv,{children:(0,i.jsx)(dm,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(ka,{width:320,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:e("rechercher_un_t_34829"),value:o,onChange:r})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:e("nom_08311")}),(0,i.jsx)(pm,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(pm,{width:100})]}),numberOfPages:m,offset:a,rows:c?(0,i.jsx)(i.Fragment,{}):d.organization.tags.nodes.map(e=>(0,i.jsx)(h1,{organizationId:t,reload:u,tag:e},e.id)),setOffset:l,title:e("liste_des_tags_83521"),totalCount:h})})]}),p&&(0,i.jsx)(Tj,{organizationId:t,onClose:()=>{f(!1)},onSuccess:u})]})};function p1(e,t){const n=e[`${t.toLowerCase()}String`];return g(n)?n:g(e.enString)?e.enString:g(e.frString)?e.frString:g(e.esString)?e.esString:g(e.deString)?e.deString:g(e.nlString)?e.nlString:""}const f1=e=>{const{translate:t,params:{organizationId:n}}=bd(),{user:o}=Li(),{mutate:s,isLoading:r}=function(e={}){return Di("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,V.useState)(!1),[d,c]=(0,V.useState)(Object.fromEntries(e.languages.map(t=>[t,e.translation[t.toLowerCase()]||""]))),u=o.language,m=e.languages.every(t=>e.translation[`is${t}Translated`]);return(0,i.jsxs)(rd,{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)(rd,{align:"center",css:{background:"white",cursor:"pointer",padding:"$4",userSelect:"none"},gap:"2",width:1,onClick:()=>{l(!a)},children:[(0,i.jsx)(kd,{color:"invisible",css:{color:"$gray700"},leftIcon:a?"chevron-down":"chevron-right"}),(0,i.jsx)(ka,{css:{flex:"1"},font:"gray800 textMd medium",children:p1(e.translation,u)}),(0,i.jsxs)(rd,{gap:"3",children:[(0,i.jsx)(vu,{children:t(e.translation.module)}),m?(0,i.jsx)(vu,{color:"success",children:t("Translated")}):(0,i.jsx)(vu,{color:"warning",children:t("NotTranslated")})]})]}),a&&(0,i.jsxs)(rd,{css:{background:"$gray100",padding:"$6"},direction:"column",gap:"6",children:[e.languages.map(t=>{const n=`Version ${t}`;return e.translation.translationType===Ve.RichText?(0,i.jsx)(AI,{initialValue:d[t],label:n,onChange:e=>{c({...d,[t]:e})}},t):(0,i.jsx)(Qd,{label:n,value:d[t],onChange:e=>{c({...d,[t]:e})}},t)}),(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(rd,{children:(0,i.jsx)(kd,{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")})})})]})]})},_1=e=>{const t=Ti(),n=um(),[o,s]=(0,V.useState)(!1),[r,a]=(0,V.useState)(e.eventsIds),[l,d]=(0,V.useState)(e.modules),[c,u]=(0,V.useState)(e.translationStatus),m=(0,V.useMemo)(()=>(0,cm.A)(e.organization.events.nodes,e=>e.name.toLowerCase()),[e.organization]);return(0,i.jsxs)(rd,{css:{background:"white",bd:!0,padding:"$4"},gap:"3",children:[(0,i.jsx)(Qd,{icon:"search",placeholder:t("rechercher_une_22159"),value:e.content,onChange:e.setContent}),(0,i.jsxs)(hS,{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(Le.TranslatedAndNotTranslated),u(Le.TranslatedAndNotTranslated),s(!1)},showButtons:!0,onStateChange:s,children:[(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("_v_nements_53672"),multiple:!0,renderOnPortal:!0,values:r,onChange:a,children:m.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Uu,{isSearchVisible:!0,label:t("module_67984"),multiple:!0,renderOnPortal:!0,values:l,onChange:d,children:n(ui)}),(0,i.jsx)(hh,{label:t("statut_de_tradu_58384"),value:c,onChange:u,children:n(mi)})]})]})},x1=e=>(0,i.jsx)(rd,{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)(ju,{borderRadius:"$2",height:32,width:1})}),I1=e=>{const{translate:t}=bd(),n=e.organization.translations.totalCount-e.organization.translated.totalCount;return(0,i.jsxs)(rd,{css:{height:"fit-content"},gap:"6",width:1,children:[(0,i.jsx)(ka,{width:.3,children:(0,i.jsx)(mB,{css:{height:"100%"},children:(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(ka,{font:"gray500 textSm medium",children:t("nombre_de_langu_75924")}),(0,i.jsx)(ka,{font:"gray900 displayMd medium",children:e.organization.languages.length})]})})}),(0,i.jsx)(ka,{css:{flex:"1"},children:(0,i.jsx)(mB,{children:(0,i.jsxs)(rd,{gap:"6",justify:"between",children:[(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(ka,{font:"gray500 textSm medium",children:t("nombre_de_champ_26560")}),(0,i.jsx)(ka,{font:"gray900 displayMd medium",children:e.organization.translations.totalCount})]}),(0,i.jsxs)(rd,{direction:"column",gap:"3",children:[(0,i.jsx)(ka,{font:"gray700 textXs semiBold",children:t("dont_10477")}),(0,i.jsxs)(rd,{align:"center",gap:"8",justify:"between",children:[(0,i.jsx)(ka,{font:"gray500 textSm medium",children:t("champs_tradui_47609")}),(0,i.jsx)(ka,{font:"gray900 textMd semiBold",children:n})]}),(0,i.jsxs)(rd,{align:"center",gap:"8",justify:"between",children:[(0,i.jsx)(ka,{font:"gray500 textSm medium",children:t("champs_traduits_03119")}),(0,i.jsx)(ka,{font:"gray900 textMd semiBold",children:e.organization.translated.totalCount})]})]})]})})})]})},v1=e=>{const{translate:t,params:{organizationId:n}}=bd(),[o,s,r]=gm(""),[a,l]=(0,V.useState)([]),[d,c]=(0,V.useState)(Le.TranslatedAndNotTranslated),[u,m]=(0,V.useState)([]),[h,p]=(0,V.useState)(0),{data:f,isLoading:_}=Oi("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:g(s)?s:null,eventsIds:a,modules:u,status:d,offset:h},[js.TranslationFragment]);const{numberOfPages:x,totalCount:I}=ah(f.organization?.translations),v=f.organization?.translations.nodes??[];return(0,i.jsxs)(rd,{css:{overflowY:"auto"},direction:"column",height:1,children:[(0,i.jsxs)(rd,{css:{borderBottom:"1px solid $gray200",padding:"$6 $7"},direction:"column",children:[(0,i.jsx)(ka,{font:"gray900 textXl medium",children:t("traductions_88349")}),(0,i.jsx)(ka,{color:"gray500",children:t("g_rer_toutes_le_39107")})]}),(0,i.jsxs)(rd,{css:{background:"$gray50",flex:"1",padding:"$7"},direction:"column",children:[(0,i.jsx)(I1,{organization:e.organization}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(_1,{content:o,eventsIds:a,modules:u,organization:e.organization,setContent:r,setEventsIds:l,setModules:m,setTranslationStatus:c,translationStatus:d}),(0,i.jsx)(md,{height:"4"}),_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x1,{isFirst:!0,isLast:!1}),(0,i.jsx)(x1,{isFirst:!1,isLast:!1}),(0,i.jsx)(x1,{isFirst:!1,isLast:!0})]}):v.map((t,n)=>(0,i.jsx)(f1,{isFirst:0===n,isLast:n===v.length-1,languages:e.organization.languages,translation:t},t.id)),(0,i.jsx)(md,{height:"4"}),(0,i.jsx)(rm,{numberOfPages:x,offset:h,setOffset:p,totalCount:I})]})]})},b1=()=>{const{params:{organizationId:e}}=bd(),{data:t,loader:n}=Oi("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)(v1,{organization:t.organization})},j1=e=>{const{translate:t,params:{organizationId:n}}=bd(),{showNotification:o}=HI(),{mutate:s}=function(e={}){return Di("mutation UserRolesDelete($organizationId: OrganizationId!, $userId: UserId!) {\n userRolesDelete(organizationId: $organizationId, userId: $userId)\n}\n",e)}(),r=function(e,t){const{mutate:n}=Yr();return(0,V.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,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vm,{children:[(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{icon:"paper-plane",onClick:async e=>{eu(e.target),await r()},children:t("r_envoyer_l_e_96215")})}),(0,i.jsx)(MA,{children:(0,i.jsx)(ru,{color:"red",icon:"trash-can",onClick:e=>{eu(e.target),l(!0)},children:t("supprimer_l_acc_85342")})})]}),a&&(0,i.jsx)(DA,{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()}})]})},C1=e=>{const{history:t}=bd(),{organization:n}=_v();return(0,i.jsx)(vu,{css:{minWidth:0},cursor:"pointer",leftIcon:"people-group",onClick:()=>{t.push(fs.EDIT_ORGANIZATION_PARAMETERS_GROUP(n.id,e.group.id))},children:e.group.name})},y1=e=>{const{organization:t}=_v(),{canOrganizationUserEdit:n}=zv(),{mutate:o}=El(),[s,r]=(0,V.useState)(e.roleId);return(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:e.group?(0,i.jsxs)(rd,{align:"center",gap:"2",width:1,children:[(0,i.jsx)(ka,{ellipsis:!0,children:e.roles.find(({id:e})=>e===s)?.name}),(0,i.jsx)(C1,{group:e.group})]}):(0,i.jsx)(hh,{shouldParseAsInt:!0,state:n?"active":"disabled",value:s,onChange:n=>(r(n),(n=>o({organizationId:t.id,scope:e.scope,id:e.id,roleId:n}))(n)),children:e.roles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(Qu,{children:e.resource}),n&&(0,i.jsx)(jm,{justify:"center",children:!e.group&&(0,i.jsx)(ka,{color:"error700",onClick:async()=>{e.onDelete(e.scope,e.id)},children:(0,i.jsx)(Id,{icon:"trash-can"})})})]})},A1=e=>{const{translate:t}=bd(),{organization:n,roles:o}=_v(),{canOrganizationUserEdit:s}=zv(),{mutate:r}=wl(),[a,l]=(0,V.useState)(e.userInfo.usersEvents.filter(t=>t.event.id===e.event.id)),[d,c]=(0,V.useState)(e.userInfo.usersDelegations.filter(t=>t.eventId===e.event.id)),[u,m]=(0,V.useState)(e.userInfo.usersDelegationsCategories.filter(t=>t.eventId===e.event.id)),[h,g]=(0,V.useState)(e.userInfo.usersPositions.filter(t=>t.eventId===e.event.id)),[p,f]=(0,V.useState)(e.userInfo.usersPositionsCategories.filter(t=>t.eventId===e.event.id)),_=t=>!t.group||!e.removedGroupsIds.includes(t.group.id),x=a.filter(_),I=u.filter(_),v=h.filter(_),b=p.filter(_),j=async(e,t)=>{await r({organizationId:n.id,scope:e,id:t}),l(e=>e.filter(e=>e.id!==t)),c(e=>e.filter(e=>e.id!==t)),m(e=>e.filter(e=>e.id!==t)),g(e=>e.filter(e=>e.id!==t)),f(e=>e.filter(e=>e.id!==t))};return Bs(x)||Bs(d)||Bs(I)||Bs(v)||Bs(b)?(0,i.jsx)(dm,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:t("r_le_59302")}),(0,i.jsx)(pm,{}),s&&(0,i.jsx)(pm,{width:100})]}),rows:(0,i.jsxs)(i.Fragment,{children:[x.map(t=>(0,i.jsx)(y1,{group:t.group,id:t.id,resource:"-",roleId:t.role.id,roles:o.eventRoles,scope:Ft.Event,userId:e.userInfo.userId,onDelete:j},t.id)),d.map(e=>(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:t("responsable_de_70462")}),(0,i.jsx)(Qu,{children:e.delegation.name}),s&&(0,i.jsx)(jm,{justify:"center",children:(0,i.jsx)(ka,{color:"error700",onClick:()=>j(Ft.Delegation,e.id),children:(0,i.jsx)(Id,{icon:"trash-can"})})})]},e.id)),I.map(t=>(0,i.jsx)(y1,{group:t.group,id:t.id,resource:t.delegationCategory.name,roleId:t.role.id,roles:o.delegationCategoryRoles,scope:Ft.DelegationCategory,userId:e.userInfo.userId,onDelete:j},t.id)),v.map(t=>(0,i.jsx)(y1,{group:t.group,id:t.id,resource:t.position.name,roleId:t.role.id,roles:o.positionRoles,scope:Ft.Position,userId:e.userInfo.userId,onDelete:j},t.id)),b.map(t=>(0,i.jsx)(y1,{group:t.group,id:t.id,resource:t.positionCategory.name,roleId:t.role.id,roles:o.positionRoles,scope:Ft.PositionCategory,userId:e.userInfo.userId,onDelete:j},t.id))]}),title:e.event.name}):null},S1=e=>{const{history:t,translate:n}=bd(),{organization:o}=_v(),{canOrganizationUserEdit:s}=zv(),{mutate:r}=function(e={}){return Di("mutation GroupMemberDelete(\n $organizationId: OrganizationId!\n $groupId: GroupId!\n $userInfoId: UsersInfoId!\n) {\n groupMemberDelete(\n organizationId: $organizationId\n groupId: $groupId\n userInfoId: $userInfoId\n )\n}\n",e)}();return Bs(e.groups)?(0,i.jsx)(dm,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:n("nom_08311")}),s&&(0,i.jsx)(pm,{width:100})]}),rows:(0,i.jsx)(i.Fragment,{children:e.groups.map(a=>(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(ka,{css:{cursor:"pointer"},ellipsis:!0,title:a.name,onClick:()=>{t.push(fs.EDIT_ORGANIZATION_PARAMETERS_GROUP(o.id,a.id))},children:a.name})}),s&&(0,i.jsx)(jm,{justify:"center",children:(0,i.jsx)(ka,{color:"error700",title:n("Retirer du groupe"),onClick:()=>(async t=>{await r({organizationId:o.id,groupId:t,userInfoId:e.userInfo.id}),e.onDelete(t)})(a.id),children:(0,i.jsx)(Id,{icon:"trash-can"})})})]},a.id))}),title:n("groupes_34813")}):null},k1=e=>{const{translate:t}=bd(),{organization:n,roles:o}=_v(),{canOrganizationUserEdit:s}=zv(),{mutate:r}=El(),{mutate:a}=wl(),l=e.userOrganization.group,[d,c]=(0,V.useState)(e.userOrganization.role.id),[u,m]=(0,V.useState)(e.userOrganization.sendNotifications),h=(t,i)=>r({organizationId:n.id,scope:Ft.Organization,id:e.userOrganization.id,sendNotifications:t,roleId:i});return(0,i.jsxs)(am,{children:[(0,i.jsx)(Qu,{children:l?(0,i.jsxs)(rd,{align:"center",gap:"2",width:1,children:[(0,i.jsx)(ka,{ellipsis:!0,children:o.organizationRoles.find(({id:e})=>e===d)?.name}),(0,i.jsx)(C1,{group:l})]}):(0,i.jsx)(hh,{shouldParseAsInt:!0,state:s?"active":"disabled",value:d,onChange:e=>(c(e),h(u,e)),children:o.organizationRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(Qu,{children:(0,i.jsx)(Zm,{disabled:!s||!!l,value:u,onChange:e=>(m(e),h(e,d)),children:t("activer_38612")})}),s&&(0,i.jsx)(jm,{justify:"center",children:!l&&(0,i.jsx)(ka,{color:"error700",onClick:async()=>{await a({organizationId:n.id,scope:Ft.Organization,id:e.userOrganization.id}),e.onDelete(e.userOrganization.id)},children:(0,i.jsx)(Id,{icon:"trash-can"})})})]})},w1=e=>{const{translate:t}=bd(),{organization:n}=_v(),{canOrganizationUserEdit:o}=zv(),[s,r]=(0,V.useState)(e.userInfo.usersOrganizations),a=e=>{r(t=>t.filter(t=>t.id!==e))};return(0,i.jsx)(dm,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:t("r_le_59302")}),(0,i.jsx)(pm,{children:t("notifications_98765")}),o&&(0,i.jsx)(pm,{width:100})]}),rows:(0,i.jsx)(i.Fragment,{children:s.filter(t=>!t.group||!e.removedGroupsIds.includes(t.group.id)).map((t,n)=>(0,i.jsx)(k1,{userId:e.userInfo.userId,userOrganization:t,onDelete:a},n))}),title:n.name})},E1=e=>{const{translate:t}=bd(),{organization:n}=_v(),{canOrganizationUserEdit:o}=zv(),[s,r]=(0,V.useState)(e.userInfo.groups),a=e.userInfo.groups.filter(({id:e})=>!s.some(t=>t.id===e)).map(({id:e})=>e);return(0,i.jsxs)(Jm,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(yb,{children:e.userInfo.nameOrEmail}),(0,i.jsxs)(Qm,{css:{gap:"$4",py:"$6"},children:[Bs(e.userInfo.usersOrganizations)&&(0,i.jsx)(w1,{removedGroupsIds:a,userInfo:e.userInfo}),(0,i.jsx)(S1,{groups:s,userInfo:e.userInfo,onDelete:e=>{r(t=>t.filter(t=>t.id!==e))}}),n.events.nodes.map(t=>(0,i.jsx)(A1,{event:t,removedGroupsIds:a,userInfo:e.userInfo},t.id)),o&&(0,i.jsx)(zP,{usersInfosIds:[e.userInfo.id],onClose:e.onClose})]}),(0,i.jsx)(eh,{children:(0,i.jsx)(rd,{gap:"3",justify:"end",children:(0,i.jsx)(kd,{color:"white",onClick:e.onClose,children:t("fermer_62479")})})})]})},T1=e=>{const[t,n]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(am,{css:{cursor:"pointer",userSelect:"none","&:hover":{background:"$gray100"}},onClick:()=>n(!0),children:[(0,i.jsx)(Qu,{children:(0,i.jsx)(ub,{size:32,userInfo:e.userInfo})}),(0,i.jsx)(JC,{userPermissions:e.userInfo}),(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(jm,{justify:"end",children:(0,i.jsx)(j1,{reload:e.reload,userInfo:e.userInfo})})})]}),t&&(0,i.jsx)(E1,{userInfo:e.userInfo,onClose:()=>{e.reloadUserInfo(e.userInfo.id),n(!1)}})]})},R1=e=>{const{translate:t}=bd(),{organization:n}=_v(),{showNotification:o}=HI(),{onClose:s}=Iv(),{mutate:r,isLoading:a}=function(e={}){return Di("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:l,isLoading:d}=function(e={}){return Di("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===be.OrganizationAdmin),m=n.roles.find(e=>e.type===be.OrganizationReader),h=n.roles.find(e=>e.type===be.EventAdmin),g=n.roles.find(e=>e.type===be.EventReader),[p,f]=(0,V.useState)(""),[_,x]=(0,V.useState)(u.id),I=n.events.nodes,[v,b]=(0,V.useState)(I[0]?.id),j=(0,V.useMemo)(()=>I.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[I]),C=function(e){return c.Yj().email().required().isValidSync(e)}(p);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Cv,{icon:"user-plus",children:t("inviter_un_util_06611")}),(0,i.jsxs)(jv,{gap:"6",children:[(0,i.jsx)(Qd,{isEmail:!0,label:t("Email"),value:p,onChange:f}),(0,i.jsxs)(rd,{direction:"column",children:[(0,i.jsx)(ka,{font:"gray800 textSm medium",children:t("quel_r_le_souha_92592")}),(0,i.jsx)(md,{height:"2"}),(0,i.jsx)(zu,{state:_===u.id?"checked":"unchecked",onClick:()=>x(u.id),children:u.name}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:_===m.id?"checked":"unchecked",onClick:()=>x(m.id),children:m.name}),Bs(I)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:_===h.id?"checked":"unchecked",onClick:()=>x(h.id),children:h.name}),_===h.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(rd,{css:{paddingLeft:"$6"},children:(0,i.jsx)(hh,{shouldParseAsInt:!0,value:v,onChange:b,children:j})})]}),(0,i.jsx)(md,{height:"3"}),(0,i.jsx)(zu,{state:_===g.id?"checked":"unchecked",onClick:()=>x(g.id),children:g.name}),_===g.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(rd,{css:{paddingLeft:"$6"},children:(0,i.jsx)(hh,{shouldParseAsInt:!0,value:v,onChange:b,children:j})})]})]})]})]}),(0,i.jsx)(bv,{children:(0,i.jsx)(kd,{disabled:!C,isLoading:a||d,onClick:async()=>{const i=n.roles.find(e=>e.id===_);if(_===u.id||_===m.id)await r({organizationId:n.id,email:p,roleId:_}),o(t("_1_a_t_invit_38156",p,i.name));else{const e=I.find(e=>e.id===v);await l({eventId:v,email:p,roleId:_}),o(t("_1_a_t_invit_15646",p,i.name,e.name))}e.reload(),s()},children:t("inviter_35349")})})]})},O1=e=>{const{translate:t}=bd();return(0,i.jsxs)(tb,{gap:"6",children:[(0,i.jsx)(ka,{css:{flex:"1"},font:"gray900 displayXs medium",children:t("utilisateurs_04975")}),(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_USER_EDIT,children:(0,i.jsxs)(Av,{children:[(0,i.jsx)(Sv,{children:(0,i.jsx)(kd,{children:t("inviter_un_util_06611")})}),(0,i.jsx)(yv,{children:(0,i.jsx)(R1,{reload:e.reload})})]})})]})},D1=()=>{const{translate:e,params:{organizationId:t}}=bd(),{organization:n,roles:o}=_v(),[s,r]=(0,V.useState)(!0),[a,l,d]=gm(""),[c,u]=(0,V.useState)(-1),[m,h]=(0,V.useState)(-1),[p,f]=(0,V.useState)(em),[_,x]=(0,V.useState)(0),{data:I,isLoading:v,reload:b}=Oi("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:s,name:g(l)?l:void 0,roleId:-1!==c?c:void 0,eventId:-1!==m?m:void 0,limit:p,offset:_},[js.UserInfoOrganizationFragment]);const{numberOfPages:j,totalCount:C}=ah(I.organization?.usersInfos),[y,A]=(0,V.useState)([]),[S,k]=(0,V.useState)({}),w=(0,V.useCallback)(async e=>{k(t=>({...t,[e]:!0}));const{organization:{userInfo:t}}=await function(e,t){return Js("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:[js.UserInfoOrganizationFragment]})}({organizationId:n.id,userInfoId:e},await X());A(n=>n.map(n=>n.id===e?t:n)),k(t=>({...t,[e]:!1}))},[n]);return(0,V.useEffect)(()=>{A(I.organization?.usersInfos.nodes??[])},[I.organization]),(0,i.jsxs)(nb,{css:{overflowY:"auto"},children:[(0,i.jsx)(O1,{reload:b}),(0,i.jsx)(Qv,{children:(0,i.jsx)(dm,{filters:(0,i.jsxs)(rd,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(ka,{width:300,children:(0,i.jsx)(Qd,{icon:"magnifying-glass",placeholder:e("rechercher_un_m_05904"),value:a,onChange:d})}),(0,i.jsx)(ka,{css:{flex:"1"}}),(0,i.jsx)(Eu,{state:s?"checked":"unchecked",onClick:e=>r("checked"===e),children:e("seulement_les_u_63675")}),(0,i.jsx)(ka,{width:240,children:(0,i.jsxs)(Uu,{isSearchVisible:!0,menuWidth:492,renderOnPortal:!0,values:[c],onChange:e=>{Bs(e)&&u(e[0])},children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_r_les_18736")}),(0,i.jsx)("optgroup",{label:e("organisation_71863"),children:o.organizationRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)("optgroup",{label:e("_v_nement_22345"),children:o.eventRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)("optgroup",{label:e("Delegation"),children:o.delegationCategoryRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)("optgroup",{label:e("Position"),children:o.positionRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})}),(0,i.jsx)(ka,{width:240,children:(0,i.jsxs)(Uu,{isSearchVisible:!0,menuWidth:492,renderOnPortal:!0,values:[m],onChange:e=>{Bs(e)&&h(e[0])},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})`},e.id))]})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pm,{children:e("full_name")}),(0,i.jsx)(pm,{children:e("r_les_61679")}),(0,i.jsx)(Mv,{permissions:Ov.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(pm,{width:100})})]}),limit:p,numberOfPages:j,offset:_,rows:v?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0}),(0,i.jsx)(fm,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:y.map(e=>S[e.id]?(0,i.jsx)(fm,{bx:!0},e.id):(0,i.jsx)(T1,{reload:b,reloadUserInfo:w,userInfo:e},e.id))}),setLimit:f,setOffset:x,totalCount:C})})]})},z1=()=>{const{translate:e,params:{organizationId:t}}=bd();Zc(e("param_tres_78420"));const{hasFeature:n}=_v(),{canOrganizationParamRead:o,canOrganizationUserRead:s}=zv();return(0,i.jsxs)(rd,{height:1,width:1,children:[(0,i.jsx)(n1,{}),(0,i.jsx)(ka,{css:{flex:"1"},height:1,children:(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{exact:!0,path:fs.ORGANIZATION_PARAMETERS_PROFILE(":organizationId"),children:(0,i.jsx)(i1,{})}),o&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.ORGANIZATION_PARAMETERS_INFOS(":organizationId"),children:(0,i.jsx)(K0,{})}),s&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.ORGANIZATION_PARAMETERS_TEAM(":organizationId"),children:(0,i.jsx)(D1,{})}),s&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.ORGANIZATION_PARAMETERS_ROLES(":organizationId"),children:(0,i.jsx)(l1,{})}),s&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.ORGANIZATION_PARAMETERS_GROUPS(":organizationId"),children:(0,i.jsx)(q0,{})}),o&&(0,i.jsx)(Ea.qh,{path:fs.ORGANIZATION_PARAMETERS_EMAILS(":organizationId"),children:(0,i.jsx)(w0,{})}),o&&(0,i.jsx)(Ea.qh,{path:io.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE({organizationId:":organizationId"}),children:(0,i.jsx)(nb,{children:(0,i.jsx)(V0,{})})}),o&&(0,i.jsx)(Ea.qh,{path:io.ORGANIZATION_SETTINGS_MEMBERS_SPACE({organizationId:":organizationId"}),children:(0,i.jsx)(nb,{children:(0,i.jsx)(Q0,{})})}),o&&n(Ae.Delegation)&&(0,i.jsx)(Ea.qh,{path:io.ORGANIZATION_SETTINGS_DELEGATION_SPACE({organizationId:":organizationId"}),children:(0,i.jsx)(nb,{children:(0,i.jsx)(v0,{})})}),o&&(0,i.jsx)(Ea.qh,{path:fs.ORGANIZATION_PARAMETERS_CATEGORIES(":organizationId"),children:(0,i.jsx)(p0,{})}),o&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.ORGANIZATION_PARAMETERS_TAGS(":organizationId"),children:(0,i.jsx)(g1,{})}),o&&(0,i.jsx)(Ea.qh,{path:fs.ORGANIZATION_PARAMETERS_TRANSLATIONS(":organizationId"),children:(0,i.jsx)(b1,{})}),o&&s&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.ORGANIZATION_PARAMETERS_INVOICES(":organizationId"),children:(0,i.jsx)(Y0,{})}),o&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.ORGANIZATION_PARAMETERS_ACTIVITY(":organizationId"),children:(0,i.jsx)(n0,{})}),o&&n(Ae.Skidata)&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.ORGANIZATION_PARAMETERS_SKIDATA(":organizationId"),children:(0,i.jsx)(u1,{})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:fs.ORGANIZATION_PARAMETERS_PROFILE(t)})})]})})]})},$1=Object.keys(Ov).length/2;function P1(e){return new Array($1).fill("0").map((t,n)=>e.includes(n)?"1":"0").join("")}const M1=P1([Ov.POSITION_READ,Ov.POSITION_EDIT,Ov.MEMBER_EDIT,Ov.MEMBER_ASSIGNMENT_STATE_EDIT,Ov.COMMENT_READ,Ov.COMMENT_ADD,Ov.MEMBER_AVAILABILITIES_EDIT,Ov.MEMBER_ASSIGN,Ov.CAMPAIGN_SEND,Ov.ACCREDITATION_READ,Ov.ACCREDITATION_EDIT,Ov.MEMBER_ACCREDIT,Ov.DELEGATION_READ,Ov.DELEGATION_EDIT,Ov.FORM_READ,Ov.FORM_EDIT,Ov.EMAIL_EDIT,Ov.CAMPAIGN_READ,Ov.DOCUMENT_READ,Ov.DOCUMENT_EDIT,Ov.WORKFLOW_READ,Ov.WORKFLOW_EDIT,Ov.CUSTOM_FIELD_READ,Ov.CUSTOM_FIELD_EDIT,Ov.SEGMENT_EDIT,Ov.MEMBER_CREATE,Ov.MEMBER_DELETE,Ov.EVENT_EDIT,Ov.ORGANIZATION_PARAM_READ,Ov.ORGANIZATION_PARAM_EDIT,Ov.ORGANIZATION_USER_READ,Ov.ORGANIZATION_USER_EDIT,Ov.WEEZEVENT_READ,Ov.WEEZEVENT_EDIT,Ov.DELEGATIONS_SPACE_PARAM_READ,Ov.DELEGATIONS_SPACE_PARAM_EDIT,Ov.PRINT_CONFIG_READ,Ov.PRINT_CONFIG_EDIT,Ov.PRINT,Ov.TICKET_ID_REGENERATE]),F1=P1([Ov.POSITION_READ,Ov.COMMENT_READ,Ov.ACCREDITATION_READ,Ov.DELEGATION_READ,Ov.FORM_READ,Ov.CAMPAIGN_READ,Ov.DOCUMENT_READ,Ov.WORKFLOW_READ,Ov.CUSTOM_FIELD_READ,Ov.ORGANIZATION_PARAM_READ,Ov.ORGANIZATION_USER_READ,Ov.WEEZEVENT_READ,Ov.DELEGATIONS_SPACE_PARAM_READ,Ov.PRINT_CONFIG_READ]),N1=P1([Ov.POSITION_READ,Ov.POSITION_EDIT,Ov.MEMBER_EDIT,Ov.MEMBER_ASSIGNMENT_STATE_EDIT,Ov.COMMENT_READ,Ov.COMMENT_ADD,Ov.MEMBER_AVAILABILITIES_EDIT,Ov.MEMBER_ASSIGN,Ov.CAMPAIGN_SEND,Ov.ACCREDITATION_READ,Ov.ACCREDITATION_EDIT,Ov.MEMBER_ACCREDIT,Ov.DELEGATION_READ,Ov.DELEGATION_EDIT,Ov.FORM_READ,Ov.FORM_EDIT,Ov.EMAIL_EDIT,Ov.CAMPAIGN_READ,Ov.DOCUMENT_READ,Ov.DOCUMENT_EDIT,Ov.WORKFLOW_READ,Ov.WORKFLOW_EDIT,Ov.CUSTOM_FIELD_READ,Ov.CUSTOM_FIELD_EDIT,Ov.SEGMENT_EDIT,Ov.MEMBER_CREATE,Ov.MEMBER_DELETE,Ov.WEEZEVENT_READ,Ov.WEEZEVENT_EDIT,Ov.DELEGATIONS_SPACE_PARAM_READ,Ov.DELEGATIONS_SPACE_PARAM_EDIT,Ov.PRINT_CONFIG_READ,Ov.PRINT_CONFIG_EDIT,Ov.PRINT,Ov.TICKET_ID_REGENERATE]),L1=P1([Ov.POSITION_READ,Ov.COMMENT_READ,Ov.ACCREDITATION_READ,Ov.DELEGATION_READ,Ov.FORM_READ,Ov.CAMPAIGN_READ,Ov.DOCUMENT_READ,Ov.WORKFLOW_READ,Ov.WEEZEVENT_READ,Ov.DELEGATIONS_SPACE_PARAM_READ,Ov.PRINT_CONFIG_READ]),B1=P1([Ov.POSITION_READ,Ov.POSITION_EDIT,Ov.COMMENT_READ,Ov.MEMBER_ASSIGN,Ov.CAMPAIGN_SEND,Ov.CAMPAIGN_READ]),V1=P1([Ov.POSITION_READ,Ov.COMMENT_READ]),U1=P1([Ov.DELEGATION_READ]);let W1=class extends ic{constructor(e){super(e)}default(e){return{name:e?.name??"",description:e?.description??"",accessLevel:e?.accessLevel??je.Position,permissions:e?.permissions??B1}}schema(){return c.Ik().shape({role:c.Ik().shape({name:c.Yj().required(this.t("le_nom_est_requ_61536")),description:c.Yj().required(this.t("la_description_46559")),accessLevel:c.Yj().required(this.t("le_niveau_d_acc_94726")).oneOf(ri,this.t("le_niveau_d_acc_94726")),permissions:c.Yj().matches(new RegExp(`^[01]{${$1}}$`),this.t("le_format_des_p_68818")).required(this.t("le_format_des_p_68818"))}).required()}).required()}};W1=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],W1);const G1=({children:e,disabled:t,permission:n,subtext:o,permissions:s,change:r})=>(0,i.jsx)(Zm,{css:{alignItems:"start","> *:first-child":{margin:"2px 0"}},disabled:t,subtext:o,value:"1"===s[n],onChange:e=>r("role.permissions",function(e,t,n){return[...e].toSpliced(t,1,n).join("")}(s,n,e?"1":"0")),children:e}),q1=e=>{const{translate:t}=bd(),n=e.roleInput.accessLevel;return(0,i.jsxs)(Wp,{heading:t("accr_ditations_39450"),children:[(0,i.jsxs)(eC,{heading:t("accr_ditations_39450"),children:[(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.ACCREDITATION_READ,permissions:e.roleInput.permissions,children:t("voir_les_accr_d_34867")}),n!==je.DelegationCategory&&(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.ACCREDITATION_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_accr_86042")})]}),(0,i.jsx)(eC,{heading:t("mod_ration_09947"),children:(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.MEMBER_ACCREDIT,permissions:e.roleInput.permissions,children:t("accr_diter_les_48281")})})]})},H1=e=>{const t=Ti(),n=e.roleInput.accessLevel===je.Organization||e.roleInput.accessLevel===je.Event,o=e.roleInput.accessLevel===je.Organization||e.roleInput.accessLevel===je.Event,s=e.roleInput.accessLevel===je.Organization||e.roleInput.accessLevel===je.Event;return(0,i.jsxs)(Wp,{heading:t("communication_05277"),children:[n&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(eC,{heading:t("Form_plural"),children:[(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.FORM_READ,permissions:e.roleInput.permissions,children:t("voir_les_formul_55824")}),(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.FORM_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_form_10612")})]})}),(0,i.jsxs)(eC,{heading:t("Campaigns"),children:[(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.CAMPAIGN_READ,permissions:e.roleInput.permissions,children:t("voir_les_campag_02148")}),(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.CAMPAIGN_SEND,permissions:e.roleInput.permissions,children:t("envoyer_une_cam_35768")})]}),o&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(eC,{heading:t("e_mails_09850"),children:(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.EMAIL_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_e_ma_05609")})})}),s&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(eC,{heading:t("Documents"),children:[(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.DOCUMENT_READ,permissions:e.roleInput.permissions,children:t("voir_les_docume_33988")}),(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.DOCUMENT_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_docu_87778")})]})})]})},K1=()=>{const e=Ti();return(0,i.jsx)(Wp,{heading:e("communication_05277"),children:(0,i.jsx)(eC,{heading:e("Campaigns"),children:(0,i.jsx)(ju,{borderRadius:"$1",height:20})})})},Y1=e=>{const t=Ti();return(0,i.jsx)(Wp,{heading:t("informations_su_20567"),children:(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[(0,i.jsx)(ec,{disabled:e.disabled,label:t("nom_du_r_le_38492"),name:"role.name"}),(0,i.jsx)(Hp,{disabled:e.disabled,label:t("Description"),name:"role.description"}),(0,i.jsxs)(Ev,{label:t("niveau_d_acc_s_29898"),name:"role.accessLevel",state:e.disabled||e.isEdit?"disabled":"active",children:[(0,i.jsx)("option",{value:je.Organization,children:t("administrateur_10076")}),(0,i.jsx)("option",{value:je.Event,children:t("administrateur_99393")}),(0,i.jsx)("option",{value:je.Position,children:t("responsable_de_82794")}),(0,i.jsx)("option",{value:je.DelegationCategory,children:t("responsable_de_75445")})]})]})})},Z1=()=>{const e=Ti();return(0,i.jsx)(Wp,{heading:e("informations_su_20567"),children:(0,i.jsxs)(rd,{direction:"column",gap:"6",children:[(0,i.jsx)(ju,{borderRadius:"$2",height:64,width:"100%"}),(0,i.jsx)(ju,{borderRadius:"$2",height:126,width:"100%"})]})})},X1=e=>{const t=Ti(),n=e.roleInput.accessLevel,o=n===je.Organization||n===je.Event,s=n===je.Organization||n===je.Event||n===je.Position,r=n===je.Organization||n===je.Event||n===je.Position,a=n===je.Organization||n===je.Event||n===je.DelegationCategory,l=n===je.Organization||n===je.Event,d=n===je.Organization||n===je.Event,c=n===je.Organization||n===je.Event,u=(0,hd.A)([(0,i.jsxs)(eC,{heading:t("membres_11310"),children:[o&&(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.MEMBER_CREATE,permissions:e.roleInput.permissions,children:t("cr_er_des_membr_28893")}),(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.MEMBER_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_memb_39894")}),o&&(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.MEMBER_DELETE,permissions:e.roleInput.permissions,children:t("supprimer_les_m_98024")}),s&&(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.MEMBER_AVAILABILITIES_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_disp_75220")}),o&&(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.TICKET_ID_REGENERATE,permissions:e.roleInput.permissions,children:t("r_g_n_rer_le_co_27385")})]},"members"),r?(0,i.jsxs)(eC,{heading:t("commentaires_96492"),children:[(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.COMMENT_READ,permissions:e.roleInput.permissions,subtext:t("sans_cette_perm_08373",t("Private")),children:t("lire_les_commen_55215")}),(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.COMMENT_ADD,permissions:e.roleInput.permissions,children:t("ajouter_et_supp_32493")})]}):null,a?(0,i.jsxs)(eC,{heading:t("d_l_gations_78318"),children:[(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.DELEGATION_READ,permissions:e.roleInput.permissions,children:t("voir_les_d_l_ga_71959")}),n!==je.DelegationCategory&&(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.DELEGATION_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_d_l_60281")}),l&&(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.DELEGATIONS_SPACE_PARAM_READ,permissions:e.roleInput.permissions,children:t("voir_les_param_20270")}),l&&(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.DELEGATIONS_SPACE_PARAM_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_para_51447")})]}):null,d?(0,i.jsx)(eC,{heading:t("vues_personnali_80652"),children:(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.SEGMENT_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_vues_70658")})}):null,c?(0,i.jsxs)(eC,{heading:t("champs_de_formu_64126"),children:[(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.CUSTOM_FIELD_READ,permissions:e.roleInput.permissions,children:t("voir_les_champs_59185")}),(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.CUSTOM_FIELD_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_cham_47733")})]}):null]);return(0,i.jsx)(Wp,{heading:t("population_38615"),children:u.map((e,t)=>(0,i.jsx)(V.Fragment,{children:e},t))})},J1=()=>{const e=Ti();return(0,i.jsxs)(Wp,{heading:e("membres_11310"),subtitle:e("permissions_rel_37045"),children:[(0,i.jsx)(eC,{heading:e("profil_du_membr_68116"),children:(0,i.jsx)(ju,{borderRadius:"$1",height:20})}),(0,i.jsxs)(eC,{heading:e("commentaires_96492"),children:[(0,i.jsx)(ju,{borderRadius:"$1",height:40}),(0,i.jsx)(ju,{borderRadius:"$1",height:20})]}),(0,i.jsx)(eC,{heading:e("disponibilit_s_49923"),children:(0,i.jsx)(ju,{borderRadius:"$1",height:20})})]})},Q1=e=>{const{translate:t}=bd();return(0,i.jsxs)(Wp,{heading:t("options_53186"),children:[(0,i.jsxs)(eC,{heading:t("automatisations_60045"),children:[(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.WORKFLOW_READ,permissions:e.permissions,children:t("voir_les_automa_58340")}),(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.WORKFLOW_EDIT,permissions:e.permissions,children:t("_diter_les_auto_80436")})]}),(0,i.jsxs)(eC,{heading:"Weezeent",children:[(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.WEEZEVENT_READ,permissions:e.permissions,children:t("voir_les_param_22835")}),(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.WEEZEVENT_EDIT,permissions:e.permissions,children:t("_diter_les_para_16626")})]}),(0,i.jsxs)(eC,{heading:t("printing_06197"),children:[(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.PRINT_CONFIG_READ,permissions:e.permissions,children:t("read_the_config_50527")}),(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.PRINT_CONFIG_EDIT,permissions:e.permissions,children:t("edit_the_config_24355")}),(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.PRINT,permissions:e.permissions,children:t("print_22517")})]})]})},e2=e=>{const{translate:t}=bd();return(0,i.jsxs)(Wp,{heading:t("organisation_71863"),children:[(0,i.jsx)(eC,{heading:t("_v_nements_53672"),children:(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.EVENT_EDIT,permissions:e.permissions,children:t("_diter_les_v_n_84914")})}),(0,i.jsxs)(eC,{heading:t("param_tres_78420"),children:[(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.ORGANIZATION_PARAM_READ,permissions:e.permissions,children:t("voir_les_param_41674")}),(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.ORGANIZATION_PARAM_EDIT,permissions:e.permissions,children:t("_diter_les_para_86184")})]}),(0,i.jsxs)(eC,{heading:t("utilisateurs_et_83787"),children:[(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.ORGANIZATION_USER_READ,permissions:e.permissions,children:t("voir_les_utilis_06462")}),(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.ORGANIZATION_USER_EDIT,permissions:e.permissions,children:t("_diter_les_util_98017")})]})]})},t2=e=>{const t=Ti();return(0,i.jsxs)(Wp,{heading:t("missions_63972"),children:[(0,i.jsxs)(eC,{heading:t("missions_63972"),children:[(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.POSITION_READ,permissions:e.permissions,children:t("voir_les_missio_71964")}),(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.POSITION_EDIT,permissions:e.permissions,subtext:t("si_le_r_le_est_05344"),children:t("_diter_les_miss_75420")})]}),(0,i.jsxs)(eC,{heading:t("affectation_plural"),children:[(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.MEMBER_ASSIGN,permissions:e.permissions,children:t("affecter_des_me_26669")}),(0,i.jsx)(G1,{change:e.change,disabled:e.disabled,permission:Ov.MEMBER_ASSIGNMENT_STATE_EDIT,permissions:e.permissions,subtext:t("permet_notammen_90746",t("PreAssigned")),children:t("changer_le_stat_34124")})]})]})},n2=()=>{const e=Ti();return(0,i.jsxs)(Wp,{heading:e("missions_63972"),children:[(0,i.jsx)(eC,{heading:e("informations_su_61022"),children:(0,i.jsx)(ju,{borderRadius:"$1",height:60})}),(0,i.jsxs)(eC,{heading:e("affectation"),children:[(0,i.jsx)(ju,{borderRadius:"$1",height:20}),(0,i.jsx)(ju,{borderRadius:"$1",height:40})]})]})},i2=e=>{const{translate:t}=bd(),n=e.values.role.accessLevel,o=n===je.Organization,s=n===je.Organization||n===je.Event||n===je.Position,r=n===je.Organization||n===je.Event||n===je.DelegationCategory,a=n===je.Organization||n===je.Event||n===je.Position,l=n===je.Organization||n===je.Event;return(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(Nd,{}),(0,i.jsx)(Ba.Yr,{name:"role.accessLevel",children:t=>{t===je.Organization?e.change("role.permissions",M1):t===je.Event?e.change("role.permissions",N1):t===je.DelegationCategory?e.change("role.permissions",U1):t===je.Position&&e.change("role.permissions",B1)}}),!e.isCustom&&(0,i.jsxs)(zd,{alertStyle:"warning",children:[(0,i.jsx)($d,{children:t("impossible_de_m_46897")}),(0,i.jsx)(Pd,{children:t("ce_r_le_est_pr_71742")})]}),(0,i.jsx)(Y1,{disabled:e.disabled,isEdit:e.isEdit}),(0,i.jsx)(X1,{change:e.change,disabled:e.disabled,roleInput:e.values.role}),o&&(0,i.jsx)(e2,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),s&&(0,i.jsx)(t2,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),r&&(0,i.jsx)(q1,{change:e.change,disabled:e.disabled,roleInput:e.values.role}),a&&(0,i.jsx)(H1,{change:e.change,disabled:e.disabled,roleInput:e.values.role}),l&&(0,i.jsx)(Q1,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),e.children]})},o2=({children:e})=>(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(Z1,{}),(0,i.jsx)(J1,{}),(0,i.jsx)(n2,{}),(0,i.jsx)(K1,{}),e]}),s2=()=>{const{history:e,translate:t,params:{organizationId:n}}=bd(),o=(0,V.useRef)(null),s=Ei(W1),{mutate:r}=function(e={}){return Di("mutation RoleCreate($organizationId: OrganizationId!, $role: RoleInput!) {\n roleCreate(organizationId: $organizationId, role: $role) {\n id\n }\n}\n",e)}(),{showNotification:a}=HI(),{reload:l}=_v();return Zc(t("cr_ation_d_un_r_27933")),(0,i.jsx)(Vd,{customErrorRef:o,height:1,initialValues:{role:s.default(null)},render:({form:e,handleSubmit:s,submitting:r,values:a})=>(0,i.jsx)(zp,{category:t("cr_ation_d_un_r_27933"),color:"dark",fallbackClosePath:fs.ORGANIZATION_PARAMETERS_ROLES(n),heading:t("nouveau_r_le_20981"),children:(0,i.jsx)(Op,{ref:o,children:(0,i.jsx)(i2,{change:e.change,disabled:!1,isCustom:!0,isEdit:!1,values:a,children:(0,i.jsx)($p,{children:(0,i.jsx)(kd,{isLoading:r,textAlign:"center",onClick:s,children:t("cr_er_le_r_le_55678")})})})})}),schema:s.schema(),onSubmit:async({role:i})=>{await r({organizationId:n,role:i}),l(),a({color:"success",text:t("le_r_le_a_bien_55424")}),e.goBack(fs.ORGANIZATION_PARAMETERS_ROLES(n))}})},r2=()=>{const{history:e,translate:t,params:{organizationId:n,roleId:o}}=bd(),s=(0,V.useRef)(null),r=Ei(W1),{mutate:a}=function(e={}){return Di("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}=Oi("query Role($organizationId: OrganizationId!, $roleId: RoleId!) {\n organization(id: $organizationId) {\n role(id: $roleId) {\n id\n type\n name\n description\n accessLevel\n permissions\n }\n }\n}\n",{organizationId:n,roleId:o},[]),{canOrganizationUserEdit:c}=zv(),{showNotification:u}=HI();Zc(t("mise_jour_de_17055",l.organization?.role.name));const m=(0,V.useMemo)(()=>c&&l.organization?.role.type===be.Custom,[l.organization,c]);return d?(0,i.jsx)(a2,{}):(0,i.jsx)(Vd,{customErrorRef:s,height:1,initialValues:{role:r.default(l.organization.role)},render:({form:e,handleSubmit:o,submitting:r,values:a})=>(0,i.jsx)(zp,{button:m?(0,i.jsx)(kd,{css:{flexShrink:0},isLoading:r,onClick:o,children:t("modifier_le_r_l_58957")}):void 0,category:t("mise_jour_de_17055",l.organization.role.name),color:"dark",fallbackClosePath:fs.ORGANIZATION_PARAMETERS_ROLES(n),heading:l.organization.role.name,children:(0,i.jsx)(Op,{ref:s,children:(0,i.jsx)(i2,{change:e.change,disabled:!m,isCustom:l.organization.role.type===be.Custom,isEdit:!0,values:a,children:m&&(0,i.jsx)($p,{children:(0,i.jsx)(kd,{isLoading:r,textAlign:"center",onClick:o,children:t("modifier_le_r_l_58957")})})})})}),schema:r.schema(),onSubmit:async({role:i})=>{m&&(await a({organizationId:n,roleId:o,role:i}),u({color:"success",text:t("le_r_le_a_bien_48312")}),e.goBack(fs.ORGANIZATION_PARAMETERS_ROLES(n)))}})},a2=()=>{const{organizationId:e}=zi();return(0,i.jsx)(zp,{fallbackClosePath:fs.ORGANIZATION_PARAMETERS_ROLES(e),heading:(0,i.jsx)(ju,{borderRadius:"$1",height:39,width:400}),children:(0,i.jsx)(Op,{children:(0,i.jsx)(o2,{})})})};var l2,d2,c2,u2,m2,h2,g2,p2,f2,_2,x2,I2,v2,b2,j2,C2,y2,A2,S2,k2,w2,E2,T2,R2,O2,D2,z2,$2,P2,M2,F2,N2,L2,B2,V2,U2,W2,G2,q2,H2,K2,Y2,Z2,X2,J2,Q2,e5,t5,n5,i5,o5,s5,r5,a5,l5,d5,c5,u5,m5,h5,g5,p5,f5,_5,x5,I5,v5,b5,j5,C5,y5,A5,S5,k5,w5,E5,T5,R5,O5,D5,z5,$5,P5,M5,F5,N5,L5,B5,V5,U5,W5,G5,q5,H5,K5,Y5,Z5,X5,J5,Q5,e3,t3,n3,i3,o3,s3,r3,a3,l3,d3,c3,u3,m3,h3,g3,p3,f3,_3,x3,I3,v3,b3,j3,C3,y3,A3,S3,k3,w3,E3,T3,R3,O3,D3,z3,$3,P3,M3,F3,N3,L3,B3,V3,U3,W3,G3,q3,H3,K3,Y3,Z3,X3,J3,Q3,e4,t4,n4,i4,o4,s4,r4,a4,l4,d4,c4,u4;function m4(){return m4=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const e=Ti();return(0,i.jsx)(rd,{align:"center",css:{background:"$gray50"},height:1,justify:"center",width:1,children:(0,i.jsxs)(rd,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$xs",padding:"$9"},direction:"column",gap:"2",justify:"center",width:840,children:[(0,i.jsx)(ka,{css:{"& svg":{height:"100%",width:"100%"}},height:140,width:180,children:(0,i.jsx)(h4,{})}),(0,i.jsx)(ka,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("votre_compte_1_85226",$c)}),(0,i.jsxs)(ka,{color:"gray500",textAlign:"center",children:[e("ne_vous_inqui_t_38880")," ",(0,i.jsx)("br",{}),e("contactez_nous_35526",Pc,$c)]})]})})};var p4;function f4(){return f4=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const e=Ti();return(0,i.jsx)(rd,{align:"center",css:{background:"$gray50"},height:1,justify:"center",width:1,children:(0,i.jsxs)(rd,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$xs",padding:"$9"},direction:"column",gap:"2",justify:"center",width:840,children:[(0,i.jsx)(ka,{width:280,children:(0,i.jsx)(_4,{})}),(0,i.jsx)(ka,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("votre_compte_1_64779",$c)}),(0,i.jsxs)(ka,{color:"gray500",textAlign:"center",children:[e("ne_vous_inqui_t_38880")," ",(0,i.jsx)("br",{}),e("contactez_nous_35526",Pc,$c)]})]})})},I4=()=>{const e=Ti(),{user:t}=Li();return(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e("accepter_a_hre_50341",Mc(zc(t?.language,new URL(location.href).searchParams)),$c)}})},v4=()=>{const{history:e,translate:t,params:{organizationId:n}}=bd(),{data:o,loader:s}=Oi('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=Ei(VT),a=Ei(ld),{mutate:l}=function(e={}){return Di("mutation UserInfoAndTermsUpdate(\n $userInfoId: UsersInfoId!\n $userInfoAndTermsInput: UserInfoAndTermsInput!\n) {\n userInfoAndTermsUpdate(userInfoId: $userInfoId, userInfoAndTermsInput: $userInfoAndTermsInput) {\n id\n }\n}\n",e)}(),d=(0,V.useRef)(null),{reload:c}=_v();return s||(0,i.jsx)(Vd,{customErrorRef:d,height:1,initialValues:{userInfoAndTerms:r.userInfoAndTermsInputDefault(o.user)},render:({handleSubmit:e})=>(0,i.jsxs)(P_,{ref:d,onClose:Q,children:[(0,i.jsx)(Nd,{}),(0,i.jsx)(Wp,{centerHeader:!0,heading:t("conditions_g_n_79662"),subtitle:t("accepter_nos_co_49122"),children:(0,i.jsxs)(rd,{direction:"column",gap:"4",children:[(0,i.jsx)(Fp,{name:"userInfoAndTerms.termsAccepted",shouldPreventDefault:!1,children:(0,i.jsx)(I4,{})}),(0,i.jsxs)(rd,{gap:"4",children:[(0,i.jsx)(ec,{label:(0,i.jsx)(fI,{children:t("pr_nom_66988")}),name:"userInfoAndTerms.firstName"}),(0,i.jsx)(ec,{label:(0,i.jsx)(fI,{children:t("last_name")}),name:"userInfoAndTerms.lastName"})]}),(0,i.jsx)(G_,{label:(0,i.jsx)(fI,{children:t("Phone")}),prefix:"userInfoAndTerms.phone."})]})}),(0,i.jsx)($p,{children:(0,i.jsx)(kd,{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(io.ORGANIZATION({organizationId:n}))}})},b4=()=>{const{organization:e}=_v(),{canCustomFieldEdit:t,canCustomFieldRead:n,canDelegationEdit:o,canEventEdit:s,canOrganizationParamEdit:r,canOrganizationParamRead:a,canOrganizationUserEdit:l,canOrganizationUserRead:d}=zv(),c=om();return(0,V.useEffect)(()=>{!function(e){const t=ja({colors:{...YE(e)}});document.getElementById("heavent-react-hook")?.classList.add(t.toString())}(Sx(e.id)?.theme)},[e.id]),(0,i.jsxs)(Ea.dO,{children:[s&&(0,i.jsx)(Ea.qh,{path:So.EVENTS_IMPORT({organizationId:":organizationId"}),children:(0,i.jsx)(zM,{})}),s&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.CREATE_EVENT(":organizationId"),children:(0,i.jsx)(TM,{})}),s&&(0,i.jsx)(Ea.qh,{exact:!0,path:fs.EDIT_EVENT(":organizationId",":eventId"),children:(0,i.jsx)(RM,{})}),o&&(0,i.jsx)(Ea.qh,{path:qo.DELEGATION_CATEGORY_UPDATE({organizationId:":organizationId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(bM,{})}),(0,i.jsx)(Ea.qh,{path:So.EVENTS({organizationId:":organizationId"}),children:c?(0,i.jsx)(lF,{}):(0,i.jsx)(BT,{children:(0,i.jsx)(aF,{})})}),(0,i.jsx)(Ea.qh,{path:So.EVENT({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(sQ,{})}),t&&(0,i.jsx)(Ea.qh,{path:tx.CREATE({organizationId:":organizationId"}),children:(0,i.jsx)(CE,{})}),t&&(0,i.jsx)(Ea.qh,{path:tx.UPDATE({organizationId:":organizationId",customFieldId:":customFieldId"}),children:(0,i.jsx)(yE,{})}),n&&(0,i.jsx)(Ea.qh,{path:tx.CUSTOM_FIELDS({organizationId:":organizationId"}),children:(0,i.jsx)(BT,{children:(0,i.jsx)(_M,{})})}),r&&(0,i.jsx)(Ea.qh,{path:fs.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(":organizationId"),children:(0,i.jsx)(AQ,{})}),r&&(0,i.jsx)(Ea.qh,{path:fs.EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(":organizationId",":emailSenderId"),children:(0,i.jsx)(SQ,{})}),a&&(0,i.jsx)(Ea.qh,{path:fs.ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW(":organizationId",":emailSenderId"),children:(0,i.jsx)(kQ,{})}),l&&(0,i.jsx)(Ea.qh,{path:fs.CREATE_ORGANIZATION_PARAMETERS_GROUP(":organizationId"),children:(0,i.jsx)(OQ,{})}),l&&(0,i.jsx)(Ea.qh,{path:fs.EDIT_ORGANIZATION_PARAMETERS_GROUP(":organizationId",":groupId"),children:(0,i.jsx)(DQ,{})}),l&&(0,i.jsx)(Ea.qh,{path:fs.CREATE_ORGANIZATION_PARAMETERS_ROLE(":organizationId"),children:(0,i.jsx)(s2,{})}),d&&(0,i.jsx)(Ea.qh,{path:fs.EDIT_ORGANIZATION_PARAMETERS_ROLE(":organizationId",":roleId"),children:(0,i.jsx)(r2,{})}),(0,i.jsx)(Ea.qh,{path:fs.ORGANIZATION_PARAMETERS(":organizationId"),children:c?(0,i.jsx)(JQ,{}):(0,i.jsx)(BT,{children:(0,i.jsx)(z1,{})})}),(0,i.jsx)(Ea.qh,{path:bx.ORGANIZATION_MEMBERS({organizationId:":organizationId"}),children:(0,i.jsx)(jQ,{})}),(0,i.jsx)(Ea.qh,{path:ro.COMMUNITY({organizationId:":organizationId"}),children:(0,i.jsx)(KP,{})}),(0,i.jsx)(Ea.qh,{path:io.IS_EXPIRED(io.ORGANIZATION({organizationId:":organizationId"})),children:(0,i.jsx)(BT,{children:(0,i.jsx)(x4,{})})}),(0,i.jsx)(Ea.qh,{path:io.IS_BLOCKED(io.ORGANIZATION({organizationId:":organizationId"})),children:(0,i.jsx)(BT,{children:(0,i.jsx)(g4,{})})}),(0,i.jsx)(Ea.qh,{exact:!0,path:fs.ACCEPT_TERMS_AND_CONDITIONS(":organizationId"),children:(0,i.jsx)(v4,{})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:So.EVENTS({organizationId:e.id}),replace:!0})})]})},j4=()=>(0,i.jsx)(fv,{children:(0,i.jsx)(b4,{})}),C4=()=>{const e=JSON.parse(window.HEAVENT_EXPORT_POSITIONS_MAP_DATA),[t,n]=(0,V.useState)(!1),{searchParams:o}=new URL(location.href),s=function(e){if(g(e)){const[t,n]=e.split(",");if(g(t)&&g(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)(ka,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(eY,{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)(Wa,{})]})},y4=()=>{const{eventId:e,positionId:t}=zi(),{data:n,loader:o}=Oi("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},[js.TraceFragment]),[s,r]=(0,V.useState)(!1);if(o)return o;{const e=n.eventPublic.position;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ka,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(Ua,{initialZoom:e.zoom,layer:e.layer,mapOptions:{disableDefaultUI:!0,keyboardShortcuts:!1},point:Fa(e),traces:e.traces,onTilesloaded:()=>{r(!0)}})}),s&&(0,i.jsx)(Wa,{})]})}},A4=()=>{const e=Ti(),t=new URL(location.href).searchParams,n=t.get("eventName")||t.get("organizationName")||"",o=`${F.HEAVENT_API_URL}/users/${t.get("userId")||""}/`,s=t.get("eventId")?`${o}blacklist-event?${t}`:`${o}blacklist-organization?${t}`;return(0,i.jsx)(rd,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:(0,i.jsxs)(rd,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",gap:"7",width:640,children:[(0,i.jsxs)(rd,{align:"center",direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray900 textXl semiBold",children:e("d_sinscription_61475")}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:e("vous_tes_sur_l_71517",n)})]}),(0,i.jsx)(kd,{color:"error",textAlign:"center",onClick:()=>{window.open(s,"_blank")},children:e("oui_je_souhait_20141")})]})})},S4=()=>{const{translate:e,params:{ticketId:t}}=bd(),[n,o]=(0,V.useState)(!1),[s,r]=(0,V.useState)(!1),a=`${F.HEAVENT_API_URL}/users/${t}/check-in`;return(0,i.jsx)(rd,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:(0,i.jsx)(rd,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:(0,i.jsx)(rd,{justify:"center",width:1,children:s?(0,i.jsx)(vu,{color:"success",leftIcon:"check",children:e("votre_pointage_47695")}):(0,i.jsx)(kd,{isLoading:n,leftIcon:"check",textAlign:"center",onClick:async()=>{o(!0),await fetch(a),r(!0),o(!1)},children:e("point_sur_ma_m_52527")})})})})},k4=()=>{const{translate:e,params:{ticketId:t}}=bd(),[n,o]=(0,V.useState)(!1),[s,r]=(0,V.useState)(!1),a=`${F.HEAVENT_API_URL}/users/${t}/check-out`;return(0,i.jsx)(rd,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:(0,i.jsx)(rd,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:(0,i.jsx)(rd,{justify:"center",width:1,children:s?(0,i.jsx)(vu,{color:"success",leftIcon:"check",children:e("votre_d_pointag_86150")}):(0,i.jsx)(kd,{isLoading:n,leftIcon:"check",textAlign:"center",onClick:async()=>{o(!0),await fetch(a),r(!0),o(!1)},children:e("d_point_sur_ma_60601")})})})})},w4=()=>{const{translate:e,params:{userInfoId:t,eventId:n}}=bd(),o=(0,V.useMemo)(()=>new URL(location.href).searchParams.toString(),[]),[s,r]=(0,V.useState)(!1),[a,l]=(0,V.useState)(!1),[d,c]=(0,V.useState)(!1),u=`${F.HEAVENT_API_URL}/users/${t}/event/${n}/unregister?${o}`;return(0,i.jsx)(rd,{align:"center",css:{background:"$gray50",overflow:"hidden",px:"$3"},direction:"column",gap:"7",height:1,justify:"center",width:1,children:(0,i.jsxs)(rd,{align:"center",css:{background:"white",bd:!0,padding:"$7",width:"100%","@desktop":{width:"640px"}},direction:"column",children:[(0,i.jsx)(ka,{font:"gray900 textXl semiBold",children:e("_tes_vous_s_r_d_36428")}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{justify:"center",width:1,children:a?(0,i.jsx)(vu,{color:"success",leftIcon:"check",children:e("vous_avez_t_d_46799")}):d?(0,i.jsx)(vu,{color:"error",leftIcon:"triangle-exclamation",children:e("erreur_dans_le_52844")}):(0,i.jsx)(kd,{isLoading:s,leftIcon:"check",textAlign:"center",onClick:async()=>{try{r(!0),200===(await fetch(u)).status?(l(!0),r(!1)):(c(!0),r(!1))}catch{l(!0),r(!1)}},children:e("se_d_sinscrire_87896")})})]})})},E4=()=>{const{translate:e,params:{organizationId:t,userInfoId:n,customFieldSlug:o,value:s}}=bd(),r=(0,V.useMemo)(()=>new URL(location.href).searchParams.toString(),[]),{data:a,loader:l}=Nl({organizationId:t,slug:o}),[d,c]=(0,V.useState)(!1),[u,m]=(0,V.useState)(!1),[h,g]=(0,V.useState)(!1),p=a.organization?.customField.name??"",f=a.organization?.customField.description??"",_=(0,V.useMemo)(()=>{if(a.organization){const t=a.organization.customField;return t.fieldType===Oe.Select?t.values.find(({id:e})=>e===parseInt(s,10))?.value:e("je_valide_79615")}return""},[a.organization]),x=`${F.HEAVENT_API_URL}/users/${n}/field/${o}/update/${s}?${r}`;return(0,i.jsxs)(rd,{align:"center",css:{background:"$gray50",overflow:"hidden",px:"$3"},direction:"column",gap:"7",height:1,justify:"center",width:1,children:[3720===t&&(0,i.jsxs)(rd,{align:"center",direction:"column",gap:"3",children:[(0,i.jsx)(ka,{textAlign:"center",width:300,children:(0,i.jsx)("img",{src:`${F.HEAVENT_ASSETS_URL}/logo_planetb.png`,width:"100%"})}),(0,i.jsx)(ka,{css:{color:"#60624e",fontFamily:"$roboto",fontSize:"30px",textTransform:"uppercase"},textAlign:"center",children:"Invitation planet b - 30 ans"}),(0,i.jsx)(ka,{css:{color:"#60624e",fontFamily:"$roboto",fontSize:"16px"},textAlign:"center",children:"Au plaisir de vous retrouver pour fêter ensemble les 30 ans de PLANET B !"})]}),l||(0,i.jsxs)(rd,{align:"center",css:{background:"white",bd:!0,padding:"$7",width:"100%","@desktop":{width:"640px"}},direction:"column",children:[(0,i.jsx)(ka,{font:"gray900 textXl semiBold",children:p}),(0,i.jsx)(md,{height:"1"}),(0,i.jsx)(ka,{color:"gray500",textAlign:"center",children:f}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{justify:"center",width:1,children:u?(0,i.jsx)(vu,{color:"success",leftIcon:"check",children:e("votre_r_ponse_a_83191")}):h?(0,i.jsx)(vu,{color:"error",leftIcon:"triangle-exclamation",children:e("erreur_dans_le_52844")}):(0,i.jsx)(kd,{isLoading:d,leftIcon:"check",textAlign:"center",onClick:async()=>{try{c(!0),200===(await fetch(x)).status?(m(!0),c(!1)):(g(!0),c(!1))}catch{m(!0),c(!1)}},children:_})})]})]})},T4=()=>{const{translate:e,params:{organizationId:t,customFieldSlug:n}}=bd(),{data:o,loader:s}=Nl({organizationId:t,slug:n}),[r,a]=(0,V.useState)(!1),[l,d]=(0,V.useState)(!1),[c,u]=(0,V.useState)(!1),[m,h]=(0,V.useState)(""),[g,p]=(0,V.useState)(""),f=o.organization?.customField.name??"",_=o.organization?.customField.description??"",x=`${F.HEAVENT_API_URL}/users/organization/${t}/update-by-ticket-id`;return(0,i.jsx)(rd,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:s||(0,i.jsxs)(rd,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:[l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rd,{width:1,children:(0,i.jsx)(zd,{alertStyle:"success",width:1,onClose:()=>{d(!1)},children:(0,i.jsx)(Pd,{children:e("le_champ_1_36490",f)})})}),(0,i.jsx)(md,{height:"6"})]}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rd,{width:1,children:(0,i.jsx)(zd,{alertStyle:"error",width:1,onClose:()=>{u(!1)},children:(0,i.jsx)(Pd,{children:e("le_champ_1_46567",f)})})}),(0,i.jsx)(md,{height:"6"})]}),(0,i.jsx)(Qd,{label:e("TicketId"),value:m,onChange:h}),(0,i.jsx)(md,{height:"6"}),(0,i.jsx)(Qd,{hint:_,label:f,value:g,onChange:p}),(0,i.jsx)(md,{height:"7"}),(0,i.jsx)(rd,{justify:"center",width:1,children:(0,i.jsx)(kd,{isLoading:r,textAlign:"center",onClick:async()=>{a(!0),d(!1),u(!1),200===(await fetch(x,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticketId:m,slug:n,value:g})})).status?(d(!0),h(""),p("")):u(!0),a(!1)},children:e("mettre_jour_34131",f)})})]})})},R4=()=>{const{history:e,translate:t,params:{weezeventOrganizationId:n}}=bd(),{data:o,loader:s}=Oi("query WeezeventOrganizatio($id: Int) {\n organization: organizationByWeezeventId(id: $id) {\n id\n }\n}\n",{id:parseInt(n,10)},[]);return s||(o.organization?.id?(0,i.jsx)(Ea.rd,{to:io.ORGANIZATION({organizationId:o.organization.id})}):(0,i.jsxs)(rd,{align:"center",css:{background:"white"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(rd,{align:"center",css:{background:Ia.colors.blueGray900.value},height:64,justify:"center",width:1,children:(0,i.jsx)(rd,{align:"center",css:{"& svg":{height:"50%"}},height:1,width:300,children:(0,i.jsx)(pc,{})})}),(0,i.jsxs)(rd,{align:"center",css:{background:"white",flex:"1"},direction:"column",gap:"6",justify:"center",width:1,children:[(0,i.jsx)(ka,{height:240,width:240,children:(0,i.jsx)("img",{height:"100%",src:wc.WeezConstruction,width:"100%"})}),(0,i.jsxs)(rd,{align:"center",direction:"column",gap:"1",children:[(0,i.jsx)(ka,{font:"gray800 textMd medium",children:t("aucun_compte_we_48865")}),(0,i.jsx)(ka,{color:"gray500",dangerouslySetInnerHTML:{__html:t("si_vous_d_sirez_19702")}})]}),(0,i.jsxs)(rd,{gap:"3",children:[(0,i.jsx)(kd,{onClick:()=>window.open("mailto:benjamin.vuitton@gmail.com","_blank"),children:t("nous_contacter_38070")}),(0,i.jsx)(kd,{color:"invisible",onClick:()=>e.push(fs.CREATE_EVENT_WITH_ORGANIZATION(n)),children:t("essayer_mainten_36692")})]})]})]}))},O4=e=>(0,i.jsx)(Bi,{getRedirectPath:()=>fs.AUTH_SIGN_IN,shouldHaveUser:!0,children:e.children}),D4=e=>(0,i.jsx)(Bi,{getRedirectPath:()=>fs.HOME,shouldHaveUser:!1,children:e.children});const z4=async()=>{const{user:e}=await(async()=>{try{const e=await async function(){const e=await X();if(g(e)){const{user:t}=await function(e,t){return Js("query CurrentUser {\n user {\n id\n email\n hubspotToken\n insertedAt\n language\n profile\n termsAcceptedAt\n }\n}\n",{variables:{},token:t||void 0,fragments:[]})}(0,e);return{user:t}}throw new Error("No token")}();return As.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()),g(t)&&(n=t);const i=n?`lang=${n}`:"";return Xx(`${F.HEAVENT_API_URL}/translation/language.js?${i}`)})(e),{user:e}},$4=e=>{const[t,n]=(0,V.useState)(null);return(0,V.useEffect)(()=>{let e=!0;return z4().then(t=>{e&&n(t)}).catch(()=>{alert("Could not load application, please try again.")}),()=>{e=!1}},[]),t?e.render(t):(0,i.jsx)(Cd,{})},P4=window.matchMedia("(max-width: 1200px)"),M4=V.createContext({isMobile:!1}),F4=e=>{const[t,n]=V.useState(!1);return V.useEffect(()=>{n(P4.matches),P4.addListener(e=>{n(e.matches)})},[]),(0,i.jsx)(M4.Provider,{value:{isMobile:t},children:e.children})},N4=(0,i.jsx)(Cd,{});function L4(e,{redirectOnSuccess:t}={}){const[n,i]=(0,V.useState)(!1),{setIsError:o}=(0,V.useContext)(aX);let s=null;return n&&(s=N4),{isLoading:n,loader:s,mutate:async(n,s)=>{i(!0);try{const r=await X(),a=await((e,t,n)=>Js(e,{variables:t,token:n||void 0}))(e,n,s||r);return!0!==t&&(i(!1),o(!1)),a}catch(e){throw o(!0,e),i(!1),e}}}}const B4=(0,i.jsx)(Cd,{});function V4(e,t,n){const[i,o]=(0,V.useState)(!0),[s,r]=(0,V.useState)({}),[a,l]=(0,V.useState)(0),{setIsError:d}=(0,V.useContext)(aX),c=Object.keys(t).sort().map(e=>{const n=t[e];return`"${e}":${JSON.stringify(n)}`}).join(",");(0,V.useEffect)(()=>{let i=!1;var s;return o(!0),s=c,X().then(i=>Js(e,{reloadOnNewVersion:!0,variables:t,token:i,fragments:n})).then(e=>{i||s!==c||(r(e),d(!1),o(!1))},e=>{i||s!==c||d(!0,e)}),()=>{i=!0}},[e,c,a]);let u=null;return i&&(u=B4),{data:s,isLoading:i,loader:u,reload(){l(a+1)}}}function U4(){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,Ea.g)())}function W4(){const e=(0,Ea.W6)();return{...e,goBack:t=>{"POP"===e.action&&e.length<=2?e.push(t):e.goBack()}}}function G4(){return(0,Ea.zy)()}function q4(){return(0,V.useMemo)(()=>{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 H4=class extends ic{constructor(e){super(e)}delegationFormInviteValuesDefault(){return{usersInfos:[{email:"",fields:{firstName:"",lastName:""}}]}}delegationFormInviteValuesSchema(){return c.Ik().shape({usersInfos:c.YO().of(c.Ik().shape({email:c.Yj().email(this.t("l_e_mail_est_re_04856")).required(this.t("l_e_mail_est_re_04856")),fields:c.gl()})).min(1,"Vous devez invité au moins une personne.")})}};H4=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],H4);let K4=class extends ic{translationService;constructor(e){super(e),this.translationService=e}massStateUpdateSchema(){return c.Ik().shape({state:c.Yj().required(this.t("le_statut_est_r_13164")).oneOf([ve.NotApplicable,ve.PreAssigned,ve.Refused,ve.WaitingAssignment],this.t("le_statut_est_r_13164"))})}massAccreditationStateUpdateSchema(){return c.Ik().shape({state:c.Yj().required(this.t("le_statut_est_r_13164")).oneOf([We.NotApplicable,We.Refused,We.WaitingAccreditation],this.t("le_statut_est_r_13164"))})}};K4=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],K4);let Y4=class extends ic{translationService;constructor(e){super(e),this.translationService=e}};Y4=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,fn._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Si])],Y4);let Z4=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 Ve.String:return g(t)?t:"";case Ve.StringArray:return Array.isArray(t)?t:[];case Ve.RichText:return g(t)?t:"";default:return vd()}}};Z4=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,fn._G)()],Z4);let X4=class{get(){return{[be.OrganizationAdmin]:{accessLevel:je.Organization,permissions:M1,nameKey:"administrateur_11083",descriptionKey:"a_acc_s_toute_73520"},[be.OrganizationReader]:{accessLevel:je.Organization,permissions:F1,nameKey:"acc_s_en_lectur_30252",descriptionKey:"a_acc_s_l_org_94388"},[be.EventAdmin]:{accessLevel:je.Event,permissions:N1,nameKey:"administrateur_24785",descriptionKey:"a_acc_s_toute_25473"},[be.EventReader]:{accessLevel:je.Event,permissions:L1,nameKey:"acc_s_en_lectur_33482",descriptionKey:"a_acc_s_l_v_17476"},[be.PositionEditor]:{accessLevel:je.Position,permissions:B1,nameKey:"responsable_de_95683",descriptionKey:"peut_modifier_s_82832"},[be.PositionReader]:{accessLevel:je.Position,permissions:V1,nameKey:"responsable_de_72569",descriptionKey:"a_acc_s_ses_m_09741"},[be.DelegationCategoryLeader]:{accessLevel:je.DelegationCategory,permissions:U1,nameKey:"responsable_de_32820",descriptionKey:"a_acc_s_aux_d_l_87634"}}}};var J4;X4=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,fn._G)()],X4),function(e){e.Id="id",e.WeezaccessPartner="weezaccessPartner",e.PrinterGroup="printerGroup",e.MediaType="mediaType",e.Document="document",e.CreatedBy="createdBy",e.CreatedAt="createdAt"}(J4||(J4={}));class Q4 extends Um{constructor(e,t,n){super(e,t,n)}getPrintTriggersPossibleColumns(){return[{slug:J4.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:nn.Id,width:100},{slug:J4.WeezaccessPartner,name:this.t("op_rateur_weeza_31732"),isSearchable:!0,minWidth:180},{slug:J4.PrinterGroup,name:this.t("printing_locati_10729"),isSearchable:!0,minWidth:180},{slug:J4.MediaType,name:this.t("type_d_impressi_00431"),isSearchable:!1,minWidth:180},{slug:J4.Document,name:this.t("document_87149"),isSearchable:!0,minWidth:180},{slug:J4.CreatedBy,name:this.t("cr_par_41994"),isSearchable:!0,minWidth:180},{slug:J4.CreatedAt,name:this.t("cr_le_85046"),isSortable:!0,minWidth:180,sortAttribute:nn.CreatedAt}]}}const e6=new fn.i0(e=>{e(X4).toSelf().inSingletonScope(),e(Mm).toSelf().inSingletonScope(),e(Cm).toSelf().inSingletonScope(),e(CC).toSelf().inSingletonScope(),e(Yh).toSelf().inSingletonScope(),e(lI).toSelf().inSingletonScope(),e(Nk).toSelf().inSingletonScope(),e(ld).toSelf().inSingletonScope()}),t6=new fn.i0(e=>{e(uF).toSelf().inSingletonScope(),e(EB).toSelf().inSingletonScope(),e($F).toSelf().inSingletonScope(),e(BB).toSelf().inSingletonScope(),e(dF).toSelf().inSingletonScope(),e(cF).toSelf().inSingletonScope(),e($w).toSelf().inSingletonScope(),e(lc).toSelf().inSingletonScope(),e(Zp).toSelf().inSingletonScope(),e(ZI).toSelf().inSingletonScope(),e(FR).toSelf().inSingletonScope(),e(cD).toSelf().inSingletonScope(),e(zU).toSelf().inSingletonScope(),e(cE).toSelf().inSingletonScope(),e(dH).toSelf().inSingletonScope(),e(cH).toSelf().inSingletonScope(),e(IM).toSelf().inSingletonScope(),e(xM).toSelf().inSingletonScope(),e(H4).toSelf().inSingletonScope(),e(XE).toSelf().inSingletonScope(),e(cU).toSelf().inSingletonScope(),e(wU).toSelf().inSingletonScope(),e(kU).toSelf().inSingletonScope(),e($b).toSelf().inSingletonScope(),e(tj).toSelf().inSingletonScope(),e(CQ).toSelf().inSingletonScope(),e(ME).toSelf().inSingletonScope(),e(LM).toSelf().inSingletonScope(),e(DM).toSelf().inSingletonScope(),e(V_).toSelf().inSingletonScope(),e(E0).toSelf().inSingletonScope(),e(oj).toSelf().inSingletonScope(),e(Pw).toSelf().inSingletonScope(),e(jc).toSelf().inSingletonScope(),e(Ww).toSelf().inSingletonScope(),e(oH).toSelf().inSingletonScope(),e(uH).toSelf().inSingletonScope(),e(LE).toSelf().inSingletonScope(),e(iT).toSelf().inSingletonScope(),e(_H).toSelf().inSingletonScope(),e(aT).toSelf().inSingletonScope(),e(GT).toSelf().inSingletonScope(),e(mD).toSelf().inSingletonScope(),e(hD).toSelf().inSingletonScope(),e(XA).toSelf().inSingletonScope(),e(FP).toSelf().inSingletonScope(),e(hL).toSelf().inSingletonScope(),e(bL).toSelf().inSingletonScope(),e(bK).toSelf().inSingletonScope(),e(x$).toSelf().inSingletonScope(),e(j$).toSelf().inSingletonScope(),e(IS).toSelf().inSingletonScope(),e(SL).toSelf().inSingletonScope(),e(K4).toSelf().inSingletonScope(),e(wS).toSelf().inSingletonScope(),e(B_).toSelf().inSingletonScope(),e(wQ).toSelf().inSingletonScope(),e(L_).toSelf().inSingletonScope(),e(RH).toSelf().inSingletonScope(),e(UH).toSelf().inSingletonScope(),e(EH).toSelf().inSingletonScope(),e(TH).toSelf().inSingletonScope(),e(ZH).toSelf().inSingletonScope(),e(W1).toSelf().inSingletonScope(),e(uz).toSelf().inSingletonScope(),e(Y4).toSelf().inSingletonScope(),e(dc).toSelf().inSingletonScope(),e(Nc).toSelf().inSingletonScope(),e(d1).toSelf().inSingletonScope(),e(Gk).toSelf().inSingletonScope(),e(LK).toSelf().inSingletonScope(),e(Z4).toSelf().inSingletonScope(),e(VT).toSelf().inSingletonScope(),e(WT).toSelf().inSingletonScope(),e(UT).toSelf().inSingletonScope(),e(PD).toSelf().inSingletonScope(),e(VD).toSelf().inSingletonScope()}),n6=new fn.i0(e=>{e(Xb).toSelf().inSingletonScope(),e(Um).toSelf().inSingletonScope(),e(GB).toSelf().inSingletonScope(),e(NF).toSelf().inSingletonScope(),e(Sp).toSelf().inSingletonScope(),e(Qz).toSelf().inSingletonScope(),e(YP).toSelf().inSingletonScope(),e(wg).toSelf().inSingletonScope(),e(PM).toSelf().inSingletonScope(),e(hQ).toSelf().inSingletonScope(),e(GS).toSelf().inSingletonScope(),e(HH).toSelf().inSingletonScope(),e(Q4).toSelf().inSingletonScope(),e(Fg).toSelf().inSingletonScope(),e(Lg).toSelf().inSingletonScope()});function i6(){const e=new fn.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(!Dc(n))throw new Error("window.HEAVENT_LANGUAGE is not valid");return e.bind(Si).toConstantValue(new Si(Dc(n),t)),e.load(e6,t6,n6),e}const o6=e=>(0,i.jsx)(ki.Provider,{value:{container:i6(),useQuery:V4,useMutation:L4,useExecuteQuery:Qs,useParams:U4,useHistory:W4,useLocation:G4,useLocalStorage:q4},children:e.children});var s6=n(9132);const r6=V.createContext({}),a6=e=>{const t=V.useCallback((e,t)=>{F.USE_MIXPANEL&&s6.A.track(e,t)},[]);return V.useEffect(()=>{F.USE_MIXPANEL&&s6.A.init(F.MIXPANEL_TOKEN,{debug:!0})},[]),(0,i.jsx)(r6.Provider,{value:{track:t},children:e.children})};(0,pn.render)((0,i.jsx)(V.StrictMode,{children:(0,i.jsxs)(({children:e})=>(0,i.jsx)($4,{render:t=>(0,i.jsx)(Ni.Provider,{value:t,children:(0,i.jsx)(o6,{children:(0,i.jsx)(F4,{children:(0,i.jsx)(lX,{children:(0,i.jsx)(qI,{children:(0,i.jsx)(a6,{children:(0,i.jsx)(Zu.Provider,{value:{designSystem:Ku},children:(0,i.jsx)(i.Fragment,{children:e})})})})})})})})}),{children:[(0,i.jsx)(()=>((0,V.useEffect)(()=>{X().then(e=>{"true"===F.LOG_TOKEN&&console.log(`"${B}": "${e||""}"`)})},[]),null),{}),(0,i.jsx)(({children:e})=>{const[t,n]=(0,V.useState)(!0);return(0,i.jsxs)(gQ.Provider,{value:{active:t,enable:()=>{n(!0)},disable:()=>{n(!1)}},children:[(0,i.jsx)(fQ,{}),e]})},{children:(0,i.jsx)(({children:e})=>{const t=(0,V.useCallback)(e=>{F.USE_INTERCOM&&window.Intercom&&g(e)&&window.Intercom("boot",{api_base:"https://api-iam.intercom.io",app_id:"tyoj39m1",hide_default_launcher:!0,intercom_user_jwt:e})},[]),n=(0,V.useCallback)(()=>{F.USE_INTERCOM&&window.Intercom&&window.Intercom("show")},[]);return(0,i.jsx)(mv.Provider,{value:{canShow:F.USE_INTERCOM,show:n,update:t},children:e})},{children:(0,i.jsx)(()=>(0,i.jsx)(ka,{className:Aa,css:{color:"$gray800",height:"100%",overflow:"hidden",position:"relative",width:"100%"},children:(0,i.jsx)(wa.Kd,{basename:F.HEAVENT_APP_URL.pathnameOptional,children:(0,i.jsxs)(Ea.dO,{children:[(0,i.jsx)(Ea.qh,{exact:!0,path:fs.HOME,children:(0,i.jsx)(O4,{children:(0,i.jsx)(Z_,{})})}),(0,i.jsx)(Ea.qh,{path:fs.USER_UPDATE_BY_TICKET_ID(":organizationId",":customFieldSlug"),children:(0,i.jsx)(T4,{})}),(0,i.jsx)(Ea.qh,{path:fs.USER_FIELD_UPDATE(":organizationId",":userInfoId",":customFieldSlug",":value"),children:(0,i.jsx)(E4,{})}),(0,i.jsx)(Ea.qh,{path:fs.USER_EVENT_UNREGISTER(":organizationId",":userInfoId",":eventId"),children:(0,i.jsx)(w4,{})}),(0,i.jsx)(Ea.qh,{path:fs.USER_CHECK_IN(":organizationId",":ticketId"),children:(0,i.jsx)(S4,{})}),(0,i.jsx)(Ea.qh,{path:fs.USER_CHECK_OUT(":organizationId",":ticketId"),children:(0,i.jsx)(k4,{})}),(0,i.jsx)(Ea.qh,{path:fs.BACKOFFICE,children:(0,i.jsx)(O4,{children:(0,i.jsx)(D_,{})})}),(0,i.jsx)(Ea.qh,{path:fs.POSITION_MAP(":eventId",":positionId"),children:(0,i.jsx)(y4,{})}),(0,i.jsx)(Ea.qh,{path:fs.ACCREDITATION_MAP(":eventId",":accreditationId"),children:(0,i.jsx)(nd,{})}),(0,i.jsx)(Ea.qh,{path:fs.EXPORT_POSITIONS_MAP(":eventId",":segmentId"),children:(0,i.jsx)(C4,{})}),(0,i.jsx)(Ea.qh,{path:Yi(io.ORGANIZATIONS),children:(0,i.jsx)(O4,{children:(0,i.jsx)(X_,{})})}),(0,i.jsx)(Ea.qh,{exact:!0,path:fs.CREATE_EVENT_WITH_ORGANIZATION(":weezeventOrganizationId?"),children:(0,i.jsx)(O4,{children:(0,i.jsx)(Y_,{})})}),(0,i.jsx)(Ea.qh,{path:io.ORGANIZATION({organizationId:":organizationId"}),children:(0,i.jsx)(O4,{children:(0,i.jsx)(j4,{})})}),(0,i.jsx)(Ea.qh,{path:fs.AUTH,children:(0,i.jsx)(D4,{children:(0,i.jsx)(Uc,{})})}),(0,i.jsx)(Ea.qh,{path:fs.COGNITO_CALLBACK,children:(0,i.jsx)(D4,{children:(0,i.jsx)(Gc,{})})}),(0,i.jsx)(Ea.qh,{path:fs.MAGIC_LINK(":code",":source"),children:(0,i.jsx)(D4,{children:(0,i.jsx)(ua,{})})}),(0,i.jsx)(Ea.qh,{path:fs.UNSUBSCRIBE_EMAIL,children:(0,i.jsx)(A4,{})}),(0,i.jsx)(Ea.qh,{path:"/o:weezeventOrganizationId",children:(0,i.jsx)(R4,{})}),(0,i.jsx)(Ea.qh,{children:(0,i.jsx)(Fi,{path:fs.HOME})})]})})}),{})})})]})}),document.getElementById("heavent-react-hook"))},9625:(e,t,n)=>{"use strict";e.exports=n.p+"svg/fileCSV-6ea65d2431d3a4293aad.svg"},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={}))},9848:(e,t,n)=>{"use strict";e.exports=n.p+"svg/filePDF-37cadc96dae9bc3a10ef.svg"},9882:(e,t,n)=>{"use strict";e.exports=n.p+"img/ign-3cfd31ba578060a32efa.png"}},e=>{e.O(0,[121],()=>e(e.s=9192)),e.O()}]);
//# sourceMappingURL=app-788aad824140fbbd4567.cjs.map